parcelRequire=function(r,i,t){var e,s="function"==typeof parcelRequire&&parcelRequire,a="function"==typeof require&&require;function c(e,t){if(!i[e]){if(!r[e]){var n="function"==typeof parcelRequire&&parcelRequire;if(!t&&n)return n(e,!0);if(s)return s(e,!0);if(a&&"string"==typeof e)return a(e);t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}o.resolve=function(t){return r[e][1][t]||t},o.cache={};n=i[e]=new c.Module(e);r[e][0].call(n.exports,o,n,n.exports,this)}return i[e].exports;function o(t){return c(o.resolve(t))}}c.isParcelRequire=!0,c.Module=function(t){this.id=t,this.bundle=c,this.exports={}},c.modules=r,c.cache=i,c.parent=s,c.register=function(t,n){r[t]=[function(t,e){e.exports=n},{}]};for(var n,o=0;o<t.length;o++)try{c(t[o])}catch(r){e=e||r}if(t.length&&(n=c(t[t.length-1]),"object"==typeof exports&&"undefined"!=typeof module?module.exports=n:"function"==typeof define&&define.amd&&define(function(){return n})),parcelRequire=c,e)throw e;return c}({aSor:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Component=R,n.Fragment=A,n.cloneElement=function(t,e,n){var o,r,i,s=S({},t.props);for(i in e)"key"==i?o=e[i]:"ref"==i?r=e[i]:s[i]=e[i];return 2<arguments.length&&(s.children=3<arguments.length?T.call(arguments,2):n),v(t.type,s,o||t.key,r||t.ref,null)},n.createContext=function(t,o){t={__c:o="__cC"+a++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,e;return this.getChildContext||(n=[],((e={})[o]=this).getChildContext=function(){return e},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(l)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return t.Provider.__=t.Consumer.contextType=t},n.h=n.createElement=u,n.createRef=function(){return{current:null}},n.hydrate=function t(e,n){m(e,n,t)},n.options=n.isValidElement=void 0,n.render=m,n.toChildArray=function e(t,n){return n=n||[],null!=t&&"boolean"!=typeof t&&(Array.isArray(t)?t.some(function(t){e(t,n)}):n.push(t)),n};var T,E,i,o,r,s,a,x={},b=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function S(t,e){for(var n in e)t[n]=e[n];return t}function C(t){var e=t.parentNode;e&&e.removeChild(t)}function u(t,e,n){var o,r,i,s={};for(i in e)"key"==i?o=e[i]:"ref"==i?r=e[i]:s[i]=e[i];if(2<arguments.length&&(s.children=3<arguments.length?T.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===s[i]&&(s[i]=t.defaultProps[i]);return v(t,s,o,r,null)}function v(t,e,n,o,r){t={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++i:r};return null==r&&null!=E.vnode&&E.vnode(t),t}function A(t){return t.children}function R(t,e){this.props=t,this.context=e}function O(t,e){if(null==e)return t.__?O(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?O(t):null}function l(t){(!t.__d&&(t.__d=!0)&&o.push(t)&&!p.__r++||s!==E.debounceRendering)&&((s=E.debounceRendering)||r)(p)}function p(){for(var t;p.__r=o.length;)t=o.sort(function(t,e){return t.__v.__b-e.__v.__b}),o=[],t.some(function(t){var e,n,o,r,i;t.__d&&(r=(o=(t=t).__v).__e,(i=t.__P)&&(e=[],(n=S({},o)).__v=o.__v+1,k(i,o,n,t.__n,void 0!==i.ownerSVGElement,null!=o.__h?[r]:null,e,null==r?O(o):r,o.__h),g(e,o),o.__e!=r&&function t(e){var n,o;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if(null!=(o=e.__k[n])&&null!=o.__e){e.__e=e.__c.base=o.__e;break}return t(e)}}(o)))})}function P(t,e,n,o,r,i,s,a,c,u){var l,p,h,d,f,g,m,y=o&&o.__k||b,_=y.length;for(n.__k=[],l=0;l<e.length;l++)if(null!=(d=n.__k[l]=null==(d=e[l])||"boolean"==typeof d?null:"string"==typeof d||"number"==typeof d||"bigint"==typeof d?v(null,d,null,null,d):Array.isArray(d)?v(A,{children:d},null,null,null):0<d.__b?v(d.type,d.props,d.key,null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(h=y[l])||h&&d.key==h.key&&d.type===h.type)y[l]=void 0;else for(p=0;p<_;p++){if((h=y[p])&&d.key==h.key&&d.type===h.type){y[p]=void 0;break}h=null}k(t,d,h=h||x,r,i,s,a,c,u),f=d.__e,(p=d.ref)&&h.ref!=p&&(m=m||[],h.ref&&m.push(h.ref,null,d),m.push(p,d.__c||f,d)),null!=f?(null==g&&(g=f),"function"==typeof d.type&&d.__k===h.__k?d.__d=c=function t(e,n,o){for(var r,i=e.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=e,n="function"==typeof r.type?t(r,n,o):w(o,r,r,i,r.__e,n));return n}(d,c,t):c=w(t,d,h,y,f,c),"function"==typeof n.type&&(n.__d=c)):c&&h.__e==c&&c.parentNode!=t&&(c=O(h))}for(n.__e=g,l=_;l--;)null!=y[l]&&("function"==typeof n.type&&null!=y[l].__e&&y[l].__e==n.__d&&(n.__d=O(o,l+1)),function t(e,n,o){var r,i;if(E.unmount&&E.unmount(e),!(r=e.ref)||r.current&&r.current!==e.__e||j(r,null,n),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){E.__e(e,n)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&t(r[i],n,"function"!=typeof e.type);o||null==e.__e||C(e.__e),e.__e=e.__d=void 0}(y[l],y[l]));if(m)for(l=0;l<m.length;l++)j(m[l],m[++l],m[++l])}function w(t,e,n,o,r,i){var s,a,c;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==n||r!=i||null==r.parentNode)t:if(null==i||i.parentNode!==t)t.appendChild(r),s=null;else{for(a=i,c=0;(a=a.nextSibling)&&c<o.length;c+=2)if(a==r)break t;t.insertBefore(r,i),s=i}return void 0!==s?s:r.nextSibling}function h(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function M(t,e,n,o,r){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||h(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||h(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/Capture$/,"")),e=(e.toLowerCase()in t?e.toLowerCase():e).slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o||t.addEventListener(e,i?f:d,i):t.removeEventListener(e,i?f:d,i);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"!=typeof n&&(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function d(t){this.l[t.type+!1](E.event?E.event(t):t)}function f(t){this.l[t.type+!0](E.event?E.event(t):t)}function k(t,e,n,o,r,i,s,a,c){var u,l,p,h,d,f,g,m,y,_,b,v,w,k=e.type;if(void 0===e.constructor){null!=n.__h&&(c=n.__h,a=e.__e=n.__e,e.__h=null,i=[a]),(u=E.__b)&&u(e);try{t:if("function"==typeof k){if(m=e.props,y=(u=k.contextType)&&o[u.__c],_=u?y?y.props.value:u.__:o,n.__c?g=(l=e.__c=n.__c).__=l.__E:("prototype"in k&&k.prototype.render?e.__c=l=new k(m,_):(e.__c=l=new R(m,_),l.constructor=k,l.render=D),y&&y.sub(l),l.props=m,l.state||(l.state={}),l.context=_,l.__n=o,p=l.__d=!0,l.__h=[]),null==l.__s&&(l.__s=l.state),null!=k.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=S({},l.__s)),S(l.__s,k.getDerivedStateFromProps(m,l.__s))),h=l.props,d=l.state,p)null==k.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==h&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(m,_),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(m,l.__s,_)||e.__v===n.__v){l.props=m,l.state=l.__s,e.__v!==n.__v&&(l.__d=!1),(l.__v=e).__e=n.__e,e.__k=n.__k,e.__k.forEach(function(t){t&&(t.__=e)}),l.__h.length&&s.push(l);break t}null!=l.componentWillUpdate&&l.componentWillUpdate(m,l.__s,_),null!=l.componentDidUpdate&&l.__h.push(function(){l.componentDidUpdate(h,d,f)})}if(l.context=_,l.props=m,l.__v=e,l.__P=t,b=E.__r,v=0,"prototype"in k&&k.prototype.render)l.state=l.__s,l.__d=!1,b&&b(e),u=l.render(l.props,l.state,l.context);else for(;l.__d=!1,b&&b(e),u=l.render(l.props,l.state,l.context),l.state=l.__s,l.__d&&++v<25;);l.state=l.__s,null!=l.getChildContext&&(o=S(S({},o),l.getChildContext())),p||null==l.getSnapshotBeforeUpdate||(f=l.getSnapshotBeforeUpdate(h,d)),w=null!=u&&u.type===A&&null==u.key?u.props.children:u,P(t,Array.isArray(w)?w:[w],e,n,o,r,i,s,a,c),l.base=e.__e,e.__h=null,l.__h.length&&s.push(l),g&&(l.__E=l.__=null),l.__e=!1}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=function(t,e,n,o,r,i,s,a){var c,u,l,p=n.props,h=e.props,d=e.type,f=0;if("svg"===d&&(r=!0),null!=i)for(;f<i.length;f++)if((c=i[f])&&"setAttribute"in c==!!d&&(d?c.localName===d:3===c.nodeType)){t=c,i[f]=null;break}if(null==t){if(null===d)return document.createTextNode(h);t=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,h.is&&h),i=null,a=!1}if(null===d)p===h||a&&t.data===h||(t.data=h);else{if(i=i&&T.call(t.childNodes),u=(p=n.props||x).dangerouslySetInnerHTML,l=h.dangerouslySetInnerHTML,!a){if(null!=i)for(p={},f=0;f<t.attributes.length;f++)p[t.attributes[f].name]=t.attributes[f].value;!l&&!u||l&&(u&&l.__html==u.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||"")}if(function(t,e,n,o,r){for(var i in n)"children"===i||"key"===i||i in e||M(t,i,null,n[i],o);for(i in e)r&&"function"!=typeof e[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===e[i]||M(t,i,e[i],n[i],o)}(t,h,p,r,a),l)e.__k=[];else if(f=e.props.children,P(t,Array.isArray(f)?f:[f],e,n,o,r&&"foreignObject"!==d,i,s,i?i[0]:n.__k&&O(n,0),a),null!=i)for(f=i.length;f--;)null!=i[f]&&C(i[f]);a||("value"in h&&void 0!==(f=h.value)&&(f!==t.value||"progress"===d&&!f||"option"===d&&f!==p.value)&&M(t,"value",f,p.value,!1),"checked"in h&&void 0!==(f=h.checked)&&f!==t.checked&&M(t,"checked",f,p.checked,!1))}return t}(n.__e,e,n,o,r,i,s,c);(u=E.diffed)&&u(e)}catch(t){e.__v=null,!c&&null==i||(e.__e=a,e.__h=!!c,i[i.indexOf(a)]=null),E.__e(t,e,n)}}}function g(t,e){E.__c&&E.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){E.__e(t,e.__v)}})}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){E.__e(t,n)}}function D(t,e,n){return this.constructor(t,n)}function m(t,e,n){var o,r,i;E.__&&E.__(t,e),r=(o="function"==typeof n)?null:n&&n.__k||e.__k,i=[],k(e,t=(!o&&n||e).__k=u(A,null,[t]),r||x,x,void 0!==e.ownerSVGElement,!o&&n?[n]:!r&&e.firstChild?T.call(e.childNodes):null,i,!o&&n?n:r?r.__e:e.firstChild,o),g(i,t)}n.isValidElement=void 0,n.options=E,T=b.slice,n.options=E={__e:function(t,e,n,o){for(var r,i,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},i=0,n.isValidElement=function(t){return null!=t&&void 0===t.constructor},R.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=S({},this.state);(t="function"==typeof t?t(S({},n),this.props):t)&&S(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),l(this))},R.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),l(this))},R.prototype.render=A,o=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=p.__r=0},{}],pVo6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MessageType=void 0,n.MessageType=void 0,n.MessageType={WEB:"web",OPERATOR:"tg",SYSTEM:"system"}},{}],Ndp7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,r,i=t("preact"),t=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t=(o=i.Component,t(s,o),s.prototype.render=function(){var t=this;return(0,i.h)("div",{style:{position:"fixed",zIndex:99999999999,paddingTop:"60px",paddingBottom:"50px",left:0,top:0,width:"100%",height:"100%",overflow:"auto",backgroundColor:"rgba(0,0,0,0.9)",cursor:"pointer"},onClick:function(){return t.props.onClose()}},(0,i.h)("span",{style:{position:"absolute",top:"15px",right:"35px",color:"#f1f1f1",fontSize:"40px",fontWeight:"bold",transition:"0.2s",userSelect:"none"},onClick:function(){return t.props.onClose()}},"×"),(0,i.h)("img",{src:"data:image/png;base64,".concat(this.props.imageBase64),alt:"opened",style:{margin:"auto",display:"block",objectFit:"contain",maxWidth:"90%",maxHeight:"90%"}}))},s);function s(){return null!==o&&o.apply(this,arguments)||this}n.default=t},{preact:"aSor"}],u8e7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,r,i=t("preact"),t=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t=(o=i.Component,t(s,o),s.prototype.componentDidUpdate=function(t){!1===t.isCleanMessageText&&!0===this.props.isCleanMessageText&&(this.setState({enteredText:""}),this.props.onMessageTextCleaned())},s.prototype.render=function(){var e=this,t=this.state.enteredText;return(0,i.h)("input",{className:"tf-input",type:"text",value:t,onInput:function(t){t&&t.currentTarget&&(t=(t.currentTarget.value||"").slice(0,4e3),e.setState({enteredText:t}),e.props.onMessageTextChanged(t))},placeholder:this.props.widgetSettings.customEnterText||"Введите сообщение...",onKeyDown:function(t){"Enter"===t.key&&(t.preventDefault(),t.stopPropagation(),e.props.onSendMessage())}})},s);function s(t){t=o.call(this,t)||this;return t.state={enteredText:"",messagesCount:0},t}n.default=t},{preact:"aSor"}],MwGB:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.useCallback=function(t,e){return c=8,v(function(){return t},e)},n.useContext=function(t){var e=i.context[t.__c],n=m(r++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(i)),e.props.value):t.__},n.useDebugValue=function(t,e){a.options.useDebugValue&&a.options.useDebugValue(e?e(t):t)},n.useEffect=function(t,e){var n=m(r++,3);!a.options.__s&&x(n.__H,e)&&(n.__=t,n.u=e,i.__H.__h.push(n))},n.useErrorBoundary=function(t){var e=m(r++,10),n=y();return e.__=t,i.componentDidCatch||(i.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]},n.useImperativeHandle=function(t,e,n){c=6,b(function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},null==n?n:n.concat(t))},n.useLayoutEffect=b,n.useMemo=v,n.useReducer=_,n.useRef=function(t){return c=5,v(function(){return{current:t}},[])},n.useState=y;var r,i,o,s,a=t("preact"),c=0,u=[],l=[],p=a.options.__b,h=a.options.__r,d=a.options.diffed,f=a.options.__c,g=a.options.unmount;function m(t,e){a.options.__h&&a.options.__h(i,t,c||e),c=0;e=i.__H||(i.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({__V:l}),e.__[t]}function y(t){return c=1,_(S,t)}function _(t,e,n){var o=m(r++,2);return o.t=t,o.__c||(o.__=[n?n(e):S(void 0,e),function(t){t=o.t(o.__[0],t);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=i),o.__}function b(t,e){var n=m(r++,4);!a.options.__s&&x(n.__H,e)&&(n.__=t,n.u=e,i.__h.push(n))}function v(t,e){var n=m(r++,7);return x(n.__H,e)?(n.__V=t(),n.u=e,n.__h=t,n.__V):n.__}function w(){for(var e;e=u.shift();)if(e.__P)try{e.__H.__h.forEach(T),e.__H.__h.forEach(E),e.__H.__h=[]}catch(t){e.__H.__h=[],a.options.__e(t,e.__v)}}a.options.__b=function(t){i=null,p&&p(t)},a.options.__r=function(t){h&&h(t),r=0;t=(i=t.__c).__H;t&&(o===i?(t.__h=[],i.__h=[],t.__.forEach(function(t){t.__V=l,t.u=void 0})):(t.__h.forEach(T),t.__h.forEach(E),t.__h=[])),o=i},a.options.diffed=function(t){d&&d(t);t=t.__c;t&&t.__H&&(!t.__H.__h.length||1!==u.push(t)&&s===a.options.requestAnimationFrame||((s=a.options.requestAnimationFrame)||function(t){function e(){clearTimeout(o),k&&cancelAnimationFrame(n),setTimeout(t)}var n,o=setTimeout(e,100);k&&(n=requestAnimationFrame(e))})(w),t.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.__V!==l&&(t.__=t.__V),t.u=void 0,t.__V=l})),o=i=null},a.options.__c=function(t,n){n.some(function(e){try{e.__h.forEach(T),e.__h=e.__h.filter(function(t){return!t.__||E(t)})}catch(t){n.some(function(t){t.__h&&(t.__h=[])}),n=[],a.options.__e(t,e.__v)}}),f&&f(t,n)},a.options.unmount=function(t){g&&g(t);var e,t=t.__c;t&&t.__H&&(t.__H.__.forEach(function(t){try{T(t)}catch(t){e=t}}),e&&a.options.__e(e,t.__v))};var k="function"==typeof requestAnimationFrame;function T(t){var e=i,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),i=e}function E(t){var e=i;t.__c=t.__(),i=e}function x(n,t){return!n||n.length!==t.length||t.some(function(t,e){return t!==n[e]})}function S(t,e){return"function"==typeof e?e(t):e}},{preact:"aSor"}],mI36:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=t("preact"),a=t("preact/hooks");n.default=function(t){var t=t.widgetSettings,e=(0,a.useState)(0),n=e[0],o=e[1];(0,a.useEffect)(function(){var t=setTimeout(function(){var t=n;3===t?t=0:t+=1,o(t)},300);return function(){clearTimeout(t)}},[n]);for(var r="",i=0;i<n;i+=1)r+=".";return(0,s.h)("div",{style:{marginLeft:"5px",marginBottom:"5px",color:"#696969",fontSize:"12px"}},t.operatorTyping||"Оператор отвечает",r,(0,s.h)("svg",{className:"telegram_feedback_svg",style:{width:"10px",height:"10px",marginLeft:"5px",transition:"700ms",filter:"invert(44%) sepia(0%) saturate(14%) hue-rotate(146deg) brightness(90%) contrast(87%)"},version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","enable-background":"new 0 0 512 512"},(0,s.h)("g",null,(0,s.h)("g",null,(0,s.h)("path",{d:"m179.2,410.4l-77.3-77.4 272.5-272.9 77.3,77.4-272.5,272.9zm-96-38.3l56.9,57-79.2,22.3 22.3-79.3zm411.8-249l-106.2-106.4c-7.7-7.7-21.2-7.7-28.9-3.55271e-15l-301.3,301.8c-2.5,2.5-4.3,5.5-5.2,8.9l-41.6,148c-2,7.1 0,14.8 5.2,20 3.9,3.9 11.7,6.7 20,5.2l147.8-41.7c3.4-0.9 6.4-2.7 8.9-5.2l301.3-301.7c8-8 8-20.9 0-28.9z"})))))}},{preact:"aSor","preact/hooks":"MwGB"}],YWeT:[function(t,e,n){"use strict";function o(){}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,o.isValidEmail=function(t){return/^\S+@\S+\.\S+$/.test(t)},n.default=o},{}],Q0HA:[function(t,e,n){"use strict";function o(){}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,o.wait=function(e){return new Promise(function(t){setTimeout(function(){t()},e)})},n.default=o},{}],t3K6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FormComponent=void 0;var _=t("preact"),b=t("preact/hooks"),v=o(t("../../../util/FormValidator")),w=o(t("../../../util/Waiter"));function o(t){return t&&t.__esModule?t:{default:t}}function k(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}n.FormComponent=function(t){function e(){return c=function(){var e,n,o,r,i;return k(this,function(t){switch(t.label){case 0:if(l.isUsernameMandatory&&!p.trim())return h(!0),[2];if(l.isEmailMandatory&&!d.trim()||d.trim()&&!v.default.isValidEmail(d))return f(!0),[2];if(l.isPhoneMandatory&&!g.trim())return m(!0),[2];t.label=1;case 1:t.trys.push([1,7,,8]),e=u.data.getDialogApiRepository(),n=u.domain.getWidgetHolder(),o=e.getDialogData(n.getWebsiteUuid()),r=0,t.label=2;case 2:return o?[3,6]:[4,w.default.wait(1e3)];case 3:return t.sent(),r+=1,o=e.getDialogData(n.getWebsiteUuid()),30<r?[4,u.data.getErrorApiRepository().createError({domain:window.location.origin,reason:"dialogData is not accessible more than 30 seconds"})]:[3,5];case 4:return t.sent(),[2];case 5:return[3,2];case 6:return e.saveUserData(n.getWebsiteUuid(),o.dialogId,p,d,g),o.username=p,o.email=d,o.phone=g,e.saveDialogData(n.getWebsiteUuid(),o),y(!0),[3,8];case 7:return(i=t.sent()).message.includes("Forbidden")||alert(i.message),[3,8];case 8:return[2]}})},new(a=(a=s=t=void 0)||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())});var t,s,a,c}var u=t.dependencyInjector,l=t.widgetSettings,t=(0,b.useState)(""),p=t[0],n=t[1],t=(0,b.useState)(!1),o=t[0],h=t[1],t=(0,b.useState)(""),d=t[0],r=t[1],t=(0,b.useState)(!1),i=t[0],f=t[1],t=(0,b.useState)(""),g=t[0],s=t[1],t=(0,b.useState)(!1),a=t[0],m=t[1],t=(0,b.useState)(!1),c=t[0],y=t[1];return(0,b.useEffect)(function(){var t=u.data.getDialogApiRepository(),e=u.domain.getWidgetHolder(),t=t.getDialogData(e.getWebsiteUuid());n((null==t?void 0:t.username)||""),r((null==t?void 0:t.email)||""),s((null==t?void 0:t.phone)||""),(null!=t&&t.username||null!=t&&t.email||null!=t&&t.phone)&&y(!0)},[]),l.isTakeFormData&&(l.isTakeUsername||l.isTakePhone||l.isTakeEmail)?(0,_.h)("div",null,(0,_.h)("div",{id:"tf-form-header"},l.formHeading||"Как к вам можно обращаться?"),(0,_.h)("div",{id:"tf-form-root"},(0,_.h)("div",{id:"tf-form-inner"},l.isTakeUsername&&(0,_.h)("div",{className:"tf-text-input"},(0,_.h)("input",{type:"text",value:p,onInput:function(t){n(t.currentTarget.value),h(!1),y(!1)},className:o?"tf-input-error":"",placeholder:l.formUsernamePlaceholder||"Ваше имя",onKeyDown:function(t){"Enter"===t.key&&(t.preventDefault(),t.stopPropagation(),e())}})),l.isTakeEmail&&(0,_.h)("div",{className:"tf-text-input"},(0,_.h)("input",{type:"text",value:d,onInput:function(t){r(t.currentTarget.value),f(!1),y(!1)},className:i?"tf-input-error":"",placeholder:l.formEmailPlaceholder||"Ваша почта",onKeyDown:function(t){"Enter"===t.key&&(t.preventDefault(),t.stopPropagation(),e())}})),l.isTakePhone&&(0,_.h)("div",{className:"tf-text-input"},(0,_.h)("input",{type:"text",value:g,onInput:function(t){s(t.currentTarget.value),m(!1),y(!1)},className:a?"tf-input-error":"",placeholder:l.formPhonePlaceholder||"Ваш номер телефона",onKeyDown:function(t){"Enter"===t.key&&(t.preventDefault(),t.stopPropagation(),e())}})),(p.trim()||d.trim()||g.trim())&&(0,_.h)("div",{className:"tf-text-input"},(0,_.h)("button",{disabled:c,onClick:e,type:"button",id:"tf-form-send-button"},c?l.formSendButtonThank||"Спасибо!":l.formSendButtonText||"Отправить"))))):(0,_.h)("div",null)}},{preact:"aSor","preact/hooks":"MwGB","../../../util/FormValidator":"YWeT","../../../util/Waiter":"Q0HA"}],wbel:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=t("preact"),c=t("../../domain/MessageType"),u=o(t("./ImageModal")),l=o(t("./InputComponent")),p=o(t("./OperatorWritingComponent")),h=t("./FormComponent");function o(t){return t&&t.__esModule?t:{default:t}}i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};var r,i,t=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},t=(r=a.Component,t(s,r),s.prototype.componentDidMount=function(){this.dialogViewModel.attachView(this),this.dialogViewModel.attachBlockListener(this.props.onIpBlocked)},s.prototype.componentWillUnmount=function(){this.dialogViewModel.detachView(this)},s.prototype.onViewModelChanged=function(){this.setState({messages:this.dialogViewModel.messages,enteredText:this.dialogViewModel.enteredText,imagesCodesBase64:this.dialogViewModel.imagesCodesBase64,isCleanMessageText:this.dialogViewModel.isCleanMessageText,isShowOperatorWriting:this.dialogViewModel.isShowOperatorWriting}),0<this.dialogViewModel.messages.length&&this.props.dialogApiRepository.setLastViewedMessageTime(Date.now())},s.prototype.render=function(){var o=this,r=this.props.widgetSettings,t=this.state,i=t.messages,e=t.openedImage,n=t.isCleanMessageText,t=t.isShowOperatorWriting,s=-1;return i.forEach(function(t,e){t.type===c.MessageType.WEB&&-1===s&&(s=e)}),(0,a.h)(a.Fragment,null,(0,a.h)("div",{className:"dialog-head"},(0,a.h)("div",{className:"tf-send-message"},r.isEnabledCustomOpenedTitle&&r.customOpenedTitle?r.customOpenedTitle:"Напишите сообщение"),(0,a.h)("div",{style:{marginLeft:"auto"}},(0,a.h)("svg",{className:"telegram_feedback_svg",style:{cursor:"pointer",marginRight:"10px"},onClick:function(){return o.props.onClose()},width:"13",height:"15",viewBox:"0 0 379 379",xmlns:"http://www.w3.org/2000/svg"},(0,a.h)("path",{d:"M378.303 28.285L350.018 0L189.151 160.867L28.285 0L0 28.285L160.867 189.151L0 350.018L28.285 378.302L189.151 217.436L350.018 378.302L378.303 350.018L217.436 189.151L378.303 28.285Z",fill:r.closeButtonColor})))),(0,a.h)("div",{id:"telegram_feedback_dialog_body",className:"tf-dialog-body"},r.autoOpenMessage&&(0,a.h)("div",null,(0,a.h)("div",{className:"left-message",style:{marginBottom:"5px"}},(0,a.h)("div",{dangerouslySetInnerHTML:{__html:r.autoOpenMessage}}))),i.map(function(t,e){var n;return(0,a.h)("div",{key:"message_".concat(t.id)},t.type===c.MessageType.OPERATOR&&(null==(n=i[e-1])?void 0:n.type)!==c.MessageType.OPERATOR&&(0,a.h)("div",{className:"operator"},r.operatorName||"Оператор"),(0,a.h)("div",{style:t.type===c.MessageType.OPERATOR?{}:{display:"flex",justifyContent:"flex-end"}},t.type===c.MessageType.OPERATOR&&(0,a.h)("span",{className:"left-message",style:{marginBottom:(null==(n=i[e+1])?void 0:n.type)!==c.MessageType.OPERATOR?"5px":"0px"}},t.messagePhotoCode&&o.getImageRender(t),(0,a.h)("div",{dangerouslySetInnerHTML:{__html:t.text}})),t.type===c.MessageType.WEB&&(0,a.h)("span",{className:"right-message",style:{marginTop:(null==(n=i[e-1])?void 0:n.type)!==c.MessageType.WEB?"5px":"2px",marginBottom:(null==(n=i[e+1])?void 0:n.type)!==c.MessageType.WEB?"5px":"0px"}},t.messagePhotoCode&&o.getImageRender(t),(0,a.h)("div",{dangerouslySetInnerHTML:{__html:t.text}}))),i[0]&&(0,a.h)(a.Fragment,null,s===e&&(0,a.h)(h.FormComponent,{dependencyInjector:o.props.dependencyInjector,widgetSettings:o.props.widgetSettings})))}),t&&(0,a.h)(p.default,{widgetSettings:r})),(0,a.h)("div",{className:"tf-link"},(0,a.h)("a",{href:"https://click-chat.ru?utm_source=widget_link&widget_uuid=".concat(r.uuid),rel:"noopener noreferrer",onClick:function(t){return t.stopPropagation()},target:"_blank",style:{width:"45px"}},"КликЧат")),(0,a.h)("div",{className:"tf-footer"},(0,a.h)("div",{className:"tf-footer-inner"},(0,a.h)("div",{className:"tf-attach-button"},(0,a.h)("input",{type:"file",style:{display:"none",height:"50px"},onChange:function(t){var e;t.currentTarget.files&&t.currentTarget.files[0]&&(e=t.currentTarget.files[0],o.dialogViewModel.onUploadFile(e),t.target.value=null)},id:"telegram-feedback-image-upload",accept:".jpg,.jpeg,.png"}),(0,a.h)("label",{className:"attach-message-label",htmlFor:"telegram-feedback-image-upload"},(0,a.h)("svg",{className:"telegram_feedback_svg",style:{width:"20px",height:"20px"},version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 296.108 296.108",fill:"#a4a4a4"},(0,a.h)("g",null,(0,a.h)("path",{d:"M29.506,279.807c12.869,13.315,25.928,16.301,35.038,16.301c0.468,0,0.925-0.011,1.376-0.022\n\t\tc21.147-0.702,36.192-16.508,39.205-19.923l170.02-172.288l0.778-1.213c0.859-1.354,20.641-33.516-18.591-73.335\n\t\tC238.262,9.97,220.547,0.103,204.431,0c-9.752,0-17.144,3.862-20.832,7.511L33.928,155.769\n\t\tc-8.534,8.458-11.172,19.635-5.885,24.971c5.287,5.336,16.491,2.807,25.031-5.651L202.027,27.538\n\t\tc3.1-1.338,15.218-0.152,35.925,20.87c20.549,20.859,16.714,35.419,15.382,38.851L85.463,257.371l-0.647,0.702\n\t\tc-2.551,2.937-11.096,10.601-19.902,10.835c-5.167,0.076-10.514-2.475-15.849-7.995c-5.075-5.254-7.571-10.421-7.413-15.354\n\t\tc0.261-8.284,7.413-14.925,7.408-14.925l122.303-126.91c2.388-2.181,6.298-3.579,11.547,1.675c1.235,1.229,3.296,3.291-0.544,7.424\n\t\tl-94.118,94.123c-8.496,8.496-11.079,19.689-5.765,24.998c5.314,5.309,16.502,2.725,24.998-5.771l94.123-94.118\n\t\tc9.333-9.328,17.177-29.251,0.555-45.879c-18.553-18.564-39.901-11.351-49.729-1.969L30.61,210.65\n\t\tc-3.04,2.817-15.371,15.344-16.132,33.624C14.119,253.009,16.425,266.264,29.506,279.807z"})),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null),(0,a.h)("g",null)))),(0,a.h)(l.default,{onMessageTextChanged:function(t){return o.dialogViewModel.onEnteredTextChanged(t)},onSendMessage:function(){return o.dialogViewModel.onSendMessage()},isCleanMessageText:n,onMessageTextCleaned:function(){o.dialogViewModel.onMessageTextCleaned()},widgetSettings:r}),(0,a.h)("div",{style:{border:"#fff",backgroundColor:"#fff",paddingRight:"10px",paddingLeft:"10px",cursor:"pointer",margin:"0px",height:"50px",display:"flex",alignItems:"center"},onClick:function(){return o.dialogViewModel.onSendMessage()}},(0,a.h)("svg",{style:{marginRight:"5px"},height:"20",viewBox:"0 0 61 108",fill:r.sendArrowColor,xmlns:"http://www.w3.org/2000/svg"},(0,a.h)("line",{x1:"3.53553",y1:"4.46447",x2:"56.5685",y2:"57.4975",stroke:r.sendArrowColor,"stroke-width":"10"}),(0,a.h)("line",{x1:"56.5687",y1:"50.5355",x2:"3.53573",y2:"103.569",stroke:r.sendArrowColor,"stroke-width":"10"}))))),e&&(0,a.h)(u.default,{imageBase64:e,onClose:function(){return o.setState({openedImage:void 0})}}))},s.prototype.getImageRender=function(e){var n,o,t=this,r=!1;return this.state.imagesCodesBase64.forEach(function(t){t.code===e.messagePhotoCode&&(n=t.base64,o=t.base64Type,r=t.isError)}),n?(0,a.h)("div",null,(0,a.h)("img",{style:{maxWidth:"100%",objectFit:"contain",cursor:"pointer"},src:"".concat(o,",").concat(n),alt:"message img ".concat(e.messagePhotoCode),onClick:function(){return t.setState({openedImage:n})}})):r?(0,a.h)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minWidth:"200px",minHeight:"100px"}},(0,a.h)("svg",{className:"telegram_feedback_svg",style:{width:"50px",height:"50px"},viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.h)("path",{d:"M4.46814 17.5319C5.62291 19.7154 7.92876 20.5 12 20.5C17.6255 20.5 19.8804 19.002 20.3853 14.3853M4.46814 17.5319C3.77924 16.2292 3.5 14.4288 3.5 12C3.5 5.5 5.5 3.5 12 3.5C18.5 3.5 20.5 5.5 20.5 12C20.5 12.8745 20.4638 13.6676 20.3853 14.3853M4.46814 17.5319L7.58579 14.4142C8.36684 13.6332 9.63317 13.6332 10.4142 14.4142L10.5858 14.5858C11.3668 15.3668 12.6332 15.3668 13.4142 14.5858L15.5858 12.4142C16.3668 11.6332 17.6332 11.6332 18.4142 12.4142L20.3853 14.3853M10.691 8.846C10.691 9.865 9.864 10.692 8.845 10.692C7.827 10.692 7 9.865 7 8.846C7 7.827 7.827 7 8.845 7C9.864 7 10.691 7.827 10.691 8.846Z",stroke:"#000000","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))):(0,a.h)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minWidth:"200px",minHeight:"100px"}},(0,a.h)("div",{className:"tf-big-loader",style:{borderTop:"4px solid ".concat(this.props.widgetSettings.customPrimaryColor)}}))},s);function s(t){var e=r.call(this,t)||this;return e.dialogViewModel=t.dialogViewModel,e.state={messages:e.dialogViewModel.messages,enteredText:e.dialogViewModel.enteredText,imagesCodesBase64:e.dialogViewModel.imagesCodesBase64,isCleanMessageText:e.dialogViewModel.isCleanMessageText,isShowOperatorWriting:e.dialogViewModel.isShowOperatorWriting},e}n.default=t},{preact:"aSor","../../domain/MessageType":"pVo6","./ImageModal":"Ndp7","./InputComponent":"u8e7","./OperatorWritingComponent":"mI36","./FormComponent":"t3K6"}],djyf:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WidgetSize=void 0,n.WidgetSize=void 0,n.WidgetSize={DEFAULT:"default",MINI:"mini"}},{}],CITf:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,r,i=t("preact"),s=t("../settings/domain/WidgetSize"),t=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),t=(o=i.Component,t(a,o),a.getDerivedStateFromProps=function(t,e){return t.isMobile!==e.isMobile?{isMobile:t.isMobile}:null},a.prototype.componentDidMount=function(){this.props.dialogViewModel.attachView(this)},a.prototype.componentWillUnmount=function(){this.props.dialogViewModel.detachView(this)},a.prototype.onViewModelChanged=function(){},a.prototype.render=function(){var t=this,e=this.props.widgetSettings,n=this.state.isMobile;return(0,i.h)(i.Fragment,null,n||e.size===s.WidgetSize.MINI?(0,i.h)("div",{className:"tf-circle",onClick:function(){return t.props.onOpen()}},(0,i.h)("svg",{className:"telegram_feedback_svg",style:{width:"30px",height:"30px",margin:"auto"},viewBox:"0 0 513 513",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("g",{clipPath:"url(#clip0_229_2)"},(0,i.h)("path",{d:"M437.333 21.355H74.667C33.493 21.355 0 54.848 0 96.021V309.354C0 350.527 33.493 384.021 74.667 384.021H122.923L86.102 476.053C84.331 480.448 85.697 485.482 89.43 488.405C91.35 489.92 93.675 490.688 96.022 490.688C98.198 490.688 100.374 490.027 102.23 488.704L248.79 384.021H437.377C478.55 384.021 512.044 350.528 512.044 309.354V96.021C512 54.848 478.507 21.355 437.333 21.355Z",fill:e.customMessageIconColor})),(0,i.h)("defs",null,(0,i.h)("clipPath",{id:"clip0_229_2"},(0,i.h)("rect",{width:"512.043",height:"512.043",fill:"white"}))))):(0,i.h)("div",{className:"tf-rectangle",onClick:function(){t.props.onOpen()}},(0,i.h)("div",{className:"tf-message-us"},e.isEnabledCustomClosedTitle&&e.customClosedTitle?e.customClosedTitle:"Напишите нам, мы онлайн!")))},a);function a(t){var e=o.call(this,t)||this;return e.state={isMobile:t.isMobile},e}n.default=t},{preact:"aSor","../settings/domain/WidgetSize":"djyf"}],Tkd2:[function(t,e,n){"use strict";function o(){this.initialize=function(){},this.cleanup=function(){},this.attachedViews=[]}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,o.prototype.attachView=function(t){this.attachedViews.push(t),this.notifyViewAboutChanges(),this.initialize()},o.prototype.detachView=function(t){this.attachedViews.splice(this.attachedViews.indexOf(t),1),this.notifyViewAboutChanges(),this.cleanup()},o.prototype.notifyViewAboutChanges=function(){0<this.attachedViews.length&&this.attachedViews.forEach(function(t){return t.onViewModelChanged()})},o.prototype.getViewsCount=function(){return this.attachedViews.length},n.default=o},{}],lMcE:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PACKET_TYPES_REVERSE=n.PACKET_TYPES=n.ERROR_PACKET=void 0;const o=Object.create(null),r=((n.PACKET_TYPES=o).open="0",o.close="1",o.ping="2",o.pong="3",o.message="4",o.upgrade="5",o.noop="6",Object.create(null));n.PACKET_TYPES_REVERSE=r,Object.keys(o).forEach(t=>{r[o[t]]=t});n.ERROR_PACKET={type:"error",data:"parser error"}},{}],L0DL:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t("./commons.js");const i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),s="function"==typeof ArrayBuffer,a=(t,e)=>{const n=new FileReader;return n.onload=function(){var t=n.result.split(",")[1];e("b"+t)},n.readAsDataURL(t)};n.default=({type:t,data:e},n,o)=>i&&e instanceof Blob?n?o(e):a(e,o):s&&(e instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer)(e))?n?o(e):a(new Blob([e]),o):o(r.PACKET_TYPES[t]+(e||""))},{"./commons.js":"lMcE"}],jyCB:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.encode=n.decode=void 0;const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<i.length;t++)p[i.charCodeAt(t)]=t;n.encode=t=>{let e,n=new Uint8Array(t),o=n.length,r="";for(e=0;e<o;e+=3)r=(r=(r=(r+=i[n[e]>>2])+i[(3&n[e])<<4|n[e+1]>>4])+i[(15&n[e+1])<<2|n[e+2]>>6])+i[63&n[e+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r};n.decode=t=>{let e,n,o,r,i,s=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);const u=new ArrayBuffer(s),l=new Uint8Array(u);for(e=0;e<a;e+=4)n=p[t.charCodeAt(e)],o=p[t.charCodeAt(e+1)],r=p[t.charCodeAt(e+2)],i=p[t.charCodeAt(e+3)],l[c++]=n<<2|o>>4,l[c++]=(15&o)<<4|r>>2,l[c++]=(3&r)<<6|63&i;return u}},{}],kOt4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("./commons.js"),r=t("./contrib/base64-arraybuffer.js");const i="function"==typeof ArrayBuffer,s=(t,e)=>"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t;n.default=(t,e)=>{if("string"!=typeof t)return{type:"message",data:s(t,e)};var n=t.charAt(0);return"b"===n?{type:"message",data:((t,e)=>{if(i){const i=(0,r.decode)(t);return s(i,e)}return{base64:!0,data:t}})(t.substring(1),e)}:o.PACKET_TYPES_REVERSE[n]?1<t.length?{type:o.PACKET_TYPES_REVERSE[n],data:t.substring(1)}:{type:o.PACKET_TYPES_REVERSE[n]}:o.ERROR_PACKET}},{"./commons.js":"lMcE","./contrib/base64-arraybuffer.js":"jyCB"}],EpRy:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"decodePacket",{enumerable:!0,get:function(){return i.default}}),n.decodePayload=void 0,Object.defineProperty(n,"encodePacket",{enumerable:!0,get:function(){return s.default}}),n.protocol=n.encodePayload=void 0;var s=o(t("./encodePacket.js")),i=o(t("./decodePacket.js"));function o(t){return t&&t.__esModule?t:{default:t}}const a=String.fromCharCode(30);n.encodePayload=(t,n)=>{const o=t.length,r=new Array(o);let i=0;t.forEach((t,e)=>{(0,s.default)(t,!1,t=>{r[e]=t,++i===o&&n(r.join(a))})})};n.decodePayload=(e,n)=>{const o=e.split(a),r=[];for(let t=0;t<o.length;t++){const e=(0,i.default)(o[t],n);if(r.push(e),"error"===e.type)break}return r};n.protocol=4},{"./encodePacket.js":"L0DL","./decodePacket.js":"kOt4"}],jELO:[function(t,e,n){"use strict";function o(t){if(t){var e,n=t;for(e in o.prototype)n[e]=o.prototype[e];return n}}Object.defineProperty(n,"__esModule",{value:!0}),(n.Emitter=o).prototype.on=o.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},o.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+t];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<o.length;r++)if((n=o[r])===e||n.fn===e){o.splice(r,1);break}return 0===o.length&&delete this._callbacks["$"+t],this},o.prototype.emitReserved=o.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],o=1;o<arguments.length;o++)e[o-1]=arguments[o];if(n)for(var o=0,r=(n=n.slice(0)).length;o<r;++o)n[o].apply(this,e);return this},o.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},o.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],anfm:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.globalThisShim=void 0;var o="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();n.globalThisShim=o},{}],iNAc:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.byteLength=function(t){return"string"==typeof t?function(n){let o=0,r=0;for(let t=0,e=n.length;t<e;t++)(o=n.charCodeAt(t))<128?r+=1:o<2048?r+=2:o<55296||57344<=o?r+=3:(t++,r+=4);return r}(t):Math.ceil((t.byteLength||t.size)*s)},n.installTimerFunctions=function(t,e){e.useNativeTimers?(t.setTimeoutFn=r.bind(o.globalThisShim),t.clearTimeoutFn=i.bind(o.globalThisShim)):(t.setTimeoutFn=setTimeout.bind(o.globalThisShim),t.clearTimeoutFn=clearTimeout.bind(o.globalThisShim))},n.pick=function(n,...t){return t.reduce((t,e)=>(n.hasOwnProperty(e)&&(t[e]=n[e]),t),{})};var o=t("./globalThis.js");const r=setTimeout,i=clearTimeout;const s=1.33},{"./globalThis.js":"anfm"}],Let2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Transport=void 0;var o=t("engine.io-parser"),r=t("@socket.io/component-emitter"),i=t("./util.js");class s extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class a extends r.Emitter{constructor(t){super(),(this.writable=!1,i.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new s(t,e,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){t=(0,o.decodePacket)(t,this.socket.binaryType);this.onPacket(t)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}n.Transport=a},{"engine.io-parser":"EpRy","@socket.io/component-emitter":"jELO","./util.js":"iNAc"}],l8q5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.decode=function(t){let e=0;for(c=0;c<t.length;c++)e=e*r+i[t.charAt(c)];return e},n.encode=u,n.yeast=function(){var t=u(+new Date);return t!==s?(a=0,s=t):t+"."+u(a++)};const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r=64,i={};let s,a=0,c=0;function u(t){let e="";for(;e=o[t%r]+e,0<(t=Math.floor(t/r)););return e}for(;c<r;c++)i[o[c]]=c},{}],EZxM:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.decode=function(t){let n={},o=t.split("&");for(let t=0,e=o.length;t<e;t++){var r=o[t].split("=");n[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return n},n.encode=function(t){let e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}},{}],CVja:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.hasCORS=void 0;let o=!1;try{o="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}var r=o;n.hasCORS=r},{}],IRVK:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.XHR=function(t){t=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||o.hasCORS))return new XMLHttpRequest}catch(t){}if(!t)try{return new r.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}};var o=t("../contrib/has-cors.js"),r=t("../globalThis.js")},{"../contrib/has-cors.js":"CVja","../globalThis.js":"anfm"}],FMNK:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Request=n.Polling=void 0;var o=t("../transport.js"),r=t("../contrib/yeast.js"),i=t("../contrib/parseqs.js"),s=t("engine.io-parser"),a=t("./xmlhttprequest.js"),c=t("@socket.io/component-emitter"),u=t("../util.js"),t=t("../globalThis.js");function l(){}const p=null!=new a.XHR({xdomain:!1}).responseType;class h extends o.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const n="https:"===location.protocol;let t=location.port;t=t||(n?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||t!==e.port,this.xs=e.secure!==n}const n=e&&e.forceBase64;this.supportsBinary=p&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){(0,s.decodePayload)(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){var t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){(this.writable=!1,s.encodePayload)(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};var e=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,r.yeast)()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"==e&&443!==Number(this.opts.port)||"http"==e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);var o=(0,i.encode)(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(o.length?"?"+o:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new d(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}n.Polling=h;class d extends c.Emitter{constructor(t,e){super(),(0,u.installTimerFunctions)(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const t=(0,u.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref"),e=(t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs,this.xhr=new a.XHR(t));try{e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var n in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(n)&&e.setRequestHeader(n,this.opts.extraHeaders[n])}catch(t){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof e.status?e.status:0)},0))},e.send(this.data)}catch(t){return void this.setTimeoutFn(()=>{this.onError(t)},0)}"undefined"!=typeof document&&(this.index=d.requestsCount++,d.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=l,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete d.requests[this.index],this.xhr=null}}onLoad(){var t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if((n.Request=d).requestsCount=0,d.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",f);else if("function"==typeof addEventListener){const o="onpagehide"in t.globalThisShim?"pagehide":"unload";addEventListener(o,f,!1)}function f(){for(var t in d.requests)d.requests.hasOwnProperty(t)&&d.requests[t].abort()}},{"../transport.js":"Let2","../contrib/yeast.js":"l8q5","../contrib/parseqs.js":"EZxM","engine.io-parser":"EpRy","./xmlhttprequest.js":"IRVK","@socket.io/component-emitter":"jELO","../util.js":"iNAc","../globalThis.js":"anfm"}],Ms0r:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.usingBrowserWebSocket=n.nextTick=n.defaultBinaryType=n.WebSocket=void 0;var t=t("../globalThis.js"),o="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),o=(n.nextTick=o,t.globalThisShim.WebSocket||t.globalThisShim.MozWebSocket);n.WebSocket=o,n.usingBrowserWebSocket=!0;n.defaultBinaryType="arraybuffer"},{"../globalThis.js":"anfm"}],yh9p:[function(t,e,n){"use strict";n.byteLength=function(t){var t=l(t),e=t[0],t=t[1];return 3*(e+t)/4-t},n.toByteArray=function(t){var e,n,o=l(t),r=o[0],o=o[1],i=new u(function(t,e){return 3*(t+e)/4-e}(r,o)),s=0,a=0<o?r-4:r;for(n=0;n<a;n+=4)e=c[t.charCodeAt(n)]<<18|c[t.charCodeAt(n+1)]<<12|c[t.charCodeAt(n+2)]<<6|c[t.charCodeAt(n+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=255&e;return 2===o&&(e=c[t.charCodeAt(n)]<<2|c[t.charCodeAt(n+1)]>>4,i[s++]=255&e),1===o&&(e=c[t.charCodeAt(n)]<<10|c[t.charCodeAt(n+1)]<<4|c[t.charCodeAt(n+2)]>>2,i[s++]=e>>8&255,i[s++]=255&e),i},n.fromByteArray=function(t){for(var e,n=t.length,o=n%3,r=[],i=0,s=n-o;i<s;i+=16383)r.push(function(t,e,n){for(var o,r=[],i=e;i<n;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),r.push(function(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}(o));return r.join("")}(t,i,s<i+16383?s:i+16383));return 1==o?(e=t[n-1],r.push(a[e>>2]+a[e<<4&63]+"==")):2==o&&(e=(t[n-2]<<8)+t[n-1],r.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"=")),r.join("")};for(var a=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=o.length;r<i;++r)a[r]=o[r],c[o.charCodeAt(r)]=r;function l(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],JgNJ:[function(t,e,n){n.read=function(t,e,n,o,r){var i,s,a=8*r-o-1,c=(1<<a)-1,u=c>>1,l=-7,p=n?r-1:0,h=n?-1:1,r=t[e+p];for(p+=h,i=r&(1<<-l)-1,r>>=-l,l+=a;0<l;i=256*i+t[e+p],p+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=o;0<l;s=256*s+t[e+p],p+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(r?-1:1);s+=Math.pow(2,o),i-=u}return(r?-1:1)*s*Math.pow(2,i-o)},n.write=function(t,e,n,o,r,i){var s,a,c=8*i-r-1,u=(1<<c)-1,l=u>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:i-1,d=o?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-s))<1&&(s--,o*=2),2<=(e+=1<=s+l?p/o:p*Math.pow(2,1-l))*o&&(s++,o/=2),u<=s+l?(a=0,s=u):1<=s+l?(a=(e*o-1)*Math.pow(2,r),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,r),s=0));8<=r;t[n+h]=255&a,h+=d,a/=256,r-=8);for(s=s<<r|a,c+=r;0<c;t[n+h]=255&s,h+=d,s/=256,c-=8);t[n+h-d]|=128*i}},{}],REa7:[function(t,e,n){var o={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==o.call(t)}},{}],peL6:[function(t,e,n){var o=arguments[3],E=t("base64-js"),i=t("ieee754"),a=t("isarray");function r(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=p.prototype:(t=null===t?new p(e):t).length=e,t}function p(t,e,n){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(t,e,n);if("number"!=typeof t)return s(this,t,e,n);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}function s(t,e,n,o){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var r=t,i=e,s=n;if(i.byteLength,s<0||i.byteLength<s)throw new RangeError("'offset' is out of bounds");if(i.byteLength<s+(o||0))throw new RangeError("'length' is out of bounds");return i=void 0===s&&void 0===o?new Uint8Array(i):void 0===o?new Uint8Array(i,s):new Uint8Array(i,s,o),p.TYPED_ARRAY_SUPPORT?(r=i).__proto__=p.prototype:r=h(r,i),r}if("string"==typeof e){s=t,o=e,i=n;if(!p.isEncoding(i="string"==typeof i&&""!==i?i:"utf8"))throw new TypeError('"encoding" must be a valid string encoding');r=0|f(o,i);return s=(o=(s=c(s,r)).write(o,i))!==r?s.slice(0,o):s}n=t,o=e;if(p.isBuffer(o))return t=0|d(o.length),0!==(n=c(n,t)).length&&o.copy(n,0,0,t),n;if(o){if("undefined"!=typeof ArrayBuffer&&o.buffer instanceof ArrayBuffer||"length"in o)return"number"!=typeof o.length||function(t){return t!=t}(o.length)?c(n,0):h(n,o);if("Buffer"===o.type&&a(o.data))return h(n,o.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(u(e),t=c(t,e<0?0:0|d(e)),!p.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|d(e.length);t=c(t,n);for(var o=0;o<n;o+=1)t[o]=255&e[o];return t}function d(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function f(t,e){if(p.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var n=(t="string"!=typeof t?""+t:t).length;if(0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(o)return M(t).length;e=(""+e).toLowerCase(),o=!0}}function g(t,e,n){var o,r=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var i=this,s=e,a=n,c=i.length;(!a||a<0||c<a)&&(a=c);for(var u="",l=s=!s||s<0?0:s;l<a;++l)u+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(i[l]);return u;case"utf8":case"utf-8":return x(this,e,n);case"ascii":var p=this,c=e,h=n,d="";h=Math.min(p.length,h);for(var f=c;f<h;++f)d+=String.fromCharCode(127&p[f]);return d;case"latin1":case"binary":var g=this,s=e,m=n,y="";m=Math.min(g.length,m);for(var _=s;_<m;++_)y+=String.fromCharCode(g[_]);return y;case"base64":return b=this,o=n,0===(v=e)&&o===b.length?E.fromByteArray(b):E.fromByteArray(b.slice(v,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=e,v=n,w=this.slice(b,v),k="",T=0;T<w.length;T+=2)k+=String.fromCharCode(w[T]+256*w[T+1]);return k;default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var o=t[e];t[e]=t[n],t[n]=o}function y(t,e,n,o,r){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,(n=(n=isNaN(n)?r?0:t.length-1:n)<0?t.length+n:n)>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=p.from(e,o)),p.isBuffer(e))return 0===e.length?-1:_(t,e,n,o,r);if("number"==typeof e)return e&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(r?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,n):_(t,[e],n,o,r);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,o,r){var i=1,s=t.length,a=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;s/=i=2,a/=2,n/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(r)for(var u=-1,l=n;l<s;l++)if(c(t,l)===c(e,-1===u?0:l-u)){if(l-(u=-1===u?l:u)+1===a)return u*i}else-1!==u&&(l-=l-u),u=-1;else for(l=n=s<n+a?s-a:n;0<=l;l--){for(var p=!0,h=0;h<a;h++)if(c(t,l+h)!==c(e,h)){p=!1;break}if(p)return l}return-1}function b(t,e,n,o){return D(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,o)}function v(t,e,n,o){return D(function(t,e){for(var n,o,r=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(o=t.charCodeAt(i))>>8,o=o%256,r.push(o),r.push(n);return r}(e,t.length-n),t,n,o)}function x(t,e,n){n=Math.min(t.length,n);for(var o=[],r=e;r<n;){var i,s,a,c,u=t[r],l=null,p=239<u?4:223<u?3:191<u?2:1;if(r+p<=n)switch(p){case 1:u<128&&(l=u);break;case 2:128==(192&(i=t[r+1]))&&127<(c=(31&u)<<6|63&i)&&(l=c);break;case 3:i=t[r+1],s=t[r+2],128==(192&i)&&128==(192&s)&&2047<(c=(15&u)<<12|(63&i)<<6|63&s)&&(c<55296||57343<c)&&(l=c);break;case 4:i=t[r+1],s=t[r+2],a=t[r+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&65535<(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,p=1):65535<l&&(l-=65536,o.push(l>>>10&1023|55296),l=56320|1023&l),o.push(l),r+=p}var h=o,d=h.length;if(d<=w)return String.fromCharCode.apply(String,h);for(var f="",g=0;g<d;)f+=String.fromCharCode.apply(String,h.slice(g,g+=w));return f}n.Buffer=p,n.SlowBuffer=function(t){return p.alloc(+(t=+t!=t?0:t))},n.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=void 0!==o.TYPED_ARRAY_SUPPORT?o.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),n.kMaxLength=r(),p.poolSize=8192,p._augment=function(t){return t.__proto__=p.prototype,t},p.from=function(t,e,n){return s(null,t,e,n)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0})),p.alloc=function(t,e,n){return o=null,e=e,n=n,u(t=t),!(t<=0)&&void 0!==e?"string"==typeof n?c(o,t).fill(e,n):c(o,t).fill(e):c(o,t);var o},p.allocUnsafe=function(t){return l(null,t)},p.allocUnsafeSlow=function(t){return l(null,t)},p.isBuffer=function(t){return!(null==t||!t._isBuffer)},p.compare=function(t,e){if(!p.isBuffer(t)||!p.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,o=e.length,r=0,i=Math.min(n,o);r<i;++r)if(t[r]!==e[r]){n=t[r],o=e[r];break}return n<o?-1:o<n?1:0},p.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return p.alloc(0);if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;for(var n=p.allocUnsafe(e),o=0,r=0;r<t.length;++r){var i=t[r];if(!p.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},p.byteLength=f,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},p.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},p.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},p.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},p.prototype.equals=function(t){if(p.isBuffer(t))return this===t||0===p.compare(this,t);throw new TypeError("Argument must be a Buffer")},p.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},p.prototype.compare=function(t,e,n,o,r){if(!p.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),(e=void 0===e?0:e)<0||n>t.length||o<0||r>this.length)throw new RangeError("out of range index");if(r<=o&&n<=e)return 0;if(r<=o)return-1;if(n<=e)return 1;if(this===t)return 0;for(var i=(r>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(o,r),u=t.slice(e,n),l=0;l<a;++l)if(c[l]!==u[l]){i=c[l],s=u[l];break}return i<s?-1:s<i?1:0},p.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},p.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},p.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},p.prototype.write=function(t,e,n,o){if(void 0===e)o="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)o=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}var r=this.length-e;if((void 0===n||r<n)&&(n=r),0<t.length&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var i,s,a,c=!1;;)switch(o){case"hex":var u=this,l=t,p=e,h=n,d=(p=Number(p)||0,u.length-p);if((!h||(h=Number(h))>d)&&(h=d),(d=l.length)%2!=0)throw new TypeError("Invalid hex string");d/2<h&&(h=d/2);for(var f=0;f<h;++f){var g=parseInt(l.substr(2*f,2),16);if(isNaN(g))return f;u[p+f]=g}return f;case"utf8":case"utf-8":return d=e,a=n,D(M(t,(s=this).length-d),s,d,a);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return b(this,t,e,n);case"base64":return s=this,a=e,i=n,D(j(t),s,a,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,n);default:if(c)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),c=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(n<t+e)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,n,o,r,i){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r<e||e<i)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}function S(t,e,n,o){e<0&&(e=65535+e+1);for(var r=0,i=Math.min(t.length-n,2);r<i;++r)t[n+r]=(e&255<<8*(o?r:1-r))>>>8*(o?r:1-r)}function C(t,e,n,o){e<0&&(e=4294967295+e+1);for(var r=0,i=Math.min(t.length-n,4);r<i;++r)t[n+r]=e>>>8*(o?r:3-r)&255}function A(t,e,n,o){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(t,e,n,o,r){return r||A(t,0,n,4),i.write(t,e,n,o,23,4),n+4}function O(t,e,n,o,r){return r||A(t,0,n,8),i.write(t,e,n,o,52,8),n+8}p.prototype.slice=function(t,e){var n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),p.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=p.prototype;else for(var o=e-t,r=new p(o,void 0),i=0;i<o;++i)r[i]=this[i+t];return r},p.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||k(t,e,this.length);for(var o=this[t],r=1,i=0;++i<e&&(r*=256);)o+=this[t+i]*r;return o},p.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||k(t,e,this.length);for(var o=this[t+--e],r=1;0<e&&(r*=256);)o+=this[t+--e]*r;return o},p.prototype.readUInt8=function(t,e){return e||k(t,1,this.length),this[t]},p.prototype.readUInt16LE=function(t,e){return e||k(t,2,this.length),this[t]|this[t+1]<<8},p.prototype.readUInt16BE=function(t,e){return e||k(t,2,this.length),this[t]<<8|this[t+1]},p.prototype.readUInt32LE=function(t,e){return e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},p.prototype.readUInt32BE=function(t,e){return e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},p.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||k(t,e,this.length);for(var o=this[t],r=1,i=0;++i<e&&(r*=256);)o+=this[t+i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},p.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||k(t,e,this.length);for(var o=e,r=1,i=this[t+--o];0<o&&(r*=256);)i+=this[t+--o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*e)),i},p.prototype.readInt8=function(t,e){return e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},p.prototype.readInt16LE=function(t,e){e||k(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},p.prototype.readInt16BE=function(t,e){e||k(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},p.prototype.readInt32LE=function(t,e){return e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},p.prototype.readInt32BE=function(t,e){return e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},p.prototype.readFloatLE=function(t,e){return e||k(t,4,this.length),i.read(this,t,!0,23,4)},p.prototype.readFloatBE=function(t,e){return e||k(t,4,this.length),i.read(this,t,!1,23,4)},p.prototype.readDoubleLE=function(t,e){return e||k(t,8,this.length),i.read(this,t,!0,52,8)},p.prototype.readDoubleBE=function(t,e){return e||k(t,8,this.length),i.read(this,t,!1,52,8)},p.prototype.writeUIntLE=function(t,e,n,o){t=+t,e|=0,n|=0,o||T(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,i=0;for(this[e]=255&t;++i<n&&(r*=256);)this[e+i]=t/r&255;return e+n},p.prototype.writeUIntBE=function(t,e,n,o){t=+t,e|=0,n|=0,o||T(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,i=1;for(this[e+r]=255&t;0<=--r&&(i*=256);)this[e+r]=t/i&255;return e+n},p.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,1,255,0),p.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},p.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},p.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},p.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},p.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},p.prototype.writeIntLE=function(t,e,n,o){t=+t,e|=0,o||T(this,t,e,n,(o=Math.pow(2,8*n-1))-1,-o);var r=0,i=1,s=0;for(this[e]=255&t;++r<n&&(i*=256);)t<0&&0===s&&0!==this[e+r-1]&&(s=1),this[e+r]=(t/i>>0)-s&255;return e+n},p.prototype.writeIntBE=function(t,e,n,o){t=+t,e|=0,o||T(this,t,e,n,(o=Math.pow(2,8*n-1))-1,-o);var r=n-1,i=1,s=0;for(this[e+r]=255&t;0<=--r&&(i*=256);)t<0&&0===s&&0!==this[e+r+1]&&(s=1),this[e+r]=(t/i>>0)-s&255;return e+n},p.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},p.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},p.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},p.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},p.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},p.prototype.writeFloatLE=function(t,e,n){return R(this,t,e,!0,n)},p.prototype.writeFloatBE=function(t,e,n){return R(this,t,e,!1,n)},p.prototype.writeDoubleLE=function(t,e,n){return O(this,t,e,!0,n)},p.prototype.writeDoubleBE=function(t,e,n){return O(this,t,e,!1,n)},p.prototype.copy=function(t,e,n,o){if(n=n||0,o||0===o||(o=this.length),e>=t.length&&(e=t.length),(o=0<o&&o<n?n:o)===n)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var r,i=(o=t.length-e<o-n?t.length-e+n:o)-n;if(this===t&&n<e&&e<o)for(r=i-1;0<=r;--r)t[r+e]=this[r+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(r=0;r<i;++r)t[r+e]=this[r+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},p.prototype.fill=function(t,e,n,o){if("string"==typeof t){var r;if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),1===t.length&&(r=t.charCodeAt(0))<256&&(t=r),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;if(e>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(t=t||0))for(a=e;a<n;++a)this[a]=t;else for(var i=p.isBuffer(t)?t:M(new p(t,o).toString()),s=i.length,a=0;a<n-e;++a)this[a+e]=i[a%s];return this};var P=/[^+\/0-9A-Za-z-_]/g;function M(t,e){var n;e=e||1/0;for(var o=t.length,r=null,i=[],s=0;s<o;++s){if(55295<(n=t.charCodeAt(s))&&n<57344){if(!r){if(56319<n){-1<(e-=3)&&i.push(239,191,189);continue}if(s+1===o){-1<(e-=3)&&i.push(239,191,189);continue}r=n;continue}if(n<56320){-1<(e-=3)&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&-1<(e-=3)&&i.push(239,191,189);if(r=null,n<128){if(--e<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function j(t){return E.toByteArray(function(t){if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(P,"")).length<2)return"";for(var e;t.length%4!=0;)t+="=";return t}(t))}function D(t,e,n,o){for(var r=0;r<o&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}},{"base64-js":"yh9p",ieee754:"JgNJ",isarray:"REa7",buffer:"peL6"}],mfJR:[function(t,e,n){t("buffer").Buffer;var r=t("buffer").Buffer,o=(Object.defineProperty(n,"__esModule",{value:!0}),n.WS=void 0,t("../transport.js")),i=t("../contrib/parseqs.js"),s=t("../contrib/yeast.js"),a=t("../util.js"),c=t("./websocket-constructor.js"),u=t("engine.io-parser");const l="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class p extends o.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(this.check()){const t=this.uri(),e=this.opts.protocols,n=l?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!l?e?new c.WebSocket(t,e):new c.WebSocket(t):new c.WebSocket(t,e,n)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||c.defaultBinaryType,this.addEventListeners()}}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],o=t===e.length-1;(0,u.encodePacket)(n,this.supportsBinary,t=>{const e={};!c.usingBrowserWebSocket&&(n.options&&(e.compress=n.options.compress),this.opts.perMessageDeflate)&&("string"==typeof t?r.byteLength(t):t.length)<this.opts.perMessageDeflate.threshold&&(e.compress=!1);try{c.usingBrowserWebSocket?this.ws.send(t):this.ws.send(t,e)}catch(t){}o&&(0,c.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};var e=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"==e&&443!==Number(this.opts.port)||"ws"==e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||(t.b64=1);var o=(0,i.encode)(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(o.length?"?"+o:"")}check(){return!!c.WebSocket}}n.WS=p},{"../transport.js":"Let2","../contrib/parseqs.js":"EZxM","../contrib/yeast.js":"l8q5","../util.js":"iNAc","./websocket-constructor.js":"Ms0r","engine.io-parser":"EpRy",buffer:"peL6"}],JfH1:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.transports=void 0;var o=t("./polling.js"),t={websocket:t("./websocket.js").WS,polling:o.Polling};n.transports=t},{"./polling.js":"FMNK","./websocket.js":"mfJR"}],Mog3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.parse=function(t){var e=t,n=t.indexOf("["),o=t.indexOf("]");-1!=n&&-1!=o&&(t=t.substring(0,n)+t.substring(n,o).replace(/:/g,";")+t.substring(o,t.length));let r=a.exec(t||""),i={},s=14;for(;s--;)i[c[s]]=r[s]||"";return-1!=n&&-1!=o&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(t){const e=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.substr(0,1)&&0!==t.length||e.splice(0,1),"/"==t.substr(t.length-1,1)&&e.splice(e.length-1,1),e}((i,i.path)),i.queryKey=function(t){const o={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,n){e&&(o[e]=n)}),o}((i,i.query)),i};const a=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,c=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]},{}],CKLz:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Socket=void 0;var o=t("./transports/index.js"),r=t("./util.js"),i=t("./contrib/parseqs.js"),s=t("./contrib/parseuri.js"),a=t("@socket.io/component-emitter"),c=t("engine.io-parser");class l extends a.Emitter{constructor(t,e={}){super(),t&&"object"==typeof t&&(e=t,t=null),t?(t=(0,s.parse)(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=(0,s.parse)(e.host).host),(0,r.installTimerFunctions)(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=(0,i.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=Object.assign({},this.opts.query);e.EIO=c.protocol,e.transport=t,this.id&&(e.sid=this.id);var n=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new o.transports[t](n)}open(){let t;if(this.opts.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),(this.transport=t).on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(t){let n=this.createTransport(t),e=!1;l.priorWebsocketSuccess=!1;const o=()=>{e||(n.send([{type:"ping",data:"probe"}]),n.once("packet",t=>{if(!e)if("pong"===t.type&&"probe"===t.data)this.upgrading=!0,this.emitReserved("upgrading",n),n&&(l.priorWebsocketSuccess="websocket"===n.name,this.transport.pause(()=>{e||"closed"!==this.readyState&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())}));else{const t=new Error("probe error");t.transport=n.name,this.emitReserved("upgradeError",t)}}))};function r(){e||(e=!0,u(),n.close(),n=null)}const i=t=>{const e=new Error("probe error: "+t);e.transport=n.name,r(),this.emitReserved("upgradeError",e)};function s(){i("transport closed")}function a(){i("socket closed")}function c(t){n&&t.name!==n.name&&r()}const u=()=>{n.removeListener("open",o),n.removeListener("error",i),n.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};n.once("open",o),n.once("error",i),n.once("close",s),this.once("close",a),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let t=0;for(var e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){var t;"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(t=this.getWritablePackets(),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush"))}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&1<this.writeBuffer.length))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){var n=this.writeBuffer[t].data;if(n&&(e+=(0,r.byteLength)(n)),0<t&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,o){"function"==typeof e&&(o=e,e=void 0),"function"==typeof n&&(o=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((n=n||{}).compress=!1!==n.compress,this.emitReserved("packetCreate",t={type:t,data:e,options:n}),this.writeBuffer.push(t),o&&this.once("flush",o),this.flush())}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{(this.upgrading?n:t)()}):(this.upgrading?n:t)()),this}onError(t){l.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;for(var o=t.length;n<o;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}(n.Socket=l).protocol=c.protocol},{"./transports/index.js":"JfH1","./util.js":"iNAc","./contrib/parseqs.js":"EZxM","./contrib/parseuri.js":"Mog3","@socket.io/component-emitter":"jELO","engine.io-parser":"EpRy"}],XWty:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Socket",{enumerable:!0,get:function(){return o.Socket}}),Object.defineProperty(n,"Transport",{enumerable:!0,get:function(){return r.Transport}}),Object.defineProperty(n,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return a.parse}}),n.protocol=void 0,Object.defineProperty(n,"transports",{enumerable:!0,get:function(){return i.transports}});var o=t("./socket.js"),r=t("./transport.js"),i=t("./transports/index.js"),s=t("./util.js"),a=t("./contrib/parseuri.js"),t=o.Socket.protocol;n.protocol=t},{"./socket.js":"CKLz","./transport.js":"Let2","./transports/index.js":"JfH1","./util.js":"iNAc","./contrib/parseuri.js":"Mog3"}],w3Sn:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.url=function(t,e="",n){let o=t;n=n||"undefined"!=typeof location&&location,"string"==typeof(t=null==t?n.protocol+"//"+n.host:t)&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),o=(0,r.parse)(t)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";t=-1!==o.host.indexOf(":")?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+t+":"+o.port+e,o.href=o.protocol+"://"+t+(n&&n.port===o.port?"":":"+o.port),o};var r=t("engine.io-client")},{"engine.io-client":"XWty"}],WCGZ:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.hasBinary=function n(o,t){if(!o||"object"!=typeof o)return!1;if(Array.isArray(o)){for(let t=0,e=o.length;t<e;t++)if(n(o[t]))return!0;return!1}if(c(o))return!0;if(o.toJSON&&"function"==typeof o.toJSON&&1===arguments.length)return n(o.toJSON(),!0);for(const e in o)if(Object.prototype.hasOwnProperty.call(o,e)&&n(o[e]))return!0;return!1},n.isBinary=c;const o="function"==typeof ArrayBuffer,r=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,i=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),a="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);function c(t){return o&&(t instanceof ArrayBuffer||r(t))||s&&t instanceof Blob||a&&t instanceof File}},{}],c32R:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.deconstructPacket=function(t){const e=[],n=t.data,o=t;return o.data=function e(n,o){if(!n)return n;if((0,r.isBinary)(n)){const r={_placeholder:!0,num:o.length};return o.push(n),r}if(Array.isArray(n)){const r=new Array(n.length);for(let t=0;t<n.length;t++)r[t]=e(n[t],o);return r}if("object"==typeof n&&!(n instanceof Date)){const r={};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=e(n[t],o));return r}return n}(n,e),o.attachments=e.length,{packet:o,buffers:e}},n.reconstructPacket=function(t,e){return t.data=function e(n,o){if(!n)return n;if(n&&!0===n._placeholder){if("number"==typeof n.num&&0<=n.num&&n.num<o.length)return o[n.num];throw new Error("illegal attachments")}if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=e(n[t],o);else if("object"==typeof n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=e(n[t],o));return n}(t.data,e),t.attachments=void 0,t};var r=t("./is-binary.js")},{"./is-binary.js":"WCGZ"}],mSEf:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.protocol=n.PacketType=n.Encoder=n.Decoder=void 0;var r,o=t("@socket.io/component-emitter"),i=t("./binary.js"),s=t("./is-binary.js");n.protocol=5,n.PacketType=r,(t=r||(n.PacketType=r={}))[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK";n.Encoder=class{constructor(t){this.replacer=t}encode(t){return t.type!==r.EVENT&&t.type!==r.ACK||!(0,s.hasBinary)(t)?[this.encodeAsString(t)]:(t.type=t.type===r.EVENT?r.BINARY_EVENT:r.BINARY_ACK,this.encodeAsBinary(t))}encodeAsString(t){let e=""+t.type;return t.type!==r.BINARY_EVENT&&t.type!==r.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=(0,i.deconstructPacket)(t),n=this.encodeAsString(e.packet),o=e.buffers;return o.unshift(n),o}};class a extends o.Emitter{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");(e=this.decodeString(t)).type===r.BINARY_EVENT||e.type===r.BINARY_ACK?(this.reconstructor=new c(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!(0,s.isBinary)(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===r[n.type])throw new Error("unknown packet type "+n.type);if(n.type===r.BINARY_EVENT||n.type===r.BINARY_ACK){const o=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const r=t.substring(o,e);if(r!=Number(r)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(r)}if("/"===t.charAt(e+1)){const o=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);n.nsp=t.substring(o,e)}else n.nsp="/";const o=t.charAt(e+1);if(""!==o&&Number(o)==o){const o=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(o,e+1))}if(t.charAt(++e)){const o=this.tryParse(t.substr(e));if(!a.isPayloadValid(n.type,o))throw new Error("invalid payload");n.data=o}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case r.CONNECT:return"object"==typeof e;case r.DISCONNECT:return void 0===e;case r.CONNECT_ERROR:return"string"==typeof e||"object"==typeof e;case r.EVENT:case r.BINARY_EVENT:return Array.isArray(e)&&0<e.length;case r.ACK:case r.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}n.Decoder=a;class c{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length!==this.reconPack.attachments)return null;{const t=(0,i.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},{"@socket.io/component-emitter":"jELO","./binary.js":"c32R","./is-binary.js":"WCGZ"}],NMdr:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.on=function(t,e,n){return t.on(e,n),function(){t.off(e,n)}}},{}],KTgC:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Socket=void 0;var r=t("socket.io-parser"),o=t("./on.js"),t=t("@socket.io/component-emitter");const i=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class s extends t.Emitter{constructor(t,e,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){var t;this.subs||(t=this.io,this.subs=[(0,o.on)(t,"open",this.onopen.bind(this)),(0,o.on)(t,"packet",this.onpacket.bind(this)),(0,o.on)(t,"error",this.onerror.bind(this)),(0,o.on)(t,"close",this.onclose.bind(this))])}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(i.hasOwnProperty(t))throw new Error('"'+t+'" is a reserved event name');e.unshift(t);const n={type:r.PacketType.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const r=this.ids++,t=e.pop();this._registerAckCallback(r,t),n.id=r}t=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return(!this.flags.volatile||t&&this.connected)&&(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,n){var t=this.flags.timeout;if(void 0===t)this.acks[e]=n;else{const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);n.call(this,new Error("operation has timed out"))},t);this.acks[e]=(...t)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...t])}}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this.packet({type:r.PacketType.CONNECT,data:t})}):this.packet({type:r.PacketType.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case r.PacketType.CONNECT:if(t.data&&t.data.sid){const r=t.data.sid;this.onconnect(r)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case r.PacketType.EVENT:case r.PacketType.BINARY_EVENT:this.onevent(t);break;case r.PacketType.ACK:case r.PacketType.BINARY_ACK:this.onack(t);break;case r.PacketType.DISCONNECT:this.ondisconnect();break;case r.PacketType.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length)for(const e of this._anyListeners.slice())e.apply(this,t);super.emit.apply(this,t)}ack(e){const n=this;let o=!1;return function(...t){o||(o=!0,n.packet({type:r.PacketType.ACK,id:e,data:t}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:r.PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let t=0;t<n.length;t++)if(e===n[t])return n.splice(t,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let t=0;t<n.length;t++)if(e===n[t])return n.splice(t,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(const e of this._anyOutgoingListeners.slice())e.apply(this,t.data)}}n.Socket=s},{"socket.io-parser":"mSEf","./on.js":"NMdr","@socket.io/component-emitter":"jELO"}],FMUV:[function(t,e,n){"use strict";function o(t){this.ms=(t=t||{}).min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=0<t.jitter&&t.jitter<=1?t.jitter:0,this.attempts=0}Object.defineProperty(n,"__esModule",{value:!0}),(n.Backoff=o).prototype.duration=function(){var t,e,n=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(t=Math.random(),e=Math.floor(t*this.jitter*n),n=0==(1&Math.floor(10*t))?n-e:n+e),0|Math.min(n,this.max)},o.prototype.reset=function(){this.attempts=0},o.prototype.setMin=function(t){this.ms=t},o.prototype.setMax=function(t){this.max=t},o.prototype.setJitter=function(t){this.jitter=t}},{}],s1gw:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Manager=void 0;var i=t("engine.io-client"),o=t("./socket.js"),r=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};e=c(e);if(e&&e.has(t))return e.get(t);var n,o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in t){var i;"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&((i=r?Object.getOwnPropertyDescriptor(t,n):null)&&(i.get||i.set)?Object.defineProperty(o,n,i):o[n]=t[n])}return o.default=t,e&&e.set(t,o),o}(t("socket.io-parser")),s=t("./on.js"),a=t("./contrib/backo2.js");function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}class u extends t("@socket.io/component-emitter").Emitter{constructor(t,e){var n;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,(0,i.installTimerFunctions)(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(n=e.randomizationFactor)?n:.5),this.backoff=new a.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;const o=e.parser||r;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null!=(e=this.backoff)&&e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null!=(e=this.backoff)&&e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null!=(e=this.backoff)&&e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new i.Socket(this.uri,this.opts);const t=this.engine,n=this,o=(this._readyState="opening",(this.skipReconnect=!1,s.on)(t,"open",function(){n.onopen(),e&&e()})),r=(0,s.on)(t,"error",t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()});if(!1!==this._timeout){const i=this._timeout,e=(0===i&&o(),this.setTimeoutFn(()=>{o(),t.close(),t.emit("error",new Error("timeout"))},i));this.opts.autoUnref&&e.unref(),this.subs.push(function(){clearTimeout(e)})}return this.subs.push(o),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");var t=this.engine;this.subs.push((0,s.on)(t,"ping",this.onping.bind(this)),(0,s.on)(t,"data",this.ondata.bind(this)),(0,s.on)(t,"error",this.onerror.bind(this)),(0,s.on)(t,"close",this.onclose.bind(this)),(0,s.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){this.decoder.add(t)}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n||(n=new o.Socket(this,t,e),this.nsps[t]=n),n}_destroy(t){for(const e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){var n=this.encoder.encode(e);for(let t=0;t<n.length;t++)this.engine.write(n[t],e.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(function(){clearTimeout(n)})}}onreconnect(){var t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}n.Manager=u},{"engine.io-client":"XWty","./socket.js":"KTgC","socket.io-parser":"mSEf","./on.js":"NMdr","./contrib/backo2.js":"FMUV","@socket.io/component-emitter":"jELO"}],DNkq:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Manager",{enumerable:!0,get:function(){return a.Manager}}),Object.defineProperty(n,"Socket",{enumerable:!0,get:function(){return o.Socket}}),n.default=n.connect=n.io=i,Object.defineProperty(n,"protocol",{enumerable:!0,get:function(){return r.protocol}});var s=t("./url.js"),a=t("./manager.js"),o=t("./socket.js"),r=t("socket.io-parser");const c={};function i(t,e){"object"==typeof t&&(e=t,t=void 0);var t=(0,s.url)(t,(e=e||{}).path||"/socket.io"),n=t.source,o=t.id,r=t.path,r=c[o]&&r in c[o].nsps;let i;return i=e.forceNew||e["force new connection"]||!1===e.multiplex||r?new a.Manager(n,e):(c[o]||(c[o]=new a.Manager(n,e)),c[o]),t.query&&!e.query&&(e.query=t.queryKey),i.socket(t.path,e)}Object.assign(i,{Manager:a.Manager,Socket:o.Socket,io:i,connect:i})},{"./url.js":"w3Sn","./manager.js":"s1gw","./socket.js":"KTgC","socket.io-parser":"mSEf"}],eKDL:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HISTORY_DATA_KEY=n.APPLICATION_SERVER=void 0;var o="undefined"!=typeof window&&window.location.origin.includes("localhost")?"http://localhost:3343":"https://api.click-chat.ru";n.APPLICATION_SERVER=o;n.HISTORY_DATA_KEY="telegram_feedback"},{}],fOyp:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(t("../../../util/ui/ViewModel")),r=a(t("../../../util/Waiter")),l=t("../../domain/MessageType"),i=t("socket.io-client"),s=t("../../../constants");function a(t){return t&&t.__esModule?t:{default:t}}function p(t,s,a,c){return new(a=a||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())})}function h(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};var d,c,t=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},u=/(https?:\/\/[^\s]+)/g,o=(d=o.default,t(f,d),f.prototype.attachNewMessageListener=function(t){this.onNewMessageReceived=t},f.prototype.attachBlockListener=function(t){this.onIpBlocked=t},f.prototype.onEnteredTextChanged=function(t){this.enteredText=t},f.prototype.onMessageTextCleaned=function(){this.isCleanMessageText=!1,d.prototype.notifyViewAboutChanges.call(this)},f.prototype.onUploadFile=function(e){return p(this,void 0,void 0,function(){var n,o=this;return h(this,function(t){if(!/\.(png)$/i.test(e.name)&&!/\.(jpg)$/i.test(e.name)&&!/\.(jpeg)$/i.test(e.name))return alert("Поддерживаются только PNG, JPG и JPEG"),[2];if(e){if(10485760<e.size)return alert("Изображения более 10 мегабайт не поддерживаются"),[2];(n=new FileReader).readAsDataURL(e),n.onload=function(){var t=n.result,e=t.split(",")[1],t=t.split(",")[0];o.enteredText="",o.isCleanMessageText=!0,o.onSendMessage(e,t)}}return[2]})})},f.prototype.addTempImage=function(t,e,n){this.imagesCodesBase64.push({code:n,base64:t,base64Type:e,isError:!1})},f.prototype.removeTempImage=function(e){var t=this.imagesCodesBase64.filter(function(t){return t.code===e})[0];t&&this.imagesCodesBase64.splice(this.imagesCodesBase64.indexOf(t),1)},f.prototype.onSendMessage=function(s,a){var c;return p(this,void 0,void 0,function(){var e,n,o,r,i=this;return h(this,function(t){switch(t.label){case 0:if(!this.enteredText&&!s)return[2];document.telegramFeedback_messageSent&&document.telegramFeedback_messageSent(),e=this.enteredText,this.lastEnteredMessage=e,this.enteredText="",this.isCleanMessageText=!0,d.prototype.notifyViewAboutChanges.call(this),s&&a&&(n="temp_".concat(Date.now()),this.addTempImage(s,a,n)),t.label=1;case 1:return t.trys.push([1,3,,4]),this.messages.push({id:-1,type:l.MessageType.WEB,text:e,messageTime:Date.now(),messagePhotoCode:n}),d.prototype.notifyViewAboutChanges.call(this),setTimeout(function(){i.scrollToChatBottom()},100),"/"===(o=window.location.href.replace("https://","").replace("http://","").split("?")[0])[o.length-1]&&(o=o.slice(0,o.length-1)),[4,this.dialogApiRepository.sendMessage(this.widgetHolder.getWebsiteUuid(),null==(c=this.dialogApiRepository.getDialogData(this.widgetHolder.getWebsiteUuid()))?void 0:c.dialogId,e,Date.now(),"".concat(this.widgetHolder.getWebsiteUuid(),"-").concat(Date.now(),"-").concat((Math.random()+1).toString(36).substring(2)),s,a,o,this.ymClientId)];case 2:if((o=t.sent()).error)throw new Error(o.error);return this.dialogApiRepository.saveDialogData(this.widgetHolder.getWebsiteUuid(),{dialogUuid:o.dialog.uuid,dialogId:o.dialog.id,dialogCreationTime:o.dialog.chatCreationTime}),this.socket||this.openSocket(this.widgetHolder.getWebsiteUuid(),o.dialog.uuid),d.prototype.notifyViewAboutChanges.call(this),this.scrollToChatBottom(),[3,4];case 3:return r=t.sent(),console.log(r.message),r.message.includes("Forbidden resource")||r.message.includes("Forbidden")?(this.onIpBlocked&&this.onIpBlocked(),[2]):(this.errorLogger.logError("DialogViewModel.onSendMessage (".concat(r.message,")"),r.stack),1===this.messages.length&&(this.messages=[]),this.enteredText=e,[3,4]);case 4:return n&&this.removeTempImage(n),d.prototype.notifyViewAboutChanges.call(this),[2]}})})},f.prototype.onUpdatesReceived=function(a,c,u){return p(this,void 0,void 0,function(){var e,n,o,r,i,s=this;return h(this,function(t){switch(t.label){case 0:if(!a.isActive)return this.cleanDialog(),[2];e=(this.messages||[]).filter(function(t){return t.type===l.MessageType.OPERATOR}),o=(c||[]).filter(function(t){return t.type===l.MessageType.OPERATOR}),(n=e.length!==o.length)&&this.isShowOperatorWriting&&(this.isShowOperatorWriting=!1),n&&0<o.length&&this.onNewMessageReceived&&this.onNewMessageReceived(o[o.length-1].messageTime),this.messages=c,this.mapMessagesLinks(),d.prototype.notifyViewAboutChanges.call(this),n=(c||[]).filter(function(t){return t.type===l.MessageType.OPERATOR}),t.label=1;case 1:return t.trys.push([1,4,,5]),this.notification&&!this.widgetHolder.getWidgetSettings().isDisableSound&&3e3<Date.now()-this.lastSoundPlay&&n.length>e.length&&0!==e.length?[4,this.notification.play()]:[3,3];case 2:t.sent(),this.lastSoundPlay=Date.now(),t.label=3;case 3:return[3,5];case 4:return(o=t.sent()).message.includes("failed because the user didn't interact with the document first")||o.message.includes("play() ")||(this.errorLogger.logError("DialogViewModel.checkForUpdate (2) (".concat(o.message,")"),o.stack),console.log("[TF] ".concat(o.message))),[3,5];case 5:return i=c.filter(function(t){return t.type===l.MessageType.OPERATOR}).sort(function(t,e){return t.messageTime>e.messageTime?1:t.messageTime<e.messageTime?-1:0}),i=i[i.length-1],u&&u!==this.previousResponsibleAttachTime&&(!i||i.messageTime<u)&&(r=u,this.previousResponsibleAttachTime=r,(i=Date.now()-u)<6e4&&(this.isShowOperatorWriting=!0,d.prototype.notifyViewAboutChanges.call(this),setTimeout(function(){s.previousResponsibleAttachTime===r&&(s.isShowOperatorWriting=!1,d.prototype.notifyViewAboutChanges.call(s))},6e4-i))),this.syncImages(),this.scrollToChatBottom(),a.errorText&&this.handleDialogError(a.errorText),[2]}})})},f.prototype.scrollToChatBottom=function(){setTimeout(function(){var t=document.getElementById("telegram_feedback_dialog_body");t&&(t.scrollTop=t.scrollHeight)},100)},f.prototype.checkForDialogTimeout=function(){var n;return p(this,void 0,void 0,function(){var e;return h(this,function(t){switch(t.label){case 0:return(e=null==(n=this.dialogApiRepository.getDialogData(this.widgetHolder.getWebsiteUuid()))?void 0:n.dialogCreationTime)&&Date.now()-e>this.DIALOG_TIMEOUT_MS&&(this.cleanDialog(),d.prototype.notifyViewAboutChanges.call(this)),[4,r.default.wait(6e4)];case 1:return t.sent(),this.checkForDialogTimeout(),[2]}})})},f.prototype.syncImages=function(){return p(this,void 0,Promise,function(){var s=this;return h(this,function(t){return[2,new Promise(function(t){var n=0,e=[],o=(s.messages.forEach(function(t){t.messagePhotoCode&&e.push(t.messagePhotoCode)}),s.imagesCodesBase64.map(function(t){return t.code})),r=[],i=(e.forEach(function(t){o.includes(t)||r.push(t)}),r.map(function(t){t={code:t,isError:!1};return s.imagesCodesBase64.push(t),t}));d.prototype.notifyViewAboutChanges.call(s),n=i.length,0===i.length?t():i.forEach(function(e){s.imageApiRepository.getImageBase64(e.code).then(function(t){e.base64=t.base64,e.base64Type=t.base64Type,d.prototype.notifyViewAboutChanges.call(s)}).catch(function(){e.isError=!0,d.prototype.notifyViewAboutChanges.call(s)}).finally(function(){0==--n&&(t(),s.scrollToChatBottom())})})})]})})},f.prototype.mapMessagesLinks=function(){var t=this.widgetHolder.getWidgetSettings();t.autoOpenMessage&&!t.autoOpenMessage.includes("</a>")&&(t.autoOpenMessage=t.autoOpenMessage.replace(u,function(t){return'<a href="'.concat(t,'" target="_blank" rel="noreferrer" class="tf-left-link">').concat(t,"</a>")})),this.messages.forEach(function(t){t.type===l.MessageType.OPERATOR?t.text=t.text.replace(u,function(t){return'<a href="'.concat(t,'" target="_blank" rel="noreferrer" class="tf-left-link">').concat(t,"</a>")}):t.text=t.text.replace(u,function(t){return'<a href="'.concat(t,'" target="_blank" rel="noreferrer" class="tf-right-link">').concat(t,"</a>")})})},f.prototype.recreateDialog=function(t){void 0===t&&(t=!0),this.cleanDialog(),t?(this.enteredText=this.lastEnteredMessage,this.lastEnteredMessage="",this.onSendMessage()):(this.enteredText="",this.lastEnteredMessage=""),d.prototype.notifyViewAboutChanges.call(this)},f.prototype.cleanDialog=function(){this.closeSocket(),this.messages=[],this.dialogApiRepository.saveDialogData(this.widgetHolder.getWebsiteUuid(),void 0),this.isShowOperatorWriting=!1},f.prototype.openSocket=function(n,t){var o=this;this.socket=(0,i.io)("".concat(s.APPLICATION_SERVER),{transports:["websocket"]}),this.lastSocketPingEventTime=Date.now(),this.socket.on("connect",function(){console.log("connected"),o.lastSocketPingEventTime=Date.now(),o.socket&&o.socket.emit("reply",JSON.stringify({websiteUuid:n,dialogUuid:t}))}),this.socket.on("request",function(t){t=JSON.parse(t);t.isPingEvent?o.lastSocketPingEventTime=Date.now():o.onUpdatesReceived(t.dialog,t.messages,t.responsibleAttachTime)}),this.socket.on("disconnect",function(){var t,e;console.log("disconnected"),o.socket&&(o.lastSocketPingEventTime=0,o.closeSocket(),(e=null==(t=o.dialogApiRepository.getDialogData(o.widgetHolder.getWebsiteUuid()))?void 0:t.dialogUuid)&&setTimeout(function(){o.openSocket(n,e)},1e3))}),this.socket.on("connect_error",function(){var t,e;console.log("connection_error"),o.socket&&(o.closeSocket(),(e=null==(t=o.dialogApiRepository.getDialogData(o.widgetHolder.getWebsiteUuid()))?void 0:t.dialogUuid)&&setTimeout(function(){o.openSocket(n,e)},1e3))})},f.prototype.closeSocket=function(){try{this.socket&&(console.log("close socket"),this.socket.close(),this.socket=void 0)}catch(t){console.log("Close socket error: ".concat(t.message))}},f.prototype.pingSocketRepeated=function(){return p(this,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return this.socket&&this.socket.connected&&0<this.lastSocketPingEventTime&&3e3<Date.now()-this.lastSocketPingEventTime&&this.closeSocket(),[4,r.default.wait(1e3)];case 1:return t.sent(),this.pingSocketRepeated(),[2]}})})},f.prototype.handleDialogError=function(t){if(t&&t.includes("Forbidden"))this.onIpBlocked&&this.onIpBlocked();else if(t&&t.includes("Replied message not found"))this.recreateDialog();else if(t&&t.includes("Message to edit not found"))this.recreateDialog();else if(t&&t.includes("Could not find any entity of type"))this.recreateDialog();else if(t&&t.includes("Not enough rights to create a topic"))this.recreateDialog(!1);else{if(!t||!t.includes("Message thread not found"))return t&&t.includes("Bot was kicked from the supergroup")?(this.cleanDialog(),this.enteredText="",alert("Бот был удален из обсуждения (которое привязано к каналу). Пожалуйста, верните бота в обсуждение и сделайе его администратором"),void d.prototype.notifyViewAboutChanges.call(this)):t&&t.includes("group chat was upgraded to a supergroup chat")?(this.cleanDialog(),this.enteredText="",alert("Проблемы с настройкой чата для сайта. Пожалуйста, перезагрузите страницу и попробуйте отправить сообщение позже"),void d.prototype.notifyViewAboutChanges.call(this)):t&&t.includes("Bot is not a member of the channel chat")?(this.cleanDialog(),this.enteredText="",alert("Бот был удален из канала. Пожалуйста, верните бота в канал для получения сообщений"),void d.prototype.notifyViewAboutChanges.call(this)):void 0;this.recreateDialog()}},f.prototype.detectYmClientId=function(e){var n=this;e.yandexMetrikaNumber&&(this.ymClientIdDetectionInterval=setInterval(function(){try{ym?ym("".concat(e.yandexMetrikaNumber),"getClientID",function(t){console.log("[TF] Detected ClientID ".concat(t," for YM counter ").concat(e.yandexMetrikaNumber)),n.ymClientId="".concat(t),n.ymClientIdDetectionInterval&&(clearInterval(n.ymClientIdDetectionInterval),n.ymClientIdDetectionInterval=void 0)}):console.log("[TF] Yandex Metrika is not detected")}catch(t){console.log("[TF] YM error: ".concat(t.message))}},1e3),setTimeout(function(){n.ymClientIdDetectionInterval&&(clearInterval(n.ymClientIdDetectionInterval),n.ymClientIdDetectionInterval=void 0)},6e4))},f);function f(t,e,n,o){var r=d.call(this)||this;return r.DIALOG_TIMEOUT_MS=576e5,r.initialize=function(){return p(r,void 0,void 0,function(){var e,n,o=this;return h(this,function(t){return this.isInitialized||(e=null==(e=this.dialogApiRepository.getDialogData(this.widgetHolder.getWebsiteUuid()))?void 0:e.dialogUuid,n=null==(n=this.dialogApiRepository.getDialogData(this.widgetHolder.getWebsiteUuid()))?void 0:n.dialogCreationTime,e&&n&&(Date.now()-n>this.DIALOG_TIMEOUT_MS?this.dialogApiRepository.saveDialogData(this.widgetHolder.getWebsiteUuid(),void 0):(this.openSocket(this.widgetHolder.getWebsiteUuid(),e),this.dialogApiRepository.focusTab(e,this.widgetHolder.getWebsiteUuid(),Date.now()))),this.checkForDialogTimeout(),this.mapMessagesLinks(),this.dialogApiRepository.getMessageNotification().then(function(t){o.notification=new Audio(t),o.notification.volume=.4}).catch(function(t){return console.log("[TF] ".concat(t.message))}),this.pingSocketRepeated(),this.detectYmClientId(this.widgetHolder.getWidgetSettings()),window.addEventListener("focus",function(){var t=null==(t=o.dialogApiRepository.getDialogData(o.widgetHolder.getWebsiteUuid()))?void 0:t.dialogUuid;t&&o.dialogApiRepository.focusTab(t,o.widgetHolder.getWebsiteUuid(),Date.now())}),window.addEventListener("blur",function(){var t=null==(t=o.dialogApiRepository.getDialogData(o.widgetHolder.getWebsiteUuid()))?void 0:t.dialogUuid;t&&o.dialogApiRepository.loseTabFocus(t,o.widgetHolder.getWebsiteUuid(),Date.now())}),this.isInitialized=!0),[2]})})},r.dialogApiRepository=t,r.imageApiRepository=e,r.widgetHolder=n,r.errorLogger=o,r.messages=[],r.enteredText="",r.imagesCodesBase64=[],r.isCleanMessageText=!1,r.isShowOperatorWriting=!1,r.lastSoundPlay=0,r.lastSocketPingEventTime=0,r.lastEnteredMessage="",r.isInitialized=!1,r}n.default=o},{"../../../util/ui/ViewModel":"Tkd2","../../../util/Waiter":"Q0HA","../../domain/MessageType":"pVo6","socket.io-client":"DNkq","../../../constants":"eKDL"}],NHn6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=t("preact"),a=r(t("./dialog/presentation/view/DialogComponent")),c=t("./settings/domain/WidgetSize"),u=r(t("./presentation/RequestingHeadComponent")),o=r(t("./dialog/presentation/viewmodel/DialogViewModel"));function r(t){return t&&t.__esModule?t:{default:t}}p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};var l,i,p,t=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},h="is_dialog_has_been_closed",t=(i=s.Component,t(d,i),d.prototype.componentDidMount=function(){var t=this;!this.state.widgetSettings.autoOpen||this.state.widgetSettings.doNotAutoOpenIfClosed&&"true"===localStorage.getItem(h)||(l=setTimeout(function(){t.isEnableDialogTranstition=!1,t.setState({isShowDialog:!0},function(){t.isEnableDialogTranstition=!0,setTimeout(function(){return t.setState({isDialogVisible:!0})},100)})},1e3*this.state.widgetSettings.autoOpenTimeSec)),document.telegramFeedback_open=function(){t.isEnableDialogTranstition=!1,t.setState({isShowDialog:!0},function(){t.isEnableDialogTranstition=!0,setTimeout(function(){return t.setState({isDialogVisible:!0})},100)})},document.telegramFeedback_close=function(){t.isEnableDialogTranstition=!0,t.setState({isDialogVisible:!1},function(){setTimeout(function(){return t.setState({isShowDialog:!1})},100)})},window.addEventListener("resize",this.resizeEventListener,!0)},d.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.resizeEventListener,!0)},d.prototype.render=function(){var t=this,e=this.state,n=e.isMobile,o=e.isShowDialog,r=e.widgetSettings,i=e.isDialogVisible;return e.isIpBlocked?(0,s.h)("div",null):(0,s.h)("div",{id:"telegram-feedback-root",className:"".concat(o?"tf_root_open":"tf_root_closed"," ").concat(!o&&(n||r.size===c.WidgetSize.MINI)?"small-root":"large-root"," ").concat(o?i?"tf-visible-dialog ":"tf-invisible-dialog":""," ").concat(this.isEnableDialogTranstition?"tf-transtition":"")},o?(0,s.h)(a.default,{dialogApiRepository:this.props.dependencyInjector.data.getDialogApiRepository(),dependencyInjector:this.props.dependencyInjector,dialogViewModel:this.dialogViewModel,widgetSettings:r,onClose:function(){l&&clearTimeout(l),t.isEnableDialogTranstition=!0,t.setState({isDialogVisible:!1},function(){setTimeout(function(){return t.setState({isShowDialog:!1})},100)}),localStorage.setItem(h,"true")},onIpBlocked:function(){return t.setState({isIpBlocked:!0})}}):(0,s.h)(u.default,{dialogViewModel:this.dialogViewModel,widgetSettings:r,onOpen:function(){t.isEnableDialogTranstition=!1,t.setState({isShowDialog:!0},function(){t.isEnableDialogTranstition=!0,setTimeout(function(){return t.setState({isDialogVisible:!0})},100)}),document.telegramFeedback_widgetOpened&&document.telegramFeedback_widgetOpened()},isMobile:n}))},d.prototype.isMobile=function(){return window.innerWidth<=768},d);function d(e){var n=i.call(this,e)||this;return n.dialogViewModel=new o.default(e.dependencyInjector.data.getDialogApiRepository(),e.dependencyInjector.data.getImageApiRepository(),e.dependencyInjector.domain.getWidgetHolder(),e.dependencyInjector.domain.getErrorLogger()),n.dialogViewModel.attachNewMessageListener(function(t){n.state.isShowDialog||e.dependencyInjector.data.getDialogApiRepository().getLastViewedMessageTime()>t||(n.isEnableDialogTranstition=!1,n.setState({isShowDialog:!0},function(){n.isEnableDialogTranstition=!0,setTimeout(function(){return n.setState({isDialogVisible:!0})},100)}))}),n.resizeEventListener=function(){n.isMobile()!==n.state.isMobile&&n.setState({isMobile:!n.state.isMobile})},n.state={isMobile:window.innerWidth<=768,isShowDialog:!1,widgetSettings:e.dependencyInjector.domain.getWidgetHolder().getWidgetSettings(),isDialogVisible:!1,isIpBlocked:!1},n.isEnableDialogTranstition=!1,n}n.default=t},{preact:"aSor","./dialog/presentation/view/DialogComponent":"wbel","./settings/domain/WidgetSize":"djyf","./presentation/RequestingHeadComponent":"CITf","./dialog/presentation/viewmodel/DialogViewModel":"fOyp"}],sqNh:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WidgetPlacement=void 0,n.WidgetPlacement=void 0,n.WidgetPlacement={BOTTOM_LEFT:"bottom_left",BOTTOM_RIGHT:"bottom_right"}},{}],SGzV:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("./settings/domain/WidgetPlacement");function r(){}r.prototype.generateCss=function(t){return"\n.telegram_feedback_svg {\n  pointer-events: all !important;\n}\n#telegram_feedback svg {\n  pointer-events: all !important;\n}\n#telegram_feedback_root svg rect {\nfill: initial !important;\n}\n\n#telegram_feedback_root {\ntext-align: left !important;\nletter-spacing: 0px;\n}\n#telegram-feedback-root {\nposition: fixed;\nmargin: 0px;\npadding: 0px;\nz-index: 9999999999;\nfont-family: ".concat(t.isCustomFont?t.customFontName||"":"Inter"," !important;\nbox-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n}\n#telegram-feedback-root.tf-invisible-dialog {\nbottom: -460px !important;\n}\n#telegram-feedback-root.tf-visible-dialog {\nbottom: 0px;\n}\n.tf-transtition {\ntransition: 0.2s;\n}\n#telegram-feedback-root.small-root {\nbottom: ").concat(t.marginYPx,"px;\nwidth: 70px;\nheight: 70px;\nborder-radius: 360px;\nmargin-right: ").concat(t.marginXPx,"px;\nmargin-left: ").concat(t.marginXPx,"px;\n").concat(t.placement===o.WidgetPlacement.BOTTOM_RIGHT?"right: 0px;":"","\n").concat(t.placement===o.WidgetPlacement.BOTTOM_LEFT?"left: 0px;":"","\n}\n#telegram-feedback-root.large-root {\nbottom: 0px;\nwidth: 300px;\nborder-radius: 15px 15px 0px 0px;\nmargin-right: ").concat(t.marginXPx,"px;\nmargin-left: ").concat(t.marginXPx,"px;\n").concat(t.placement===o.WidgetPlacement.BOTTOM_RIGHT?"right: 0px;":"","\n").concat(t.placement===o.WidgetPlacement.BOTTOM_LEFT?"left: 0px;":"","\n}\n#telegram-feedback-root .tf-message-us {\nfont-size: 14px;\npadding: 5px;\npadding-left: 10px;\n}\n#telegram-feedback-root .rectangle .tf-message-us {\nfont-weight: 700 !important;\ncolor: ").concat(t.customTitleColor," !important;\n}\n/* ======== CIRCLE ============ */\n#telegram-feedback-root .tf-circle {\ntransition: 0.2s;\nwidth: 100%;\nheight: 100%;\ndisplay: flex;\nbackground-color: ").concat(t.isWhite?"#fff":t.customPrimaryColor,";\nborder: ").concat(t.isWhite?"1px solid #d6d6d6":"transparent",";\nborder-radius: 360px;\ncursor: pointer;\n}\n/* ======== END OF CIRCLE ======== */\n/* ======== RECTANGLE ============ */\n#telegram-feedback-root .tf-rectangle {\ntransition: 0.2s;\nbackground-color: ").concat(t.customPrimaryColor,";\nfont-weight: 700 !important;\ncolor: ").concat(t.customTitleColor," !important;\nuser-select: none;\ncursor: pointer;\npadding: 10px;\nborder-radius: 20px 20px 0px 0px;\n}\n/* ======== END OF RECTANGLE ======== */\n#telegram-feedback-root .tf-input {\nfont-weight: 500;\nborder: none !important;\nfont-size: 15px !important;\npadding-left: 15px !important;\npadding-top: 15px !important;\npadding-bottom: 15px !important;\nflex-grow: 1 !important;\nborder-radius: 0px !important;\nbackground-color: #fff !important;\nbackground: #fff !important;\nbox-shadow: none !important;\ncolor: #000 !important;\nmargin: 0px !important;\nwidth: 200px !important;\nmax-height: 50px !important;\nfont-family: ").concat(t.isCustomFont?t.customFontName||"":"Inter"," !important;\n}\n#telegram-feedback-root .tf-input:focus {\noutline: none !important;\n}\n#telegram-feedback-root .dialog-head {\nbackground-color: ").concat(t.customPrimaryColor," !important;\nfont-weight: 700 !important;\ncolor: ").concat(t.customTitleColor," !important;\nuser-select: none !important;\ncursor: pointer !important;\nborder-top-left-radius: 20px !important;\nborder-top-right-radius: 20px !important;\nborder-bottom-right-radius: 0px !important;\nborder-bottom-left-radius: 0px !important;\nuser-select: none !important;\npadding: 10px !important;\nborder-radius: 15px 15px 0px 0px !important;\ndisplay: flex !important;\nalign-items: center !important;\nline-height: 1.5 !important;\n}\n#telegram-feedback-root .left-message {\nmax-width: 240px !important;\ntext-align: left !important;\nbackground-color: ").concat(t.customLeftMessageColor," !important;\ncolor: ").concat(t.customLeftTextColor," !important;\nmargin-left: 5px !important;\nmargin-right: 5px !important;\nmargin-top: 2px !important;\nborder-top-left-radius: 15px !important;\nborder-top-right-radius: 15px !important;\nborder-bottom-right-radius: 15px !important;\nborder-bottom-left-radius: 0px !important;\npadding: 10px !important;\ndisplay: inline-block !important;\nmin-width: 50px !important;\nfont-size: 14px !important;\nwhite-space: pre-line !important;\nword-break: break-word;\nline-height: 1.5 !important;\n}\n#telegram-feedback-root .left-message div {\ncolor: ").concat(t.customLeftTextColor," !important;\n}\n#telegram-feedback-root .right-message {\nmargin-left: 10px !important;\nmargin-right: 5px !important;\nmax-width: 240px !important;\ntext-align: left !important;\nbackground-color: ").concat(t.customRightMessageColor," !important;\ncolor: ").concat(t.customRightTextColor," !important;\nborder-top-left-radius: 15px !important;\nborder-top-right-radius: 15px !important;\nborder-bottom-right-radius: 0px !important;\nborder-bottom-left-radius: 15px !important;\npadding: 10px !important;\ndisplay: inline-block !important;\nfont-size: 14px !important;\nwhite-space: pre-line !important;\nword-break: break-word;\nline-height: 1.5 !important;\n}\n#telegram-feedback-root .right-message div {\ncolor: ").concat(t.customRightTextColor," !important;\n}\n#telegram-feedback-root .tf-dialog-body {\nbackground-color: #fff !important;\nmin-height: 350px !important;\nmax-height: 350px !important;\noverflow-x: hidden !important;\noverflow-y: auto !important;\npadding-top: 5px !important;\ndisplay: block !important;\n}\n#telegram-feedback-root .tf-dialog-body::-webkit-scrollbar {\nwidth: 5px !important;\n}\n#telegram-feedback-root .tf-dialog-body::-webkit-scrollbar-track {\nmargin-top: 2px !important;\nbackground: transparent !important;\n}\n#telegram-feedback-root .tf-dialog-body::-webkit-scrollbar-thumb {\nbackground-color: #e7e7e7 !important;\nborder-radius: 25px !important;\nborder: 1px solid #e7e7e7 !important;\n}\n@keyframes loader {\n0% { transform: rotate(0deg); }\n100% { transform: rotate(360deg); }\n}\n#telegram-feedback-root .tf-small-loader {\nborder: 2px solid #f3f3f3; /* Light grey */\nborder-radius: 50% !important;\nwidth: 10px !important;\nheight: 10px !important;\nanimation: loader 2s linear infinite !important;\nmargin-left: 10px !important;\nmargin-right: 5px !important;\n}\n#telegram-feedback-root .tf-big-loader {\nborder: 4px solid #f3f3f3; /* Light grey */\nborder-radius: 50% !important;\nwidth: 20px !important;\nheight: 20px !important;\nanimation: loader 2s linear infinite !important;\n}\n#telegram-feedback-root .tf-footer {\nbackground-color: #fff !important;\nborder-top: 1px solid #cccccc !important;\nheight: 50px !important;\n}\n#telegram-feedback-root .tf-footer-inner {\ndisplay: flex !important;\nalign-items: center !important;\nheight: 50px !important;\nbackground-color: #fff !important;\n}\n#telegram-feedback-root .tf-attach-button {\nheight: 50px !important;\nbackground-color: #fff !important;\ndisplay: flex !important;\nalign-items: center !important;\n}\n#telegram-feedback-root .tf-send-message {\nfont-size: 14px !important;\npadding: 5px !important;\npadding-left: 10px !important;\n}\n#telegram-feedback-root .dialog-head .tf-send-message {\nfont-weight: 700 !important;\ncolor: ").concat(t.customTitleColor," !important;\n}\n#telegram-feedback-root .attach-message-label {\npadding-left: 10px !important;\npadding-right: 5px !important;\npadding-top: 15px !important;\npadding-bottom: 15px !important;\ncursor: pointer !important;\nheight: 50px !important;\ndisplay: flex !important;\nalign-items: center !important;\nmax-width: 35px !important;\nmargin: 0px !important;\n}\n#telegram-feedback-root .tf-link {\ndisplay: block !important;\nopacity: 100% !important;\nbackground-color: #fff !important;\nbackground: #fff !important;\n}\n#telegram-feedback-root .tf-link a {\nfont-size: 9px !important;\ntext-decoration: none !important;\ncolor: #6c757d !important;\ndisplay: block !important;\npadding-top: 0px !important;\npadding-left: 5px !important;\npadding-bottom: 5px !important;\nline-height: 1 !important;\nopacity: 30% !important;\n}\n#telegram-feedback-root .operator {\nmargin-left: 13px !important;\nfont-size: 10px !important;\nmargin-top: 5px !important;\n}\n#telegram-feedback-root .tf-right-link {\nfont-size: 14px !important;\ntext-decoration: underline;\ncolor: ").concat(t.customRightTextColor," !important;\ncursor: pointer !important;\n}\n#telegram-feedback-root .tf-left-link {\nfont-size: 14px !important;\ntext-decoration: underline;\ncolor: ").concat(t.customLeftTextColor," !important;\ncursor: pointer !important;\n}\n#tf-form-header {\n  display: flex !important;\n  justify-content: center !important;\n  font-size: 14px !important;\n  margin: 10px 0px !important;\n  color: #697582 !important;\n}\n\n#tf-form-root {\n  display: flex !important;\n  justify-content: center !important;\n  padding: 15px !important;\n}\n\n#tf-form-inner {\n  flex-grow: 1 !important;\n  box-shadow: 0 3px 10px 0 rgba(0,0,0,.08), 0 0 1px 0 rgba(0,0,0,.22);\n  border-radius: 15px !important;\n  padding-top: 15px !important;\n  padding-bottom: 15px !important;\n}\n\n#tf-form-inner .tf-text-input {\n  display: flex !important;\n  margin-left: 20px !important;\n  margin-right: 20px !important;\n}\n\n#tf-form-inner input {\n  border: none !important;\n  border-bottom: 1px solid gainsboro !important;\n  font-size: 15px !important;\n  padding: 10px !important;\n  margin-bottom: 5px !important;\n  outline: none !important;\n  flex-grow: 1 !important;\n}\n\n#tf-form-inner input:hover {\n  outline: none !important;\n}\n\n#tf-form-send-button {\n  margin-top: 10px !important;\n  flex-grow: 1 !important;\n  height: 35px !important;\n  border: none !important;\n  background-color: ").concat(t.customPrimaryColor," !important;\n  font-weight: 600 !important;\n  color: ").concat(t.customTitleColor," !important;\n  cursor: pointer !important;\n  border-radius: 5px !important;\n}\n\n#tf-form-send-button:hover {\n  opacity: 0.8 !important;\n}\n\n#tf-form-send-button:disabled {\n  opacity: 0.7 !important;\n}\n\n#tf-form-inner input.tf-input-error {\n  border-bottom: 1px solid red !important;\n}\n")},n.default=r},{"./settings/domain/WidgetPlacement":"sqNh"}],m4Rm:[function(t,e,n){"use strict";function o(){this.headers=[]}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,o.prototype.setMethod=function(t){return this.method=t,this},o.prototype.setCredentials=function(t){return this.credentials=t,this},o.prototype.setBody=function(t){return this.body=t,this},o.prototype.addHeader=function(t,e){return this.headers.push([t,e]),this},o.prototype.toRequestInit=function(){var o=[],t=(this.headers.forEach(function(t){var e=t[0],t=t[1],n=[];n.push(e),n.push(t),o.push(n)}),{headers:o});return this.method&&(t.method=this.method),this.credentials&&(t.credentials=this.credentials),this.body&&(t.body=this.body),t},n.default=o},{}],w1tu:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var p=t("../../constants"),h=(t=t("../../util/api/RequestOptions"))&&t.__esModule?t:{default:t};function d(t,s,a,c){return new(a=a||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())})}function f(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function o(t){this.apiHelper=t,this.DIALOG_KEY="telegram_feedback_dialog_data",this.LAST_VIEWED_MESSAGE_KEY="click_chat_last_viewed_message"}o.prototype.sendMessage=function(n,o,r,i,s,a,c,u,l){return d(this,void 0,Promise,function(){var e;return f(this,function(t){return(e=new h.default).setBody(JSON.stringify({websiteUuid:n,dialogId:o,messageText:r,messageTime:i,messageGuaranteeUuid:s,base64:a,base64Type:c,dialogUrl:u,ymClientId:l})),[2,this.apiHelper.fetchPostJson("".concat(p.APPLICATION_SERVER,"/api/dialog/send-message"),e).then(function(t){return t.data})]})})},o.prototype.saveUserData=function(n,o,r,i,s){return d(this,void 0,Promise,function(){var e;return f(this,function(t){return(e=new h.default).setBody(JSON.stringify({websiteUuid:n,dialogId:o,username:r,email:i,phone:s})),[2,this.apiHelper.fetchPostJson("".concat(p.APPLICATION_SERVER,"/api/dialog/save-user-data"),e).then(function(t){return t.data})]})})},o.prototype.getMessageNotification=function(){return d(this,void 0,Promise,function(){return f(this,function(t){return[2,this.apiHelper.fetchGetJson("".concat(p.APPLICATION_SERVER,"/api/dialog/sound")).then(function(t){return t.data.sound})]})})},o.prototype.saveDialogData=function(n,t){var o,r,e=localStorage.getItem(this.DIALOG_KEY);e?(e=JSON.parse(e),o=!1,r=-1,e.dialogs.forEach(function(t,e){t.websiteUuid===n&&(o=!0,r=e)}),o?e.dialogs[r].dialogData=t:e.dialogs.push({websiteUuid:n,dialogData:t}),localStorage.setItem(this.DIALOG_KEY,JSON.stringify(e))):localStorage.setItem(this.DIALOG_KEY,JSON.stringify({dialogs:[{websiteUuid:n,dialogData:t}]}))},o.prototype.getDialogData=function(t){var e=localStorage.getItem(this.DIALOG_KEY);if(e)for(var n=0,o=JSON.parse(e).dialogs;n<o.length;n++){var r=o[n];if(t===r.websiteUuid)return r.dialogData}},o.prototype.focusTab=function(e,n,o){return d(this,void 0,void 0,function(){return f(this,function(t){return[2,this.apiHelper.fetchGetJson("".concat(p.APPLICATION_SERVER,"/api/dialog-online/tab-focused?dialogUuid=").concat(e,"&websiteUuid=").concat(n,"&eventTime=").concat(o))]})})},o.prototype.loseTabFocus=function(e,n,o){return d(this,void 0,void 0,function(){return f(this,function(t){return[2,this.apiHelper.fetchGetJson("".concat(p.APPLICATION_SERVER,"/api/dialog-online/tab-focus-lost?dialogUuid=").concat(e,"&websiteUuid=").concat(n,"&eventTime=").concat(o))]})})},o.prototype.setLastViewedMessageTime=function(t){localStorage.setItem(this.LAST_VIEWED_MESSAGE_KEY,"".concat(t))},o.prototype.getLastViewedMessageTime=function(){var t=localStorage.getItem(this.LAST_VIEWED_MESSAGE_KEY);return t?Number(t):0},n.default=o},{"../../constants":"eKDL","../../util/api/RequestOptions":"m4Rm"}],AW2m:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function o(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}var r=t("../../constants");function i(t){this.apiHelper=t}i.prototype.getImageBase64=function(e){return t=this,s=void 0,a=Promise,c=function(){return o(this,function(t){return[2,this.apiHelper.fetchGetJson("".concat(r.APPLICATION_SERVER,"/api/images/image?code=").concat(e)).then(function(t){return t.data})]})},new(a=a||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())});var t,s,a,c},n.default=i},{"../../constants":"eKDL"}],zfV3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("../../constants"),r=(t=t("../../util/api/RequestOptions"))&&t.__esModule?t:{default:t};function i(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}var u=function(){return(u=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function s(t){this.apiHelper=t}s.prototype.createError=function(n){return t=this,s=void 0,a=Promise,c=function(){var e;return i(this,function(t){return(e=new r.default).setBody(JSON.stringify(u({},n))),[2,this.apiHelper.fetchPostJson("".concat(o.APPLICATION_SERVER,"/api/logger/error"),e)]})},new(a=a||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())});var t,s,a,c},n.default=s},{"../../constants":"eKDL","../../util/api/RequestOptions":"m4Rm"}],xBWa:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function o(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}var r=t("../../constants");function i(t){this.apiHelper=t}i.prototype.getRemoteWidgetSettings=function(e){return t=this,s=void 0,a=Promise,c=function(){return o(this,function(t){return[2,this.apiHelper.fetchGetJson("".concat(r.APPLICATION_SERVER,"/api/widget-settings/remote-widget-settings?wid=").concat(e)).then(function(t){return t.data})]})},new(a=a||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())});var t,s,a,c},n.default=i},{"../../constants":"eKDL"}],Yzz0:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function o(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}var r=t("../constants");function i(t){this.apiHelper=t}i.prototype.onLoad=function(e,n){return t=this,c=function(){return o(this,function(t){return[2,this.apiHelper.fetchGetJson("".concat(r.APPLICATION_SERVER,"/api/statistics/onload?websiteUuid=").concat(e,"&domain=").concat(n))]})},new(a=(a=s=void 0)||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())});var t,s,a,c},n.default=i},{"../constants":"eKDL"}],NZn9:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=r(t("./RequestOptions")),c=r(t("../Waiter"));function r(t){return t&&t.__esModule?t:{default:t}}function u(t,s,a,c){return new(a=a||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())})}function l(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function i(){}i.prototype.fetchPostJson=function(a,n){return u(this,void 0,Promise,function(){var s,e=this;return l(this,function(t){return(s=(s=n)?s:new o.default).setMethod("POST").addHeader("Content-Type","application/json").addHeader("Access-Control-Allow-Methods","POST").addHeader("Accept","application/json"),[2,new Promise(function(r,i){return u(e,void 0,void 0,function(){var e,n,o=this;return l(this,function(t){switch(t.label){case 0:if(!s)throw new Error("Options wrapper is undefined");t.label=1;case 1:t.label=2;case 2:return t.trys.push([2,4,,8]),[4,fetch(a,s.toRequestInit()).then(function(e){return u(o,void 0,void 0,function(){return l(this,function(t){return[2,e]})})}).then(function(t){return t.json()}).then(function(t){if(t.errorMessage)throw new Error(t.errorMessage);if(t.message)throw new Error(t.message);return t})];case 3:return e=t.sent(),r(e),[2];case 4:return(n=t.sent()).message.includes("Failed to fetch")||n.message.includes("Failed to fetch")||n.message.includes("ERR_CONNECTION_RE")||n.message.includes("ERR_CONNECTION_CLOSED")||n.message.includes("Load failed")||n.message.includes("Сетевое соединение потеряно")||n.message.includes("Превышен лимит времени на запрос")||n.message.includes("when attempting to fetch resource")||n.message.includes("The operation was aborted")||n.message.includes("request to")&&n.message.includes("failed")?[4,c.default.wait(1e3)]:[3,6];case 5:return t.sent(),console.log("failed to fetch. trying again"),[3,7];case 6:return i(n),[2];case 7:return[3,8];case 8:return[3,1];case 9:return[2]}})})})]})})},i.prototype.fetchGetJson=function(a,n){return u(this,void 0,Promise,function(){var s,e=this;return l(this,function(t){return(s=(s=n)?s:new o.default).addHeader("Content-Type","application/json").addHeader("Access-Control-Allow-Methods","GET").addHeader("Accept","application/json"),[2,new Promise(function(r,i){return u(e,void 0,void 0,function(){var e,n,o=this;return l(this,function(t){switch(t.label){case 0:if(!s)throw new Error("Options wrapper is undefined");t.label=1;case 1:t.label=2;case 2:return t.trys.push([2,4,,8]),[4,fetch(a,s.toRequestInit()).then(function(e){return u(o,void 0,Promise,function(){return l(this,function(t){return[2,e.json().then(function(t){if(t.errorMessage)throw new Error(t.errorMessage);if(t.message)throw new Error(t.message);return t})]})})})];case 3:return e=t.sent(),r(e),[2];case 4:return(n=t.sent()).message.includes("Failed to fetch")||n.message.includes("ERR_CONNECTION_RE")||n.message.includes("ERR_CONNECTION_CLOSED")||n.message.includes("Load failed")||n.message.includes("Сетевое соединение потеряно")||n.message.includes("Превышен лимит времени на запрос")||n.message.includes("when attempting to fetch resource")||n.message.includes("The operation was aborted")||n.message.includes("request to")&&n.message.includes("failed")?[4,c.default.wait(1e3)]:[3,6];case 5:return t.sent(),console.log("failed to fetch. trying again"),[3,7];case 6:return i(n),[2];case 7:return[3,8];case 8:return[3,1];case 9:return[2]}})})})]})})},i.prototype.fetchPutJson=function(a,n){return u(this,void 0,Promise,function(){var s,e=this;return l(this,function(t){return(s=(s=n)?s:new o.default).setMethod("PUT").addHeader("Content-Type","application/json").addHeader("Access-Control-Allow-Methods","PUT").addHeader("Accept","application/json"),[2,new Promise(function(r,i){return u(e,void 0,void 0,function(){var e,n,o=this;return l(this,function(t){switch(t.label){case 0:if(!s)throw new Error("Options wrapper is undefined");t.label=1;case 1:t.label=2;case 2:return t.trys.push([2,4,,8]),[4,fetch(a,s.toRequestInit()).then(function(e){return u(o,void 0,Promise,function(){return l(this,function(t){return[2,e.json().then(function(t){if(t.errorMessage)throw new Error(t.errorMessage);if(t.message)throw new Error(t.message);return t})]})})})];case 3:return e=t.sent(),r(e),[2];case 4:return(n=t.sent()).message.includes("Failed to fetch")||n.message.includes("ERR_CONNECTION_RE")||n.message.includes("ERR_CONNECTION_CLOSED")||n.message.includes("Load failed")||n.message.includes("Сетевое соединение потеряно")||n.message.includes("Превышен лимит времени на запрос")||n.message.includes("when attempting to fetch resource")||n.message.includes("The operation was aborted")||n.message.includes("request to")&&n.message.includes("failed")?[4,c.default.wait(1e3)]:[3,6];case 5:return t.sent(),console.log("failed to fetch. trying again"),[3,7];case 6:return i(n),[2];case 7:return[3,8];case 8:return[3,1];case 9:return[2]}})})})]})})},i.prototype.fetchDeleteJson=function(a,n){return u(this,void 0,Promise,function(){var s,e=this;return l(this,function(t){return(s=(s=n)?s:new o.default).setMethod("DELETE").addHeader("Access-Control-Allow-Methods","DELETE").addHeader("Accept","application/json"),[2,new Promise(function(r,i){return u(e,void 0,void 0,function(){var e,n,o=this;return l(this,function(t){switch(t.label){case 0:if(!s)throw new Error("Options wrapper is undefined");t.label=1;case 1:t.label=2;case 2:return t.trys.push([2,4,,8]),[4,fetch(a,s.toRequestInit()).then(function(e){return u(o,void 0,Promise,function(){return l(this,function(t){return[2,e.json().then(function(t){if(t.errorMessage)throw new Error(t.errorMessage);if(t.message)throw new Error(t.message);return t})]})})})];case 3:return e=t.sent(),r(e),[2];case 4:return(n=t.sent()).message.includes("Failed to fetch")||n.message.includes("ERR_CONNECTION_RE")||n.message.includes("ERR_CONNECTION_CLOSED")||n.message.includes("Load failed")||n.message.includes("Сетевое соединение потеряно")||n.message.includes("Превышен лимит времени на запрос")||n.message.includes("when attempting to fetch resource")||n.message.includes("The operation was aborted")||n.message.includes("request to")&&n.message.includes("failed")?[4,c.default.wait(1e3)]:[3,6];case 5:return t.sent(),console.log("failed to fetch. trying again"),[3,7];case 6:return i(n),[2];case 7:return[3,8];case 8:return[3,1];case 9:return[2]}})})})]})})},i.prototype.getBase64FromImageUrl=function(e){return u(this,void 0,Promise,function(){var o;return l(this,function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[4,t.sent().blob()];case 2:return o=t.sent(),[2,new Promise(function(e){var n=new FileReader;n.readAsDataURL(o),n.onloadend=function(){var t=n.result;e(t)}})]}})})},n.default=i},{"./RequestOptions":"m4Rm","../Waiter":"Q0HA"}],qNSO:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=u(t("../dialog/api/DialogApiRepository")),r=u(t("../dialog/api/ImageApiRepository")),i=u(t("../errors/data/ErrorApiRepository")),s=u(t("../settings/api/WidgetSettingsApiRepository")),a=u(t("../statistics/StatisticsApiRepository")),c=u(t("../util/api/ApiHelper"));function u(t){return t&&t.__esModule?t:{default:t}}function l(){}l.prototype.getApiHelper=function(){return this.apiHelper||(this.apiHelper=new c.default),this.apiHelper},l.prototype.getErrorApiRepository=function(){return this.errorApiRepository||(this.errorApiRepository=new i.default(this.getApiHelper())),this.errorApiRepository},l.prototype.getWidgetSettingsApiRepository=function(){return this.widgetSettingsApiRepository||(this.widgetSettingsApiRepository=new s.default(this.getApiHelper())),this.widgetSettingsApiRepository},l.prototype.getDialogApiRepository=function(){return this.dialogApiRepository||(this.dialogApiRepository=new o.default(this.getApiHelper())),this.dialogApiRepository},l.prototype.getStatisticsApiRepository=function(){return this.statisticsApiRepository||(this.statisticsApiRepository=new a.default(this.getApiHelper())),this.statisticsApiRepository},l.prototype.getImageApiRepository=function(){return this.imageApiRepository||(this.imageApiRepository=new r.default(this.getApiHelper())),this.imageApiRepository},n.default=l},{"../dialog/api/DialogApiRepository":"w1tu","../dialog/api/ImageApiRepository":"AW2m","../errors/data/ErrorApiRepository":"zfV3","../settings/api/WidgetSettingsApiRepository":"xBWa","../statistics/StatisticsApiRepository":"Yzz0","../util/api/ApiHelper":"NZn9"}],u8tV:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function r(o,r){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&e[0]?s.return:e[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,(e=a?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=r.call(o,c)}catch(t){e=[6,t],s=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function o(t){this.errorApiRepository=t,this.sentErrosCount=0,this.callStack=[]}o.prototype.log=function(t,e){this.callStack.push({method:t||"-",params:e||"-"});for(var n=!0;n;)50<this.callStack.length?this.callStack.splice(1,1):n=!1},o.prototype.logError=function(n,o){return t=this,c=function(){var e;return r(this,function(t){return this.sentErrosCount+=1,2<this.sentErrosCount||(e="undefined"!=typeof window?window.location.href:"not detected",o&&(o+="Call stack: ".concat(JSON.stringify(this.callStack,void 0,4))),this.errorApiRepository.createError({domain:e,reason:n,additionalData:o})),[2]})},new(a=(a=s=void 0)||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(o,r)}i((c=c.apply(t,s||[])).next())});var t,s,a,c},n.default=o},{}],VC5q:[function(t,e,n){"use strict";function o(){}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,o.prototype.setWebsiteUuid=function(t){this.websiteUuid=t},o.prototype.getWebsiteUuid=function(){if(this.websiteUuid)return this.websiteUuid;throw new Error("websiteUuid is not initialized")},o.prototype.setWidgetSettings=function(t){this.widgetSettings=t},o.prototype.getWidgetSettings=function(){if(this.widgetSettings)return this.widgetSettings;throw new Error("widgetSettings is not initialized")},n.default=o},{}],wGy5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t("../errors/domain/ErrorLogger")),r=i(t("../settings/domain/WidgetHolder"));function i(t){return t&&t.__esModule?t:{default:t}}function s(t){this.dataDependencies=t}s.prototype.getErrorLogger=function(){return this.errorLogger||(this.errorLogger=new o.default(this.dataDependencies.getErrorApiRepository())),this.errorLogger},s.prototype.getWidgetHolder=function(){return this.widgetHolder||(this.widgetHolder=new r.default),this.widgetHolder},n.default=s},{"../errors/domain/ErrorLogger":"u8tV","../settings/domain/WidgetHolder":"VC5q"}],n70U:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t("./DataDependencies")),r=i(t("./DomainDependencies"));function i(t){return t&&t.__esModule?t:{default:t}}n.default=function(){this.data=new o.default,this.domain=new r.default(this.data)}},{"./DataDependencies":"qNSO","./DomainDependencies":"wGy5"}],zo2T:[function(t,e,n){"use strict";var c=t("preact"),u=r(t("./App")),l=r(t("./CssGenerator")),o=r(t("./di/DependencyInjector"));function r(t){return t&&t.__esModule?t:{default:t}}console.log("Last Update Date: Nov 7 2023 - 09:36");function i(){var i,s,t,e,a;((null==(t=null===window||void 0===window?void 0:window.location)?void 0:t.origin)||"").includes("127.0.0.1")||((null==(t=null===window||void 0===window?void 0:window.location)?void 0:t.origin)||"").includes("localhost")?console.log("[TF] ClickChat cannot be loaded on localhost"):((t=document.createElement("div")).id="telegram_feedback_root",document.body.appendChild(t),i=new o.default,s=i.domain.getWidgetHolder(),t=i.data.getWidgetSettingsApiRepository(),(e=Array.from(document.getElementsByTagName("script")).filter(function(t){return t.src&&t.src.includes("https://telegram-feedback.com/chat.js")||t.src&&t.src.includes("https://app.telegram-feedback.com/chat.js")||t.src&&t.src.includes("https://script.telegram-feedback.com/chat.js")||t.src&&t.src.includes("https://click-chat.ru/chat.js")||t.src&&t.src.includes("https://script.click-chat.ru/chat.js")}).map(function(t){return t.src})[0])?(a=e.split("wid=")[1])?(s.setWebsiteUuid(a),t.getRemoteWidgetSettings(a).then(function(t){if(s.setWidgetSettings(t),t.isDeleted)console.log("[TF] Сайт был удален в личном кабинете");else if(!!((e=t).isSwitchOffWidgetInInterval&&e.widgetSwitchOffStart&&e.isSwitchOffWidgetInInterval)&&(r=(new Date).getTime()+1e3*e.timezoneValueSeconds,n=new Date("1980-01-01T".concat(e.widgetSwitchOffStart,":00.000Z")).getTime(),o=new Date("1980-01-01T".concat(e.widgetSwitchOffEnd,":00.000Z")).getTime(),e.isDaylightSavingTime&&(r+=36e5,n+=36e5,o+=36e5),e=new Date(r).toISOString().slice(11,16),r=new Date("1980-01-01T".concat(e,":00.000Z")).getTime(),n<o?n<r&&r<o:n<r||r<o))console.log("[TF] Виджет сейчас выключен в настройках");else{e=document.createElement("style");if(e.innerHTML=(new l.default).generateCss(t),document.head.appendChild(e),!t.isCustomFont||t.isCustomFont&&t.customFontGoogleLink){n=document.createElement("link");if(n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),t.isCustomFont){if(!t.isCustomFont||!t.customFontGoogleLink)throw new Error("Unreachable code");n.setAttribute("href",t.customFontGoogleLink)}else n.setAttribute("href","https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");document.head.appendChild(n),n.onload=function(){setTimeout(function(){(0,c.render)((0,c.h)(u.default,{dependencyInjector:i}),document.getElementById("telegram_feedback_root"))},100)}}else(0,c.render)((0,c.h)(u.default,{dependencyInjector:i}),document.getElementById("telegram_feedback_root"));i.data.getStatisticsApiRepository().onLoad(a,window.location.origin)}var e,n,o,r}).catch(function(t){console.log("[TF] Error: "+t.message)})):console.log("[TF] Website ID script has not been found"):console.log("[TF] ClickChat script has not been found"))}var s=Date.now();setTimeout(function(){Date.now()-s<10||i()},10)},{preact:"aSor","./App":"NHn6","./CssGenerator":"SGzV","./di/DependencyInjector":"n70U"}]},{},["zo2T"]);