!function(){"use strict";var e=function(){var e=setTimeout;function n(){}function t(e){if(!(this instanceof t))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function r(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,t._immediateFn((function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var r;try{r=t(e._value)}catch(e){return void o(n.promise,e)}i(n.promise,r)}else(1===e._state?i:o)(n.promise,e._value)}))):e._deferreds.push(n)}function i(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var r=n.then;if(n instanceof t)return e._state=3,e._value=n,void a(e);if("function"==typeof r)return void c((i=r,u=n,function(){i.apply(u,arguments)}),e)}e._state=1,e._value=n,a(e)}catch(n){o(e,n)}var i,u}function o(e,n){e._state=2,e._value=n,a(e)}function a(e){2===e._state&&0===e._deferreds.length&&t._immediateFn((function(){e._handled||t._unhandledRejectionFn(e._value)}));for(var n=0,i=e._deferreds.length;i>n;n++)r(e,e._deferreds[n]);e._deferreds=null}function u(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function c(e,n){var t=!1;try{e((function(e){t||(t=!0,i(n,e))}),(function(e){t||(t=!0,o(n,e))}))}catch(e){if(t)return;t=!0,o(n,e)}}t.prototype.catch=function(e){return this.then(null,e)},t.prototype.then=function(e,t){var i=new this.constructor(n);return r(this,new u(e,t,i)),i},t.prototype.finally=function(e){var n=this.constructor;return this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){return n.reject(t)}))}))},t.all=function(e){return new t((function(n,t){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);var i=r.length;function o(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(n){o(e,n)}),t)}r[e]=a,0==--i&&n(r)}catch(e){t(e)}}for(var a=0;r.length>a;a++)o(a,r[a])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(n){n(e)}))},t.reject=function(e){return new t((function(n,t){t(e)}))},t.race=function(e){return new t((function(n,t){for(var r=0,i=e.length;i>r;r++)e[r].then(n,t)}))},t._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(n){e(n,0)},t._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var s=t;return/native code/.test(window.Promise)?window.Promise:s}();function n(){return(n=Object.assign||function(e){for(var n=1;arguments.length>n;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function t(e,n){return e+n}var r={}.hasOwnProperty;function i(e,n){return r.call(n,e)}function o(){return(o=Object.assign||function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];return t.forEach((function(n){for(var t in n)i(t,n)&&(e[t]=n[t])})),e}).apply(void 0,arguments)}var a=Array.isArray;function u(e){return"object"==typeof e&&null!==e&&!a(e)}function c(e,n){return Object.keys(n).reduce((function(t,r){return t[r]=e(n[r]),t}),{})}function s(e){return a(e)?e.map(s):u(e)?c(s,e):e}function d(e,n){for(var t=0;n.length>t;t++){var r=n[t];if(e(r))return r}}function l(e,n){for(var t=n.length-1;t>=0;t--)if(e(n[t]))return n[t]}function f(e){return e}function p(e,n){return Object.keys(n).forEach((function(t){e(n[t],t)}))}function h(){return Math.random().toString(36).substring(2)}function m(e){var n=h();return i(n,e)?m(e):n}function v(e,n,t){var r=function(e,n){for(var t="string"==typeof e?e.split("."):e,r=0,i=n;i&&t.length>r;)i=i[t[r++]];return i}(n,t);return null!=r?r:e}function g(e,n){return-1!==n.indexOf(e)}function _(e){return 0===(a(e)?e:Object.keys(e)).length}function w(e){return!e}function y(e){return!!e}function b(e){return e.length>0?e[e.length-1]:null}function k(e,n){return Object.keys(n).reduce((function(t,r){return t[e(r)]=n[r],t}),{})}function C(e,n){if(_(n))return e;var t={};return p((function(r,o){if(i(o,n))if(u(e[o])&&u(n[o]))t[o]=C(e[o],n[o]);else if(a(e[o])&&a(n[o])){var c=Math.max(e[o].length,n[o].length);t[o]=Array(c);for(var s=0;c>s;s++)s in n[o]?t[o][s]=n[o][s]:s in e[o]&&(t[o][s]=e[o][s])}else t[o]=n[o];else t[o]=e[o]}),e),p((function(e,r){i(r,t)||(t[r]=n[r])}),n),t}function I(e){if(0===e.length)return{};var n=e[0];return e.slice(1).reduce((function(e,n){return C(e,n)}),n)}function L(e){return function(e,n){var t={};return function(){var r=e.apply(void 0,arguments);if(i(r,t))return t[r];var o=n.apply(void 0,arguments);return t[r]=o,o}}(f,e)}function x(){}function E(e,n){return e===n?0!==e||0!==n||1/e==1/n:e!=e&&n!=n}function A(e,n){if(E(e,n))return!0;if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(var r=0;t.length>r;r++)if(!i(t[r],n)||!E(e[t[r]],n[t[r]]))return!1;return!0}function O(e){return e.reduce(t,0)}var T=function(e){return Object.keys(e).map((function(n){return[n,e[n]]}))};var P=function(e,n){p((function(e,t){n.style[t]=e}),e)},z=function(e,n){p((function(e,t){"style"!==t?n.setAttribute(t,e):P(e,n)}),e)},S=function(){return!!document.documentElement.currentStyle},j=function(e,n){var t=window.getComputedStyle(n),r="border-box"===t.boxSizing,o=function(e,n){return e.reduce((function(e,t){return e[t]=n[t],e}),{})}(e,t);S()&&r&&i("width",o)&&null!==o.width&&(o.width=O([o.width,t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].map(parseFloat))+"px");S()&&r&&i("height",o)&&null!==o.height&&(o.height=O([o.height,t.paddingTop,t.paddingBottom,t.borderTopWidth,t.borderBottomWidth].map(parseFloat))+"px");return o};function M(){return new e((function(e){!function n(){document.body?e(document.body):setTimeout(n,100)}()}))}function N(e){var n=e.parentNode;n&&n.removeChild(e)}var q=function(e,n){var t=document.createElement(e);return z(n,t),t},D=function(e){return T(e).map((function(e){return e.map(encodeURIComponent).join("=")})).join("&")},H=/(?:[^:]+:\/\/)?([^/\s]+)/;var F=/[^:]+:\/\/[^(/|?)\s]+/,W=/.*?\?([^#]+)/,B=function(e){var n=function(e){return e.replace(/^\?/,"")}(function(e){var n=e.match(W);return n?"?"+n[1]:""}(e));return(n||e).split("&").map((function(e){return e.split("=").map((function(e){return decodeURIComponent(e.replace("+","%20"))}))})).reduce((function(e,n){return e[n[0]]=n[1],e}),{})},R=/^(?:https?:)?\/\/[^/]+\/([^?#]+)/,V=function(e){return e.replace(/\w/g,"$&[\\r\\n\\t]*")},G=(RegExp("^[\0-]*("+V("javascript")+"|"+V("data")+"):","i"),/^((http(s)?:)?\/\/)/),U=function(e){return function(n,t){if(0===n){if("function"!=typeof e)return t(0,(function(){})),void t(2);var r,i=!1;t(0,(function(e){i||(i=2===e)&&"function"==typeof r&&r()})),i||(r=e((function(e){i||t(1,e)}),(function(e){i||void 0===e||(i=!0,t(2,e))}),(function(){i||(i=!0,t(2))})))}}},J=function(e){return function(n,t){var r,i;0===n&&e(0,(function(e,n){if(0===e)r=n,t(0,o);else if(1===e){var a=n;i&&i(2),a(0,(function(e,n){0===e?(i=n)(1):1===e?t(1,n):2===e&&n?(r&&r(2),t(2,n)):2===e&&(r?(i=void 0,r(1)):t(2))}))}else 2===e&&n?(i&&i(2),t(2,n)):2===e&&(i?r=void 0:t(2))}));function o(e,n){1===e&&(i||r)(1,n),2===e&&(i&&i(2),r&&r(2))}}},X=function(e,n){return e===n};function Y(e){return void 0===e&&(e=X),function(n){return function(t,r){if(0===t){var i,o,a=!1;n(0,(function(n,t){0===n&&(o=t),1===n?a&&e(i,t)?o(1):(a=!0,i=t,r(1,t)):r(n,t)}))}}}}var $=function(e){return function(n){return function(t,r){var i;0===t&&n(0,(function(n,t){0===n?(i=t,r(n,t)):1===n?e(t)?r(n,t):i(1):r(n,t)}))}}},K=function(e){return function(n){var t;n(0,(function(n,r){0===n&&(t=r),1===n&&e(r),1!==n&&0!==n||t(1)}))}},Q=function(e,n,t){return function(r,i){if(0===r){var o=!1,a=function(e){i(1,e)};i(0,(function(r){2===r&&(o=!0,e.removeEventListener(n,a,t))})),o||e.addEventListener(n,a,t)}}};var Z=function(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return function(e,t){if(0===e)for(var r=n.length,i=Array(r),o=0,a=0,u=function(e){if(0!==e)for(var n=0;r>n;n++)i[n]&&i[n](e)},c=function(e){n[e](0,(function(n,c){0===n?(i[e]=c,1==++o&&t(0,u)):2===n?(i[e]=void 0,++a===r&&t(2)):t(n,c)}))},s=0;r>s;s++)c(s)}};function ee(e,n){return U((function(t){return e.on(n,t),function(){e.off(n,t)}}))}!function(e){var n,t=e.Symbol;"function"==typeof t?t.observable?n=t.observable:(n=t("observable"),t.observable=n):n="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());var ne=function(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];for(var r=n[0],i=1,o=n.length;o>i;i++)r=n[i](r);return r},te=function(e){return function(n){return function(t,r){var i;0===t&&n(0,(function(n,t){0===n?(i=t,r(0,(function(e,n){0!==e&&i(e,n)})),r(1,e)):r(n,t)}))}}},re=function(e){return function(n){return function(t,r){0===t&&n(0,(function(n,t){r(n,1===n?e(t):t)}))}}};function ie(e){return function(n){return J(re(e)(n))}}var oe=function(){};function ae(e,n){0===e&&n(0,oe)}function ue(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return function(e,t){if(0===e){var r=!1;for(t(0,(function(e){2===e&&(r=!0,n.length=0)}));0!==n.length;)t(1,n.shift());r||t(2)}}}function ce(e){return function(n,t){if(0===n){var r,i,o,a=0;e(0,(function(e,n){if(0===e&&(o=n),1===e){var u=[i,n];r=u[0],i=u[1],2>++a?o(1):t(1,[r,i])}else t(e,n)}))}}}var se=function(){},de={};function le(e){var n,t,r=[],i=!1,o=de;return function(a,u){if(0===a){if(o!==de)return u(0,se),i&&u(1,t),void u(2,o);r.push(u);var c=function(e,t){if(2!==e)o===de&&n(e,t);else{var i=r.indexOf(u);-1!==i&&r.splice(i,1)}};1!==r.length?(u(0,c),i&&o===de&&u(1,t)):e(0,(function(e,a){if(0===e)return n=a,void u(0,c);1===e&&(i=!0,t=a);var s=r.slice(0);2===e&&(o=a,r=null),s.forEach((function(n){n(e,a)}))}))}}}var fe=function(e){return function(n){return function(t,r){if(0===t){var i,o=0;n(0,(function(n,t){0===n?(i=t,r(n,t)):1===n&&e>o?(o++,i(1)):r(n,t)}))}}}},pe=function(e){return void 0===e&&(e={}),function(n){"function"==typeof e&&(e={next:e});var t,r=e.next,i=e.error,o=e.complete;n(0,(function(e,n){0===e&&(t=n),1===e&&r&&r(n),1!==e&&0!==e||t(1),2===e&&!n&&o&&o(),2===e&&n&&i&&i(n)}));return function(){t&&t(2)}}},he=function(e){return function(n){return function(t,r){if(0===t){var i,o=0;n(0,(function(n,t){0===n?(i=t,r(0,a)):1===n?e>o&&(o++,r(n,t),o===e&&(r(2),i(2))):r(n,t)}))}function a(n,t){e>o&&i(n,t)}}}},me={},ve=function(e){return function(n){return function(t,r){if(0===t){var i,o,a=!1,u=me;n(0,(function(n,t){if(0===n)return i=t,e(0,(function(e,n){if(0!==e)return 1===e?(u=void 0,o(2),i(2),void(a&&r(2))):void(2===e&&(o=null,n&&(u=n,i(2),a&&r(e,n))));(o=n)(1)})),a=!0,r(0,(function(e,n){u===me&&(2===e&&o&&o(2),i(e,n))})),void(u!==me&&r(2,u));2===n&&o(2),r(n,t)}))}}}};function ge(n){return new e((function(e,t){pe({next:e,error:t,complete:function(){var e=Error("No elements in sequence.");e.code="NO_ELEMENTS",t(e)}})(function(e){return function(n,t){if(0===n){var r,i,o=!1,a=!1;e(0,(function(e,n){return 0===e?(r=n,void t(0,(function(e,n){2===e&&(a=!0),r(e,n)}))):1===e?(o=!0,i=n,void r(1)):void(2===e&&!n&&o&&(t(1,i),a)||t(e,n))}))}}}(n))}))}var _e=function(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},t.exports),t.exports}((function(e,n){function t(e,n){return e===n}function r(e,n,t){if(null===n||null===t||n.length!==t.length)return!1;for(var r=n.length,i=0;r>i;i++)if(!e(n[i],t[i]))return!1;return!0}function i(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=null,o=null;return function(){return r(n,i,arguments)||(o=e.apply(null,arguments)),i=arguments,o}}function o(e){var n=Array.isArray(e[0])?e[0]:e;if(!n.every((function(e){return"function"==typeof e}))){var t=n.map((function(e){return typeof e})).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+t+"]")}return n}function a(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];return function(){for(var n=arguments.length,r=Array(n),a=0;n>a;a++)r[a]=arguments[a];var u=0,c=r.pop(),s=o(r),d=e.apply(void 0,[function(){return u++,c.apply(null,arguments)}].concat(t)),l=i((function(){for(var e=[],n=s.length,t=0;n>t;t++)e.push(s[t].apply(null,arguments));return d.apply(null,e)}));return l.resultFunc=c,l.recomputations=function(){return u},l.resetRecomputations=function(){return u=0},l}}n.__esModule=!0,n.defaultMemoize=i,n.createSelectorCreator=a,n.createStructuredSelector=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;if("object"!=typeof e)throw Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var t=Object.keys(e);return n(t.map((function(n){return e[n]})),(function(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.reduce((function(e,n,r){return e[t[r]]=n,e}),{})}))};var u=n.createSelector=a(i)})),we=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},ye=function(){function e(){we(this,e),this._cache={}}return e.prototype.set=function(e,n){this._cache[e]=n},e.prototype.get=function(e){return this._cache[e]},e.prototype.remove=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}},e}();(function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.cacheSize;if(we(this,e),void 0===t)throw Error("Missing the required property `cacheSize`.");if(!Number.isInteger(t)||0>=t)throw Error("The `cacheSize` property must be a positive integer value.");this._cache={},this._cacheOrdering=[],this._cacheSize=t}e.prototype.set=function(e,n){(this._cache[e]=n,this._cacheOrdering.push(e),this._cacheOrdering.length>this._cacheSize)&&this.remove(this._cacheOrdering[0])},e.prototype.get=function(e){return this._cache[e]},e.prototype.remove=function(e){var n=this._cacheOrdering.indexOf(e);n>-1&&this._cacheOrdering.splice(n,1),delete this._cache[e]},e.prototype.clear=function(){this._cache={},this._cacheOrdering=[]}})(),function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.cacheSize;if(we(this,e),void 0===t)throw Error("Missing the required property `cacheSize`.");if(!Number.isInteger(t)||0>=t)throw Error("The `cacheSize` property must be a positive integer value.");this._cache={},this._cacheOrdering=[],this._cacheSize=t}e.prototype.set=function(e,n){(this._cache[e]=n,this._registerCacheHit(e),this._cacheOrdering.length>this._cacheSize)&&this.remove(this._cacheOrdering[0])},e.prototype.get=function(e){return this._registerCacheHit(e),this._cache[e]},e.prototype.remove=function(e){this._deleteCacheHit(e),delete this._cache[e]},e.prototype.clear=function(){this._cache={},this._cacheOrdering=[]},e.prototype._registerCacheHit=function(e){this._deleteCacheHit(e),this._cacheOrdering.push(e)},e.prototype._deleteCacheHit=function(e){var n=this._cacheOrdering.indexOf(e);n>-1&&this._cacheOrdering.splice(n,1)}}();function be(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];var r=ye;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,o=void 0;"function"==typeof t?(console.warn('[re-reselect] Deprecation warning: "selectorCreator" argument is discouraged and will be removed in the upcoming major release. Please use "options.selectorCreator" instead.'),i=new r,o=t):(i=t.cacheObject||new r,o=t.selectorCreator||_e.createSelector);var a=function(){var t=e.apply(void 0,arguments);if("string"==typeof t||"number"==typeof t){var r=i.get(t);return void 0===r&&(r=o.apply(void 0,n),i.set(t,r)),r.apply(void 0,arguments)}};return a.getMatchingSelector=function(){var n=e.apply(void 0,arguments);return i.get(n)},a.removeMatchingSelector=function(){var n=e.apply(void 0,arguments);i.remove(n)},a.clearCache=function(){i.clear()},a.resultFunc=n[n.length-1],a}}var ke=function(e,n){return n},Ce=function(e,n){return function(e){return e.entities.chats.byIds}(e)[n]},Ie=be([function(e,n){return Ce(e,n).events.orderedIds},function(e,n){return Ce(e,n).events.byIds}],(function(e,n){return e.map((function(e){return n[e]}))}))(ke),Le=be([Ce,Ie],(function(e,t){return n({},e,{events:t})}))(ke),xe=function(e){return e.entities.users.byIds},Ee=function(e){return xe(e)[function(e){return e.session.id}(e)]},Ae=function(e,n){return xe(e)[n]},Oe=function(e){return Ee(e).id},Te=(be([Ie,Oe],(function(e,n){return l((function(e){return e.delivered&&e.author===n}),e)}))(ke),be([Ie,Oe],(function(e,n){return l((function(e){return e.seen&&e.author===n}),e)}))(ke),{boosters:!0,form:!0,system_message:!0});_e.createSelector([Ie,function(e){return Ee(e).id}],(function(e,n){return function(e,n,t){for(var r=n;r>=0;r--)if(e(t[r]))return r;return-1}((function(e){return e.author===n&&"message"===e.type&&!(e.properties&&"file"===e.properties.serverType)||!0===e.seen&&!Te[e.type]&&e.serverId}),(t=e).length-1,t);var t})),be([function(e,n){return Ce(e,n).participants},xe],(function(e,n){return e.map((function(e){return n[e]}))}))(ke);function Pe(e,n){return void 0===n?e.application:e.application[n]}function ze(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>n.indexOf(t=o[r])&&(i[t]=e[t]);return i}var Se="application/x-postmate-v1+json",je=0,Me={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},Ne=function(e,n){return("string"!=typeof n||e.origin===n)&&(!!e.data&&("object"==typeof e.data&&("postmate"in e.data&&(e.data.type===Se&&!!Me[e.data.postmate]))))},qe=function(){function e(e){var n=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.events={},this.listener=function(e){if(!Ne(e,n.childOrigin))return!1;var t=((e||{}).data||{}).value||{},r=t.name;"emit"===e.data.postmate&&r in n.events&&n.events[r].call(n,t.data)},this.parent.addEventListener("message",this.listener,!1)}var n=e.prototype;return n.get=function(e){var n=this;return new He.Promise((function(t){var r=++je;n.parent.addEventListener("message",(function e(i){i.data.uid===r&&"reply"===i.data.postmate&&(n.parent.removeEventListener("message",e,!1),t(i.data.value))}),!1),n.child.postMessage({postmate:"request",type:Se,property:e,uid:r},n.childOrigin)}))},n.call=function(e,n){this.child.postMessage({postmate:"call",type:Se,property:e,data:n},this.childOrigin)},n.on=function(e,n){this.events[e]=n},n.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},e}(),De=function(){function e(e){var n=this;this.model=e.model,this.parent=e.parent,this.parentOrigin=e.parentOrigin,this.child=e.child,this.child.addEventListener("message",(function(e){if(Ne(e,n.parentOrigin)){var t=e.data,r=t.property,i=t.uid,o=t.data;"call"!==e.data.postmate?function(e,n){var t="function"==typeof e[n]?e[n]():e[n];return He.Promise.resolve(t)}(n.model,r).then((function(n){return e.source.postMessage({property:r,postmate:"reply",type:Se,uid:i,value:n},e.origin)})):r in n.model&&"function"==typeof n.model[r]&&n.model[r].call(n,o)}}))}return e.prototype.emit=function(e,n){this.parent.postMessage({postmate:"emit",type:Se,value:{name:e,data:n}},this.parentOrigin)},e}(),He=function(){function e(e){var n=e.container,t=void 0===n?void 0!==t?t:document.body:n,r=e.model,i=e.url,o=e.iframeAllowedProperties;return this.parent=window,this.frame=document.createElement("iframe"),o&&(this.frame.allow=o),t.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=r||{},this.sendHandshake(i)}return e.prototype.sendHandshake=function(n){var t,r=this,i=function(e){var n=document.createElement("a");n.href=e;var t=n.protocol.length>4?n.protocol:window.location.protocol,r=n.host.length?"80"===n.port||"443"===n.port?n.hostname:n.host:window.location.host;return n.origin||t+"//"+r}(n),o=0;return new e.Promise((function(e,a){r.parent.addEventListener("message",(function n(o){return!!Ne(o,i)&&("handshake-reply"===o.data.postmate?(clearInterval(t),r.parent.removeEventListener("message",n,!1),r.childOrigin=o.origin,e(new qe(r))):a("Failed handshake"))}),!1);var u=function(){o++,r.child.postMessage({postmate:"handshake",type:Se,model:r.model},i),5===o&&clearInterval(t)},c=function(){u(),t=setInterval(u,500)};r.frame.attachEvent?r.frame.attachEvent("onload",c):r.frame.addEventListener("load",c),r.frame.src=n}))},e}();He.debug=!1,He.Promise=function(){try{return window?window.Promise:e}catch(e){return null}}(),He.Model=function(){function e(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return e.prototype.sendHandshakeReply=function(){var e=this;return new He.Promise((function(n,t){e.child.addEventListener("message",(function r(i){if(i.data.postmate){if("handshake"===i.data.postmate){e.child.removeEventListener("message",r,!1),i.source.postMessage({postmate:"handshake-reply",type:Se},i.origin),e.parentOrigin=i.origin;var o=i.data.model;return o&&Object.keys(o).forEach((function(n){e.model[n]=o[n]})),n(new De(e))}return t("Handshake Reply Failed")}}),!1)}))},e}();var Fe=function(){var e,t={all:e=e||new Map,on:function(n,t){var r=e.get(n);r?r.push(t):e.set(n,[t])},off:function(n,t){var r=e.get(n);r&&(t?r.splice(r.indexOf(t)>>>0,1):e.set(n,[]))},emit:function(n,t){var r=e.get(n);r&&r.slice().map((function(e){e(t)})),(r=e.get("*"))&&r.slice().map((function(e){e(n,t)}))}},r=t.all,i=ze(t,["all"]);return n({},i,{off:function(e,n){e?i.off(e,n):r.clear()},once:function(e,n){i.on(e,(function t(r,o){i.off(e,t),n(r,o)}))}})};He.Promise=e;var We=function(n){var t=n.methods,r=ze(n,["methods"]);return new He(r).then((function(n){var r=n.on,i=n.call,a=function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.apply(n,t)},u=Fe(),c={},s={};return t.resolveRemoteCall=function(e){var n=e.id,t=e.value,r=s[n];delete s[n],r(t)},n.on=function(e,t){u.on(e,t),c[e]||(c[e]=!0,function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.apply(n,t)}(e,(function(n){u.emit(e,n)})))},n.off=u.off,n.on("remote-call",(function(e){var r=e.id,i=e.method,o="function"==typeof t[i]?t[i].apply(n,e.args):void 0;o&&"function"==typeof o.then?o.then((function(e){a("resolveRemoteCall",{id:r,value:e})})):a("resolveRemoteCall",{id:r,value:o})})),n.emit=function(e,n){a("emitEvent",{event:e,data:n})},n._emit=u.emit,n.call=function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];return new e((function(e){var t=m(s);s[t]=e,a("remoteCall",{id:t,method:n,args:r})}))},o(n,t)}))};function Be(e,n){return null!=n&&null!=e&&"object"==typeof n&&"object"==typeof e?Re(n,e):e}function Re(e,t){var r;if(Array.isArray(e)){r=e.slice(0,t.length);for(var o=0;t.length>o;o++)void 0!==t[o]&&(r[o]=Be(t[o],r[o]))}else for(var a in r=n({},e),t)i(a,t)&&(void 0===t[a]?delete r[a]:r[a]=Be(t[a],r[a]));return r}var Ve=function(n){return new e((function(e){n.on("state",(function t(r){n.off("state",t),n.state=r,e(r)})),n.on("state_diff",(function(e){n.state=Re(n.state,e)})),n.on("store_event",(function(e){n._emit(e[0],e[1])})),n.call("startStateSync")}))},Ge="chat-widget",Ue={opacity:0,visibility:"hidden",zIndex:-1},Je={opacity:1,visibility:"visible",zIndex:2147483639},Xe={id:Ge+"-container",style:n({},Ue,{position:"fixed",bottom:0,width:0,height:0,maxWidth:"100%",maxHeight:"100%",minHeight:0,minWidth:0,backgroundColor:"transparent",border:0,overflow:"hidden"})},Ye=(n({},Xe.style),{id:"livechat-eye-catcher",style:{position:"fixed",visibility:"visible",zIndex:2147483639,background:"transparent",border:0,padding:"10px 10px 0 0",float:"left",marginRight:"-10px",webkitBackfaceVisibility:"hidden"}}),$e={style:{position:"absolute",display:"none",top:"-5px",right:"-5px",width:"16px",lineHeight:"16px",textAlign:"center",cursor:"pointer",textDecoration:"none",color:"#000",fontSize:"20px",fontFamily:"Arial, sans-serif",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.5)"}},Ke={id:"livechat-eye-catcher-img",style:{display:"block",overflow:"hidden",cursor:"pointer"}},Qe={alt:"",style:{display:"block",border:0,float:"right"}},Ze={position:"absolute",top:"0px",left:"0px",bottom:"0px",right:"0px"},en={allowtransparency:!0,id:Ge,name:Ge,title:"LiveChat chat widget",scrolling:"no",style:{width:"100%",height:"100%","min-height":"0px","min-width":"0px",margin:"0px",padding:"0px","background-image":"none","background-position-x":"0%","background-position-y":"0%","background-size":"initial","background-attachment":"scroll","background-origin":"initial","background-clip":"initial","background-color":"rgba(0, 0, 0, 0)","border-width":"0px",float:"none"}},nn=e.resolve(),tn=function(e){nn.then(e)},rn=function(e){return tn((function(){throw e}))},on=function(e){return function(n){var t=window.LC_API||{};if("function"==typeof n&&n(t),"function"==typeof t[e])try{t[e]()}catch(e){rn(e)}}},an=function(e,n){if(!e)return!0;var t=function(e){var n=e.match(H);return n&&n[1]}(n);return!!t&&[].concat(e,["livechatinc.com","lc.chat"]).some((function(e){var n=t.length-e.length;return-1!==t.indexOf(e,n)&&(t.length===e.length||"."===t.charAt(n-1))}))},un=[],cn=function(e){30>un.length||(un=un.slice(1));for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];un.push({name:e,args:t})},sn="always visible",dn="always hide",ln="hide until it gets activated";function fn(e,n,t){return function(r){var i,o=(void 0===r?{}:r).prettyPrint,a=void 0===o||o,u=n.analytics.googleAnalytics.trackerName,c=!an(t.allowedDomains,document.location.href),s=[["window.open",!/native code/.test(window.open)],["document.domain",window.location.hostname!==document.domain],["window.frames",window.frames!==window],["JSON.stringify",!/native code/.test(window.JSON.stringify)],["JSON.parse",!/native code/.test(window.JSON.parse)],["Object.keys",!/native code/.test(Object.keys)],["console.log",!/native code/.test(console.log)]].filter((function(e){return e[1]})).map((function(e){return e[0]})),d=function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n}(en.style).some((function(n){return e.frame.style.getPropertyValue(n)!==en.style[n]})),l=function(e){var n="";return{desktopVisibility:n=e.initiallyHidden?e.disabledMinimized?dn:ln:sn,mobileVisibility:e.hasCustomMobileSettings?e.hiddenOnMobile?dn:e.initiallyHiddenOnMobile?e.disabledMinimizedOnMobile?dn:ln:sn:n}}(t.__unsafeProperties.group),f=l.desktopVisibility,p=l.mobileVisibility,h=[{msg:"language: "+t.__unsafeProperties.group.language},{msg:"region: "+t.region},{msg:"license number: "+window.__lc.license},{msg:"group id: "+e.state.application.group},{msg:"hidden: "+(e.state.application.hidden?"yes":"no")},{msg:"tracker name: "+u},{msg:"desktop visibility: "+f,isNotStandard:f!==sn},{msg:"mobile visibility: "+p,isNotStandard:p!==sn},{msg:"chat between groups: "+(window.__lc.chat_between_groups?"yes":"no")},{msg:"is iframe inline style modified: "+(d?"yes":"no"),isNotStandard:d},{msg:"is current domain not allowed by the allowed domains: "+(c?"yes":"no"),isNotStandard:c},{msg:"overrides: "+(s.length>0?s.join(",\n"):"none"),isNotStandard:s.length>0},{msg:"call history: "+(un.length>0?un.map((function(e){return e.name+"("+e.args.join(", ")+")"})).join(",\n"):"none"),isNotStandard:un.length>0}];if(!a)return h;var m=h.filter((function(e){return e.isNotStandard})),v=h.filter((function(e){return!e.isNotStandard})),g=[].concat(m,v);return-1!==s.indexOf("console.log")?g.map((function(e){return e.msg})).join("\n\n"):((i=console).log.apply(i,[g.map((function(e){return"%c"+e.msg})).join("\n\n")].concat(g.map((function(e){return e.isNotStandard?"color: red;":""})))),"")}}function pn(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];return function(){"function"==typeof e&&e.apply(void 0,t)}}function hn(e,n,t){return ne(ee(e,t),K((function(e){return tn(pn(n[t],e))})))}function mn(e){return I(e.filter(Boolean).map((function(e){var n;return(n={})[e.name]=e.value+"",n})))}function vn(e,n){var t,r=d((function(e){return!e[1]}),T((t=n,["name","email"].reduce((function(e,n){return i(n,t)&&(e[n]=t[n]),e}),{}))));if(r){var o=r[1];console.error("[LiveChatWidget] Customer "+r[0]+" cannot be set to "+(""===o?"empty string":o))}else e.call("storeMethod",["requestUpdateUser",Oe(e.state),n])}function gn(e,n){e.call("storeMethod",["requestSetUserProperties",Oe(e.state),n])}function _n(e){return null!=e?e+"":null}var wn=function(e,n){return Pe(e,"visibility").state===n};function yn(e,n){return J((t=function(){return ne(ee(e,"state_diff"),re((function(){return e.state})),te(e.state),re(n),Y(A),ve(ee(e,"unbind")))},function(e,n){if(0===e){var r=!1;n(0,(function(e){2===e&&(r=!0)})),n(1,t()),r||n(2)}}));var t}var bn=function(e,n){return ne(yn(e,n),fe(1))};function kn(e){return ne(yn(e,(function(e){return Pe(e,"availability")})),$(y))}var Cn="liveChatChatId";function In(e){return ne(yn(e,(function(e){return Le(e,Cn).active})),fe(1),ie((function(n){return n?ne(yn(e,(function(e){return Le(e,Cn).properties.currentAgent})),$(Boolean),re((function(){return n})),he(1)):ue(n)})))}function Ln(e,n){return ne(ee(e,"state_diff"),re((function(){return Pe(e.state,"readyState")})),$((function(e){return e===n})),he(1),le)}var xn="not_ready",En="ready",An="bootstrapped";function On(e,n){return ne(Ln(e,En),ie(n))}function Tn(e,n){return ne(Ln(e,An),ie(n))}function Pn(e,n){return ne(yn(e,(function(e){return Pe(e,"invitation")})),re((function(e){return e[n]})),$(y),ce,$((function(e){return e[1].length>e[0].length})),re((function(e){return b(e[1])})))}var zn=function(e){return e.actingAsDirectLink||e.isInCustomContainer},Sn="liveChatChatId",jn=function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];return tn(pn.apply(void 0,[e].concat(t)))};function Mn(e,n,t){window.LC_API=window.LC_API||{};var r=window.LC_API;ne(function(e){return ne(yn(e,(function(e){return wn(e,"maximized")})),$(y))}(e),K((function(){return jn(r.on_chat_window_opened)}))),ne(Tn(e,(function(){return function(e){return ne(yn(e,(function(e){return wn(e,"minimized")})),fe(1),$(y))}(e)})),K((function(){return jn(r.on_chat_window_minimized)}))),ne(function(e){return ne(yn(e,(function(e){return wn(e,"hidden")})),$(y))}(e),K((function(){return jn(r.on_chat_window_hidden)}))),ne(kn(e),K((function(e){return jn(r.on_chat_state_changed,{state:"online"===e?"online_for_chat":"offline"})}))),ne(Tn(e,(function(){return In(e)})),$(y),K((function(){return jn(r.on_chat_started,{agent_name:Ae(e.state,Le(e.state,Sn).properties.currentAgent).name})}))),ne(Tn(e,(function(){return In(e)})),$(w),K((function(){return jn(r.on_chat_ended)}))),ne(Tn(e,(function(){return ee(e,"on_message")})),K((function(e){return jn(r.on_message,e)}))),ne(ee(e,"widget_resize"),K((function(e){return jn(r.on_widget_resize,e.size)}))),ne(function(e){return ne(ee(e,"add_event"),$((function(e){return e.event.properties.invitation})),re((function(n){var t=n.event;return{event:t,author:Ae(e.state,t.author)}})))}(e),K((function(e){var n=e.author,t=e.event,i=t.properties;jn(r.on_message,{text:i.text,timestamp:t.timestamp,invitation:!0,user_type:"agent",agent_login:n.id,agent_name:n.name,received_first_time:i.receivedFirstTime})}))),hn(e,r,"on_postchat_survey_submitted"),hn(e,r,"on_prechat_survey_submitted"),hn(e,r,"on_rating_comment_submitted"),hn(e,r,"on_rating_submitted"),hn(e,r,"on_ticket_created"),r.set_custom_variables=function(n){cn("LC_API.set_custom_variables",n),gn(e,mn(n))},r.update_custom_variables=function(n){cn("LC_API.update_custom_variables",n),vn(e,{properties:mn(n)})},r.set_visitor_name=function(n){cn("LC_API.set_visitor_name",n),vn(e,{name:_n(n)})},r.set_visitor_email=function(n){cn("LC_API.set_visitor_email",n),vn(e,{email:_n(n)})},r.open_chat_window=r.show_full_view=r.open_mobile_window=function(){cn("LC_API.open_chat_window"),e.maximize()},r.minimize_chat_window=function(){cn("LC_API.minimize_chat_window"),zn(n)||e.minimize()},r.hide_eye_catcher=function(){cn("LC_API.hide_eye_catcher"),e.call("hideEyeCatcher")},r.hide_chat_window=function(){cn("LC_API.hide_chat_window"),zn(n)||e.hide()},r.agents_are_available=function(){return cn("LC_API.agents_are_available"),"online"===Pe(e.state,"availability")},r.chat_window_maximized=function(){return cn("LC_API.chat_window_maximized"),wn(e.state,"maximized")},r.chat_window_minimized=function(){return cn("LC_API.chat_window_minimized"),wn(e.state,"minimized")},r.chat_window_hidden=function(){return cn("LC_API.chat_window_hidden"),wn(e.state,"hidden")},r.visitor_queued=function(){return cn("LC_API.visitor_queued"),Le(e.state,Sn).properties.queued},r.chat_running=function(){return cn("LC_API.chat_running"),Le(e.state,Sn).active},r.visitor_engaged=function(){return cn("LC_API.visitor_engaged"),r.visitor_queued()||r.chat_running()||!!Le(e.state,Sn).properties.fakeAgentMessageId},r.get_window_type=function(){return cn("LC_API.get_window_type"),"embedded"},r.close_chat=function(){cn("LC_API.close_chat"),e.call("storeMethod",["requestUpdateChat",Sn,{active:!1}])},r.diagnose=fn(e,n,t),r.get_last_visit_timestamp=function(){return Pe(e.state).clientLastVisitTimestamp},r.get_visits_number=function(){return Pe(e.state).clientVisitNumber},r.get_page_views_number=function(){return Pe(e.state).clientPageViewsCount},r.get_chats_number=function(){return Pe(e.state).clientChatNumber},r.get_visitor_id=function(){return Ee(e.state).serverId},r.get_chat_id=function(){return Le(e.state,Sn).serverId},r.trigger_sales_tracker=function(e,n){var t=a(n)?n:[];"string"==typeof e&&""!==e&&r.set_custom_variables([].concat(t,[{name:"__sales_tracker_"+e,value:"1"}]))},r.scriptTagVersion=function(){return"LiveChatWidget"in window?window.LiveChatWidget._v:"1.0"},["on","off","call","get"].forEach((function(e){r[e]=function(){var n="LiveChatWidget"in window?'call it on the new "LiveChatWidget" global object.':"upgrade your snippet code. You can do it by going to: https://my.livechatinc.com/settings/code";console.warn('[LiveChatWidget] In order to use "'+e+'" function you need to '+n)}})),r.disable_sounds=x}var Nn={handler:null,setHandler:function(e){this.handler=e},navigate:function(e){var n=this;tn((function(){window.location.origin===function(e){var n=e.match(F);return n&&n[0]}(e)&&"function"==typeof n.handler?n.handler(function(e){var n=e.match(R);return"/"+(n&&n[1]||"")}(e)):window.open(e,"_blank")}))}},qn="liveChatChatId",Dn=function(e){var t,r=e.trackerId,i=e.variables;return n({},c(String,void 0===i?{}:i),((t={})["__sales_tracker_"+r]="1",t))},Hn=function(e){var t=e.id;return n({uniqueId:e.uniqueId},t&&{id:t})},Fn=function(e,n){return v(null,"properties",l((function(e){return e.properties.uniqueId===n}),Ie(e.state,qn)))},Wn=function(e){return n=function(e){if("call"!==e[0])return"other";switch(e[1][0]){case"set_customer_email":return"email";case"set_customer_name":return"name";case"set_session_variables":case"trigger_sales_tracker":case"update_session_variables":return"fields";case"destroy":case"hide":case"maximize":case"minimize":return"visibility"}},Object.keys(t=e).reduce((function(e,r){var i=t[r],o=n(i);return e[o]=e[o]||[],e[o].push(i),e}),{});var n,t};function Bn(e,t,r){var i,o=Fe(),a=window.LiveChatWidget,u=function(e,n){var t;return(t={get:w,call:k,on:m,once:v,off:o.off})[e].apply(t,n)},l=function(e,n){return tn((function(){return o.emit(e,n)}))},f=function(e){void 0===e&&(e=[]);var n=b(e);if(n){var t=n[1];k(t[0],t[1])}},p=Wn(a._q);function h(n,t,r){switch(t){case"new_event":case"form_submitted":case"greeting_hidden":case"rating_submitted":case"visibility_changed":case"greeting_displayed":case"availability_changed":case"customer_status_changed":case"rich_message_button_clicked":return void o[n](t,r);case"ready":return void(Pe(e.state,"readyState")!==xn?tn((function(){return r({state:_("state"),customerData:_("customer_data")})})):o[n](t,r));default:return void console.error('[LiveChatWidget] callback "'+t+'" does not exist.')}}function m(e,n){cn("LiveChatWidget.on","'"+e+"'",n),h("on",e,n)}function v(e,n){cn("LiveChatWidget.once","'"+e+"'",n),h("once",e,n)}function _(n){switch(n){case"state":var t=Pe(e.state);return{availability:t.availability,visibility:t.visibility.state};case"chat_data":var r=Le(e.state,qn),i=r.properties;return{chatId:r.serverId||null,threadId:(r.active||i.ended)&&i.lastThread||null};case"customer_data":var o=Ee(e.state),a=o.serverId,u=o.name,c=o.email,l=o.properties,f=Pe(e.state).isReturning,p=Le(e.state,qn),h=p.active,m=p.properties,v=m.queued,g=m.fakeAgentMessageId,_=d((function(e){return e.id===g}),p.events);return{name:u,email:c,isReturning:f,sessionVariables:l,id:a,status:v?"queued":h?"chatting":_&&_.properties.invitation?"invited":"browsing"};case"features":return s(Pe(e.state).config.features);default:return void console.error('[LiveChatWidget] property "'+n+'" not exists.')}}function w(e){return cn("LiveChatWidget.get","'"+e+"'"),_(e)}function k(n,r){switch(cn.apply(void 0,["LiveChatWidget.call","'"+n+"'"].concat(r)),n){case"hide":case"maximize":case"minimize":if(zn(t))return;return void e[n](r);case"destroy":return e.kill(),delete window.__lc_inited,delete window.LC_API,void delete window.LiveChatWidget;case"set_session_variables":return void gn(e,c(String,r));case"set_customer_name":return void vn(e,{name:_n(r)});case"set_customer_email":return void vn(e,{email:_n(r)});case"update_session_variables":return void vn(e,{properties:c(String,r)});case"trigger_sales_tracker":return void gn(e,Dn(r));case"hide_greeting":return void e.call("hideGreeting");case"set_navigation_handler":return void Nn.setHandler(r);default:return void console.error('[LiveChatWidget] method "'+n+'" not exists.')}}void 0===(i=p.other)&&(i=[]),i.forEach((function(e){u(e[0],e[1])})),f(p.visibility),f(p.name),f(p.email),function(e){var t,r=(void 0===(t=e)&&(t=[]),t.reduce((function(e,t){var r=t[1],i=r[1];switch(r[0]){case"set_session_variables":return e.mode="set",e.properties=i,e;case"trigger_sales_tracker":return e.mode="set",e.properties=Dn(i),e;case"update_session_variables":return"none"===e.mode&&(e.mode="update"),e.properties=n({},e.properties,i),e}}),{mode:"none"})),i=r.mode;"none"!==i&&k(i+"_session_variables",r.properties)}(p.fields),a._q=[],a._h=u,a.scriptTagVersion=function(){return a._v},a.diagnose=fn(e,t,r),ne(Ln(e,An),K((function(){var e;e=function(e){return"function"==typeof e&&tn((function(){return e(a)}))},Array.isArray(window.__lc_onready)&&(window.__lc_onready.forEach(e),window.__lc_onready={push:e}),l("ready",{state:_("state"),customerData:_("customer_data")})}))),ne(Tn(e,(function(){return kn(e)})),K((function(e){return l("availability_changed",{availability:e})}))),ne(Tn(e,(function(){return bn(e,(function(){return _("state").visibility}))})),K((function(e){l("visibility_changed",{visibility:e})}))),ne(Tn(e,(function(){return bn(e,(function(){return _("customer_data").status}))})),K((function(e){return l("customer_status_changed",{status:e})}))),ne(Tn(e,(function(){return Pn(e,"hiddenIds")})),re((function(n){return Fn(e,n)})),$(y),K((function(e){return l("greeting_hidden",Hn(e))}))),ne(Tn(e,(function(){return Pn(e,"displayedIds")})),re((function(n){return Fn(e,n)})),$(y),K((function(e){return l("greeting_displayed",Hn(e))}))),ne(ee(e,"on_rating_submitted"),K((function(e){return l("rating_submitted",e)}))),ne(Z(ee(e,"add_event"),ee(e,"send_event")),$((function(e){return g(e.event.type,["message","emoji","rich_message","file"])})),re((function(t){var r=t.event,i=r.timestamp,o=r.properties,a=Ae(e.state,r.author),u=!0===o.invitation;return n({timestamp:i,type:r.type,author:{id:a.serverId,type:a.id===Oe(e.state)?"customer":"agent"}},u&&{greeting:Hn(o)})})),K((function(e){return l("new_event",e)}))),ne(Z(ne(ee(e,"send_event"),re((function(e){var n=e.event,t=n.type,r=n.properties;if("rich_message_postback"===t)return{postbackId:"postback"in r?r.postback.id:r.id,eventId:r.eventId};if("message"===t&&r.triggeredBy){var i=r.triggeredBy;return{postbackId:i.button.postbackId,eventId:i.event}}return null})),$(y)),ne(ee(e,"rich_greeting_button_clicked"),re((function(e){var n=e.event;return{eventId:n.id,postbackId:e.button.postbackId,greeting:Hn(n.properties)}})))),K((function(e){return l("rich_message_button_clicked",e)}))),ne(Z(ne(ee(e,"on_ticket_created"),re((function(){return"ticket"}))),ne(ee(e,"on_prechat_survey_submitted"),re((function(){return"prechat"}))),ne(ee(e,"on_postchat_survey_submitted"),re((function(){return"postchat"})))),K((function(e){return l("form_submitted",{type:e})})))}var Rn=function(){return window.GoogleAnalyticsObject||"ga"},Vn=function(e){var n=e.event,t=e.label,r=e.nonInteraction,i=e.trackerName,o=window[Rn()];o&&"function"==typeof o&&o([i,"send"].filter(Boolean).join("."),{hitType:"event",eventCategory:"LiveChat",eventAction:n,eventLabel:t,nonInteraction:r})},Gn={ga:Vn,gaAll:function(e){var t=window[Rn()];if(t&&"function"==typeof t.getAll){var r=t.getAll();a(r)&&r.forEach((function(t){Vn(n({},e,{trackerName:t&&"function"==typeof t.get?t.get("name"):null}))}))}},gaq:function(e){var n=window._gaq;n&&"function"==typeof n.push&&n.push(["_trackEvent","LiveChat",e.event,e.label,null,e.nonInteraction])},gtm:function(e){var n=window.dataLayer;n&&"function"==typeof n.push&&n.push({event:"LiveChat",eventCategory:"LiveChat",eventAction:e.event,eventLabel:e.label,nonInteraction:e.nonInteraction})},pageTracker:function(e){var n=window.pageTracker;n&&"function"==typeof n._trackEvent&&n._trackEvent("LiveChat",e.event,e.label,null,e.nonInteraction)},urchinTracker:function(e){var n=window.urchinTracker;n&&"function"==typeof n&&n(e.event)},gtag:function(e){var n=window.gtag;n&&"function"==typeof n&&n("event",e.event,{event_category:"LiveChat",event_label:e.label,non_interaction:e.nonInteraction})}},Un=function(e){var n=e.version,t=e.sendToAll;if(n&&"function"==typeof Gn[n])return t&&"ga"===n?"gaAll":n;if("object"==typeof window.pageTracker&&"function"==typeof window.pageTracker._trackEvent)return"pageTracker";if("function"==typeof window.urchinTracker)return"urchinTracker";if("function"==typeof window.gtag)return"gtag";if(!e.omitGtm&&"object"==typeof window.dataLayer&&"function"==typeof window.dataLayer.push)return"gtm";if("object"==typeof window._gaq)return"gaq";if(window.GoogleAnalyticsObject&&"string"==typeof window.GoogleAnalyticsObject)return t?"gaAll":"ga";if("function"==typeof window.ga){var r=!1;if(window.ga((function(e){r="object"==typeof e})),r)return t?"gaAll":"ga"}return null},Jn={Chat:"LiveChat Chat started","Automated greeting":"LiveChat Automated greeting displayed","Ticket form":"LiveChat Ticket form displayed","Ticket form filled in":"LiveChat Ticket form filled in","Pre-chat survey":"LiveChat Pre-chat survey displayed","Pre-chat survey filled in":"LiveChat Pre-chat survey filled in","Post-chat survey":"LiveChat Post-chat survey displayed","Post-chat survey filled in":"LiveChat Post-chat survey filled in"},Xn=function(){return window.mixpanel&&"function"==typeof window.mixpanel.track&&"function"==typeof window.mixpanel.register},Yn={googleAnalytics:function(e){var n=e.trackerName;return n?Gn[n]:null},kissmetrics:function(){return null},mixpanel:function(){if(!Xn())return null;return function(e){var n=e.event,t=e.eventData,r=e.persistentData;if(Xn()){var i=window.mixpanel;r&&(i.register(r),!Xn())||n in Jn&&i.track(Jn[n],t)}}}},$n=function(e,t){var r=t.analytics,i=Object.keys(r).filter((function(e){return r[e].enabled})).map((function(e){var n=r[e],t=Yn[e];try{return t(n)}catch(e){return rn(e),null}})).filter(Boolean);if(0!==i.length){var o=function(t,r){var o=void 0===r?{}:r,a=o.group,u=void 0===a?Pe(e.state,"group"):a,c=o.nonInteraction,s=void 0!==c&&c,d=o.eventData,l=void 0===d?{}:d,f=o.persistentData,p=void 0===f?null:f,h=o.useDataAsLabel,m=0!==u?"Group ID: "+u:"(no group)",v=void 0!==h&&h?T(l).map((function(e){return e[0]+": "+e[1]})).join(", "):m;i.forEach((function(e){try{e({event:t,nonInteraction:s,label:v,eventData:n({},l,{group:m}),persistentData:p})}catch(e){rn(e)}}))};ne(yn(e,(function(e){return Pe(e,"readyState")})),$((function(e){return e===En})),he(1),ie((function(){return In(e)})),$(Boolean),K((function(){var n=Ee(e.state);o("Chat",{eventData:{email:n.email,name:n.name},persistentData:{"performed chat":!0}})}))),e.on("add_event",(function(e){var n=e.event.properties;n.invitation&&n.receivedFirstTime&&o("Automated greeting",{nonInteraction:!0})})),e.on("on_chat_booster_launched",(function(e){var n=e.title;o("Chat Booster Launched: "+n,{eventData:{appId:e.id,title:n}})})),e.on("on_prechat_survey_submitted",(function(){o("Pre-chat survey filled in")})),e.on("on_postchat_survey_submitted",(function(){o("Post-chat survey filled in")})),e.on("on_ticket_created",(function(e){o("Ticket form filled in",{eventData:{email:e.visitor_email}})})),e.on("rich_greeting_button_clicked",(function(e){o("Rich greeting button clicked",{eventData:{buttonText:e.button.text,greetingId:e.event.properties.id},useDataAsLabel:!0})})),["prechat","postchat","ticket","offline"].forEach((function(n){var t;ne(Z(ee(e,"set_default_view"),ee(e,"set_current_view")),$((function(e){return e.viewInfo&&"Chat"===e.viewInfo.view&&e.viewInfo.default===n})),ve(ee(e,"unbind")),(t=function(){var t,r,i,o,a={prechat:["on_prechat_survey_submitted","Pre-chat survey"],postchat:["on_postchat_survey_submitted","Post-chat survey"],ticket:["on_ticket_created","Ticket form"],offline:["on_ticket_created","Ticket form"]}[n],u=a[0];return ne(function(){for(var e=arguments.length,n=Array(e),t=0;e>t;t++)n[t]=arguments[t];return function(e,t){if(0===e){var r=n.length;if(0===r)return t(0,(function(){})),void t(2);var i,o=0,a=function(e,n){i(e,n)};!function e(){o!==r?n[o](0,(function(n,r){0===n?(i=r,0===o?t(0,a):i(1)):2===n&&r?t(2,r):2===n?(o++,e()):t(n,r)})):t(2)}()}}}(ue(a[1]),ae),(t=ne(yn(e,(function(e){return wn(e,"maximized")})),$(Boolean)),o=void 0===(i=(void 0===r?{}:r).size)?100:i,function(e){return function(n,r){var i=[];if(0===n){var a,u,c=!1;e(0,(function(e,n){if(0===e&&(a=n,t(0,(function(e,n){if(0===e)(u=n)(1);else if(1===e){c=!0,u(2);var t=i.slice();i.length=0,t.forEach((function(e){return r(1,e)}))}}))),1===e)return c?void r(1,n):(i.push(n),i.length>o&&i.shift(),void a(1));r(e,n)}))}}}),ve(ee(e,u)))},function(e){return function(n,r){if(0===n){var i,o=null,a=function(e,n){if(0!==e)return 1===e?(r(1,n),void o(1)):void(2===e&&(o=null));(o=n)(1)},u=function(e,n){2===e&&null!==o&&o(2,n),i(e,n)};e(0,(function(e,n){if(0===e)return i=n,void r(0,u);if(1!==e){if(2===e){if(r(2,n),null===o)return;o(2,n)}}else{if(null!==o)return;t(n)(0,a)}}))}}}),K((function(e){o(e)})))}))}},Kn=/\.(\w+)$/i,Qn=new Audio,Zn={mp3:"audio/mpeg",ogg:"audio/ogg"},et=function(e){var n,t=(n=e.match(Kn))?n[1].toLowerCase():"";return t in Zn&&""!==Qn.canPlayType(Zn[t])},nt=function(n){return new e((function(e,t){var r=new Audio(n);r.onloadeddata=function(){e(r)},r.onerror=t}))},tt=function(n){var t,r=n.play();return(t=r)&&"function"==typeof t.then?r:e.resolve()},rt=function(e){return"function"==typeof e.start&&"function"==typeof e.stop},it=function(e){rt(e)?e.start(0):e.noteOn(0)},ot=function(){var n=new(window.AudioContext||window.webkitAudioContext),t=!0,r=[],i=function(t){return new e((function(e,r){n.decodeAudioData(t,e,r)}))},o=function(t){return{play:function(){var r=n.createBufferSource();return r.connect(n.destination),r.buffer=t,{playback:new e((function(e,t){if(r.onended=function(){return e()},it(r),"running"!==n.state){var i=Error("Playback failed, AudioContext is in incorrect state '"+n.state+"'");i.name="PlaybackError",t(i)}})),stop:function(){!function(e){rt(e)?e.stop(0):e.noteOff(0)}(r)}}}}};return{preload:function(n){return function(n){return new e((function(e,t){var r=new XMLHttpRequest;r.onload=function(){e(r.response)},r.onerror=t,r.open("GET",n),r.responseType="arraybuffer",r.send()}))}(n).then(i).then(o)},playSound:function(e){var n=e.play();return t&&r.push(n),n.playback},unlock:function(){return new e((function(e){document.addEventListener("click",(function i(){var o,a;document.removeEventListener("click",i,!0),t&&(r.forEach((function(e){e.stop()})),r=[],t=!1),n.resume(),o=n.createBuffer(1,1,22050),(a=n.createBufferSource()).buffer=o,a.connect(n.destination),it(a),e()}),!0)}))}}},at=function(){return"function"==typeof window.webkitAudioContext?(n=ot(),{play:function(e){var r=t(e).then(n.playSound);return r.catch(x),r},preload:t=L((function(e){var t=n.preload(e);return t.catch(x),t})),unlock:function(){return n.unlock()}}):function(){var n=L(nt);return{play:function(e){return n(e).then(tt)},preload:n,unlock:function(){return e.resolve()}}}();var n,t},ut=function(e){return Object.keys(e).reduce((function(n,t){var r,i=d((function(e){return et(e)}),a(r=e[t])?r:[r]);return n[t]=i,n}),{})},ct="new_message",st=function(){var e,n,t,r,i=((e={}).new_message=["https://cdn.livechatinc.com/widget/static/media/new_message.34190d36.ogg","https://cdn.livechatinc.com/widget/static/media/new_message.f3efb3d2.mp3"],n=e,t=at(),r=ut(n),{play:function(e){t.play(r[e]).then(x,x)},preload:function(e){t.preload(r[e]).then(x,x)},unlock:function(){return t.unlock()}});return i.unlock().then((function(){return e=2e3,n=function(e){i.play(e)},t=0,function(){var r=Date.now();e>r-t||(t=Date.now(),n.apply(void 0,arguments))};var e,n,t}))},dt=function(e,n){return void 0===n&&(n=!1),n&&e.__unsafeProperties.group.hasCustomMobileSettings},lt=function(e,n){var t=e.__unsafeProperties.group;return dt(e,n)?t.screenPositionOnMobile:t.screenPosition},ft=function(e,n){var t=e.__unsafeProperties.group;return dt(e,n)?{x:t.offsetXOnMobile,y:t.offsetYOnMobile}:{x:t.offsetX,y:t.offsetY}},pt=function(e){return!!e&&/native code/.test(e+"")},ht=function(){return g(navigator.platform,["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"])&&g("Version/15",navigator.userAgent)},mt=function(){return/mobile/gi.test(navigator.userAgent)&&!("MacIntel"===navigator.platform&&g("iPad",navigator.userAgent))},vt=function(){return/Firefox/.test(navigator.userAgent)},gt=function(e,n){var t=function(){n()||P(Ue,e)},r=function(){n()||P(Je,e)};if("onbeforeprint"in window)window.addEventListener("beforeprint",t),window.addEventListener("afterprint",r);else if(pt(window.matchMedia)){var i=window.matchMedia("print");i&&i.addListener((function(e){e.matches?t():r()}))}},_t=function(e,t,r){var i=t.__unsafeProperties.group.eyeCatcher;if(i.enabled&&!function(e,n){var t=e.__unsafeProperties.group;return dt(e,n)?t.disabledMinimizedOnMobile:t.disabledMinimized}(t)){var o,a,u=function(e){var n=Pe(e);return n.eyeCatcher.hidden||"minimized"!==n.visibility.state||"online"!==n.availability||n.readyState===xn},c=function(){o&&(N(o),o=null),clearTimeout(a)},s=function(){var o,a=q("div",Ye),s=lt(t);P(((o={bottom:i.y+"px"})[s]=i.x+"px",o),a);var d,l=q("div",$e);15>i.x&&"right"===s&&P(((d={})[s]=10-i.x+"px",d),l);l.innerHTML="×";var f=q("div",Ke),p=n({},Qe,{src:i.src,alt:r.embedded_chat_now});i.srcset&&(p.srcset=T(i.srcset).map((function(e){return e[1]+" "+e[0]})).join(", "));var h=q("img",p);return f.appendChild(h),h.addEventListener("load",(function(){P({width:h.width+"px",height:h.height+"px"},h)})),h.addEventListener("error",c),a.appendChild(l),a.appendChild(f),gt(a,(function(){return u(e.state)})),document.body.appendChild(a),pt(window.matchMedia)&&window.matchMedia("(hover: none)").matches?P({display:"block"},l):(a.addEventListener("mouseover",(function(){P({display:"block"},l)})),a.addEventListener("mouseout",(function(){P({display:"none"},l)}))),a.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),e.maximize()})),l.addEventListener("mouseover",(function(){P({color:"#444"},l)})),l.addEventListener("mouseout",(function(){P({color:"#000"},l)})),l.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation(),e.call("hideEyeCatcher")})),a};ne(yn(e,u),pe({next:function(e){e?c():a=setTimeout((function(){o=s()}),430)},complete:c}))}},wt=function(e){e.innerHTML=""},yt=function(e,n){var t=document.querySelectorAll(".livechat_button"),r=g(n.groupId,n.onlineGroupIds);[].forEach.call(t,(function(t){var i=t.getAttribute("data-id"),o=d((function(e){return e.id===i}),n.buttons);if(o){var a=v("#","0.href",t);"image"===o.type?function(e,n){var t=e.text,r=e.url,i=e.src;wt(n);var o=q("a",{href:r}),a=q("img",{src:i,alt:t,title:t});o.appendChild(a),n.appendChild(o)}({url:a,text:t.textContent,src:r?o.onlineValue:o.offlineValue},t):function(e,n){var t=e.text,r=e.url;wt(n);var i=q("a",{href:r});i.appendChild(document.createTextNode(t)),n.appendChild(i)}({url:a,text:r?o.onlineValue:o.offlineValue},t),t.children[0].addEventListener("click",(function(n){n.preventDefault(),e.maximize()}))}}))},bt=function(e){return e.replace(/\?+$/,"")},kt=function(){return{title:document.title,url:bt(document.location+""),referrer:document.referrer}},Ct=function(e){var n;ne((n=2e3,function(e,t){if(0===e){var r=0,i=setInterval((function(){t(1,r++)}),n);t(0,(function(e){2===e&&clearInterval(i)}))}}),re(kt),Y((function(e,n){return e.url===n.url})),ve(ee(e,"unbind")),K((function(n){e.call("storeMethod",["setApplicationState",{page:n}])})))};var It=function(e){ne(On(e,(function(){return ee(e,"add_event")})),$((function(e){var n=e.event;return"custom"===n.type&&n.properties.customId&&-1!==n.properties.customId.indexOf("cyber-finger-snapshot-request-")})),K((function(n){var t,r=n.event.properties.customId.replace("cyber-finger-snapshot-request-","");try{var i=(t=(void 0)[0],JSON.stringify(t));e.call("storeMethod",["emit","send_snapshot",{snapshot:i,requestId:r,screen:{width:window.innerWidth,height:window.innerHeight,scrollY:window.pageYOffset,scrollX:window.pageXOffset}}])}catch(e){}})))},Lt=window.Wix,xt=function(){return new e((function(e){Lt.getSiteInfo((function(n){var t=n.url,r=n.referrer||n.referer||"";n.baseUrl&&-1===t.indexOf(n.baseUrl)&&(t=n.baseUrl),e({title:n.pageTitle,referrer:r,url:t})}))}))},Et=function(e){var n,t,r,i;ne((n=function(){return!!document.hasFocus&&document.hasFocus()},t=function(e,t){if(0===e){var r=!1;t(0,(function(e){2===e&&(r=!0)})),t(1,n()),r||t(2)}},r=re((function(){return!0}))(Q(window,"focus")),i=re((function(){return!1}))(Q(window,"blur")),Z(t,r,i)),ve(ee(e,"unbind")),K((function(n){e.emit("focus",n)})))},At=null,Ot=!1;function Tt(){return e=/^Mac/,null!=window.navigator&&e.test(window.navigator.platform);var e}function Pt(e){Ot=!0,function(e){return!(e.metaKey||!Tt()&&e.altKey||e.ctrlKey)}(e)&&(At="keyboard")}function zt(e){At="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Ot=!0)}function St(e){(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||0===e.detail&&!e.pointerType})(e)&&(Ot=!0,At="virtual")}function jt(e){e.target!==window&&e.target!==document&&(Ot||(At="keyboard"),Ot=!1)}function Mt(){Ot=!1}var Nt=(document.addEventListener("keydown",Pt,!0),document.addEventListener("keyup",Pt,!0),document.addEventListener("click",St,!0),window.addEventListener("focus",jt,!0),window.addEventListener("blur",Mt,!1),"undefined"!=typeof PointerEvent?(document.addEventListener("pointerdown",zt,!0),document.addEventListener("pointermove",zt,!0),document.addEventListener("pointerup",zt,!0)):(document.addEventListener("mousedown",zt,!0),document.addEventListener("mousemove",zt,!0),document.addEventListener("mouseup",zt,!0)),function(){document.removeEventListener("keydown",Pt,!0),document.removeEventListener("keyup",Pt,!0),document.removeEventListener("click",St,!0),window.removeEventListener("focus",jt,!0),window.removeEventListener("blur",Mt,!1),"undefined"!=typeof PointerEvent?(document.removeEventListener("pointerdown",zt,!0),document.removeEventListener("pointermove",zt,!0),document.removeEventListener("pointerup",zt,!0)):(document.removeEventListener("mousedown",zt,!0),document.removeEventListener("mousemove",zt,!0),document.removeEventListener("mouseup",zt,!0))});function qt(e){if("Google Inc."===navigator.vendor&&"Win32"===navigator.platform){var n,t,r,i=e.frame,o=(n=100,t=function(){P(j(["width"],i),i),requestAnimationFrame((function(){P({width:en.style.width},i)}))},function(){clearTimeout(r);for(var e=arguments.length,i=Array(e),o=0;e>o;o++)i[o]=arguments[o];r=setTimeout.apply(void 0,[t,n].concat(i))});document.addEventListener("scroll",o);e.on("unbind",(function n(){e.off("unbind",n),document.removeEventListener("scroll",o)}))}}var Dt={position:ht()?"absolute":"fixed",height:ht()?"calc(100vh - env(safe-area-inset-bottom))":"100%",width:"100%",top:0,right:0,bottom:0,left:0,overflowY:"hidden"},Ht=function(e){var n=document.querySelector('meta[name="viewport"]')||function(){var e=q("meta",{name:"viewport"});return document.getElementsByTagName("head")[0].appendChild(e),e}(),t=null,r=function(){var e,r=n.content,i=(e=document.body,Object.keys(Dt).reduce((function(n,t){return n[t]=e.style[t],n}),{})),o=document.documentElement.scrollTop;return n.content="width=device-width, initial-scale=1.0, maximum-scale=1.0",P(Dt,document.body),function(){t=null,P(i,document.body),n.content=r,document.documentElement.scrollTop=o}};wn(e.state,"maximized")&&(t=r()),ne(yn(e,(function(e){return wn(e,"maximized")})),ce,pe({next:function(e){e[1]?t=r():t()},complete:function(){t&&t()}}))},Ft=mt(),Wt=function(e,n){if(e.iframeAddress)return e.iframeAddress;var t="https://secure"+((1520===e.licenseId?"-lc":"")+".livechatinc.com");return n.region&&(t=t.replace("secure","secure-"+n.region)),t+"/customer/action/open_chat"},Bt=function(e,n,t){var r=!!e.customContainer;return{page:n,license:e.licenseId,region:t.region,group:t.groupId,requestedGroup:e.requestedGroupId,customer:e.customer,hidden:!(e.actingAsDirectLink||r)&&function(e){var n=e.__unsafeProperties.group;return Ft&&n.hasCustomMobileSettings?n.initiallyHiddenOnMobile:n.initiallyHidden}(t),uniqueGroups:e.uniqueGroups,analytics:{googleAnalytics:{enabled:!!t.integrations.analytics,trackerName:Un(e.gaParams)},kissmetrics:{enabled:!!t.integrations.kissmetrics},mixpanel:{enabled:!!t.integrations.mixpanel}},actingAsDirectLink:e.actingAsDirectLink,isInCustomContainer:r,clientLimitExceeded:t.clientLimitExceeded,integrationName:e.integrationName,iframeAddress:Wt(e,t)}},Rt=function(){var e="lc_get_time_"+h();window.performance&&"function"==typeof window.performance.mark&&window.performance.mark(e);var n=performance.getEntriesByName(e)[0].startTime;return performance.clearMarks(e),n},Vt=function(){if("undefined"==typeof PerformanceObserver)return null;var n=Rt(),t=[],r=new PerformanceObserver((function(e){t.push.apply(t,e.getEntries())}));r.observe({entryTypes:["longtask"]});var i=function(){var e,r=b(t);return r?(e=r,Rt()-e.startTime+e.duration):Rt()-n};return{disconnect:function(){return r.disconnect()},getLongTasks:function(){return[].concat(t)},waitForIdle:function(n){return new e((function(e){!function o(){t.push.apply(t,r.takeRecords());var a=i();n>a?setTimeout(o,Math.ceil(n-a)):e()}()}))}}},Gt=function(n){void 0===n&&(n="first-contentful-paint");var t,r=Vt();return r?(t=n,new e((function(e){var n=performance.getEntriesByName(t);if(_(n))if("undefined"!=typeof PerformanceObserver){var r=setTimeout((function(){i.disconnect(),e(null)}),6e4),i=new PerformanceObserver((function(n){var o=d((function(e){return e.name===t}),n.getEntries());o&&(i.disconnect(),clearTimeout(r),e(o))}));i.observe({entryTypes:["paint"]})}else e(null);else e(n[0])}))).then((function(e){return e?r.waitForIdle(5e3).then((function(){return r.disconnect(),r.getLongTasks()})):null})):e.resolve(null)},Ut=function(e){var n=performance.getEntriesByName(e);return 1!==n.length?null:n[0]},Jt=function(e,n){return e&&n?Math.abs(n.startTime-e.startTime):null},Xt=function(e){if(!e)return null;var n=performance.getEntriesByType("navigation");return e.startTime-(_(n)?performance.timing.domContentLoadedEventStart-performance.timing.navigationStart:n[0].domContentLoadedEventStart)},Yt=function(){if(!Math.floor(1e3*Math.random())){var e=Gt().then((function(e){return e?O(e.filter((function(e){return g(".livechatinc.com",e.attribution[0].containerSrc)})).map((function(e){return e.duration}))):null}));return{getLogs:function(){return e.then((function(e){var n,t=1!==(n=performance.getEntriesByType("resource").filter((function(e){return/livechatinc\.com\/(.+\/)?tracking.js/.test(e.name)}))).length?null:n[0],r=Ut("lc_bridge_init"),i=Ut("lc_bridge_ready");return c((function(e){return e&&Number(e.toFixed(2))}),{timeFromTrackingStart:Jt(t,i),timeFromBridgeInit:Jt(r,i),timeFromDomContentLoaded:Xt(i),totalBlockingTimeContributedToOurScript:e})}))}}}};function $t(n,t){return t=t||{},new e((function(r,i){var o=new XMLHttpRequest,a=[],u=[],c={},s=function n(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return e.resolve(o.responseText)},json:function(){return e.resolve(o.responseText).then(JSON.parse)},blob:function(){return e.resolve(new Blob([o.response]))},clone:n,headers:{keys:function(){return a},entries:function(){return u},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var d in o.open(t.method||"get",n,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,n,t){a.push(n=n.toLowerCase()),u.push([n,t]),c[n]=c[n]?c[n]+","+t:t})),r(s())},o.onerror=i,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(d,t.headers[d]);o.send(t.body||null)}))}var Kt={};function Qt(t,r){var i=void 0===r?{}:r,o=i.query,a=void 0===o?{}:o,u=i.jsonpParam,c=void 0===u?"jsonp":u,s=i.callbackName;return new e((function(e,r){M().then((function(i){var o,u=document.createElement("script"),d=s||m(Kt);Kt[d]=!0;var l="__"+d;window[l]=function(n){delete Kt[d],delete window[l],N(u),e(n)},u.src=t+"?"+D(n({},a,((o={})[c]=l,o))),u.addEventListener("error",(function(){setTimeout((function(){return r(Error("JSONP request failed."))}),100)})),i.appendChild(u)}))}))}var Zt,er="__test_storage_support__",nr="@@test",tr=function(e){void 0===e&&(e="local");try{var n="session"===e?window.sessionStorage:window.localStorage;return n.setItem(er,nr),n.getItem(er)!==nr?!1:(n.removeItem(er),!0)}catch(e){return!1}},rr=function(){var e=Object.create(null);return{getItem:function(n){var t=e[n];return"string"==typeof t?t:null},setItem:function(n,t){e[n]=t},removeItem:function(n){delete e[n]},clear:function(){e=Object.create(null)}}}(),ir=(tr()&&window,Object.freeze({success:!0}),(Zt={}).CONNECTION_LOST="Connection lost.",Zt.MISDIRECTED_CONNECTION="Connected to wrong region.",function(e){return e.map((function(e){switch(e.type){case"group_chooser":return n({},e,{options:e.options.map((function(e){var t=e.group_id;return n({},ze(e,["group_id"]),{groupId:t})}))});case"rating":var t=e.comment_label;return n({},ze(e,["comment_label"]),{commentLabel:t});default:return e}}))}),or=function(e){var t,r;return{id:e.id,fields:!("id"in e.fields[0])?(t=e.fields,r=t.map((function(e,t){return n({},e,{id:t+""})})),ir(r)):ir(e.fields)}},ar=function(e){var n=function(e){return e.replace(G,"")}(e);return"https://"+(!g("cdn.livechatinc.com/cloud/?uri",n)&&!g(".livechat-static.com/",n)?"cdn.livechatinc.com/cloud/?"+D({uri:"https://"+n}):n)},ur=/\.([a-z]{1,})$/i,cr=function(e){var n=e.__priv,t={enabled:!0,x:parseInt(n.group["embedded_chat.eye_grabber.x"])+15,y:parseInt(n.group["embedded_chat.eye_grabber.y"]),src:ar(n.group["embedded_chat.eye_grabber.path"])};if(-1!==t.src.indexOf("/default/eyeCatchers/")){var r=t.src.match(ur)[1];t.srcset={"1x":t.src,"2x":t.src.replace(RegExp("\\."+r,"i"),"-2x."+r)}}return t},sr=function(e,n){return"https://api"+((r=(t=n).region)?"-"+r:"")+((1520===t.licenseId?".staging":"")+".livechatinc.com/v3.3/customer/action/")+e;var t,r},dr=function e(t){return Qt(sr("get_dynamic_configuration",t),{query:n({license_id:t.licenseId,url:t.url},"number"==typeof t.groupId&&{group_id:t.groupId},t.channelType&&{channel_type:t.channelType},t.skipCodeInstallationTracking&&{test:1})}).then((function(r){if(r.error)switch(r.error.type){case"misdirected_request":return e(n({},t,{region:r.error.data.region}));case"license_expired":if("direct_link"===t.channelType){var i=D({utm_source:"expired_chat_link",utm_medium:"referral",utm_campaign:"expired"});window.location.replace("https://www.livechat.com/powered-by-livechat/?"+i)}var o=Error(r.error.message);throw o.code=r.error.type.toUpperCase(),o;default:var a=Error(r.error.message);throw a.code=r.error.type.toUpperCase(),a}if(!r.domain_allowed){var u=Error("Current domain is not added to the allowlist.");throw u.code="DOMAIN_NOT_ALLOWED",u}return{groupId:r.group_id,clientLimitExceeded:r.client_limit_exceeded,configVersion:r.config_version,localizationVersion:r.localization_version,onlineGroupIds:r.online_group_ids||[],region:t.region||null}}))},lr=function(e){var n,t,r,i=e.allowVideoConferencing,o=e.allowClipboardWrite,a=[];if(e.allowAutoplay&&!vt()&&a.push("autoplay;"),i){var u={"display-capture *;":!g("Chrome",navigator.userAgent)||(r=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),(r?parseInt(r[2],10):0)>=94),"picture-in-picture *;":"PictureInPictureEvent"in window,"fullscreen *;":"function"==typeof Element.prototype.requestFullscreen};a=[].concat(a,["microphone *;","camera *;"],Object.keys((n=Boolean,Object.keys(t=u).reduce((function(e,r){return n(t[r])&&(e[r]=t[r]),e}),{}))))}return o&&!vt()&&a.push("clipboard-write *;"),a.join(" ")},fr=mt(),pr=function(e){return/px$/.test(e)?Math.ceil(parseFloat(e))+"px":e},hr=function(e){return fr?{width:"100%",height:"100%"}:"modern"===e.__unsafeProperties.group.theme.name?{width:"400px",height:"465px"}:{width:"352px",height:"652px"}},mr=function(e,n){return Object.keys(e.properties.license).some((function(t){return e.properties.license[t][n]}))},vr=function(e,n,t){var r,i,o,a=ft(n,fr);return!e&&t?((i={})[lt(n,fr)]="0",i.bottom=a.y+"px",i.maxHeight="100%",i):fr&&e?((o={})[lt(n,fr)]="0",o.bottom="0",o.maxHeight="100%",o):((r={})[lt(n,fr)]=a.x+"px",r.bottom=a.y+"px",r.maxHeight="calc(100% - "+a.y+"px)",r)},gr=function(e){return e.style.setProperty("transition","none","important")},_r=function(e,t){var r,i=q("div",Xe),o=ft(e,fr),a=vr(t,e),u=hr(e);return P(n(((r={width:u.width,height:u.height})[lt(e,fr)]=o.x+"px",r),a),i),i},wr=function(t,r,i,o){var a,u,c=D(n({license_id:r.license,group:r.group,embedded:1,widget_version:3,unique_groups:Number(r.uniqueGroups)},!!o&&{custom_identity_provider:1})),s={kill:function(){this._emit("widget_resize",{size:{width:"0px",height:"0px"}}),this.unbind(),t.custom||N(t.element)},applyHiddenStyles:function(){P(Ue,t.element)},isFocused:function(){return!!document.hasFocus&&document.hasFocus()},resize:function(e){var r=void 0===e?{}:e,o=r.height,a=r.maximized,u=r.ignoreHorizontalOffset,c={width:pr(r.width),height:pr(o)},s=vr(a,i,u);P(n({},c,s),t.element);var d=j(["width","height"],t.element);this._emit("widget_resize",{size:c,computedSize:d})},show:function(){P(Je,t.element)},hide:function(){this.call("hide")},minimize:function(){this.call("minimize")},maximize:function(){var e=this;if(!!window.event&&window.event.isTrusted&&g(window.event.type,["click","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend"])){var n=document.activeElement;n.addEventListener("blur",(function t(){n.removeEventListener("blur",t),e.emit("host_focus_shifted")})),this.call("maximize",{modality:At})}else this.call("maximize")},unbind:function(){var e=this;this.hide(),this.destroy(),this._emit("unbind"),this.off(),this.call=x,Object.keys(s).forEach((function(n){e[n]=x})),Nt()},callIdentityProvider:function(e){return null==o?void 0:o[e]()}},l=r.iframeAddress+"?"+c,f=new MutationObserver((function(e){return e.forEach((function(e){var n=d((function(e){return"IFRAME"===e.tagName&&e.getAttribute("src")===l}),e.addedNodes);n&&function(e,n){z(en,n),e.custom||P(Ze,n)}(t,n)}))}));return f.observe(t.element,{childList:!0}),new We({container:t.element,url:l,methods:s,iframeAllowedProperties:lr({allowAutoplay:!0,allowVideoConferencing:mr(i,"microphone"),allowClipboardWrite:mr(i,"clipboard_write")}),model:n({},r,{fullWidth:null==(a=t.size)?void 0:a.width,fullHeight:null==(u=t.size)?void 0:u.height,serverConfig:i,parentWidth:window.innerWidth,parentHeight:window.innerHeight})}).then((function(n){return e.all([n,Ve(n)])})).then((function(e){var n=e[0];return f.disconnect(),n}))},yr=function(e,n,t,r,i){e.call("storeMethod",["setLocalization",r]),t.custom||gt(t.element,(function(){return wn(e.state,"hidden")})),fr||"wix"===n.integrationName||_t(e,i,r),gr(e.frame),function(e,n,t){Mn(e,n,t),"LiveChatWidget"in window&&Bn(e,n,t)}(e,n,i),$n(e,n),ne(On(e,(function(){return function(e){var n=!1;e.on("iframe_sound_unlocked",(function(){return n=!0})),st().then((function(t){n||(e.emit("bridge_sound_unlocked"),e.on("add_event",(function(n){var r=n.event;Pe(e.state,"muted")||function(e,n){return"system"!==e.author&&!e.properties.welcomeMessage&&e.author!==n&&"custom"!==e.type}(r,Oe(e.state))&&t(ct)})))}))}(e),ae})),K(x)),"wix"===n.integrationName?function(e){Lt.addEventListener(Lt.Events.PAGE_NAVIGATION,(function(){xt().then((function(n){return e.call("storeMethod",["setApplicationState",{page:n}])}))}))}(e):Ct(e),Et(e),n.actingAsDirectLink||t.custom||function(e){ne(yn(e,(function(e){return wn(e,"hidden")})),fe(1),K((function(n){n?e.applyHiddenStyles():e.show()})))}(e),qt(e),function(e){var n=function(){setTimeout((function(){document.addEventListener("touchstart",x),setTimeout((function(){document.removeEventListener("touchstart",x)}),500)}),500)};window.addEventListener("orientationchange",n),e.on("unbind",(function t(){e.off("unbind",t),window.removeEventListener("orientationchange",n)}))}(e),yt(e,i),fr&&Ht(e),It(e),e.on("rich_greeting_button_clicked",(function(e){var n=e.button;"url"===n.type&&Nn.navigate(n.value)})),e.on("open_in_new_tab",(function(e){Nn.navigate(e)}))},br=function(t){return dr(t).then((function(r){var i;return e.all([r,(i={licenseId:t.licenseId,groupId:r.groupId,region:r.region,version:r.configVersion},Qt(sr("get_configuration",i),{callbackName:"lc_static_config",query:n({license_id:i.licenseId,version:i.version},"number"==typeof i.groupId&&{group_id:i.groupId})}).then((function(e){var t=e.buttons,r=e.allowed_domains,o=e.prechat_form,a=e.ticket_form,u=e.__priv;return n({},ze(e,["buttons","allowed_domains","prechat_form","ticket_form","__priv"]),o&&{prechatForm:or(o)},a&&{ticketForm:or(a)},{buttons:t.map((function(e){return"image"===e.type?{id:e.id,type:e.type,onlineValue:ar(e.online_value),offlineValue:ar(e.offline_value)}:{id:e.id,type:e.type,onlineValue:e.online_value,offlineValue:e.offline_value}}))},r&&{allowedDomains:r},{__unsafeProperties:n({},u.s&&{s:!0},{group:{chatBoosters:u.group.chat_boosters,disabledMinimized:"1"===u.group["chat_window.disable_minimized"],disabledMinimizedOnMobile:"1"===u.group["chat_window.mobile_disable_minimized"],disabledOnMobile:"1"===u.group["chat_window.hide_on_mobile"],eyeCatcher:"1"===u.group["embedded_chat.display_eye_catcher"]?cr(e):{enabled:!1},hasAgentAvatarsEnabled:"1"===u.group["chat_window.display_avatar"],hasCustomMobileSettings:"1"===u.group["chat_window.custom_mobile_settings"],hasHiddenTrademark:"1"===u.group["chat_window.hide_trademark"],hasSoundsEnabled:"0"===u.group["chat_window.disable_sounds"],initiallyHidden:"1"===u.group["chat_window.hide_on_init"]||"1"===u.group["chat_window.disable_minimized"],initiallyHiddenOnMobile:"1"===u.group["chat_window.mobile_hide_on_init"]||"1"===u.group["chat_window.mobile_disable_minimized"],hideOnInit:"1"===u.group["chat_window.hide_on_init"],language:u.group.language,linksUnfurlingEnabled:"1"===u.group.links_unfurling,logo:"1"===u.group["chat_window.display_logo"]?{enabled:!0,src:u.group["chat_window.logo_path"]}:{enabled:!1},minimizedType:u.group["chat_window.theme.minimized"],minimizedTypeOnMobile:u.group["chat_window.mobile_minimized_theme"],offlineMessagesEnabled:"0"===u.group.tickets_enabled,offsetX:parseInt(u.group["chat_window.offset_x"]),offsetXOnMobile:parseInt(u.group["chat_window.mobile_offset_x"]),offsetY:parseInt(u.group["chat_window.offset_y"]),offsetYOnMobile:parseInt(u.group["chat_window.mobile_offset_y"]),prechatFormAfterGreetingEnabled:"1"===u.group.pre_chat_survey_after_greeting,ratingEnabled:"1"===u.group["rate_me.enabled"],showUATrademark:"ua"===u.group.plusone_url||1520===i.licenseId,screenPosition:u.group["chat_window.screen_position"],screenPositionOnMobile:u.group["chat_window.mobile_screen_position"],transcriptButtonEnabled:"1"===u.group["chat_window.display_transcript_button"],theme:{name:u.group["chat_window.new_theme.name"],variant:u.group["chat_window.new_theme.variant"]||"light",customJson:u.group["chat_window.new_theme.custom_json"],agentbarBackgroundColor:u.group["chat_window.new_theme.agentbar_background_color"],agentbarText:u.group["chat_window.new_theme.agentbar_text"],agentMessageColorBackground:u.group["chat_window.new_theme.agent_message_color_background"],agentMessageColorText:u.group["chat_window.new_theme.agent_message_color_text"],backgroundColor:u.group["chat_window.new_theme.background_color"],ctaColor:u.group["chat_window.new_theme.cta_color"],minimizedColorBackground:u.group["chat_window.new_theme.minimized_color_background"],minimizedColorIcon:u.group["chat_window.new_theme.minimized_color_icon"],minimizedColorText:u.group["chat_window.new_theme.minimized_color_text"],systemMessageColor:u.group["chat_window.new_theme.system_message_color"],titlebarBackgroundColor:u.group["chat_window.new_theme.titlebar_background_color"],titlebarText:u.group["chat_window.new_theme.titlebar_text"],visitorMessageColorBackground:u.group["chat_window.new_theme.visitor_message_color_background"],visitorMessageColorText:u.group["chat_window.new_theme.visitor_message_color_text"]}},license:{continuousChatWidgetEnabled:"1"===u.license.continuous_chat_widget_enabled,creditCardMaskingEnabled:"1"===u.license.mask_credit_cards,customerHistoryEnabled:"1"===u.license.customer_history_enabled,fileSharingEnabled:"1"===u.license["attachments.enable_for_visitors"],inboundForwardingToHelpdeskEnabled:"1"===u.license["helpdesk.inbound_forwarding"],nonProfit:"1"===u.license.non_profit}})})})))]).then((function(e){return n({},e[0],e[1])}))}))};var kr,Cr,Ir,Lr=function(e){return function(e){return"number"==typeof e&&e>=0}(t="string"==typeof(n=void 0!==e.group?e.group:e.skill)?parseInt(n,10):n)?t:null;var n,t},xr=function(e,n){var t={name:null,email:null,properties:{}};if("object"==typeof e&&e){var r=e.name,i=e.email;"string"==typeof r&&(t.name=r),"string"==typeof i&&(t.email=i)}return Array.isArray(n)&&(t.properties=mn(n)),t};if(!window.__lc_inited)if(window.__lc_inited=!0,"msCrypto"in window)console.error("[LiveChat] We no longer support Internet Explorer");else{var Er=(Ir=window.__lc,{licenseId:parseInt(Ir.license),requestedGroupId:Lr(Ir),uniqueGroups:!1===Ir.chat_between_groups,customer:xr(Ir.visitor,Ir.params),skipCodeInstallationTracking:1===Ir.test,integrationName:Ir.wix?"wix":"string"==typeof Ir.integration_name?Ir.integration_name:null,actingAsDirectLink:!0===Ir.direct_link,customContainer:Ir.custom_container||null,gaParams:{version:"string"==typeof Ir.ga_version?Ir.ga_version:null,omitGtm:!!Ir.ga_omit_gtm,sendToAll:!!Ir.ga_send_to_all_trackers},customIdentityProviderInitializer:"function"==typeof Ir.custom_identity_provider?Ir.custom_identity_provider:null,iframeAddress:null});!Er.actingAsDirectLink&&(kr="cw_configurator",Cr=window.location.search,B(Cr)[kr]||tr("session")&&window.sessionStorage.getItem("cw_configurator"))?M().then((function(e){var n=document.createElement("iframe");P({display:"none"},n),e.appendChild(n),vt()&&(n.contentDocument.open(),n.contentDocument.close());var t=n.contentDocument.head;["https://cdn.livechatinc.com/widget/static/js/runtime-configurator.d08a143a.js","https://cdn.livechatinc.com/widget/static/js/0.5d78072a.chunk.js","https://cdn.livechatinc.com/widget/static/js/2.288ab811.chunk.js","https://cdn.livechatinc.com/widget/static/js/configurator.6c9ef22a.chunk.js"].forEach((function(e){!function(e,n){var t=document.createElement("script");z({src:n,charset:"utf-8"},t),e.appendChild(t)}(t,e)}))})):3===[1].reduce((function(e,n){return e+n}),2)?function(t){window.performance&&"function"==typeof window.performance.mark&&window.performance.mark("lc_bridge_init");var r=!1;window.LC_API=window.LC_API||{},window.LC_API.is_loaded=function(){return r};var i=t.requestedGroupId,o=t.integrationName,u=t.customIdentityProviderInitializer,c=n({licenseId:t.licenseId,skipCodeInstallationTracking:t.skipCodeInstallationTracking,channelType:t.actingAsDirectLink?"direct_link":"code",url:bt(document.location+"")},"number"==typeof i&&{groupId:i});e.all([br(c),"wix"===o?xt():kt(),M()]).then((function(i){var o=i[0],c=i[1],s=i[2];if(an(o.allowedDomains,window.top===window?window.location.hostname:document.referrer)){if(!fr||!o.__unsafeProperties.group.disabledOnMobile||t.actingAsDirectLink){var d=Yt(),l=function(e){if(null===e)return null;var n=e();return"object"!=typeof n||"function"!=typeof n.getToken||"function"!=typeof n.getFreshToken||"function"!=typeof n.hasToken||"function"!=typeof n.invalidate?(console.error("custom_identity_provider() does not return proper handlers. ({getFreshToken: () => Promise, getToken: () => Promise, hasToken: () => Promise, invalidate: () => Promise })"),null):n}(u),f=Bt(t,c,o),p=function(e,n){return e.customContainer?{custom:!0,element:e.customContainer}:{custom:!1,element:_r(n,e.actingAsDirectLink),size:hr(n)}}(t,o),h={},m=!1,v=on("on_before_load"),g=on("on_after_load");v((function(e){e.disable_sounds=x,e.mobile_is_detected=function(){return fr},e.chat_running=function(){return!1},e.visitor_engaged=function(){return!1},e.agents_are_available=function(){return-1!==o.onlineGroupIds.indexOf(o.groupId)},e.get_window_type=function(){return"embedded"},e.hide_chat_window=zn(f)?x:function(){return m=!0},e.set_visitor_name=function(e){return h.name=_n(e)},e.set_visitor_email=function(e){return h.email=_n(e)},e.set_custom_variables=function(e){return h.properties=e?mn(e):{}},e.update_custom_variables=function(e){e&&(h.properties=n({},h.properties,mn(e)))}}));var _,w=n({},f,{customer:n({},f.customer,h),hidden:f.hidden||m});p.custom||s.appendChild(p.element),window.performance&&"function"==typeof window.performance.mark&&window.performance.mark("lc_bind_child"),e.all([wr(p,w,o,l),(_={licenseId:w.license,groupId:w.group,region:w.region,version:o.localizationVersion,language:o.__unsafeProperties.group.language},Qt(sr("get_localization",_),{callbackName:"lc_localization",query:n({license_id:_.licenseId,version:_.version,language:_.language},"number"==typeof _.groupId&&{group_id:_.groupId})}).then((function(e){return k((function(e){return e.toLowerCase()}),e)})))]).then((function(e){var n=e[0],t=e[1];return p.custom||gr(p.element),yr(n,w,p,t,o),ne(yn(n,(function(e){return Pe(e,"readyState")})),$((function(e){return e===En})),he(1),re((function(){return n})),ge)})).then((function(e){window.performance&&"function"==typeof window.performance.mark&&window.performance.mark("lc_bridge_ready"),d&&d.getLogs().then((function(n){var t;e.call("logInfo","loading_time_measured",a(t=n)?t.filter((function(e){return null!=e})):Object.keys(t).reduce((function(e,n){var r=t[n];return null!=r&&(e[n]=r),e}),{}))})),g((function(){return r=!0})),Math.floor(10*Math.random())||setTimeout((function(){(function(e){return $t(sr("get_localization",e)+"?"+D(n({license_id:e.licenseId,version:e.version,language:e.language},"number"==typeof e.groupId&&{group_id:e.groupId}))).then((function(e){return e.json()})).then((function(e){return k((function(e){return e.toLowerCase()}),e)}))})({licenseId:f.license,groupId:f.group,region:f.region,version:o.localizationVersion,language:o.__unsafeProperties.group.language}).catch((function(){e.call("logInfo","potential_csp_problem",{url:window.location+""})}))}),1e4)}))}}else console.log("[LiveChat] Current domain is not added to the allowed domains. LiveChat has been disabled.")})).catch((function(e){switch(null==e?void 0:e.code){case"ACCESS_NOT_RESOLVED":case"CUSTOMER_BANNED":return void console.warn("[LiveChat] "+e.message);default:throw e}}))}(Er):console.error("[LiveChat] This site has overriden Array.prototype.reduce (for example by using Prototype library) to a version that is not compatible with Web standards. LiveChat code couldn't be initialized because of this.")}}();