@voicenter-team/events-sdk 0.0.53 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +1,20 @@
1
- (function(Bt,zt){typeof exports=="object"&&typeof module<"u"?zt(exports):typeof define=="function"&&define.amd?define(["exports"],zt):(Bt=typeof globalThis<"u"?globalThis:Bt||self,zt(Bt.VoicenterEventsSDK={}))})(this,function(Bt){"use strict";var Dm=Object.defineProperty;var Pm=(Bt,zt,ln)=>zt in Bt?Dm(Bt,zt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Bt[zt]=ln;var At=(Bt,zt,ln)=>(Pm(Bt,typeof zt!="symbol"?zt+"":zt,ln),ln);var zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ms={exports:{}},_s={exports:{}};(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o={rotl:function(n,s){return n<<s|n>>>32-s},rotr:function(n,s){return n<<32-s|n>>>s},endian:function(n){if(n.constructor==Number)return o.rotl(n,8)&16711935|o.rotl(n,24)&4278255360;for(var s=0;s<n.length;s++)n[s]=o.endian(n[s]);return n},randomBytes:function(n){for(var s=[];n>0;n--)s.push(Math.floor(Math.random()*256));return s},bytesToWords:function(n){for(var s=[],c=0,f=0;c<n.length;c++,f+=8)s[f>>>5]|=n[c]<<24-f%32;return s},wordsToBytes:function(n){for(var s=[],c=0;c<n.length*32;c+=8)s.push(n[c>>>5]>>>24-c%32&255);return s},bytesToHex:function(n){for(var s=[],c=0;c<n.length;c++)s.push((n[c]>>>4).toString(16)),s.push((n[c]&15).toString(16));return s.join("")},hexToBytes:function(n){for(var s=[],c=0;c<n.length;c+=2)s.push(parseInt(n.substr(c,2),16));return s},bytesToBase64:function(n){for(var s=[],c=0;c<n.length;c+=3)for(var f=n[c]<<16|n[c+1]<<8|n[c+2],v=0;v<4;v++)c*8+v*6<=n.length*8?s.push(r.charAt(f>>>6*(3-v)&63)):s.push("=");return s.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var s=[],c=0,f=0;c<n.length;f=++c%4)f!=0&&s.push((r.indexOf(n.charAt(c-1))&Math.pow(2,-2*f+8)-1)<<f*2|r.indexOf(n.charAt(c))>>>6-f*2);return s}};_s.exports=o})();var Ku=_s.exports,bi={utf8:{stringToBytes:function(r){return bi.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(bi.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var o=[],n=0;n<r.length;n++)o.push(r.charCodeAt(n)&255);return o},bytesToString:function(r){for(var o=[],n=0;n<r.length;n++)o.push(String.fromCharCode(r[n]));return o.join("")}}},ws=bi;/*!
1
+ (function($,ot){typeof exports=="object"&&typeof module<"u"?ot(exports):typeof define=="function"&&define.amd?define(["exports"],ot):($=typeof globalThis<"u"?globalThis:$||self,ot($.VoicenterEventsSDK={}))})(this,function($){"use strict";var Ho=Object.defineProperty;var Jo=($,ot,yt)=>ot in $?Ho($,ot,{enumerable:!0,configurable:!0,writable:!0,value:yt}):$[ot]=yt;var H=($,ot,yt)=>(Jo($,typeof ot!="symbol"?ot+"":ot,yt),yt);function ot(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yt={exports:{}},Le={exports:{}};(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(r,n){return r<<n|r>>>32-n},rotr:function(r,n){return r<<32-n|r>>>n},endian:function(r){if(r.constructor==Number)return e.rotl(r,8)&16711935|e.rotl(r,24)&4278255360;for(var n=0;n<r.length;n++)r[n]=e.endian(r[n]);return r},randomBytes:function(r){for(var n=[];r>0;r--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(r){for(var n=[],o=0,i=0;o<r.length;o++,i+=8)n[i>>>5]|=r[o]<<24-i%32;return n},wordsToBytes:function(r){for(var n=[],o=0;o<r.length*32;o+=8)n.push(r[o>>>5]>>>24-o%32&255);return n},bytesToHex:function(r){for(var n=[],o=0;o<r.length;o++)n.push((r[o]>>>4).toString(16)),n.push((r[o]&15).toString(16));return n.join("")},hexToBytes:function(r){for(var n=[],o=0;o<r.length;o+=2)n.push(parseInt(r.substr(o,2),16));return n},bytesToBase64:function(r){for(var n=[],o=0;o<r.length;o+=3)for(var i=r[o]<<16|r[o+1]<<8|r[o+2],u=0;u<4;u++)o*8+u*6<=r.length*8?n.push(t.charAt(i>>>6*(3-u)&63)):n.push("=");return n.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],o=0,i=0;o<r.length;i=++o%4)i!=0&&n.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*i+8)-1)<<i*2|t.indexOf(r.charAt(o))>>>6-i*2);return n}};Le.exports=e})();var Br=Le.exports,Yt={utf8:{stringToBytes:function(t){return Yt.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Yt.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r)&255);return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}},Ue=Yt;/*!
2
2
  * Determine if an object is a Buffer
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */var zu=function(r){return r!=null&&(bs(r)||Gu(r)||!!r._isBuffer)};function bs(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Gu(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&bs(r.slice(0,0))}(function(){var r=Ku,o=ws.utf8,n=zu,s=ws.bin,c=function(f,v){f.constructor==String?v&&v.encoding==="binary"?f=s.stringToBytes(f):f=o.stringToBytes(f):n(f)?f=Array.prototype.slice.call(f,0):!Array.isArray(f)&&f.constructor!==Uint8Array&&(f=f.toString());for(var d=r.bytesToWords(f),b=f.length*8,p=1732584193,_=-271733879,g=-1732584194,l=271733878,u=0;u<d.length;u++)d[u]=(d[u]<<8|d[u]>>>24)&16711935|(d[u]<<24|d[u]>>>8)&4278255360;d[b>>>5]|=128<<b%32,d[(b+64>>>9<<4)+14]=b;for(var w=c._ff,A=c._gg,k=c._hh,B=c._ii,u=0;u<d.length;u+=16){var Y=p,j=_,N=g,U=l;p=w(p,_,g,l,d[u+0],7,-680876936),l=w(l,p,_,g,d[u+1],12,-389564586),g=w(g,l,p,_,d[u+2],17,606105819),_=w(_,g,l,p,d[u+3],22,-1044525330),p=w(p,_,g,l,d[u+4],7,-176418897),l=w(l,p,_,g,d[u+5],12,1200080426),g=w(g,l,p,_,d[u+6],17,-1473231341),_=w(_,g,l,p,d[u+7],22,-45705983),p=w(p,_,g,l,d[u+8],7,1770035416),l=w(l,p,_,g,d[u+9],12,-1958414417),g=w(g,l,p,_,d[u+10],17,-42063),_=w(_,g,l,p,d[u+11],22,-1990404162),p=w(p,_,g,l,d[u+12],7,1804603682),l=w(l,p,_,g,d[u+13],12,-40341101),g=w(g,l,p,_,d[u+14],17,-1502002290),_=w(_,g,l,p,d[u+15],22,1236535329),p=A(p,_,g,l,d[u+1],5,-165796510),l=A(l,p,_,g,d[u+6],9,-1069501632),g=A(g,l,p,_,d[u+11],14,643717713),_=A(_,g,l,p,d[u+0],20,-373897302),p=A(p,_,g,l,d[u+5],5,-701558691),l=A(l,p,_,g,d[u+10],9,38016083),g=A(g,l,p,_,d[u+15],14,-660478335),_=A(_,g,l,p,d[u+4],20,-405537848),p=A(p,_,g,l,d[u+9],5,568446438),l=A(l,p,_,g,d[u+14],9,-1019803690),g=A(g,l,p,_,d[u+3],14,-187363961),_=A(_,g,l,p,d[u+8],20,1163531501),p=A(p,_,g,l,d[u+13],5,-1444681467),l=A(l,p,_,g,d[u+2],9,-51403784),g=A(g,l,p,_,d[u+7],14,1735328473),_=A(_,g,l,p,d[u+12],20,-1926607734),p=k(p,_,g,l,d[u+5],4,-378558),l=k(l,p,_,g,d[u+8],11,-2022574463),g=k(g,l,p,_,d[u+11],16,1839030562),_=k(_,g,l,p,d[u+14],23,-35309556),p=k(p,_,g,l,d[u+1],4,-1530992060),l=k(l,p,_,g,d[u+4],11,1272893353),g=k(g,l,p,_,d[u+7],16,-155497632),_=k(_,g,l,p,d[u+10],23,-1094730640),p=k(p,_,g,l,d[u+13],4,681279174),l=k(l,p,_,g,d[u+0],11,-358537222),g=k(g,l,p,_,d[u+3],16,-722521979),_=k(_,g,l,p,d[u+6],23,76029189),p=k(p,_,g,l,d[u+9],4,-640364487),l=k(l,p,_,g,d[u+12],11,-421815835),g=k(g,l,p,_,d[u+15],16,530742520),_=k(_,g,l,p,d[u+2],23,-995338651),p=B(p,_,g,l,d[u+0],6,-198630844),l=B(l,p,_,g,d[u+7],10,1126891415),g=B(g,l,p,_,d[u+14],15,-1416354905),_=B(_,g,l,p,d[u+5],21,-57434055),p=B(p,_,g,l,d[u+12],6,1700485571),l=B(l,p,_,g,d[u+3],10,-1894986606),g=B(g,l,p,_,d[u+10],15,-1051523),_=B(_,g,l,p,d[u+1],21,-2054922799),p=B(p,_,g,l,d[u+8],6,1873313359),l=B(l,p,_,g,d[u+15],10,-30611744),g=B(g,l,p,_,d[u+6],15,-1560198380),_=B(_,g,l,p,d[u+13],21,1309151649),p=B(p,_,g,l,d[u+4],6,-145523070),l=B(l,p,_,g,d[u+11],10,-1120210379),g=B(g,l,p,_,d[u+2],15,718787259),_=B(_,g,l,p,d[u+9],21,-343485551),p=p+Y>>>0,_=_+j>>>0,g=g+N>>>0,l=l+U>>>0}return r.endian([p,_,g,l])};c._ff=function(f,v,d,b,p,_,g){var l=f+(v&d|~v&b)+(p>>>0)+g;return(l<<_|l>>>32-_)+v},c._gg=function(f,v,d,b,p,_,g){var l=f+(v&b|d&~b)+(p>>>0)+g;return(l<<_|l>>>32-_)+v},c._hh=function(f,v,d,b,p,_,g){var l=f+(v^d^b)+(p>>>0)+g;return(l<<_|l>>>32-_)+v},c._ii=function(f,v,d,b,p,_,g){var l=f+(d^(v|~b))+(p>>>0)+g;return(l<<_|l>>>32-_)+v},c._blocksize=16,c._digestsize=16,ms.exports=function(f,v){if(f==null)throw new Error("Illegal argument "+f);var d=r.wordsToBytes(c(f,v));return v&&v.asBytes?d:v&&v.asString?s.bytesToString(d):r.bytesToHex(d)}})();var Xu=ms.exports;const $u=ln(Xu);var pn=(r=>(r.MAIN="main",r.NEXT="next",r))(pn||{}),Me=(r=>(r.USER="User",r.TOKEN="Token",r))(Me||{});class jn{static async getSessionStorageDataByKey(o,n=!0){if(typeof chrome<"u"&&typeof chrome.storage<"u"){const s=await chrome.storage.session.get(o);if(s[o])return n?JSON.parse(s[o]):s[o]}if(typeof window<"u"){const s=window.sessionStorage.getItem(o);if(s)return n?JSON.parse(s):s}}static async updateSessionStorageKey(o,n){typeof chrome<"u"&&typeof chrome.storage<"u"&&await chrome.storage.session.set({[o]:JSON.stringify(n)}),typeof window<"u"&&window.sessionStorage.setItem(o,JSON.stringify(n))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&window.sessionStorage.clear()}}class ju{constructor(o){At(this,"delay",1e3);At(this,"lastLoginTimestamp");At(this,"token");At(this,"storageKey");this.eventsSdkClass=o,this.eventsSdkClass=o,this.storageKey=""}async login(o){const n={token:o.token,email:o.email,password:o.password};if(this.storageKey=$u(JSON.stringify({...o,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp(),await this.checkLoginStatus(this.storageKey)||(jn.clearSessionStorage(),await this.userLoginFunction(n,this.storageKey,o.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(o){const n=await jn.getSessionStorageDataByKey(o);return n?(this.onLoginResponse(n),!0):!1}async userLoginFunction(o,n,s){let c,f,v;this.eventsSdkClass.options.isNewStack?(c=await this.externalLogin(this.eventsSdkClass.options.loginUrl,o,s),f=await this.getSettings(c.Data.AccessToken),v={...c.Data,...f}):(c=await this.externalLogin(this.eventsSdkClass.options.loginUrl,o,s),v={...c.Data.Socket}),this.onLoginResponse(v),await jn.updateSessionStorageKey(n,v)}onLoginResponse(o){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,s)=>n.Priority>s.Priority?n:s)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,s)=>n.Priority>s.Priority?n:s)),o.MonitorList&&o.MonitorList.length&&(this.eventsSdkClass.servers=[...o.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,s)=>n.Priority>s.Priority?n:s)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&o.URLList&&(this.eventsSdkClass.URLList=o.URLList),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.URLList.length&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");if(this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");this.eventsSdkClass.server&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${this.eventsSdkClass.server.Version}`),!this.eventsSdkClass.server&&this.eventsSdkClass.URLList.length&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${o.Client}`),o.IdentityCode&&(this.token=o.IdentityCode,this.eventsSdkClass.connect(pn.MAIN)),o.Token&&(this.token=o.Token,this.eventsSdkClass.connect(pn.MAIN)),o.RefreshToken&&o.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===Me.USER&&(this.eventsSdkClass.options.refreshToken=o.RefreshToken,this.eventsSdkClass.options.tokenExpiry=o.IdentityCodeExpiry,this.handleTokenExpiry()),o.RefreshToken&&o.TokenExpiry&&this.eventsSdkClass.options.loginType===Me.USER&&(this.eventsSdkClass.options.refreshToken=o.RefreshToken,this.eventsSdkClass.options.tokenExpiry=o.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let o;if(this.eventsSdkClass.options.tokenExpiry)o=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const n=o.getTime()-new Date().getTime()-5e3,s=Math.min(n,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let c,f;if(this.eventsSdkClass.options.isNewStack){const v=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);c=await this.getSettings(v.Data.AccessToken),f={...v.Data,...c}}else f={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(f),await jn.updateSessionStorageKey(this.storageKey,f)}},s)}async externalLogin(o,{password:n,token:s,email:c},f){if(!o)throw new Error("loginUrl not provided");let v;this.eventsSdkClass.options.isNewStack?f===Me.TOKEN?v=JSON.stringify({identityType:Me.TOKEN,token:s}):v=JSON.stringify({identityType:Me.USER,username:c,password:n}):this.eventsSdkClass.options.loginType===Me.TOKEN?(v=JSON.stringify({token:s}),o=`${o}/${Me.TOKEN}`):(v=JSON.stringify({email:c,pin:n}),o=`${o}/${Me.USER}`);try{const d=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:v});if(!d.ok&&d.status===400)throw new Error("Bad body request. Login type or isNewStack values not correct or not provided");if(!d.ok&&d.status===401)throw new Error("Unauthorized. Invalid token provided");if(!d.ok&&d.status===403)throw new Error("Forbidden. Identity token not provided or not valid");const b=await d.json();if(b.error)throw new Error(b.error);return b}catch(d){throw d}}async getSettings(o){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const n=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${o}`}});if(!n.ok&&n.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return n.json()}catch(n){throw n}}async refreshToken(o,n){try{return(await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).json()}catch(s){throw s}}}var _r={exports:{}};/**
7
- * @license
8
- * Lodash <https://lodash.com/>
9
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
10
- * Released under MIT license <https://lodash.com/license>
11
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
- */_r.exports,function(r,o){(function(){var n,s="4.17.21",c=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",v="Expected a function",d="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",p=500,_="__lodash_placeholder__",g=1,l=2,u=4,w=1,A=2,k=1,B=2,Y=4,j=8,N=16,U=32,T=64,O=128,P=256,R=512,L=30,H="...",z=800,X=16,F=1,lt=2,ct=3,xt=1/0,ut=9007199254740991,Jt=17976931348623157e292,Le=NaN,ue=4294967295,Nr=ue-1,$=ue>>>1,Q=[["ary",O],["bind",k],["bindKey",B],["curry",j],["curryRight",N],["flip",R],["partial",U],["partialRight",T],["rearg",P]],G="[object Arguments]",rt="[object Array]",K="[object AsyncFunction]",et="[object Boolean]",nt="[object Date]",Z="[object DOMException]",at="[object Error]",St="[object Function]",Yt="[object GeneratorFunction]",Ot="[object Map]",Ee="[object Number]",tr="[object Null]",fe="[object Object]",Nn="[object Promise]",er="[object Proxy]",Qt="[object RegExp]",te="[object Set]",Be="[object String]",Ue="[object Symbol]",nr="[object Undefined]",We="[object WeakMap]",rr="[object WeakSet]",en="[object ArrayBuffer]",Ln="[object DataView]",Yi="[object Float32Array]",Vi="[object Float64Array]",Zi="[object Int8Array]",Qi="[object Int16Array]",to="[object Int32Array]",eo="[object Uint8Array]",no="[object Uint8ClampedArray]",ro="[object Uint16Array]",io="[object Uint32Array]",rl=/\b__p \+= '';/g,il=/\b(__p \+=) '' \+/g,ol=/(__e\(.*?\)|\b__t\)) \+\n'';/g,da=/&(?:amp|lt|gt|quot|#39);/g,ga=/[&<>"']/g,sl=RegExp(da.source),al=RegExp(ga.source),cl=/<%-([\s\S]+?)%>/g,ul=/<%([\s\S]+?)%>/g,ya=/<%=([\s\S]+?)%>/g,fl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hl=/^\w*$/,ll=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oo=/[\\^$.*+?()[\]{}|]/g,pl=RegExp(oo.source),so=/^\s+/,dl=/\s/,gl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,yl=/\{\n\/\* \[wrapped with (.+)\] \*/,vl=/,? & /,ml=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,_l=/[()=,{}\[\]\/\s]/,wl=/\\(\\)?/g,bl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,va=/\w*$/,Cl=/^[-+]0x[0-9a-f]+$/i,Sl=/^0b[01]+$/i,kl=/^\[object .+?Constructor\]$/,Al=/^0o[0-7]+$/i,xl=/^(?:0|[1-9]\d*)$/,El=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lr=/($^)/,Tl=/['\n\r\u2028\u2029\\]/g,Br="\\ud800-\\udfff",Rl="\\u0300-\\u036f",Il="\\ufe20-\\ufe2f",Ol="\\u20d0-\\u20ff",ma=Rl+Il+Ol,_a="\\u2700-\\u27bf",wa="a-z\\xdf-\\xf6\\xf8-\\xff",Nl="\\xac\\xb1\\xd7\\xf7",Ll="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bl="\\u2000-\\u206f",Ul=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ba="A-Z\\xc0-\\xd6\\xd8-\\xde",Ca="\\ufe0e\\ufe0f",Sa=Nl+Ll+Bl+Ul,ao="['’]",Dl="["+Br+"]",ka="["+Sa+"]",Ur="["+ma+"]",Aa="\\d+",Pl="["+_a+"]",xa="["+wa+"]",Ea="[^"+Br+Sa+Aa+_a+wa+ba+"]",co="\\ud83c[\\udffb-\\udfff]",Fl="(?:"+Ur+"|"+co+")",Ta="[^"+Br+"]",uo="(?:\\ud83c[\\udde6-\\uddff]){2}",fo="[\\ud800-\\udbff][\\udc00-\\udfff]",Bn="["+ba+"]",Ra="\\u200d",Ia="(?:"+xa+"|"+Ea+")",Ml="(?:"+Bn+"|"+Ea+")",Oa="(?:"+ao+"(?:d|ll|m|re|s|t|ve))?",Na="(?:"+ao+"(?:D|LL|M|RE|S|T|VE))?",La=Fl+"?",Ba="["+Ca+"]?",ql="(?:"+Ra+"(?:"+[Ta,uo,fo].join("|")+")"+Ba+La+")*",Wl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ua=Ba+La+ql,Kl="(?:"+[Pl,uo,fo].join("|")+")"+Ua,zl="(?:"+[Ta+Ur+"?",Ur,uo,fo,Dl].join("|")+")",Gl=RegExp(ao,"g"),Xl=RegExp(Ur,"g"),ho=RegExp(co+"(?="+co+")|"+zl+Ua,"g"),$l=RegExp([Bn+"?"+xa+"+"+Oa+"(?="+[ka,Bn,"$"].join("|")+")",Ml+"+"+Na+"(?="+[ka,Bn+Ia,"$"].join("|")+")",Bn+"?"+Ia+"+"+Oa,Bn+"+"+Na,Hl,Wl,Aa,Kl].join("|"),"g"),jl=RegExp("["+Ra+Br+ma+Ca+"]"),Jl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Vl=-1,It={};It[Yi]=It[Vi]=It[Zi]=It[Qi]=It[to]=It[eo]=It[no]=It[ro]=It[io]=!0,It[G]=It[rt]=It[en]=It[et]=It[Ln]=It[nt]=It[at]=It[St]=It[Ot]=It[Ee]=It[fe]=It[Qt]=It[te]=It[Be]=It[We]=!1;var Rt={};Rt[G]=Rt[rt]=Rt[en]=Rt[Ln]=Rt[et]=Rt[nt]=Rt[Yi]=Rt[Vi]=Rt[Zi]=Rt[Qi]=Rt[to]=Rt[Ot]=Rt[Ee]=Rt[fe]=Rt[Qt]=Rt[te]=Rt[Be]=Rt[Ue]=Rt[eo]=Rt[no]=Rt[ro]=Rt[io]=!0,Rt[at]=Rt[St]=Rt[We]=!1;var Zl={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ql={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tp={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ep={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},np=parseFloat,rp=parseInt,Da=typeof zt=="object"&&zt&&zt.Object===Object&&zt,ip=typeof self=="object"&&self&&self.Object===Object&&self,Xt=Da||ip||Function("return this")(),lo=o&&!o.nodeType&&o,gn=lo&&!0&&r&&!r.nodeType&&r,Pa=gn&&gn.exports===lo,po=Pa&&Da.process,me=function(){try{var x=gn&&gn.require&&gn.require("util").types;return x||po&&po.binding&&po.binding("util")}catch{}}(),Fa=me&&me.isArrayBuffer,Ma=me&&me.isDate,qa=me&&me.isMap,Wa=me&&me.isRegExp,Ha=me&&me.isSet,Ka=me&&me.isTypedArray;function he(x,D,I){switch(I.length){case 0:return x.call(D);case 1:return x.call(D,I[0]);case 2:return x.call(D,I[0],I[1]);case 3:return x.call(D,I[0],I[1],I[2])}return x.apply(D,I)}function op(x,D,I,V){for(var ft=-1,Ct=x==null?0:x.length;++ft<Ct;){var Wt=x[ft];D(V,Wt,I(Wt),x)}return V}function _e(x,D){for(var I=-1,V=x==null?0:x.length;++I<V&&D(x[I],I,x)!==!1;);return x}function sp(x,D){for(var I=x==null?0:x.length;I--&&D(x[I],I,x)!==!1;);return x}function za(x,D){for(var I=-1,V=x==null?0:x.length;++I<V;)if(!D(x[I],I,x))return!1;return!0}function nn(x,D){for(var I=-1,V=x==null?0:x.length,ft=0,Ct=[];++I<V;){var Wt=x[I];D(Wt,I,x)&&(Ct[ft++]=Wt)}return Ct}function Dr(x,D){var I=x==null?0:x.length;return!!I&&Un(x,D,0)>-1}function go(x,D,I){for(var V=-1,ft=x==null?0:x.length;++V<ft;)if(I(D,x[V]))return!0;return!1}function Nt(x,D){for(var I=-1,V=x==null?0:x.length,ft=Array(V);++I<V;)ft[I]=D(x[I],I,x);return ft}function rn(x,D){for(var I=-1,V=D.length,ft=x.length;++I<V;)x[ft+I]=D[I];return x}function yo(x,D,I,V){var ft=-1,Ct=x==null?0:x.length;for(V&&Ct&&(I=x[++ft]);++ft<Ct;)I=D(I,x[ft],ft,x);return I}function ap(x,D,I,V){var ft=x==null?0:x.length;for(V&&ft&&(I=x[--ft]);ft--;)I=D(I,x[ft],ft,x);return I}function vo(x,D){for(var I=-1,V=x==null?0:x.length;++I<V;)if(D(x[I],I,x))return!0;return!1}var cp=mo("length");function up(x){return x.split("")}function fp(x){return x.match(ml)||[]}function Ga(x,D,I){var V;return I(x,function(ft,Ct,Wt){if(D(ft,Ct,Wt))return V=Ct,!1}),V}function Pr(x,D,I,V){for(var ft=x.length,Ct=I+(V?1:-1);V?Ct--:++Ct<ft;)if(D(x[Ct],Ct,x))return Ct;return-1}function Un(x,D,I){return D===D?Cp(x,D,I):Pr(x,Xa,I)}function hp(x,D,I,V){for(var ft=I-1,Ct=x.length;++ft<Ct;)if(V(x[ft],D))return ft;return-1}function Xa(x){return x!==x}function $a(x,D){var I=x==null?0:x.length;return I?wo(x,D)/I:Le}function mo(x){return function(D){return D==null?n:D[x]}}function _o(x){return function(D){return x==null?n:x[D]}}function ja(x,D,I,V,ft){return ft(x,function(Ct,Wt,Tt){I=V?(V=!1,Ct):D(I,Ct,Wt,Tt)}),I}function lp(x,D){var I=x.length;for(x.sort(D);I--;)x[I]=x[I].value;return x}function wo(x,D){for(var I,V=-1,ft=x.length;++V<ft;){var Ct=D(x[V]);Ct!==n&&(I=I===n?Ct:I+Ct)}return I}function bo(x,D){for(var I=-1,V=Array(x);++I<x;)V[I]=D(I);return V}function pp(x,D){return Nt(D,function(I){return[I,x[I]]})}function Ja(x){return x&&x.slice(0,Qa(x)+1).replace(so,"")}function le(x){return function(D){return x(D)}}function Co(x,D){return Nt(D,function(I){return x[I]})}function ir(x,D){return x.has(D)}function Ya(x,D){for(var I=-1,V=x.length;++I<V&&Un(D,x[I],0)>-1;);return I}function Va(x,D){for(var I=x.length;I--&&Un(D,x[I],0)>-1;);return I}function dp(x,D){for(var I=x.length,V=0;I--;)x[I]===D&&++V;return V}var gp=_o(Zl),yp=_o(Ql);function vp(x){return"\\"+ep[x]}function mp(x,D){return x==null?n:x[D]}function Dn(x){return jl.test(x)}function _p(x){return Jl.test(x)}function wp(x){for(var D,I=[];!(D=x.next()).done;)I.push(D.value);return I}function So(x){var D=-1,I=Array(x.size);return x.forEach(function(V,ft){I[++D]=[ft,V]}),I}function Za(x,D){return function(I){return x(D(I))}}function on(x,D){for(var I=-1,V=x.length,ft=0,Ct=[];++I<V;){var Wt=x[I];(Wt===D||Wt===_)&&(x[I]=_,Ct[ft++]=I)}return Ct}function Fr(x){var D=-1,I=Array(x.size);return x.forEach(function(V){I[++D]=V}),I}function bp(x){var D=-1,I=Array(x.size);return x.forEach(function(V){I[++D]=[V,V]}),I}function Cp(x,D,I){for(var V=I-1,ft=x.length;++V<ft;)if(x[V]===D)return V;return-1}function Sp(x,D,I){for(var V=I+1;V--;)if(x[V]===D)return V;return V}function Pn(x){return Dn(x)?Ap(x):cp(x)}function Te(x){return Dn(x)?xp(x):up(x)}function Qa(x){for(var D=x.length;D--&&dl.test(x.charAt(D)););return D}var kp=_o(tp);function Ap(x){for(var D=ho.lastIndex=0;ho.test(x);)++D;return D}function xp(x){return x.match(ho)||[]}function Ep(x){return x.match($l)||[]}var Tp=function x(D){D=D==null?Xt:Fn.defaults(Xt.Object(),D,Fn.pick(Xt,Yl));var I=D.Array,V=D.Date,ft=D.Error,Ct=D.Function,Wt=D.Math,Tt=D.Object,ko=D.RegExp,Rp=D.String,we=D.TypeError,Mr=I.prototype,Ip=Ct.prototype,Mn=Tt.prototype,qr=D["__core-js_shared__"],Wr=Ip.toString,Et=Mn.hasOwnProperty,Op=0,tc=function(){var t=/[^.]+$/.exec(qr&&qr.keys&&qr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Hr=Mn.toString,Np=Wr.call(Tt),Lp=Xt._,Bp=ko("^"+Wr.call(Et).replace(oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kr=Pa?D.Buffer:n,sn=D.Symbol,zr=D.Uint8Array,ec=Kr?Kr.allocUnsafe:n,Gr=Za(Tt.getPrototypeOf,Tt),nc=Tt.create,rc=Mn.propertyIsEnumerable,Xr=Mr.splice,ic=sn?sn.isConcatSpreadable:n,or=sn?sn.iterator:n,yn=sn?sn.toStringTag:n,$r=function(){try{var t=bn(Tt,"defineProperty");return t({},"",{}),t}catch{}}(),Up=D.clearTimeout!==Xt.clearTimeout&&D.clearTimeout,Dp=V&&V.now!==Xt.Date.now&&V.now,Pp=D.setTimeout!==Xt.setTimeout&&D.setTimeout,jr=Wt.ceil,Jr=Wt.floor,Ao=Tt.getOwnPropertySymbols,Fp=Kr?Kr.isBuffer:n,oc=D.isFinite,Mp=Mr.join,qp=Za(Tt.keys,Tt),Ht=Wt.max,Vt=Wt.min,Wp=V.now,Hp=D.parseInt,sc=Wt.random,Kp=Mr.reverse,xo=bn(D,"DataView"),sr=bn(D,"Map"),Eo=bn(D,"Promise"),qn=bn(D,"Set"),ar=bn(D,"WeakMap"),cr=bn(Tt,"create"),Yr=ar&&new ar,Wn={},zp=Cn(xo),Gp=Cn(sr),Xp=Cn(Eo),$p=Cn(qn),jp=Cn(ar),Vr=sn?sn.prototype:n,ur=Vr?Vr.valueOf:n,ac=Vr?Vr.toString:n;function y(t){if(Ut(t)&&!ht(t)&&!(t instanceof mt)){if(t instanceof be)return t;if(Et.call(t,"__wrapped__"))return cu(t)}return new be(t)}var Hn=function(){function t(){}return function(e){if(!Lt(e))return{};if(nc)return nc(e);t.prototype=e;var i=new t;return t.prototype=n,i}}();function Zr(){}function be(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}y.templateSettings={escape:cl,evaluate:ul,interpolate:ya,variable:"",imports:{_:y}},y.prototype=Zr.prototype,y.prototype.constructor=y,be.prototype=Hn(Zr.prototype),be.prototype.constructor=be;function mt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ue,this.__views__=[]}function Jp(){var t=new mt(this.__wrapped__);return t.__actions__=oe(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=oe(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=oe(this.__views__),t}function Yp(){if(this.__filtered__){var t=new mt(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function Vp(){var t=this.__wrapped__.value(),e=this.__dir__,i=ht(t),a=e<0,h=i?t.length:0,m=ug(0,h,this.__views__),C=m.start,S=m.end,E=S-C,M=a?S:C-1,q=this.__iteratees__,W=q.length,J=0,tt=Vt(E,this.__takeCount__);if(!i||!a&&h==E&&tt==E)return Oc(t,this.__actions__);var ot=[];t:for(;E--&&J<tt;){M+=e;for(var dt=-1,st=t[M];++dt<W;){var vt=q[dt],wt=vt.iteratee,ge=vt.type,re=wt(st);if(ge==lt)st=re;else if(!re){if(ge==F)continue t;break t}}ot[J++]=st}return ot}mt.prototype=Hn(Zr.prototype),mt.prototype.constructor=mt;function vn(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var a=t[e];this.set(a[0],a[1])}}function Zp(){this.__data__=cr?cr(null):{},this.size=0}function Qp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function td(t){var e=this.__data__;if(cr){var i=e[t];return i===b?n:i}return Et.call(e,t)?e[t]:n}function ed(t){var e=this.__data__;return cr?e[t]!==n:Et.call(e,t)}function nd(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=cr&&e===n?b:e,this}vn.prototype.clear=Zp,vn.prototype.delete=Qp,vn.prototype.get=td,vn.prototype.has=ed,vn.prototype.set=nd;function He(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var a=t[e];this.set(a[0],a[1])}}function rd(){this.__data__=[],this.size=0}function id(t){var e=this.__data__,i=Qr(e,t);if(i<0)return!1;var a=e.length-1;return i==a?e.pop():Xr.call(e,i,1),--this.size,!0}function od(t){var e=this.__data__,i=Qr(e,t);return i<0?n:e[i][1]}function sd(t){return Qr(this.__data__,t)>-1}function ad(t,e){var i=this.__data__,a=Qr(i,t);return a<0?(++this.size,i.push([t,e])):i[a][1]=e,this}He.prototype.clear=rd,He.prototype.delete=id,He.prototype.get=od,He.prototype.has=sd,He.prototype.set=ad;function Ke(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var a=t[e];this.set(a[0],a[1])}}function cd(){this.size=0,this.__data__={hash:new vn,map:new(sr||He),string:new vn}}function ud(t){var e=hi(this,t).delete(t);return this.size-=e?1:0,e}function fd(t){return hi(this,t).get(t)}function hd(t){return hi(this,t).has(t)}function ld(t,e){var i=hi(this,t),a=i.size;return i.set(t,e),this.size+=i.size==a?0:1,this}Ke.prototype.clear=cd,Ke.prototype.delete=ud,Ke.prototype.get=fd,Ke.prototype.has=hd,Ke.prototype.set=ld;function mn(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new Ke;++e<i;)this.add(t[e])}function pd(t){return this.__data__.set(t,b),this}function dd(t){return this.__data__.has(t)}mn.prototype.add=mn.prototype.push=pd,mn.prototype.has=dd;function Re(t){var e=this.__data__=new He(t);this.size=e.size}function gd(){this.__data__=new He,this.size=0}function yd(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}function vd(t){return this.__data__.get(t)}function md(t){return this.__data__.has(t)}function _d(t,e){var i=this.__data__;if(i instanceof He){var a=i.__data__;if(!sr||a.length<c-1)return a.push([t,e]),this.size=++i.size,this;i=this.__data__=new Ke(a)}return i.set(t,e),this.size=i.size,this}Re.prototype.clear=gd,Re.prototype.delete=yd,Re.prototype.get=vd,Re.prototype.has=md,Re.prototype.set=_d;function cc(t,e){var i=ht(t),a=!i&&Sn(t),h=!i&&!a&&hn(t),m=!i&&!a&&!h&&Xn(t),C=i||a||h||m,S=C?bo(t.length,Rp):[],E=S.length;for(var M in t)(e||Et.call(t,M))&&!(C&&(M=="length"||h&&(M=="offset"||M=="parent")||m&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||$e(M,E)))&&S.push(M);return S}function uc(t){var e=t.length;return e?t[Fo(0,e-1)]:n}function wd(t,e){return li(oe(t),_n(e,0,t.length))}function bd(t){return li(oe(t))}function To(t,e,i){(i!==n&&!Ie(t[e],i)||i===n&&!(e in t))&&ze(t,e,i)}function fr(t,e,i){var a=t[e];(!(Et.call(t,e)&&Ie(a,i))||i===n&&!(e in t))&&ze(t,e,i)}function Qr(t,e){for(var i=t.length;i--;)if(Ie(t[i][0],e))return i;return-1}function Cd(t,e,i,a){return an(t,function(h,m,C){e(a,h,i(h),C)}),a}function fc(t,e){return t&&Pe(e,Kt(e),t)}function Sd(t,e){return t&&Pe(e,ae(e),t)}function ze(t,e,i){e=="__proto__"&&$r?$r(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function Ro(t,e){for(var i=-1,a=e.length,h=I(a),m=t==null;++i<a;)h[i]=m?n:us(t,e[i]);return h}function _n(t,e,i){return t===t&&(i!==n&&(t=t<=i?t:i),e!==n&&(t=t>=e?t:e)),t}function Ce(t,e,i,a,h,m){var C,S=e&g,E=e&l,M=e&u;if(i&&(C=h?i(t,a,h,m):i(t)),C!==n)return C;if(!Lt(t))return t;var q=ht(t);if(q){if(C=hg(t),!S)return oe(t,C)}else{var W=Zt(t),J=W==St||W==Yt;if(hn(t))return Bc(t,S);if(W==fe||W==G||J&&!h){if(C=E||J?{}:Qc(t),!S)return E?tg(t,Sd(C,t)):Qd(t,fc(C,t))}else{if(!Rt[W])return h?t:{};C=lg(t,W,S)}}m||(m=new Re);var tt=m.get(t);if(tt)return tt;m.set(t,C),Tu(t)?t.forEach(function(st){C.add(Ce(st,e,i,st,t,m))}):xu(t)&&t.forEach(function(st,vt){C.set(vt,Ce(st,e,i,vt,t,m))});var ot=M?E?Jo:jo:E?ae:Kt,dt=q?n:ot(t);return _e(dt||t,function(st,vt){dt&&(vt=st,st=t[vt]),fr(C,vt,Ce(st,e,i,vt,t,m))}),C}function kd(t){var e=Kt(t);return function(i){return hc(i,t,e)}}function hc(t,e,i){var a=i.length;if(t==null)return!a;for(t=Tt(t);a--;){var h=i[a],m=e[h],C=t[h];if(C===n&&!(h in t)||!m(C))return!1}return!0}function lc(t,e,i){if(typeof t!="function")throw new we(v);return vr(function(){t.apply(n,i)},e)}function hr(t,e,i,a){var h=-1,m=Dr,C=!0,S=t.length,E=[],M=e.length;if(!S)return E;i&&(e=Nt(e,le(i))),a?(m=go,C=!1):e.length>=c&&(m=ir,C=!1,e=new mn(e));t:for(;++h<S;){var q=t[h],W=i==null?q:i(q);if(q=a||q!==0?q:0,C&&W===W){for(var J=M;J--;)if(e[J]===W)continue t;E.push(q)}else m(e,W,a)||E.push(q)}return E}var an=Mc(De),pc=Mc(Oo,!0);function Ad(t,e){var i=!0;return an(t,function(a,h,m){return i=!!e(a,h,m),i}),i}function ti(t,e,i){for(var a=-1,h=t.length;++a<h;){var m=t[a],C=e(m);if(C!=null&&(S===n?C===C&&!de(C):i(C,S)))var S=C,E=m}return E}function xd(t,e,i,a){var h=t.length;for(i=pt(i),i<0&&(i=-i>h?0:h+i),a=a===n||a>h?h:pt(a),a<0&&(a+=h),a=i>a?0:Iu(a);i<a;)t[i++]=e;return t}function dc(t,e){var i=[];return an(t,function(a,h,m){e(a,h,m)&&i.push(a)}),i}function $t(t,e,i,a,h){var m=-1,C=t.length;for(i||(i=dg),h||(h=[]);++m<C;){var S=t[m];e>0&&i(S)?e>1?$t(S,e-1,i,a,h):rn(h,S):a||(h[h.length]=S)}return h}var Io=qc(),gc=qc(!0);function De(t,e){return t&&Io(t,e,Kt)}function Oo(t,e){return t&&gc(t,e,Kt)}function ei(t,e){return nn(e,function(i){return je(t[i])})}function wn(t,e){e=un(e,t);for(var i=0,a=e.length;t!=null&&i<a;)t=t[Fe(e[i++])];return i&&i==a?t:n}function yc(t,e,i){var a=e(t);return ht(t)?a:rn(a,i(t))}function ee(t){return t==null?t===n?nr:tr:yn&&yn in Tt(t)?cg(t):bg(t)}function No(t,e){return t>e}function Ed(t,e){return t!=null&&Et.call(t,e)}function Td(t,e){return t!=null&&e in Tt(t)}function Rd(t,e,i){return t>=Vt(e,i)&&t<Ht(e,i)}function Lo(t,e,i){for(var a=i?go:Dr,h=t[0].length,m=t.length,C=m,S=I(m),E=1/0,M=[];C--;){var q=t[C];C&&e&&(q=Nt(q,le(e))),E=Vt(q.length,E),S[C]=!i&&(e||h>=120&&q.length>=120)?new mn(C&&q):n}q=t[0];var W=-1,J=S[0];t:for(;++W<h&&M.length<E;){var tt=q[W],ot=e?e(tt):tt;if(tt=i||tt!==0?tt:0,!(J?ir(J,ot):a(M,ot,i))){for(C=m;--C;){var dt=S[C];if(!(dt?ir(dt,ot):a(t[C],ot,i)))continue t}J&&J.push(ot),M.push(tt)}}return M}function Id(t,e,i,a){return De(t,function(h,m,C){e(a,i(h),m,C)}),a}function lr(t,e,i){e=un(e,t),t=ru(t,e);var a=t==null?t:t[Fe(ke(e))];return a==null?n:he(a,t,i)}function vc(t){return Ut(t)&&ee(t)==G}function Od(t){return Ut(t)&&ee(t)==en}function Nd(t){return Ut(t)&&ee(t)==nt}function pr(t,e,i,a,h){return t===e?!0:t==null||e==null||!Ut(t)&&!Ut(e)?t!==t&&e!==e:Ld(t,e,i,a,pr,h)}function Ld(t,e,i,a,h,m){var C=ht(t),S=ht(e),E=C?rt:Zt(t),M=S?rt:Zt(e);E=E==G?fe:E,M=M==G?fe:M;var q=E==fe,W=M==fe,J=E==M;if(J&&hn(t)){if(!hn(e))return!1;C=!0,q=!1}if(J&&!q)return m||(m=new Re),C||Xn(t)?Yc(t,e,i,a,h,m):sg(t,e,E,i,a,h,m);if(!(i&w)){var tt=q&&Et.call(t,"__wrapped__"),ot=W&&Et.call(e,"__wrapped__");if(tt||ot){var dt=tt?t.value():t,st=ot?e.value():e;return m||(m=new Re),h(dt,st,i,a,m)}}return J?(m||(m=new Re),ag(t,e,i,a,h,m)):!1}function Bd(t){return Ut(t)&&Zt(t)==Ot}function Bo(t,e,i,a){var h=i.length,m=h,C=!a;if(t==null)return!m;for(t=Tt(t);h--;){var S=i[h];if(C&&S[2]?S[1]!==t[S[0]]:!(S[0]in t))return!1}for(;++h<m;){S=i[h];var E=S[0],M=t[E],q=S[1];if(C&&S[2]){if(M===n&&!(E in t))return!1}else{var W=new Re;if(a)var J=a(M,q,E,t,e,W);if(!(J===n?pr(q,M,w|A,a,W):J))return!1}}return!0}function mc(t){if(!Lt(t)||yg(t))return!1;var e=je(t)?Bp:kl;return e.test(Cn(t))}function Ud(t){return Ut(t)&&ee(t)==Qt}function Dd(t){return Ut(t)&&Zt(t)==te}function Pd(t){return Ut(t)&&mi(t.length)&&!!It[ee(t)]}function _c(t){return typeof t=="function"?t:t==null?ce:typeof t=="object"?ht(t)?Cc(t[0],t[1]):bc(t):Wu(t)}function Uo(t){if(!yr(t))return qp(t);var e=[];for(var i in Tt(t))Et.call(t,i)&&i!="constructor"&&e.push(i);return e}function Fd(t){if(!Lt(t))return wg(t);var e=yr(t),i=[];for(var a in t)a=="constructor"&&(e||!Et.call(t,a))||i.push(a);return i}function Do(t,e){return t<e}function wc(t,e){var i=-1,a=se(t)?I(t.length):[];return an(t,function(h,m,C){a[++i]=e(h,m,C)}),a}function bc(t){var e=Vo(t);return e.length==1&&e[0][2]?eu(e[0][0],e[0][1]):function(i){return i===t||Bo(i,t,e)}}function Cc(t,e){return Qo(t)&&tu(e)?eu(Fe(t),e):function(i){var a=us(i,t);return a===n&&a===e?fs(i,t):pr(e,a,w|A)}}function ni(t,e,i,a,h){t!==e&&Io(e,function(m,C){if(h||(h=new Re),Lt(m))Md(t,e,C,i,ni,a,h);else{var S=a?a(es(t,C),m,C+"",t,e,h):n;S===n&&(S=m),To(t,C,S)}},ae)}function Md(t,e,i,a,h,m,C){var S=es(t,i),E=es(e,i),M=C.get(E);if(M){To(t,i,M);return}var q=m?m(S,E,i+"",t,e,C):n,W=q===n;if(W){var J=ht(E),tt=!J&&hn(E),ot=!J&&!tt&&Xn(E);q=E,J||tt||ot?ht(S)?q=S:Pt(S)?q=oe(S):tt?(W=!1,q=Bc(E,!0)):ot?(W=!1,q=Uc(E,!0)):q=[]:mr(E)||Sn(E)?(q=S,Sn(S)?q=Ou(S):(!Lt(S)||je(S))&&(q=Qc(E))):W=!1}W&&(C.set(E,q),h(q,E,a,m,C),C.delete(E)),To(t,i,q)}function Sc(t,e){var i=t.length;if(i)return e+=e<0?i:0,$e(e,i)?t[e]:n}function kc(t,e,i){e.length?e=Nt(e,function(m){return ht(m)?function(C){return wn(C,m.length===1?m[0]:m)}:m}):e=[ce];var a=-1;e=Nt(e,le(it()));var h=wc(t,function(m,C,S){var E=Nt(e,function(M){return M(m)});return{criteria:E,index:++a,value:m}});return lp(h,function(m,C){return Zd(m,C,i)})}function qd(t,e){return Ac(t,e,function(i,a){return fs(t,a)})}function Ac(t,e,i){for(var a=-1,h=e.length,m={};++a<h;){var C=e[a],S=wn(t,C);i(S,C)&&dr(m,un(C,t),S)}return m}function Wd(t){return function(e){return wn(e,t)}}function Po(t,e,i,a){var h=a?hp:Un,m=-1,C=e.length,S=t;for(t===e&&(e=oe(e)),i&&(S=Nt(t,le(i)));++m<C;)for(var E=0,M=e[m],q=i?i(M):M;(E=h(S,q,E,a))>-1;)S!==t&&Xr.call(S,E,1),Xr.call(t,E,1);return t}function xc(t,e){for(var i=t?e.length:0,a=i-1;i--;){var h=e[i];if(i==a||h!==m){var m=h;$e(h)?Xr.call(t,h,1):Wo(t,h)}}return t}function Fo(t,e){return t+Jr(sc()*(e-t+1))}function Hd(t,e,i,a){for(var h=-1,m=Ht(jr((e-t)/(i||1)),0),C=I(m);m--;)C[a?m:++h]=t,t+=i;return C}function Mo(t,e){var i="";if(!t||e<1||e>ut)return i;do e%2&&(i+=t),e=Jr(e/2),e&&(t+=t);while(e);return i}function gt(t,e){return ns(nu(t,e,ce),t+"")}function Kd(t){return uc($n(t))}function zd(t,e){var i=$n(t);return li(i,_n(e,0,i.length))}function dr(t,e,i,a){if(!Lt(t))return t;e=un(e,t);for(var h=-1,m=e.length,C=m-1,S=t;S!=null&&++h<m;){var E=Fe(e[h]),M=i;if(E==="__proto__"||E==="constructor"||E==="prototype")return t;if(h!=C){var q=S[E];M=a?a(q,E,S):n,M===n&&(M=Lt(q)?q:$e(e[h+1])?[]:{})}fr(S,E,M),S=S[E]}return t}var Ec=Yr?function(t,e){return Yr.set(t,e),t}:ce,Gd=$r?function(t,e){return $r(t,"toString",{configurable:!0,enumerable:!1,value:ls(e),writable:!0})}:ce;function Xd(t){return li($n(t))}function Se(t,e,i){var a=-1,h=t.length;e<0&&(e=-e>h?0:h+e),i=i>h?h:i,i<0&&(i+=h),h=e>i?0:i-e>>>0,e>>>=0;for(var m=I(h);++a<h;)m[a]=t[a+e];return m}function $d(t,e){var i;return an(t,function(a,h,m){return i=e(a,h,m),!i}),!!i}function ri(t,e,i){var a=0,h=t==null?a:t.length;if(typeof e=="number"&&e===e&&h<=$){for(;a<h;){var m=a+h>>>1,C=t[m];C!==null&&!de(C)&&(i?C<=e:C<e)?a=m+1:h=m}return h}return qo(t,e,ce,i)}function qo(t,e,i,a){var h=0,m=t==null?0:t.length;if(m===0)return 0;e=i(e);for(var C=e!==e,S=e===null,E=de(e),M=e===n;h<m;){var q=Jr((h+m)/2),W=i(t[q]),J=W!==n,tt=W===null,ot=W===W,dt=de(W);if(C)var st=a||ot;else M?st=ot&&(a||J):S?st=ot&&J&&(a||!tt):E?st=ot&&J&&!tt&&(a||!dt):tt||dt?st=!1:st=a?W<=e:W<e;st?h=q+1:m=q}return Vt(m,Nr)}function Tc(t,e){for(var i=-1,a=t.length,h=0,m=[];++i<a;){var C=t[i],S=e?e(C):C;if(!i||!Ie(S,E)){var E=S;m[h++]=C===0?0:C}}return m}function Rc(t){return typeof t=="number"?t:de(t)?Le:+t}function pe(t){if(typeof t=="string")return t;if(ht(t))return Nt(t,pe)+"";if(de(t))return ac?ac.call(t):"";var e=t+"";return e=="0"&&1/t==-xt?"-0":e}function cn(t,e,i){var a=-1,h=Dr,m=t.length,C=!0,S=[],E=S;if(i)C=!1,h=go;else if(m>=c){var M=e?null:ig(t);if(M)return Fr(M);C=!1,h=ir,E=new mn}else E=e?[]:S;t:for(;++a<m;){var q=t[a],W=e?e(q):q;if(q=i||q!==0?q:0,C&&W===W){for(var J=E.length;J--;)if(E[J]===W)continue t;e&&E.push(W),S.push(q)}else h(E,W,i)||(E!==S&&E.push(W),S.push(q))}return S}function Wo(t,e){return e=un(e,t),t=ru(t,e),t==null||delete t[Fe(ke(e))]}function Ic(t,e,i,a){return dr(t,e,i(wn(t,e)),a)}function ii(t,e,i,a){for(var h=t.length,m=a?h:-1;(a?m--:++m<h)&&e(t[m],m,t););return i?Se(t,a?0:m,a?m+1:h):Se(t,a?m+1:0,a?h:m)}function Oc(t,e){var i=t;return i instanceof mt&&(i=i.value()),yo(e,function(a,h){return h.func.apply(h.thisArg,rn([a],h.args))},i)}function Ho(t,e,i){var a=t.length;if(a<2)return a?cn(t[0]):[];for(var h=-1,m=I(a);++h<a;)for(var C=t[h],S=-1;++S<a;)S!=h&&(m[h]=hr(m[h]||C,t[S],e,i));return cn($t(m,1),e,i)}function Nc(t,e,i){for(var a=-1,h=t.length,m=e.length,C={};++a<h;){var S=a<m?e[a]:n;i(C,t[a],S)}return C}function Ko(t){return Pt(t)?t:[]}function zo(t){return typeof t=="function"?t:ce}function un(t,e){return ht(t)?t:Qo(t,e)?[t]:au(kt(t))}var jd=gt;function fn(t,e,i){var a=t.length;return i=i===n?a:i,!e&&i>=a?t:Se(t,e,i)}var Lc=Up||function(t){return Xt.clearTimeout(t)};function Bc(t,e){if(e)return t.slice();var i=t.length,a=ec?ec(i):new t.constructor(i);return t.copy(a),a}function Go(t){var e=new t.constructor(t.byteLength);return new zr(e).set(new zr(t)),e}function Jd(t,e){var i=e?Go(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}function Yd(t){var e=new t.constructor(t.source,va.exec(t));return e.lastIndex=t.lastIndex,e}function Vd(t){return ur?Tt(ur.call(t)):{}}function Uc(t,e){var i=e?Go(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Dc(t,e){if(t!==e){var i=t!==n,a=t===null,h=t===t,m=de(t),C=e!==n,S=e===null,E=e===e,M=de(e);if(!S&&!M&&!m&&t>e||m&&C&&E&&!S&&!M||a&&C&&E||!i&&E||!h)return 1;if(!a&&!m&&!M&&t<e||M&&i&&h&&!a&&!m||S&&i&&h||!C&&h||!E)return-1}return 0}function Zd(t,e,i){for(var a=-1,h=t.criteria,m=e.criteria,C=h.length,S=i.length;++a<C;){var E=Dc(h[a],m[a]);if(E){if(a>=S)return E;var M=i[a];return E*(M=="desc"?-1:1)}}return t.index-e.index}function Pc(t,e,i,a){for(var h=-1,m=t.length,C=i.length,S=-1,E=e.length,M=Ht(m-C,0),q=I(E+M),W=!a;++S<E;)q[S]=e[S];for(;++h<C;)(W||h<m)&&(q[i[h]]=t[h]);for(;M--;)q[S++]=t[h++];return q}function Fc(t,e,i,a){for(var h=-1,m=t.length,C=-1,S=i.length,E=-1,M=e.length,q=Ht(m-S,0),W=I(q+M),J=!a;++h<q;)W[h]=t[h];for(var tt=h;++E<M;)W[tt+E]=e[E];for(;++C<S;)(J||h<m)&&(W[tt+i[C]]=t[h++]);return W}function oe(t,e){var i=-1,a=t.length;for(e||(e=I(a));++i<a;)e[i]=t[i];return e}function Pe(t,e,i,a){var h=!i;i||(i={});for(var m=-1,C=e.length;++m<C;){var S=e[m],E=a?a(i[S],t[S],S,i,t):n;E===n&&(E=t[S]),h?ze(i,S,E):fr(i,S,E)}return i}function Qd(t,e){return Pe(t,Zo(t),e)}function tg(t,e){return Pe(t,Vc(t),e)}function oi(t,e){return function(i,a){var h=ht(i)?op:Cd,m=e?e():{};return h(i,t,it(a,2),m)}}function Kn(t){return gt(function(e,i){var a=-1,h=i.length,m=h>1?i[h-1]:n,C=h>2?i[2]:n;for(m=t.length>3&&typeof m=="function"?(h--,m):n,C&&ne(i[0],i[1],C)&&(m=h<3?n:m,h=1),e=Tt(e);++a<h;){var S=i[a];S&&t(e,S,a,m)}return e})}function Mc(t,e){return function(i,a){if(i==null)return i;if(!se(i))return t(i,a);for(var h=i.length,m=e?h:-1,C=Tt(i);(e?m--:++m<h)&&a(C[m],m,C)!==!1;);return i}}function qc(t){return function(e,i,a){for(var h=-1,m=Tt(e),C=a(e),S=C.length;S--;){var E=C[t?S:++h];if(i(m[E],E,m)===!1)break}return e}}function eg(t,e,i){var a=e&k,h=gr(t);function m(){var C=this&&this!==Xt&&this instanceof m?h:t;return C.apply(a?i:this,arguments)}return m}function Wc(t){return function(e){e=kt(e);var i=Dn(e)?Te(e):n,a=i?i[0]:e.charAt(0),h=i?fn(i,1).join(""):e.slice(1);return a[t]()+h}}function zn(t){return function(e){return yo(Mu(Fu(e).replace(Gl,"")),t,"")}}function gr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=Hn(t.prototype),a=t.apply(i,e);return Lt(a)?a:i}}function ng(t,e,i){var a=gr(t);function h(){for(var m=arguments.length,C=I(m),S=m,E=Gn(h);S--;)C[S]=arguments[S];var M=m<3&&C[0]!==E&&C[m-1]!==E?[]:on(C,E);if(m-=M.length,m<i)return Xc(t,e,si,h.placeholder,n,C,M,n,n,i-m);var q=this&&this!==Xt&&this instanceof h?a:t;return he(q,this,C)}return h}function Hc(t){return function(e,i,a){var h=Tt(e);if(!se(e)){var m=it(i,3);e=Kt(e),i=function(S){return m(h[S],S,h)}}var C=t(e,i,a);return C>-1?h[m?e[C]:C]:n}}function Kc(t){return Xe(function(e){var i=e.length,a=i,h=be.prototype.thru;for(t&&e.reverse();a--;){var m=e[a];if(typeof m!="function")throw new we(v);if(h&&!C&&fi(m)=="wrapper")var C=new be([],!0)}for(a=C?a:i;++a<i;){m=e[a];var S=fi(m),E=S=="wrapper"?Yo(m):n;E&&ts(E[0])&&E[1]==(O|j|U|P)&&!E[4].length&&E[9]==1?C=C[fi(E[0])].apply(C,E[3]):C=m.length==1&&ts(m)?C[S]():C.thru(m)}return function(){var M=arguments,q=M[0];if(C&&M.length==1&&ht(q))return C.plant(q).value();for(var W=0,J=i?e[W].apply(this,M):q;++W<i;)J=e[W].call(this,J);return J}})}function si(t,e,i,a,h,m,C,S,E,M){var q=e&O,W=e&k,J=e&B,tt=e&(j|N),ot=e&R,dt=J?n:gr(t);function st(){for(var vt=arguments.length,wt=I(vt),ge=vt;ge--;)wt[ge]=arguments[ge];if(tt)var re=Gn(st),ye=dp(wt,re);if(a&&(wt=Pc(wt,a,h,tt)),m&&(wt=Fc(wt,m,C,tt)),vt-=ye,tt&&vt<M){var Ft=on(wt,re);return Xc(t,e,si,st.placeholder,i,wt,Ft,S,E,M-vt)}var Oe=W?i:this,Ye=J?Oe[t]:t;return vt=wt.length,S?wt=Cg(wt,S):ot&&vt>1&&wt.reverse(),q&&E<vt&&(wt.length=E),this&&this!==Xt&&this instanceof st&&(Ye=dt||gr(Ye)),Ye.apply(Oe,wt)}return st}function zc(t,e){return function(i,a){return Id(i,t,e(a),{})}}function ai(t,e){return function(i,a){var h;if(i===n&&a===n)return e;if(i!==n&&(h=i),a!==n){if(h===n)return a;typeof i=="string"||typeof a=="string"?(i=pe(i),a=pe(a)):(i=Rc(i),a=Rc(a)),h=t(i,a)}return h}}function Xo(t){return Xe(function(e){return e=Nt(e,le(it())),gt(function(i){var a=this;return t(e,function(h){return he(h,a,i)})})})}function ci(t,e){e=e===n?" ":pe(e);var i=e.length;if(i<2)return i?Mo(e,t):e;var a=Mo(e,jr(t/Pn(e)));return Dn(e)?fn(Te(a),0,t).join(""):a.slice(0,t)}function rg(t,e,i,a){var h=e&k,m=gr(t);function C(){for(var S=-1,E=arguments.length,M=-1,q=a.length,W=I(q+E),J=this&&this!==Xt&&this instanceof C?m:t;++M<q;)W[M]=a[M];for(;E--;)W[M++]=arguments[++S];return he(J,h?i:this,W)}return C}function Gc(t){return function(e,i,a){return a&&typeof a!="number"&&ne(e,i,a)&&(i=a=n),e=Je(e),i===n?(i=e,e=0):i=Je(i),a=a===n?e<i?1:-1:Je(a),Hd(e,i,a,t)}}function ui(t){return function(e,i){return typeof e=="string"&&typeof i=="string"||(e=Ae(e),i=Ae(i)),t(e,i)}}function Xc(t,e,i,a,h,m,C,S,E,M){var q=e&j,W=q?C:n,J=q?n:C,tt=q?m:n,ot=q?n:m;e|=q?U:T,e&=~(q?T:U),e&Y||(e&=~(k|B));var dt=[t,e,h,tt,W,ot,J,S,E,M],st=i.apply(n,dt);return ts(t)&&iu(st,dt),st.placeholder=a,ou(st,t,e)}function $o(t){var e=Wt[t];return function(i,a){if(i=Ae(i),a=a==null?0:Vt(pt(a),292),a&&oc(i)){var h=(kt(i)+"e").split("e"),m=e(h[0]+"e"+(+h[1]+a));return h=(kt(m)+"e").split("e"),+(h[0]+"e"+(+h[1]-a))}return e(i)}}var ig=qn&&1/Fr(new qn([,-0]))[1]==xt?function(t){return new qn(t)}:gs;function $c(t){return function(e){var i=Zt(e);return i==Ot?So(e):i==te?bp(e):pp(e,t(e))}}function Ge(t,e,i,a,h,m,C,S){var E=e&B;if(!E&&typeof t!="function")throw new we(v);var M=a?a.length:0;if(M||(e&=~(U|T),a=h=n),C=C===n?C:Ht(pt(C),0),S=S===n?S:pt(S),M-=h?h.length:0,e&T){var q=a,W=h;a=h=n}var J=E?n:Yo(t),tt=[t,e,i,a,h,q,W,m,C,S];if(J&&_g(tt,J),t=tt[0],e=tt[1],i=tt[2],a=tt[3],h=tt[4],S=tt[9]=tt[9]===n?E?0:t.length:Ht(tt[9]-M,0),!S&&e&(j|N)&&(e&=~(j|N)),!e||e==k)var ot=eg(t,e,i);else e==j||e==N?ot=ng(t,e,S):(e==U||e==(k|U))&&!h.length?ot=rg(t,e,i,a):ot=si.apply(n,tt);var dt=J?Ec:iu;return ou(dt(ot,tt),t,e)}function jc(t,e,i,a){return t===n||Ie(t,Mn[i])&&!Et.call(a,i)?e:t}function Jc(t,e,i,a,h,m){return Lt(t)&&Lt(e)&&(m.set(e,t),ni(t,e,n,Jc,m),m.delete(e)),t}function og(t){return mr(t)?n:t}function Yc(t,e,i,a,h,m){var C=i&w,S=t.length,E=e.length;if(S!=E&&!(C&&E>S))return!1;var M=m.get(t),q=m.get(e);if(M&&q)return M==e&&q==t;var W=-1,J=!0,tt=i&A?new mn:n;for(m.set(t,e),m.set(e,t);++W<S;){var ot=t[W],dt=e[W];if(a)var st=C?a(dt,ot,W,e,t,m):a(ot,dt,W,t,e,m);if(st!==n){if(st)continue;J=!1;break}if(tt){if(!vo(e,function(vt,wt){if(!ir(tt,wt)&&(ot===vt||h(ot,vt,i,a,m)))return tt.push(wt)})){J=!1;break}}else if(!(ot===dt||h(ot,dt,i,a,m))){J=!1;break}}return m.delete(t),m.delete(e),J}function sg(t,e,i,a,h,m,C){switch(i){case Ln:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case en:return!(t.byteLength!=e.byteLength||!m(new zr(t),new zr(e)));case et:case nt:case Ee:return Ie(+t,+e);case at:return t.name==e.name&&t.message==e.message;case Qt:case Be:return t==e+"";case Ot:var S=So;case te:var E=a&w;if(S||(S=Fr),t.size!=e.size&&!E)return!1;var M=C.get(t);if(M)return M==e;a|=A,C.set(t,e);var q=Yc(S(t),S(e),a,h,m,C);return C.delete(t),q;case Ue:if(ur)return ur.call(t)==ur.call(e)}return!1}function ag(t,e,i,a,h,m){var C=i&w,S=jo(t),E=S.length,M=jo(e),q=M.length;if(E!=q&&!C)return!1;for(var W=E;W--;){var J=S[W];if(!(C?J in e:Et.call(e,J)))return!1}var tt=m.get(t),ot=m.get(e);if(tt&&ot)return tt==e&&ot==t;var dt=!0;m.set(t,e),m.set(e,t);for(var st=C;++W<E;){J=S[W];var vt=t[J],wt=e[J];if(a)var ge=C?a(wt,vt,J,e,t,m):a(vt,wt,J,t,e,m);if(!(ge===n?vt===wt||h(vt,wt,i,a,m):ge)){dt=!1;break}st||(st=J=="constructor")}if(dt&&!st){var re=t.constructor,ye=e.constructor;re!=ye&&"constructor"in t&&"constructor"in e&&!(typeof re=="function"&&re instanceof re&&typeof ye=="function"&&ye instanceof ye)&&(dt=!1)}return m.delete(t),m.delete(e),dt}function Xe(t){return ns(nu(t,n,hu),t+"")}function jo(t){return yc(t,Kt,Zo)}function Jo(t){return yc(t,ae,Vc)}var Yo=Yr?function(t){return Yr.get(t)}:gs;function fi(t){for(var e=t.name+"",i=Wn[e],a=Et.call(Wn,e)?i.length:0;a--;){var h=i[a],m=h.func;if(m==null||m==t)return h.name}return e}function Gn(t){var e=Et.call(y,"placeholder")?y:t;return e.placeholder}function it(){var t=y.iteratee||ps;return t=t===ps?_c:t,arguments.length?t(arguments[0],arguments[1]):t}function hi(t,e){var i=t.__data__;return gg(e)?i[typeof e=="string"?"string":"hash"]:i.map}function Vo(t){for(var e=Kt(t),i=e.length;i--;){var a=e[i],h=t[a];e[i]=[a,h,tu(h)]}return e}function bn(t,e){var i=mp(t,e);return mc(i)?i:n}function cg(t){var e=Et.call(t,yn),i=t[yn];try{t[yn]=n;var a=!0}catch{}var h=Hr.call(t);return a&&(e?t[yn]=i:delete t[yn]),h}var Zo=Ao?function(t){return t==null?[]:(t=Tt(t),nn(Ao(t),function(e){return rc.call(t,e)}))}:ys,Vc=Ao?function(t){for(var e=[];t;)rn(e,Zo(t)),t=Gr(t);return e}:ys,Zt=ee;(xo&&Zt(new xo(new ArrayBuffer(1)))!=Ln||sr&&Zt(new sr)!=Ot||Eo&&Zt(Eo.resolve())!=Nn||qn&&Zt(new qn)!=te||ar&&Zt(new ar)!=We)&&(Zt=function(t){var e=ee(t),i=e==fe?t.constructor:n,a=i?Cn(i):"";if(a)switch(a){case zp:return Ln;case Gp:return Ot;case Xp:return Nn;case $p:return te;case jp:return We}return e});function ug(t,e,i){for(var a=-1,h=i.length;++a<h;){var m=i[a],C=m.size;switch(m.type){case"drop":t+=C;break;case"dropRight":e-=C;break;case"take":e=Vt(e,t+C);break;case"takeRight":t=Ht(t,e-C);break}}return{start:t,end:e}}function fg(t){var e=t.match(yl);return e?e[1].split(vl):[]}function Zc(t,e,i){e=un(e,t);for(var a=-1,h=e.length,m=!1;++a<h;){var C=Fe(e[a]);if(!(m=t!=null&&i(t,C)))break;t=t[C]}return m||++a!=h?m:(h=t==null?0:t.length,!!h&&mi(h)&&$e(C,h)&&(ht(t)||Sn(t)))}function hg(t){var e=t.length,i=new t.constructor(e);return e&&typeof t[0]=="string"&&Et.call(t,"index")&&(i.index=t.index,i.input=t.input),i}function Qc(t){return typeof t.constructor=="function"&&!yr(t)?Hn(Gr(t)):{}}function lg(t,e,i){var a=t.constructor;switch(e){case en:return Go(t);case et:case nt:return new a(+t);case Ln:return Jd(t,i);case Yi:case Vi:case Zi:case Qi:case to:case eo:case no:case ro:case io:return Uc(t,i);case Ot:return new a;case Ee:case Be:return new a(t);case Qt:return Yd(t);case te:return new a;case Ue:return Vd(t)}}function pg(t,e){var i=e.length;if(!i)return t;var a=i-1;return e[a]=(i>1?"& ":"")+e[a],e=e.join(i>2?", ":" "),t.replace(gl,`{
14
- /* [wrapped with `+e+`] */
15
- `)}function dg(t){return ht(t)||Sn(t)||!!(ic&&t&&t[ic])}function $e(t,e){var i=typeof t;return e=e??ut,!!e&&(i=="number"||i!="symbol"&&xl.test(t))&&t>-1&&t%1==0&&t<e}function ne(t,e,i){if(!Lt(i))return!1;var a=typeof e;return(a=="number"?se(i)&&$e(e,i.length):a=="string"&&e in i)?Ie(i[e],t):!1}function Qo(t,e){if(ht(t))return!1;var i=typeof t;return i=="number"||i=="symbol"||i=="boolean"||t==null||de(t)?!0:hl.test(t)||!fl.test(t)||e!=null&&t in Tt(e)}function gg(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ts(t){var e=fi(t),i=y[e];if(typeof i!="function"||!(e in mt.prototype))return!1;if(t===i)return!0;var a=Yo(i);return!!a&&t===a[0]}function yg(t){return!!tc&&tc in t}var vg=qr?je:vs;function yr(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||Mn;return t===i}function tu(t){return t===t&&!Lt(t)}function eu(t,e){return function(i){return i==null?!1:i[t]===e&&(e!==n||t in Tt(i))}}function mg(t){var e=yi(t,function(a){return i.size===p&&i.clear(),a}),i=e.cache;return e}function _g(t,e){var i=t[1],a=e[1],h=i|a,m=h<(k|B|O),C=a==O&&i==j||a==O&&i==P&&t[7].length<=e[8]||a==(O|P)&&e[7].length<=e[8]&&i==j;if(!(m||C))return t;a&k&&(t[2]=e[2],h|=i&k?0:Y);var S=e[3];if(S){var E=t[3];t[3]=E?Pc(E,S,e[4]):S,t[4]=E?on(t[3],_):e[4]}return S=e[5],S&&(E=t[5],t[5]=E?Fc(E,S,e[6]):S,t[6]=E?on(t[5],_):e[6]),S=e[7],S&&(t[7]=S),a&O&&(t[8]=t[8]==null?e[8]:Vt(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=h,t}function wg(t){var e=[];if(t!=null)for(var i in Tt(t))e.push(i);return e}function bg(t){return Hr.call(t)}function nu(t,e,i){return e=Ht(e===n?t.length-1:e,0),function(){for(var a=arguments,h=-1,m=Ht(a.length-e,0),C=I(m);++h<m;)C[h]=a[e+h];h=-1;for(var S=I(e+1);++h<e;)S[h]=a[h];return S[e]=i(C),he(t,this,S)}}function ru(t,e){return e.length<2?t:wn(t,Se(e,0,-1))}function Cg(t,e){for(var i=t.length,a=Vt(e.length,i),h=oe(t);a--;){var m=e[a];t[a]=$e(m,i)?h[m]:n}return t}function es(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var iu=su(Ec),vr=Pp||function(t,e){return Xt.setTimeout(t,e)},ns=su(Gd);function ou(t,e,i){var a=e+"";return ns(t,pg(a,Sg(fg(a),i)))}function su(t){var e=0,i=0;return function(){var a=Wp(),h=X-(a-i);if(i=a,h>0){if(++e>=z)return arguments[0]}else e=0;return t.apply(n,arguments)}}function li(t,e){var i=-1,a=t.length,h=a-1;for(e=e===n?a:e;++i<e;){var m=Fo(i,h),C=t[m];t[m]=t[i],t[i]=C}return t.length=e,t}var au=mg(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ll,function(i,a,h,m){e.push(h?m.replace(wl,"$1"):a||i)}),e});function Fe(t){if(typeof t=="string"||de(t))return t;var e=t+"";return e=="0"&&1/t==-xt?"-0":e}function Cn(t){if(t!=null){try{return Wr.call(t)}catch{}try{return t+""}catch{}}return""}function Sg(t,e){return _e(Q,function(i){var a="_."+i[0];e&i[1]&&!Dr(t,a)&&t.push(a)}),t.sort()}function cu(t){if(t instanceof mt)return t.clone();var e=new be(t.__wrapped__,t.__chain__);return e.__actions__=oe(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function kg(t,e,i){(i?ne(t,e,i):e===n)?e=1:e=Ht(pt(e),0);var a=t==null?0:t.length;if(!a||e<1)return[];for(var h=0,m=0,C=I(jr(a/e));h<a;)C[m++]=Se(t,h,h+=e);return C}function Ag(t){for(var e=-1,i=t==null?0:t.length,a=0,h=[];++e<i;){var m=t[e];m&&(h[a++]=m)}return h}function xg(){var t=arguments.length;if(!t)return[];for(var e=I(t-1),i=arguments[0],a=t;a--;)e[a-1]=arguments[a];return rn(ht(i)?oe(i):[i],$t(e,1))}var Eg=gt(function(t,e){return Pt(t)?hr(t,$t(e,1,Pt,!0)):[]}),Tg=gt(function(t,e){var i=ke(e);return Pt(i)&&(i=n),Pt(t)?hr(t,$t(e,1,Pt,!0),it(i,2)):[]}),Rg=gt(function(t,e){var i=ke(e);return Pt(i)&&(i=n),Pt(t)?hr(t,$t(e,1,Pt,!0),n,i):[]});function Ig(t,e,i){var a=t==null?0:t.length;return a?(e=i||e===n?1:pt(e),Se(t,e<0?0:e,a)):[]}function Og(t,e,i){var a=t==null?0:t.length;return a?(e=i||e===n?1:pt(e),e=a-e,Se(t,0,e<0?0:e)):[]}function Ng(t,e){return t&&t.length?ii(t,it(e,3),!0,!0):[]}function Lg(t,e){return t&&t.length?ii(t,it(e,3),!0):[]}function Bg(t,e,i,a){var h=t==null?0:t.length;return h?(i&&typeof i!="number"&&ne(t,e,i)&&(i=0,a=h),xd(t,e,i,a)):[]}function uu(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var h=i==null?0:pt(i);return h<0&&(h=Ht(a+h,0)),Pr(t,it(e,3),h)}function fu(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var h=a-1;return i!==n&&(h=pt(i),h=i<0?Ht(a+h,0):Vt(h,a-1)),Pr(t,it(e,3),h,!0)}function hu(t){var e=t==null?0:t.length;return e?$t(t,1):[]}function Ug(t){var e=t==null?0:t.length;return e?$t(t,xt):[]}function Dg(t,e){var i=t==null?0:t.length;return i?(e=e===n?1:pt(e),$t(t,e)):[]}function Pg(t){for(var e=-1,i=t==null?0:t.length,a={};++e<i;){var h=t[e];a[h[0]]=h[1]}return a}function lu(t){return t&&t.length?t[0]:n}function Fg(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var h=i==null?0:pt(i);return h<0&&(h=Ht(a+h,0)),Un(t,e,h)}function Mg(t){var e=t==null?0:t.length;return e?Se(t,0,-1):[]}var qg=gt(function(t){var e=Nt(t,Ko);return e.length&&e[0]===t[0]?Lo(e):[]}),Wg=gt(function(t){var e=ke(t),i=Nt(t,Ko);return e===ke(i)?e=n:i.pop(),i.length&&i[0]===t[0]?Lo(i,it(e,2)):[]}),Hg=gt(function(t){var e=ke(t),i=Nt(t,Ko);return e=typeof e=="function"?e:n,e&&i.pop(),i.length&&i[0]===t[0]?Lo(i,n,e):[]});function Kg(t,e){return t==null?"":Mp.call(t,e)}function ke(t){var e=t==null?0:t.length;return e?t[e-1]:n}function zg(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var h=a;return i!==n&&(h=pt(i),h=h<0?Ht(a+h,0):Vt(h,a-1)),e===e?Sp(t,e,h):Pr(t,Xa,h,!0)}function Gg(t,e){return t&&t.length?Sc(t,pt(e)):n}var Xg=gt(pu);function pu(t,e){return t&&t.length&&e&&e.length?Po(t,e):t}function $g(t,e,i){return t&&t.length&&e&&e.length?Po(t,e,it(i,2)):t}function jg(t,e,i){return t&&t.length&&e&&e.length?Po(t,e,n,i):t}var Jg=Xe(function(t,e){var i=t==null?0:t.length,a=Ro(t,e);return xc(t,Nt(e,function(h){return $e(h,i)?+h:h}).sort(Dc)),a});function Yg(t,e){var i=[];if(!(t&&t.length))return i;var a=-1,h=[],m=t.length;for(e=it(e,3);++a<m;){var C=t[a];e(C,a,t)&&(i.push(C),h.push(a))}return xc(t,h),i}function rs(t){return t==null?t:Kp.call(t)}function Vg(t,e,i){var a=t==null?0:t.length;return a?(i&&typeof i!="number"&&ne(t,e,i)?(e=0,i=a):(e=e==null?0:pt(e),i=i===n?a:pt(i)),Se(t,e,i)):[]}function Zg(t,e){return ri(t,e)}function Qg(t,e,i){return qo(t,e,it(i,2))}function ty(t,e){var i=t==null?0:t.length;if(i){var a=ri(t,e);if(a<i&&Ie(t[a],e))return a}return-1}function ey(t,e){return ri(t,e,!0)}function ny(t,e,i){return qo(t,e,it(i,2),!0)}function ry(t,e){var i=t==null?0:t.length;if(i){var a=ri(t,e,!0)-1;if(Ie(t[a],e))return a}return-1}function iy(t){return t&&t.length?Tc(t):[]}function oy(t,e){return t&&t.length?Tc(t,it(e,2)):[]}function sy(t){var e=t==null?0:t.length;return e?Se(t,1,e):[]}function ay(t,e,i){return t&&t.length?(e=i||e===n?1:pt(e),Se(t,0,e<0?0:e)):[]}function cy(t,e,i){var a=t==null?0:t.length;return a?(e=i||e===n?1:pt(e),e=a-e,Se(t,e<0?0:e,a)):[]}function uy(t,e){return t&&t.length?ii(t,it(e,3),!1,!0):[]}function fy(t,e){return t&&t.length?ii(t,it(e,3)):[]}var hy=gt(function(t){return cn($t(t,1,Pt,!0))}),ly=gt(function(t){var e=ke(t);return Pt(e)&&(e=n),cn($t(t,1,Pt,!0),it(e,2))}),py=gt(function(t){var e=ke(t);return e=typeof e=="function"?e:n,cn($t(t,1,Pt,!0),n,e)});function dy(t){return t&&t.length?cn(t):[]}function gy(t,e){return t&&t.length?cn(t,it(e,2)):[]}function yy(t,e){return e=typeof e=="function"?e:n,t&&t.length?cn(t,n,e):[]}function is(t){if(!(t&&t.length))return[];var e=0;return t=nn(t,function(i){if(Pt(i))return e=Ht(i.length,e),!0}),bo(e,function(i){return Nt(t,mo(i))})}function du(t,e){if(!(t&&t.length))return[];var i=is(t);return e==null?i:Nt(i,function(a){return he(e,n,a)})}var vy=gt(function(t,e){return Pt(t)?hr(t,e):[]}),my=gt(function(t){return Ho(nn(t,Pt))}),_y=gt(function(t){var e=ke(t);return Pt(e)&&(e=n),Ho(nn(t,Pt),it(e,2))}),wy=gt(function(t){var e=ke(t);return e=typeof e=="function"?e:n,Ho(nn(t,Pt),n,e)}),by=gt(is);function Cy(t,e){return Nc(t||[],e||[],fr)}function Sy(t,e){return Nc(t||[],e||[],dr)}var ky=gt(function(t){var e=t.length,i=e>1?t[e-1]:n;return i=typeof i=="function"?(t.pop(),i):n,du(t,i)});function gu(t){var e=y(t);return e.__chain__=!0,e}function Ay(t,e){return e(t),t}function pi(t,e){return e(t)}var xy=Xe(function(t){var e=t.length,i=e?t[0]:0,a=this.__wrapped__,h=function(m){return Ro(m,t)};return e>1||this.__actions__.length||!(a instanceof mt)||!$e(i)?this.thru(h):(a=a.slice(i,+i+(e?1:0)),a.__actions__.push({func:pi,args:[h],thisArg:n}),new be(a,this.__chain__).thru(function(m){return e&&!m.length&&m.push(n),m}))});function Ey(){return gu(this)}function Ty(){return new be(this.value(),this.__chain__)}function Ry(){this.__values__===n&&(this.__values__=Ru(this.value()));var t=this.__index__>=this.__values__.length,e=t?n:this.__values__[this.__index__++];return{done:t,value:e}}function Iy(){return this}function Oy(t){for(var e,i=this;i instanceof Zr;){var a=cu(i);a.__index__=0,a.__values__=n,e?h.__wrapped__=a:e=a;var h=a;i=i.__wrapped__}return h.__wrapped__=t,e}function Ny(){var t=this.__wrapped__;if(t instanceof mt){var e=t;return this.__actions__.length&&(e=new mt(this)),e=e.reverse(),e.__actions__.push({func:pi,args:[rs],thisArg:n}),new be(e,this.__chain__)}return this.thru(rs)}function Ly(){return Oc(this.__wrapped__,this.__actions__)}var By=oi(function(t,e,i){Et.call(t,i)?++t[i]:ze(t,i,1)});function Uy(t,e,i){var a=ht(t)?za:Ad;return i&&ne(t,e,i)&&(e=n),a(t,it(e,3))}function Dy(t,e){var i=ht(t)?nn:dc;return i(t,it(e,3))}var Py=Hc(uu),Fy=Hc(fu);function My(t,e){return $t(di(t,e),1)}function qy(t,e){return $t(di(t,e),xt)}function Wy(t,e,i){return i=i===n?1:pt(i),$t(di(t,e),i)}function yu(t,e){var i=ht(t)?_e:an;return i(t,it(e,3))}function vu(t,e){var i=ht(t)?sp:pc;return i(t,it(e,3))}var Hy=oi(function(t,e,i){Et.call(t,i)?t[i].push(e):ze(t,i,[e])});function Ky(t,e,i,a){t=se(t)?t:$n(t),i=i&&!a?pt(i):0;var h=t.length;return i<0&&(i=Ht(h+i,0)),_i(t)?i<=h&&t.indexOf(e,i)>-1:!!h&&Un(t,e,i)>-1}var zy=gt(function(t,e,i){var a=-1,h=typeof e=="function",m=se(t)?I(t.length):[];return an(t,function(C){m[++a]=h?he(e,C,i):lr(C,e,i)}),m}),Gy=oi(function(t,e,i){ze(t,i,e)});function di(t,e){var i=ht(t)?Nt:wc;return i(t,it(e,3))}function Xy(t,e,i,a){return t==null?[]:(ht(e)||(e=e==null?[]:[e]),i=a?n:i,ht(i)||(i=i==null?[]:[i]),kc(t,e,i))}var $y=oi(function(t,e,i){t[i?0:1].push(e)},function(){return[[],[]]});function jy(t,e,i){var a=ht(t)?yo:ja,h=arguments.length<3;return a(t,it(e,4),i,h,an)}function Jy(t,e,i){var a=ht(t)?ap:ja,h=arguments.length<3;return a(t,it(e,4),i,h,pc)}function Yy(t,e){var i=ht(t)?nn:dc;return i(t,vi(it(e,3)))}function Vy(t){var e=ht(t)?uc:Kd;return e(t)}function Zy(t,e,i){(i?ne(t,e,i):e===n)?e=1:e=pt(e);var a=ht(t)?wd:zd;return a(t,e)}function Qy(t){var e=ht(t)?bd:Xd;return e(t)}function tv(t){if(t==null)return 0;if(se(t))return _i(t)?Pn(t):t.length;var e=Zt(t);return e==Ot||e==te?t.size:Uo(t).length}function ev(t,e,i){var a=ht(t)?vo:$d;return i&&ne(t,e,i)&&(e=n),a(t,it(e,3))}var nv=gt(function(t,e){if(t==null)return[];var i=e.length;return i>1&&ne(t,e[0],e[1])?e=[]:i>2&&ne(e[0],e[1],e[2])&&(e=[e[0]]),kc(t,$t(e,1),[])}),gi=Dp||function(){return Xt.Date.now()};function rv(t,e){if(typeof e!="function")throw new we(v);return t=pt(t),function(){if(--t<1)return e.apply(this,arguments)}}function mu(t,e,i){return e=i?n:e,e=t&&e==null?t.length:e,Ge(t,O,n,n,n,n,e)}function _u(t,e){var i;if(typeof e!="function")throw new we(v);return t=pt(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var os=gt(function(t,e,i){var a=k;if(i.length){var h=on(i,Gn(os));a|=U}return Ge(t,a,e,i,h)}),wu=gt(function(t,e,i){var a=k|B;if(i.length){var h=on(i,Gn(wu));a|=U}return Ge(e,a,t,i,h)});function bu(t,e,i){e=i?n:e;var a=Ge(t,j,n,n,n,n,n,e);return a.placeholder=bu.placeholder,a}function Cu(t,e,i){e=i?n:e;var a=Ge(t,N,n,n,n,n,n,e);return a.placeholder=Cu.placeholder,a}function Su(t,e,i){var a,h,m,C,S,E,M=0,q=!1,W=!1,J=!0;if(typeof t!="function")throw new we(v);e=Ae(e)||0,Lt(i)&&(q=!!i.leading,W="maxWait"in i,m=W?Ht(Ae(i.maxWait)||0,e):m,J="trailing"in i?!!i.trailing:J);function tt(Ft){var Oe=a,Ye=h;return a=h=n,M=Ft,C=t.apply(Ye,Oe),C}function ot(Ft){return M=Ft,S=vr(vt,e),q?tt(Ft):C}function dt(Ft){var Oe=Ft-E,Ye=Ft-M,Hu=e-Oe;return W?Vt(Hu,m-Ye):Hu}function st(Ft){var Oe=Ft-E,Ye=Ft-M;return E===n||Oe>=e||Oe<0||W&&Ye>=m}function vt(){var Ft=gi();if(st(Ft))return wt(Ft);S=vr(vt,dt(Ft))}function wt(Ft){return S=n,J&&a?tt(Ft):(a=h=n,C)}function ge(){S!==n&&Lc(S),M=0,a=E=h=S=n}function re(){return S===n?C:wt(gi())}function ye(){var Ft=gi(),Oe=st(Ft);if(a=arguments,h=this,E=Ft,Oe){if(S===n)return ot(E);if(W)return Lc(S),S=vr(vt,e),tt(E)}return S===n&&(S=vr(vt,e)),C}return ye.cancel=ge,ye.flush=re,ye}var iv=gt(function(t,e){return lc(t,1,e)}),ov=gt(function(t,e,i){return lc(t,Ae(e)||0,i)});function sv(t){return Ge(t,R)}function yi(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new we(v);var i=function(){var a=arguments,h=e?e.apply(this,a):a[0],m=i.cache;if(m.has(h))return m.get(h);var C=t.apply(this,a);return i.cache=m.set(h,C)||m,C};return i.cache=new(yi.Cache||Ke),i}yi.Cache=Ke;function vi(t){if(typeof t!="function")throw new we(v);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function av(t){return _u(2,t)}var cv=jd(function(t,e){e=e.length==1&&ht(e[0])?Nt(e[0],le(it())):Nt($t(e,1),le(it()));var i=e.length;return gt(function(a){for(var h=-1,m=Vt(a.length,i);++h<m;)a[h]=e[h].call(this,a[h]);return he(t,this,a)})}),ss=gt(function(t,e){var i=on(e,Gn(ss));return Ge(t,U,n,e,i)}),ku=gt(function(t,e){var i=on(e,Gn(ku));return Ge(t,T,n,e,i)}),uv=Xe(function(t,e){return Ge(t,P,n,n,n,e)});function fv(t,e){if(typeof t!="function")throw new we(v);return e=e===n?e:pt(e),gt(t,e)}function hv(t,e){if(typeof t!="function")throw new we(v);return e=e==null?0:Ht(pt(e),0),gt(function(i){var a=i[e],h=fn(i,0,e);return a&&rn(h,a),he(t,this,h)})}function lv(t,e,i){var a=!0,h=!0;if(typeof t!="function")throw new we(v);return Lt(i)&&(a="leading"in i?!!i.leading:a,h="trailing"in i?!!i.trailing:h),Su(t,e,{leading:a,maxWait:e,trailing:h})}function pv(t){return mu(t,1)}function dv(t,e){return ss(zo(e),t)}function gv(){if(!arguments.length)return[];var t=arguments[0];return ht(t)?t:[t]}function yv(t){return Ce(t,u)}function vv(t,e){return e=typeof e=="function"?e:n,Ce(t,u,e)}function mv(t){return Ce(t,g|u)}function _v(t,e){return e=typeof e=="function"?e:n,Ce(t,g|u,e)}function wv(t,e){return e==null||hc(t,e,Kt(e))}function Ie(t,e){return t===e||t!==t&&e!==e}var bv=ui(No),Cv=ui(function(t,e){return t>=e}),Sn=vc(function(){return arguments}())?vc:function(t){return Ut(t)&&Et.call(t,"callee")&&!rc.call(t,"callee")},ht=I.isArray,Sv=Fa?le(Fa):Od;function se(t){return t!=null&&mi(t.length)&&!je(t)}function Pt(t){return Ut(t)&&se(t)}function kv(t){return t===!0||t===!1||Ut(t)&&ee(t)==et}var hn=Fp||vs,Av=Ma?le(Ma):Nd;function xv(t){return Ut(t)&&t.nodeType===1&&!mr(t)}function Ev(t){if(t==null)return!0;if(se(t)&&(ht(t)||typeof t=="string"||typeof t.splice=="function"||hn(t)||Xn(t)||Sn(t)))return!t.length;var e=Zt(t);if(e==Ot||e==te)return!t.size;if(yr(t))return!Uo(t).length;for(var i in t)if(Et.call(t,i))return!1;return!0}function Tv(t,e){return pr(t,e)}function Rv(t,e,i){i=typeof i=="function"?i:n;var a=i?i(t,e):n;return a===n?pr(t,e,n,i):!!a}function as(t){if(!Ut(t))return!1;var e=ee(t);return e==at||e==Z||typeof t.message=="string"&&typeof t.name=="string"&&!mr(t)}function Iv(t){return typeof t=="number"&&oc(t)}function je(t){if(!Lt(t))return!1;var e=ee(t);return e==St||e==Yt||e==K||e==er}function Au(t){return typeof t=="number"&&t==pt(t)}function mi(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ut}function Lt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Ut(t){return t!=null&&typeof t=="object"}var xu=qa?le(qa):Bd;function Ov(t,e){return t===e||Bo(t,e,Vo(e))}function Nv(t,e,i){return i=typeof i=="function"?i:n,Bo(t,e,Vo(e),i)}function Lv(t){return Eu(t)&&t!=+t}function Bv(t){if(vg(t))throw new ft(f);return mc(t)}function Uv(t){return t===null}function Dv(t){return t==null}function Eu(t){return typeof t=="number"||Ut(t)&&ee(t)==Ee}function mr(t){if(!Ut(t)||ee(t)!=fe)return!1;var e=Gr(t);if(e===null)return!0;var i=Et.call(e,"constructor")&&e.constructor;return typeof i=="function"&&i instanceof i&&Wr.call(i)==Np}var cs=Wa?le(Wa):Ud;function Pv(t){return Au(t)&&t>=-ut&&t<=ut}var Tu=Ha?le(Ha):Dd;function _i(t){return typeof t=="string"||!ht(t)&&Ut(t)&&ee(t)==Be}function de(t){return typeof t=="symbol"||Ut(t)&&ee(t)==Ue}var Xn=Ka?le(Ka):Pd;function Fv(t){return t===n}function Mv(t){return Ut(t)&&Zt(t)==We}function qv(t){return Ut(t)&&ee(t)==rr}var Wv=ui(Do),Hv=ui(function(t,e){return t<=e});function Ru(t){if(!t)return[];if(se(t))return _i(t)?Te(t):oe(t);if(or&&t[or])return wp(t[or]());var e=Zt(t),i=e==Ot?So:e==te?Fr:$n;return i(t)}function Je(t){if(!t)return t===0?t:0;if(t=Ae(t),t===xt||t===-xt){var e=t<0?-1:1;return e*Jt}return t===t?t:0}function pt(t){var e=Je(t),i=e%1;return e===e?i?e-i:e:0}function Iu(t){return t?_n(pt(t),0,ue):0}function Ae(t){if(typeof t=="number")return t;if(de(t))return Le;if(Lt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ja(t);var i=Sl.test(t);return i||Al.test(t)?rp(t.slice(2),i?2:8):Cl.test(t)?Le:+t}function Ou(t){return Pe(t,ae(t))}function Kv(t){return t?_n(pt(t),-ut,ut):t===0?t:0}function kt(t){return t==null?"":pe(t)}var zv=Kn(function(t,e){if(yr(e)||se(e)){Pe(e,Kt(e),t);return}for(var i in e)Et.call(e,i)&&fr(t,i,e[i])}),Nu=Kn(function(t,e){Pe(e,ae(e),t)}),wi=Kn(function(t,e,i,a){Pe(e,ae(e),t,a)}),Gv=Kn(function(t,e,i,a){Pe(e,Kt(e),t,a)}),Xv=Xe(Ro);function $v(t,e){var i=Hn(t);return e==null?i:fc(i,e)}var jv=gt(function(t,e){t=Tt(t);var i=-1,a=e.length,h=a>2?e[2]:n;for(h&&ne(e[0],e[1],h)&&(a=1);++i<a;)for(var m=e[i],C=ae(m),S=-1,E=C.length;++S<E;){var M=C[S],q=t[M];(q===n||Ie(q,Mn[M])&&!Et.call(t,M))&&(t[M]=m[M])}return t}),Jv=gt(function(t){return t.push(n,Jc),he(Lu,n,t)});function Yv(t,e){return Ga(t,it(e,3),De)}function Vv(t,e){return Ga(t,it(e,3),Oo)}function Zv(t,e){return t==null?t:Io(t,it(e,3),ae)}function Qv(t,e){return t==null?t:gc(t,it(e,3),ae)}function t0(t,e){return t&&De(t,it(e,3))}function e0(t,e){return t&&Oo(t,it(e,3))}function n0(t){return t==null?[]:ei(t,Kt(t))}function r0(t){return t==null?[]:ei(t,ae(t))}function us(t,e,i){var a=t==null?n:wn(t,e);return a===n?i:a}function i0(t,e){return t!=null&&Zc(t,e,Ed)}function fs(t,e){return t!=null&&Zc(t,e,Td)}var o0=zc(function(t,e,i){e!=null&&typeof e.toString!="function"&&(e=Hr.call(e)),t[e]=i},ls(ce)),s0=zc(function(t,e,i){e!=null&&typeof e.toString!="function"&&(e=Hr.call(e)),Et.call(t,e)?t[e].push(i):t[e]=[i]},it),a0=gt(lr);function Kt(t){return se(t)?cc(t):Uo(t)}function ae(t){return se(t)?cc(t,!0):Fd(t)}function c0(t,e){var i={};return e=it(e,3),De(t,function(a,h,m){ze(i,e(a,h,m),a)}),i}function u0(t,e){var i={};return e=it(e,3),De(t,function(a,h,m){ze(i,h,e(a,h,m))}),i}var f0=Kn(function(t,e,i){ni(t,e,i)}),Lu=Kn(function(t,e,i,a){ni(t,e,i,a)}),h0=Xe(function(t,e){var i={};if(t==null)return i;var a=!1;e=Nt(e,function(m){return m=un(m,t),a||(a=m.length>1),m}),Pe(t,Jo(t),i),a&&(i=Ce(i,g|l|u,og));for(var h=e.length;h--;)Wo(i,e[h]);return i});function l0(t,e){return Bu(t,vi(it(e)))}var p0=Xe(function(t,e){return t==null?{}:qd(t,e)});function Bu(t,e){if(t==null)return{};var i=Nt(Jo(t),function(a){return[a]});return e=it(e),Ac(t,i,function(a,h){return e(a,h[0])})}function d0(t,e,i){e=un(e,t);var a=-1,h=e.length;for(h||(h=1,t=n);++a<h;){var m=t==null?n:t[Fe(e[a])];m===n&&(a=h,m=i),t=je(m)?m.call(t):m}return t}function g0(t,e,i){return t==null?t:dr(t,e,i)}function y0(t,e,i,a){return a=typeof a=="function"?a:n,t==null?t:dr(t,e,i,a)}var Uu=$c(Kt),Du=$c(ae);function v0(t,e,i){var a=ht(t),h=a||hn(t)||Xn(t);if(e=it(e,4),i==null){var m=t&&t.constructor;h?i=a?new m:[]:Lt(t)?i=je(m)?Hn(Gr(t)):{}:i={}}return(h?_e:De)(t,function(C,S,E){return e(i,C,S,E)}),i}function m0(t,e){return t==null?!0:Wo(t,e)}function _0(t,e,i){return t==null?t:Ic(t,e,zo(i))}function w0(t,e,i,a){return a=typeof a=="function"?a:n,t==null?t:Ic(t,e,zo(i),a)}function $n(t){return t==null?[]:Co(t,Kt(t))}function b0(t){return t==null?[]:Co(t,ae(t))}function C0(t,e,i){return i===n&&(i=e,e=n),i!==n&&(i=Ae(i),i=i===i?i:0),e!==n&&(e=Ae(e),e=e===e?e:0),_n(Ae(t),e,i)}function S0(t,e,i){return e=Je(e),i===n?(i=e,e=0):i=Je(i),t=Ae(t),Rd(t,e,i)}function k0(t,e,i){if(i&&typeof i!="boolean"&&ne(t,e,i)&&(e=i=n),i===n&&(typeof e=="boolean"?(i=e,e=n):typeof t=="boolean"&&(i=t,t=n)),t===n&&e===n?(t=0,e=1):(t=Je(t),e===n?(e=t,t=0):e=Je(e)),t>e){var a=t;t=e,e=a}if(i||t%1||e%1){var h=sc();return Vt(t+h*(e-t+np("1e-"+((h+"").length-1))),e)}return Fo(t,e)}var A0=zn(function(t,e,i){return e=e.toLowerCase(),t+(i?Pu(e):e)});function Pu(t){return hs(kt(t).toLowerCase())}function Fu(t){return t=kt(t),t&&t.replace(El,gp).replace(Xl,"")}function x0(t,e,i){t=kt(t),e=pe(e);var a=t.length;i=i===n?a:_n(pt(i),0,a);var h=i;return i-=e.length,i>=0&&t.slice(i,h)==e}function E0(t){return t=kt(t),t&&al.test(t)?t.replace(ga,yp):t}function T0(t){return t=kt(t),t&&pl.test(t)?t.replace(oo,"\\$&"):t}var R0=zn(function(t,e,i){return t+(i?"-":"")+e.toLowerCase()}),I0=zn(function(t,e,i){return t+(i?" ":"")+e.toLowerCase()}),O0=Wc("toLowerCase");function N0(t,e,i){t=kt(t),e=pt(e);var a=e?Pn(t):0;if(!e||a>=e)return t;var h=(e-a)/2;return ci(Jr(h),i)+t+ci(jr(h),i)}function L0(t,e,i){t=kt(t),e=pt(e);var a=e?Pn(t):0;return e&&a<e?t+ci(e-a,i):t}function B0(t,e,i){t=kt(t),e=pt(e);var a=e?Pn(t):0;return e&&a<e?ci(e-a,i)+t:t}function U0(t,e,i){return i||e==null?e=0:e&&(e=+e),Hp(kt(t).replace(so,""),e||0)}function D0(t,e,i){return(i?ne(t,e,i):e===n)?e=1:e=pt(e),Mo(kt(t),e)}function P0(){var t=arguments,e=kt(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var F0=zn(function(t,e,i){return t+(i?"_":"")+e.toLowerCase()});function M0(t,e,i){return i&&typeof i!="number"&&ne(t,e,i)&&(e=i=n),i=i===n?ue:i>>>0,i?(t=kt(t),t&&(typeof e=="string"||e!=null&&!cs(e))&&(e=pe(e),!e&&Dn(t))?fn(Te(t),0,i):t.split(e,i)):[]}var q0=zn(function(t,e,i){return t+(i?" ":"")+hs(e)});function W0(t,e,i){return t=kt(t),i=i==null?0:_n(pt(i),0,t.length),e=pe(e),t.slice(i,i+e.length)==e}function H0(t,e,i){var a=y.templateSettings;i&&ne(t,e,i)&&(e=n),t=kt(t),e=wi({},e,a,jc);var h=wi({},e.imports,a.imports,jc),m=Kt(h),C=Co(h,m),S,E,M=0,q=e.interpolate||Lr,W="__p += '",J=ko((e.escape||Lr).source+"|"+q.source+"|"+(q===ya?bl:Lr).source+"|"+(e.evaluate||Lr).source+"|$","g"),tt="//# sourceURL="+(Et.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vl+"]")+`
16
- `;t.replace(J,function(st,vt,wt,ge,re,ye){return wt||(wt=ge),W+=t.slice(M,ye).replace(Tl,vp),vt&&(S=!0,W+=`' +
17
- __e(`+vt+`) +
18
- '`),re&&(E=!0,W+=`';
19
- `+re+`;
20
- __p += '`),wt&&(W+=`' +
21
- ((__t = (`+wt+`)) == null ? '' : __t) +
22
- '`),M=ye+st.length,st}),W+=`';
23
- `;var ot=Et.call(e,"variable")&&e.variable;if(!ot)W=`with (obj) {
24
- `+W+`
25
- }
26
- `;else if(_l.test(ot))throw new ft(d);W=(E?W.replace(rl,""):W).replace(il,"$1").replace(ol,"$1;"),W="function("+(ot||"obj")+`) {
27
- `+(ot?"":`obj || (obj = {});
28
- `)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(E?`, __j = Array.prototype.join;
29
- function print() { __p += __j.call(arguments, '') }
30
- `:`;
31
- `)+W+`return __p
32
- }`;var dt=qu(function(){return Ct(m,tt+"return "+W).apply(n,C)});if(dt.source=W,as(dt))throw dt;return dt}function K0(t){return kt(t).toLowerCase()}function z0(t){return kt(t).toUpperCase()}function G0(t,e,i){if(t=kt(t),t&&(i||e===n))return Ja(t);if(!t||!(e=pe(e)))return t;var a=Te(t),h=Te(e),m=Ya(a,h),C=Va(a,h)+1;return fn(a,m,C).join("")}function X0(t,e,i){if(t=kt(t),t&&(i||e===n))return t.slice(0,Qa(t)+1);if(!t||!(e=pe(e)))return t;var a=Te(t),h=Va(a,Te(e))+1;return fn(a,0,h).join("")}function $0(t,e,i){if(t=kt(t),t&&(i||e===n))return t.replace(so,"");if(!t||!(e=pe(e)))return t;var a=Te(t),h=Ya(a,Te(e));return fn(a,h).join("")}function j0(t,e){var i=L,a=H;if(Lt(e)){var h="separator"in e?e.separator:h;i="length"in e?pt(e.length):i,a="omission"in e?pe(e.omission):a}t=kt(t);var m=t.length;if(Dn(t)){var C=Te(t);m=C.length}if(i>=m)return t;var S=i-Pn(a);if(S<1)return a;var E=C?fn(C,0,S).join(""):t.slice(0,S);if(h===n)return E+a;if(C&&(S+=E.length-S),cs(h)){if(t.slice(S).search(h)){var M,q=E;for(h.global||(h=ko(h.source,kt(va.exec(h))+"g")),h.lastIndex=0;M=h.exec(q);)var W=M.index;E=E.slice(0,W===n?S:W)}}else if(t.indexOf(pe(h),S)!=S){var J=E.lastIndexOf(h);J>-1&&(E=E.slice(0,J))}return E+a}function J0(t){return t=kt(t),t&&sl.test(t)?t.replace(da,kp):t}var Y0=zn(function(t,e,i){return t+(i?" ":"")+e.toUpperCase()}),hs=Wc("toUpperCase");function Mu(t,e,i){return t=kt(t),e=i?n:e,e===n?_p(t)?Ep(t):fp(t):t.match(e)||[]}var qu=gt(function(t,e){try{return he(t,n,e)}catch(i){return as(i)?i:new ft(i)}}),V0=Xe(function(t,e){return _e(e,function(i){i=Fe(i),ze(t,i,os(t[i],t))}),t});function Z0(t){var e=t==null?0:t.length,i=it();return t=e?Nt(t,function(a){if(typeof a[1]!="function")throw new we(v);return[i(a[0]),a[1]]}):[],gt(function(a){for(var h=-1;++h<e;){var m=t[h];if(he(m[0],this,a))return he(m[1],this,a)}})}function Q0(t){return kd(Ce(t,g))}function ls(t){return function(){return t}}function tm(t,e){return t==null||t!==t?e:t}var em=Kc(),nm=Kc(!0);function ce(t){return t}function ps(t){return _c(typeof t=="function"?t:Ce(t,g))}function rm(t){return bc(Ce(t,g))}function im(t,e){return Cc(t,Ce(e,g))}var om=gt(function(t,e){return function(i){return lr(i,t,e)}}),sm=gt(function(t,e){return function(i){return lr(t,i,e)}});function ds(t,e,i){var a=Kt(e),h=ei(e,a);i==null&&!(Lt(e)&&(h.length||!a.length))&&(i=e,e=t,t=this,h=ei(e,Kt(e)));var m=!(Lt(i)&&"chain"in i)||!!i.chain,C=je(t);return _e(h,function(S){var E=e[S];t[S]=E,C&&(t.prototype[S]=function(){var M=this.__chain__;if(m||M){var q=t(this.__wrapped__),W=q.__actions__=oe(this.__actions__);return W.push({func:E,args:arguments,thisArg:t}),q.__chain__=M,q}return E.apply(t,rn([this.value()],arguments))})}),t}function am(){return Xt._===this&&(Xt._=Lp),this}function gs(){}function cm(t){return t=pt(t),gt(function(e){return Sc(e,t)})}var um=Xo(Nt),fm=Xo(za),hm=Xo(vo);function Wu(t){return Qo(t)?mo(Fe(t)):Wd(t)}function lm(t){return function(e){return t==null?n:wn(t,e)}}var pm=Gc(),dm=Gc(!0);function ys(){return[]}function vs(){return!1}function gm(){return{}}function ym(){return""}function vm(){return!0}function mm(t,e){if(t=pt(t),t<1||t>ut)return[];var i=ue,a=Vt(t,ue);e=it(e),t-=ue;for(var h=bo(a,e);++i<t;)e(i);return h}function _m(t){return ht(t)?Nt(t,Fe):de(t)?[t]:oe(au(kt(t)))}function wm(t){var e=++Op;return kt(t)+e}var bm=ai(function(t,e){return t+e},0),Cm=$o("ceil"),Sm=ai(function(t,e){return t/e},1),km=$o("floor");function Am(t){return t&&t.length?ti(t,ce,No):n}function xm(t,e){return t&&t.length?ti(t,it(e,2),No):n}function Em(t){return $a(t,ce)}function Tm(t,e){return $a(t,it(e,2))}function Rm(t){return t&&t.length?ti(t,ce,Do):n}function Im(t,e){return t&&t.length?ti(t,it(e,2),Do):n}var Om=ai(function(t,e){return t*e},1),Nm=$o("round"),Lm=ai(function(t,e){return t-e},0);function Bm(t){return t&&t.length?wo(t,ce):0}function Um(t,e){return t&&t.length?wo(t,it(e,2)):0}return y.after=rv,y.ary=mu,y.assign=zv,y.assignIn=Nu,y.assignInWith=wi,y.assignWith=Gv,y.at=Xv,y.before=_u,y.bind=os,y.bindAll=V0,y.bindKey=wu,y.castArray=gv,y.chain=gu,y.chunk=kg,y.compact=Ag,y.concat=xg,y.cond=Z0,y.conforms=Q0,y.constant=ls,y.countBy=By,y.create=$v,y.curry=bu,y.curryRight=Cu,y.debounce=Su,y.defaults=jv,y.defaultsDeep=Jv,y.defer=iv,y.delay=ov,y.difference=Eg,y.differenceBy=Tg,y.differenceWith=Rg,y.drop=Ig,y.dropRight=Og,y.dropRightWhile=Ng,y.dropWhile=Lg,y.fill=Bg,y.filter=Dy,y.flatMap=My,y.flatMapDeep=qy,y.flatMapDepth=Wy,y.flatten=hu,y.flattenDeep=Ug,y.flattenDepth=Dg,y.flip=sv,y.flow=em,y.flowRight=nm,y.fromPairs=Pg,y.functions=n0,y.functionsIn=r0,y.groupBy=Hy,y.initial=Mg,y.intersection=qg,y.intersectionBy=Wg,y.intersectionWith=Hg,y.invert=o0,y.invertBy=s0,y.invokeMap=zy,y.iteratee=ps,y.keyBy=Gy,y.keys=Kt,y.keysIn=ae,y.map=di,y.mapKeys=c0,y.mapValues=u0,y.matches=rm,y.matchesProperty=im,y.memoize=yi,y.merge=f0,y.mergeWith=Lu,y.method=om,y.methodOf=sm,y.mixin=ds,y.negate=vi,y.nthArg=cm,y.omit=h0,y.omitBy=l0,y.once=av,y.orderBy=Xy,y.over=um,y.overArgs=cv,y.overEvery=fm,y.overSome=hm,y.partial=ss,y.partialRight=ku,y.partition=$y,y.pick=p0,y.pickBy=Bu,y.property=Wu,y.propertyOf=lm,y.pull=Xg,y.pullAll=pu,y.pullAllBy=$g,y.pullAllWith=jg,y.pullAt=Jg,y.range=pm,y.rangeRight=dm,y.rearg=uv,y.reject=Yy,y.remove=Yg,y.rest=fv,y.reverse=rs,y.sampleSize=Zy,y.set=g0,y.setWith=y0,y.shuffle=Qy,y.slice=Vg,y.sortBy=nv,y.sortedUniq=iy,y.sortedUniqBy=oy,y.split=M0,y.spread=hv,y.tail=sy,y.take=ay,y.takeRight=cy,y.takeRightWhile=uy,y.takeWhile=fy,y.tap=Ay,y.throttle=lv,y.thru=pi,y.toArray=Ru,y.toPairs=Uu,y.toPairsIn=Du,y.toPath=_m,y.toPlainObject=Ou,y.transform=v0,y.unary=pv,y.union=hy,y.unionBy=ly,y.unionWith=py,y.uniq=dy,y.uniqBy=gy,y.uniqWith=yy,y.unset=m0,y.unzip=is,y.unzipWith=du,y.update=_0,y.updateWith=w0,y.values=$n,y.valuesIn=b0,y.without=vy,y.words=Mu,y.wrap=dv,y.xor=my,y.xorBy=_y,y.xorWith=wy,y.zip=by,y.zipObject=Cy,y.zipObjectDeep=Sy,y.zipWith=ky,y.entries=Uu,y.entriesIn=Du,y.extend=Nu,y.extendWith=wi,ds(y,y),y.add=bm,y.attempt=qu,y.camelCase=A0,y.capitalize=Pu,y.ceil=Cm,y.clamp=C0,y.clone=yv,y.cloneDeep=mv,y.cloneDeepWith=_v,y.cloneWith=vv,y.conformsTo=wv,y.deburr=Fu,y.defaultTo=tm,y.divide=Sm,y.endsWith=x0,y.eq=Ie,y.escape=E0,y.escapeRegExp=T0,y.every=Uy,y.find=Py,y.findIndex=uu,y.findKey=Yv,y.findLast=Fy,y.findLastIndex=fu,y.findLastKey=Vv,y.floor=km,y.forEach=yu,y.forEachRight=vu,y.forIn=Zv,y.forInRight=Qv,y.forOwn=t0,y.forOwnRight=e0,y.get=us,y.gt=bv,y.gte=Cv,y.has=i0,y.hasIn=fs,y.head=lu,y.identity=ce,y.includes=Ky,y.indexOf=Fg,y.inRange=S0,y.invoke=a0,y.isArguments=Sn,y.isArray=ht,y.isArrayBuffer=Sv,y.isArrayLike=se,y.isArrayLikeObject=Pt,y.isBoolean=kv,y.isBuffer=hn,y.isDate=Av,y.isElement=xv,y.isEmpty=Ev,y.isEqual=Tv,y.isEqualWith=Rv,y.isError=as,y.isFinite=Iv,y.isFunction=je,y.isInteger=Au,y.isLength=mi,y.isMap=xu,y.isMatch=Ov,y.isMatchWith=Nv,y.isNaN=Lv,y.isNative=Bv,y.isNil=Dv,y.isNull=Uv,y.isNumber=Eu,y.isObject=Lt,y.isObjectLike=Ut,y.isPlainObject=mr,y.isRegExp=cs,y.isSafeInteger=Pv,y.isSet=Tu,y.isString=_i,y.isSymbol=de,y.isTypedArray=Xn,y.isUndefined=Fv,y.isWeakMap=Mv,y.isWeakSet=qv,y.join=Kg,y.kebabCase=R0,y.last=ke,y.lastIndexOf=zg,y.lowerCase=I0,y.lowerFirst=O0,y.lt=Wv,y.lte=Hv,y.max=Am,y.maxBy=xm,y.mean=Em,y.meanBy=Tm,y.min=Rm,y.minBy=Im,y.stubArray=ys,y.stubFalse=vs,y.stubObject=gm,y.stubString=ym,y.stubTrue=vm,y.multiply=Om,y.nth=Gg,y.noConflict=am,y.noop=gs,y.now=gi,y.pad=N0,y.padEnd=L0,y.padStart=B0,y.parseInt=U0,y.random=k0,y.reduce=jy,y.reduceRight=Jy,y.repeat=D0,y.replace=P0,y.result=d0,y.round=Nm,y.runInContext=x,y.sample=Vy,y.size=tv,y.snakeCase=F0,y.some=ev,y.sortedIndex=Zg,y.sortedIndexBy=Qg,y.sortedIndexOf=ty,y.sortedLastIndex=ey,y.sortedLastIndexBy=ny,y.sortedLastIndexOf=ry,y.startCase=q0,y.startsWith=W0,y.subtract=Lm,y.sum=Bm,y.sumBy=Um,y.template=H0,y.times=mm,y.toFinite=Je,y.toInteger=pt,y.toLength=Iu,y.toLower=K0,y.toNumber=Ae,y.toSafeInteger=Kv,y.toString=kt,y.toUpper=z0,y.trim=G0,y.trimEnd=X0,y.trimStart=$0,y.truncate=j0,y.unescape=J0,y.uniqueId=wm,y.upperCase=Y0,y.upperFirst=hs,y.each=yu,y.eachRight=vu,y.first=lu,ds(y,function(){var t={};return De(y,function(e,i){Et.call(y.prototype,i)||(t[i]=e)}),t}(),{chain:!1}),y.VERSION=s,_e(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){y[t].placeholder=y}),_e(["drop","take"],function(t,e){mt.prototype[t]=function(i){i=i===n?1:Ht(pt(i),0);var a=this.__filtered__&&!e?new mt(this):this.clone();return a.__filtered__?a.__takeCount__=Vt(i,a.__takeCount__):a.__views__.push({size:Vt(i,ue),type:t+(a.__dir__<0?"Right":"")}),a},mt.prototype[t+"Right"]=function(i){return this.reverse()[t](i).reverse()}}),_e(["filter","map","takeWhile"],function(t,e){var i=e+1,a=i==F||i==ct;mt.prototype[t]=function(h){var m=this.clone();return m.__iteratees__.push({iteratee:it(h,3),type:i}),m.__filtered__=m.__filtered__||a,m}}),_e(["head","last"],function(t,e){var i="take"+(e?"Right":"");mt.prototype[t]=function(){return this[i](1).value()[0]}}),_e(["initial","tail"],function(t,e){var i="drop"+(e?"":"Right");mt.prototype[t]=function(){return this.__filtered__?new mt(this):this[i](1)}}),mt.prototype.compact=function(){return this.filter(ce)},mt.prototype.find=function(t){return this.filter(t).head()},mt.prototype.findLast=function(t){return this.reverse().find(t)},mt.prototype.invokeMap=gt(function(t,e){return typeof t=="function"?new mt(this):this.map(function(i){return lr(i,t,e)})}),mt.prototype.reject=function(t){return this.filter(vi(it(t)))},mt.prototype.slice=function(t,e){t=pt(t);var i=this;return i.__filtered__&&(t>0||e<0)?new mt(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==n&&(e=pt(e),i=e<0?i.dropRight(-e):i.take(e-t)),i)},mt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},mt.prototype.toArray=function(){return this.take(ue)},De(mt.prototype,function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),a=/^(?:head|last)$/.test(e),h=y[a?"take"+(e=="last"?"Right":""):e],m=a||/^find/.test(e);h&&(y.prototype[e]=function(){var C=this.__wrapped__,S=a?[1]:arguments,E=C instanceof mt,M=S[0],q=E||ht(C),W=function(vt){var wt=h.apply(y,rn([vt],S));return a&&J?wt[0]:wt};q&&i&&typeof M=="function"&&M.length!=1&&(E=q=!1);var J=this.__chain__,tt=!!this.__actions__.length,ot=m&&!J,dt=E&&!tt;if(!m&&q){C=dt?C:new mt(this);var st=t.apply(C,S);return st.__actions__.push({func:pi,args:[W],thisArg:n}),new be(st,J)}return ot&&dt?t.apply(this,S):(st=this.thru(W),ot?a?st.value()[0]:st.value():st)})}),_e(["pop","push","shift","sort","splice","unshift"],function(t){var e=Mr[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",a=/^(?:pop|shift)$/.test(t);y.prototype[t]=function(){var h=arguments;if(a&&!this.__chain__){var m=this.value();return e.apply(ht(m)?m:[],h)}return this[i](function(C){return e.apply(ht(C)?C:[],h)})}}),De(mt.prototype,function(t,e){var i=y[e];if(i){var a=i.name+"";Et.call(Wn,a)||(Wn[a]=[]),Wn[a].push({name:e,func:i})}}),Wn[si(n,B).name]=[{name:"wrapper",func:n}],mt.prototype.clone=Jp,mt.prototype.reverse=Yp,mt.prototype.value=Vp,y.prototype.at=xy,y.prototype.chain=Ey,y.prototype.commit=Ty,y.prototype.next=Ry,y.prototype.plant=Oy,y.prototype.reverse=Ny,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=Ly,y.prototype.first=y.prototype.head,or&&(y.prototype[or]=Iy),y},Fn=Tp();gn?((gn.exports=Fn)._=Fn,lo._=Fn):Xt._=Fn}).call(zt)}(_r,_r.exports);var Ju=_r.exports;const Yu={isNewStack:!1,forceNew:!0,reconnectionDelay:1e4,reconnectionDelayMax:1e4,maxReconnectAttempts:5,timeout:1e4,keepAliveTimeout:6e4,idleInterval:6e4*5,protocol:"https",transports:["websocket"],upgrade:!1,serverFetchStrategy:"static",serverType:0,useLogger:!0,loggerServer:"http://socketlog.voicenter.co",loggerConfig:{logToConsole:!0,overloadGlobalConsole:!1,system:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function Vu(){return function r(o,n,s){function c(d,b){if(!n[d]){if(!o[d]){var p=typeof require=="function"&&require;if(!b&&p)return p(d,!0);if(f)return f(d,!0);throw new Error("Cannot find module '"+d+"'")}var _=n[d]={exports:{}};o[d][0].call(_.exports,function(g){var l=o[d][1][g];return c(l||g)},_,_.exports,r,o,n,s)}return n[d].exports}for(var f=typeof require=="function"&&require,v=0;v<s.length;v++)c(s[v]);return c}({1:[function(r,o){o.exports=r("./lib/")},{"./lib/":2}],2:[function(r,o,n){function s(p,_){typeof p=="object"&&(_=p,p=void 0),_=_||{};var g,l=c(p),u=l.source,w=l.id;return _.forceNew||_["force new connection"]||_.multiplex===!1?(d("ignoring socket cache for %s",u),g=v(u,_)):(b[w]||(d("new io instance for %s",u),b[w]=v(u,_)),g=b[w]),g.socket(l.path)}var c=r("./url"),f=r("socket.io-parser"),v=r("./manager"),d=r("debug")("socket.io-client");o.exports=n=s;var b=n.managers={};n.protocol=f.protocol,n.connect=s,n.Manager=r("./manager"),n.Socket=r("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(r,o){function n(l,u){return this instanceof n?(l&&typeof l=="object"&&(u=l,l=void 0),u=u||{},u.path=u.path||"/socket.io",this.nsps={},this.subs=[],this.opts=u,this.reconnection(u.reconnection!==!1),this.reconnectionAttempts(u.reconnectionAttempts||1/0),this.reconnectionDelay(u.reconnectionDelay||1e3),this.reconnectionDelayMax(u.reconnectionDelayMax||5e3),this.randomizationFactor(u.randomizationFactor||.5),this.backoff=new g({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(u.timeout==null?2e4:u.timeout),this.readyState="closed",this.uri=l,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new v.Encoder,this.decoder=new v.Decoder,this.autoConnect=u.autoConnect!==!1,void(this.autoConnect&&this.open())):new n(l,u)}var s=(r("./url"),r("engine.io-client")),c=r("./socket"),f=r("component-emitter"),v=r("socket.io-parser"),d=r("./on"),b=r("component-bind"),p=(r("object-component"),r("debug")("socket.io-client:manager")),_=r("indexof"),g=r("backo2");o.exports=n,n.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var l in this.nsps)this.nsps[l].emit.apply(this.nsps[l],arguments)},n.prototype.updateSocketIds=function(){for(var l in this.nsps)this.nsps[l].id=this.engine.id},f(n.prototype),n.prototype.reconnection=function(l){return arguments.length?(this._reconnection=!!l,this):this._reconnection},n.prototype.reconnectionAttempts=function(l){return arguments.length?(this._reconnectionAttempts=l,this):this._reconnectionAttempts},n.prototype.reconnectionDelay=function(l){return arguments.length?(this._reconnectionDelay=l,this.backoff&&this.backoff.setMin(l),this):this._reconnectionDelay},n.prototype.randomizationFactor=function(l){return arguments.length?(this._randomizationFactor=l,this.backoff&&this.backoff.setJitter(l),this):this._randomizationFactor},n.prototype.reconnectionDelayMax=function(l){return arguments.length?(this._reconnectionDelayMax=l,this.backoff&&this.backoff.setMax(l),this):this._reconnectionDelayMax},n.prototype.timeout=function(l){return arguments.length?(this._timeout=l,this):this._timeout},n.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},n.prototype.open=n.prototype.connect=function(l){if(p("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;p("opening %s",this.uri),this.engine=s(this.uri,this.opts);var u=this.engine,w=this;this.readyState="opening",this.skipReconnect=!1;var A=d(u,"open",function(){w.onopen(),l&&l()}),k=d(u,"error",function(j){if(p("connect_error"),w.cleanup(),w.readyState="closed",w.emitAll("connect_error",j),l){var N=new Error("Connection error");N.data=j,l(N)}else w.maybeReconnectOnOpen()});if(this._timeout!==!1){var B=this._timeout;p("connect attempt will timeout after %d",B);var Y=setTimeout(function(){p("connect attempt timed out after %d",B),A.destroy(),u.close(),u.emit("error","timeout"),w.emitAll("connect_timeout",B)},B);this.subs.push({destroy:function(){clearTimeout(Y)}})}return this.subs.push(A),this.subs.push(k),this},n.prototype.onopen=function(){p("open"),this.cleanup(),this.readyState="open",this.emit("open");var l=this.engine;this.subs.push(d(l,"data",b(this,"ondata"))),this.subs.push(d(this.decoder,"decoded",b(this,"ondecoded"))),this.subs.push(d(l,"error",b(this,"onerror"))),this.subs.push(d(l,"close",b(this,"onclose")))},n.prototype.ondata=function(l){this.decoder.add(l)},n.prototype.ondecoded=function(l){this.emit("packet",l)},n.prototype.onerror=function(l){p("error",l),this.emitAll("error",l)},n.prototype.socket=function(l){var u=this.nsps[l];if(!u){u=new c(this,l),this.nsps[l]=u;var w=this;u.on("connect",function(){u.id=w.engine.id,~_(w.connected,u)||w.connected.push(u)})}return u},n.prototype.destroy=function(l){var u=_(this.connected,l);~u&&this.connected.splice(u,1),this.connected.length||this.close()},n.prototype.packet=function(l){p("writing packet %j",l);var u=this;u.encoding?u.packetBuffer.push(l):(u.encoding=!0,this.encoder.encode(l,function(w){for(var A=0;A<w.length;A++)u.engine.write(w[A]);u.encoding=!1,u.processPacketQueue()}))},n.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var l=this.packetBuffer.shift();this.packet(l)}},n.prototype.cleanup=function(){for(var l;l=this.subs.shift();)l.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},n.prototype.close=n.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},n.prototype.onclose=function(l){p("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",l),this._reconnection&&!this.skipReconnect&&this.reconnect()},n.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var l=this;if(this.backoff.attempts>=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var u=this.backoff.duration();p("will wait %dms before reconnect attempt",u),this.reconnecting=!0;var w=setTimeout(function(){l.skipReconnect||(p("attempting reconnect"),l.emitAll("reconnect_attempt",l.backoff.attempts),l.emitAll("reconnecting",l.backoff.attempts),l.skipReconnect||l.open(function(A){A?(p("reconnect attempt error"),l.reconnecting=!1,l.reconnect(),l.emitAll("reconnect_error",A.data)):(p("reconnect success"),l.onreconnect())}))},u);this.subs.push({destroy:function(){clearTimeout(w)}})}},n.prototype.onreconnect=function(){var l=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",l)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(r,o){function n(s,c,f){return s.on(c,f),{destroy:function(){s.removeListener(c,f)}}}o.exports=n},{}],5:[function(r,o,n){function s(u,w){this.io=u,this.nsp=w,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var c=r("socket.io-parser"),f=r("component-emitter"),v=r("to-array"),d=r("./on"),b=r("component-bind"),p=r("debug")("socket.io-client:socket"),_=r("has-binary");o.exports=s;var g={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},l=f.prototype.emit;f(s.prototype),s.prototype.subEvents=function(){if(!this.subs){var u=this.io;this.subs=[d(u,"open",b(this,"onopen")),d(u,"packet",b(this,"onpacket")),d(u,"close",b(this,"onclose"))]}},s.prototype.open=s.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},s.prototype.send=function(){var u=v(arguments);return u.unshift("message"),this.emit.apply(this,u),this},s.prototype.emit=function(u){if(g.hasOwnProperty(u))return l.apply(this,arguments),this;var w=v(arguments),A=c.EVENT;_(w)&&(A=c.BINARY_EVENT);var k={type:A,data:w};return typeof w[w.length-1]=="function"&&(p("emitting packet with ack id %d",this.ids),this.acks[this.ids]=w.pop(),k.id=this.ids++),this.connected?this.packet(k):this.sendBuffer.push(k),this},s.prototype.packet=function(u){u.nsp=this.nsp,this.io.packet(u)},s.prototype.onopen=function(){p("transport is open - connecting"),this.nsp!="/"&&this.packet({type:c.CONNECT})},s.prototype.onclose=function(u){p("close (%s)",u),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",u)},s.prototype.onpacket=function(u){if(u.nsp==this.nsp)switch(u.type){case c.CONNECT:this.onconnect();break;case c.EVENT:this.onevent(u);break;case c.BINARY_EVENT:this.onevent(u);break;case c.ACK:this.onack(u);break;case c.BINARY_ACK:this.onack(u);break;case c.DISCONNECT:this.ondisconnect();break;case c.ERROR:this.emit("error",u.data)}},s.prototype.onevent=function(u){var w=u.data||[];p("emitting event %j",w),u.id!=null&&(p("attaching ack callback to event"),w.push(this.ack(u.id))),this.connected?l.apply(this,w):this.receiveBuffer.push(w)},s.prototype.ack=function(u){var w=this,A=!1;return function(){if(!A){A=!0;var k=v(arguments);p("sending ack %j",k);var B=_(k)?c.BINARY_ACK:c.ACK;w.packet({type:B,id:u,data:k})}}},s.prototype.onack=function(u){p("calling ack %s with %j",u.id,u.data);var w=this.acks[u.id];w.apply(this,u.data),delete this.acks[u.id]},s.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},s.prototype.emitBuffered=function(){var u;for(u=0;u<this.receiveBuffer.length;u++)l.apply(this,this.receiveBuffer[u]);for(this.receiveBuffer=[],u=0;u<this.sendBuffer.length;u++)this.packet(this.sendBuffer[u]);this.sendBuffer=[]},s.prototype.ondisconnect=function(){p("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},s.prototype.destroy=function(){if(this.subs){for(var u=0;u<this.subs.length;u++)this.subs[u].destroy();this.subs=null}this.io.destroy(this)},s.prototype.close=s.prototype.disconnect=function(){return this.connected&&(p("performing disconnect (%s)",this.nsp),this.packet({type:c.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{"./on":4,"component-bind":8,"component-emitter":9,debug:10,"has-binary":36,"socket.io-parser":44,"to-array":48}],6:[function(r,o){(function(n){function s(v,p){var b=v,p=p||n.location;return v==null&&(v=p.protocol+"//"+p.host),typeof v=="string"&&(v.charAt(0)=="/"&&(v=v.charAt(1)=="/"?p.protocol+v:p.hostname+v),/^(https?|wss?):\/\//.test(v)||(f("protocol-less url %s",v),v=typeof p<"u"?p.protocol+"//"+v:"https://"+v),f("parse %s",v),b=c(v)),b.port||(/^(http|ws)$/.test(b.protocol)?b.port="80":/^(http|ws)s$/.test(b.protocol)&&(b.port="443")),b.path=b.path||"/",b.id=b.protocol+"://"+b.host+":"+b.port,b.href=b.protocol+"://"+b.host+(p&&p.port==b.port?"":":"+b.port),b}var c=r("parseuri"),f=r("debug")("socket.io-client:url");o.exports=s}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(r,o){function n(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}o.exports=n,n.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var c=Math.random(),f=Math.floor(c*this.jitter*s);s=1&Math.floor(10*c)?s+f:s-f}return 0|Math.min(s,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(s){this.ms=s},n.prototype.setMax=function(s){this.max=s},n.prototype.setJitter=function(s){this.jitter=s}},{}],8:[function(r,o){var n=[].slice;o.exports=function(s,c){if(typeof c=="string"&&(c=s[c]),typeof c!="function")throw new Error("bind() requires a function");var f=n.call(arguments,2);return function(){return c.apply(s,f.concat(n.call(arguments)))}}},{}],9:[function(r,o){function n(c){return c?s(c):void 0}function s(c){for(var f in n.prototype)c[f]=n.prototype[f];return c}o.exports=n,n.prototype.on=n.prototype.addEventListener=function(c,f){return this._callbacks=this._callbacks||{},(this._callbacks[c]=this._callbacks[c]||[]).push(f),this},n.prototype.once=function(c,f){function v(){d.off(c,v),f.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},v.fn=f,this.on(c,v),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(c,f){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var v=this._callbacks[c];if(!v)return this;if(arguments.length==1)return delete this._callbacks[c],this;for(var d,b=0;b<v.length;b++)if(d=v[b],d===f||d.fn===f){v.splice(b,1);break}return this},n.prototype.emit=function(c){this._callbacks=this._callbacks||{};var f=[].slice.call(arguments,1),v=this._callbacks[c];if(v){v=v.slice(0);for(var d=0,b=v.length;b>d;++d)v[d].apply(this,f)}return this},n.prototype.listeners=function(c){return this._callbacks=this._callbacks||{},this._callbacks[c]||[]},n.prototype.hasListeners=function(c){return!!this.listeners(c).length}},{}],10:[function(r,o){function n(c){return n.enabled(c)?function(f){f=s(f);var v=new Date,d=v-(n[c]||v);n[c]=v,f=c+" "+f+" +"+n.humanize(d),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function s(c){return c instanceof Error?c.stack||c.message:c}o.exports=n,n.names=[],n.skips=[],n.enable=function(c){try{localStorage.debug=c}catch{}for(var f=(c||"").split(/[\s,]+/),v=f.length,d=0;v>d;d++)c=f[d].replace("*",".*?"),c[0]==="-"?n.skips.push(new RegExp("^"+c.substr(1)+"$")):n.names.push(new RegExp("^"+c+"$"))},n.disable=function(){n.enable("")},n.humanize=function(c){var f=1e3,v=6e4,d=60*v;return c>=d?(c/d).toFixed(1)+"h":c>=v?(c/v).toFixed(1)+"m":c>=f?(c/f|0)+"s":c+"ms"},n.enabled=function(c){for(var f=0,v=n.skips.length;v>f;f++)if(n.skips[f].test(c))return!1;for(var f=0,v=n.names.length;v>f;f++)if(n.names[f].test(c))return!0;return!1};try{window.localStorage&&n.enable(localStorage.debug)}catch{}},{}],11:[function(r,o){o.exports=r("./lib/")},{"./lib/":12}],12:[function(r,o){o.exports=r("./socket"),o.exports.parser=r("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(r,o){(function(n){function s(u,w){if(!(this instanceof s))return new s(u,w);if(w=w||{},u&&typeof u=="object"&&(w=u,u=null),u&&(u=_(u),w.host=u.host,w.secure=u.protocol=="https"||u.protocol=="wss",w.port=u.port,u.query&&(w.query=u.query)),this.secure=w.secure!=null?w.secure:n.location&&location.protocol=="https:",w.host){var A=w.host.split(":");w.hostname=A.shift(),A.length?w.port=A.pop():w.port||(w.port=this.secure?"443":"80")}this.agent=w.agent||!1,this.hostname=w.hostname||(n.location?location.hostname:"localhost"),this.port=w.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=w.query||{},typeof this.query=="string"&&(this.query=l.decode(this.query)),this.upgrade=w.upgrade!==!1,this.path=(w.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!w.forceJSONP,this.jsonp=w.jsonp!==!1,this.forceBase64=!!w.forceBase64,this.enablesXDR=!!w.enablesXDR,this.timestampParam=w.timestampParam||"t",this.timestampRequests=w.timestampRequests,this.transports=w.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=w.policyPort||843,this.rememberUpgrade=w.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=w.onlyBinaryUpgrades,this.pfx=w.pfx||null,this.key=w.key||null,this.passphrase=w.passphrase||null,this.cert=w.cert||null,this.ca=w.ca||null,this.ciphers=w.ciphers||null,this.rejectUnauthorized=w.rejectUnauthorized||null,this.open()}function c(u){var w={};for(var A in u)u.hasOwnProperty(A)&&(w[A]=u[A]);return w}var f=r("./transports"),v=r("component-emitter"),d=r("debug")("engine.io-client:socket"),b=r("indexof"),p=r("engine.io-parser"),_=r("parseuri"),g=r("parsejson"),l=r("parseqs");o.exports=s,s.priorWebsocketSuccess=!1,v(s.prototype),s.protocol=p.protocol,s.Socket=s,s.Transport=r("./transport"),s.transports=r("./transports"),s.parser=r("engine.io-parser"),s.prototype.createTransport=function(u){d('creating transport "%s"',u);var w=c(this.query);w.EIO=p.protocol,w.transport=u,this.id&&(w.sid=this.id);var A=new f[u]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:w,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return A},s.prototype.open=function(){var w;if(this.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)w="websocket";else{if(this.transports.length==0){var u=this;return void setTimeout(function(){u.emit("error","No transports available")},0)}w=this.transports[0]}this.readyState="opening";var w;try{w=this.createTransport(w)}catch{return this.transports.shift(),void this.open()}w.open(),this.setTransport(w)},s.prototype.setTransport=function(u){d("setting transport %s",u.name);var w=this;this.transport&&(d("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=u,u.on("drain",function(){w.onDrain()}).on("packet",function(A){w.onPacket(A)}).on("error",function(A){w.onError(A)}).on("close",function(){w.onClose("transport close")})},s.prototype.probe=function(u){function w(){if(O.onlyBinaryUpgrades){var P=!this.supportsBinary&&O.transport.supportsBinary;T=T||P}T||(d('probe transport "%s" opened',u),U.send([{type:"ping",data:"probe"}]),U.once("packet",function(R){if(!T)if(R.type=="pong"&&R.data=="probe"){if(d('probe transport "%s" pong',u),O.upgrading=!0,O.emit("upgrading",U),!U)return;s.priorWebsocketSuccess=U.name=="websocket",d('pausing current transport "%s"',O.transport.name),O.transport.pause(function(){T||O.readyState!="closed"&&(d("changing transport and sending upgrade packet"),N(),O.setTransport(U),U.send([{type:"upgrade"}]),O.emit("upgrade",U),U=null,O.upgrading=!1,O.flush())})}else{d('probe transport "%s" failed',u);var L=new Error("probe error");L.transport=U.name,O.emit("upgradeError",L)}}))}function A(){T||(T=!0,N(),U.close(),U=null)}function k(P){var R=new Error("probe error: "+P);R.transport=U.name,A(),d('probe transport "%s" failed because of error: %s',u,P),O.emit("upgradeError",R)}function B(){k("transport closed")}function Y(){k("socket closed")}function j(P){U&&P.name!=U.name&&(d('"%s" works - aborting "%s"',P.name,U.name),A())}function N(){U.removeListener("open",w),U.removeListener("error",k),U.removeListener("close",B),O.removeListener("close",Y),O.removeListener("upgrading",j)}d('probing transport "%s"',u);var U=this.createTransport(u,{probe:1}),T=!1,O=this;s.priorWebsocketSuccess=!1,U.once("open",w),U.once("error",k),U.once("close",B),this.once("close",Y),this.once("upgrading",j),U.open()},s.prototype.onOpen=function(){if(d("socket open"),this.readyState="open",s.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){d("starting upgrade probes");for(var u=0,w=this.upgrades.length;w>u;u++)this.probe(this.upgrades[u])}},s.prototype.onPacket=function(u){if(this.readyState=="opening"||this.readyState=="open")switch(d('socket receive: type "%s", data "%s"',u.type,u.data),this.emit("packet",u),this.emit("heartbeat"),u.type){case"open":this.onHandshake(g(u.data));break;case"pong":this.setPing();break;case"error":var w=new Error("server error");w.code=u.data,this.emit("error",w);break;case"message":this.emit("data",u.data),this.emit("message",u.data)}else d('packet received with socket readyState "%s"',this.readyState)},s.prototype.onHandshake=function(u){this.emit("handshake",u),this.id=u.sid,this.transport.query.sid=u.sid,this.upgrades=this.filterUpgrades(u.upgrades),this.pingInterval=u.pingInterval,this.pingTimeout=u.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},s.prototype.onHeartbeat=function(u){clearTimeout(this.pingTimeoutTimer);var w=this;w.pingTimeoutTimer=setTimeout(function(){w.readyState!="closed"&&w.onClose("ping timeout")},u||w.pingInterval+w.pingTimeout)},s.prototype.setPing=function(){var u=this;clearTimeout(u.pingIntervalTimer),u.pingIntervalTimer=setTimeout(function(){d("writing ping packet - expecting pong within %sms",u.pingTimeout),u.ping(),u.onHeartbeat(u.pingTimeout)},u.pingInterval)},s.prototype.ping=function(){this.sendPacket("ping")},s.prototype.onDrain=function(){for(var u=0;u<this.prevBufferLen;u++)this.callbackBuffer[u]&&this.callbackBuffer[u]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},s.prototype.flush=function(){this.readyState!="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(d("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},s.prototype.write=s.prototype.send=function(u,w){return this.sendPacket("message",u,w),this},s.prototype.sendPacket=function(u,w,A){if(this.readyState!="closing"&&this.readyState!="closed"){var k={type:u,data:w};this.emit("packetCreate",k),this.writeBuffer.push(k),this.callbackBuffer.push(A),this.flush()}},s.prototype.close=function(){function u(){k.onClose("forced close"),d("socket closing - telling transport to close"),k.transport.close()}function w(){k.removeListener("upgrade",w),k.removeListener("upgradeError",w),u()}function A(){k.once("upgrade",w),k.once("upgradeError",w)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var k=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?A():u()}):this.upgrading?A():u()}return this},s.prototype.onError=function(u){d("socket error %j",u),s.priorWebsocketSuccess=!1,this.emit("error",u),this.onClose("transport error",u)},s.prototype.onClose=function(u,w){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){d('socket close with reason: "%s"',u);var A=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){A.writeBuffer=[],A.callbackBuffer=[],A.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",u,w)}},s.prototype.filterUpgrades=function(u){for(var w=[],A=0,k=u.length;k>A;A++)~b(this.transports,u[A])&&w.push(u[A]);return w}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:40,parsejson:32,parseqs:33,parseuri:34}],14:[function(r,o){function n(f){this.path=f.path,this.hostname=f.hostname,this.port=f.port,this.secure=f.secure,this.query=f.query,this.timestampParam=f.timestampParam,this.timestampRequests=f.timestampRequests,this.readyState="",this.agent=f.agent||!1,this.socket=f.socket,this.enablesXDR=f.enablesXDR,this.pfx=f.pfx,this.key=f.key,this.passphrase=f.passphrase,this.cert=f.cert,this.ca=f.ca,this.ciphers=f.ciphers,this.rejectUnauthorized=f.rejectUnauthorized}var s=r("engine.io-parser"),c=r("component-emitter");o.exports=n,c(n.prototype),n.timestamps=0,n.prototype.onError=function(f,v){var d=new Error(f);return d.type="TransportError",d.description=v,this.emit("error",d),this},n.prototype.open=function(){return(this.readyState=="closed"||this.readyState=="")&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return(this.readyState=="opening"||this.readyState=="open")&&(this.doClose(),this.onClose()),this},n.prototype.send=function(f){if(this.readyState!="open")throw new Error("Transport not open");this.write(f)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(f){var v=s.decodePacket(f,this.socket.binaryType);this.onPacket(v)},n.prototype.onPacket=function(f){this.emit("packet",f)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(r,o,n){(function(s){function c(p){var _,g=!1,l=!1,u=p.jsonp!==!1;if(s.location){var w=location.protocol=="https:",A=location.port;A||(A=w?443:80),g=p.hostname!=location.hostname||A!=p.port,l=p.secure!=w}if(p.xdomain=g,p.xscheme=l,_=new f(p),"open"in _&&!p.forceJSONP)return new v(p);if(!u)throw new Error("JSONP disabled");return new d(p)}var f=r("xmlhttprequest"),v=r("./polling-xhr"),d=r("./polling-jsonp"),b=r("./websocket");n.polling=c,n.websocket=b}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(r,o){(function(n){function s(){}function c(_){f.call(this,_),this.query=this.query||{},d||(n.___eio||(n.___eio=[]),d=n.___eio),this.index=d.length;var g=this;d.push(function(l){g.onData(l)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){g.script&&(g.script.onerror=s)},!1)}var f=r("./polling"),v=r("component-inherit");o.exports=c;var d,b=/\n/g,p=/\\n/g;v(c,f),c.prototype.supportsBinary=!1,c.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),f.prototype.doClose.call(this)},c.prototype.doPoll=function(){var _=this,g=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),g.async=!0,g.src=this.uri(),g.onerror=function(w){_.onError("jsonp poll error",w)};var l=document.getElementsByTagName("script")[0];l.parentNode.insertBefore(g,l),this.script=g;var u=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);u&&setTimeout(function(){var w=document.createElement("iframe");document.body.appendChild(w),document.body.removeChild(w)},100)},c.prototype.doWrite=function(_,g){function l(){u(),g()}function u(){if(w.iframe)try{w.form.removeChild(w.iframe)}catch(N){w.onError("jsonp polling iframe removal error",N)}try{var j='<iframe src="javascript:0" name="'+w.iframeId+'">';A=document.createElement(j)}catch{A=document.createElement("iframe"),A.name=w.iframeId,A.src="javascript:0"}A.id=w.iframeId,w.form.appendChild(A),w.iframe=A}var w=this;if(!this.form){var A,k=document.createElement("form"),B=document.createElement("textarea"),Y=this.iframeId="eio_iframe_"+this.index;k.className="socketio",k.style.position="absolute",k.style.top="-1000px",k.style.left="-1000px",k.target=Y,k.method="POST",k.setAttribute("accept-charset","utf-8"),B.name="d",k.appendChild(B),document.body.appendChild(k),this.form=k,this.area=B}this.form.action=this.uri(),u(),_=_.replace(p,`\\
33
- `),this.area.value=_.replace(b,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){w.iframe.readyState=="complete"&&l()}:this.iframe.onload=l}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-inherit":21}],17:[function(r,o){(function(n){function s(){}function c(l){if(b.call(this,l),n.location){var u=location.protocol=="https:",w=location.port;w||(w=u?443:80),this.xd=l.hostname!=n.location.hostname||w!=l.port,this.xs=l.secure!=u}}function f(l){this.method=l.method||"GET",this.uri=l.uri,this.xd=!!l.xd,this.xs=!!l.xs,this.async=l.async!==!1,this.data=l.data!=null?l.data:null,this.agent=l.agent,this.isBinary=l.isBinary,this.supportsBinary=l.supportsBinary,this.enablesXDR=l.enablesXDR,this.pfx=l.pfx,this.key=l.key,this.passphrase=l.passphrase,this.cert=l.cert,this.ca=l.ca,this.ciphers=l.ciphers,this.rejectUnauthorized=l.rejectUnauthorized,this.create()}function v(){for(var l in f.requests)f.requests.hasOwnProperty(l)&&f.requests[l].abort()}var d=r("xmlhttprequest"),b=r("./polling"),p=r("component-emitter"),_=r("component-inherit"),g=r("debug")("engine.io-client:polling-xhr");o.exports=c,o.exports.Request=f,_(c,b),c.prototype.supportsBinary=!0,c.prototype.request=function(l){return l=l||{},l.uri=this.uri(),l.xd=this.xd,l.xs=this.xs,l.agent=this.agent||!1,l.supportsBinary=this.supportsBinary,l.enablesXDR=this.enablesXDR,l.pfx=this.pfx,l.key=this.key,l.passphrase=this.passphrase,l.cert=this.cert,l.ca=this.ca,l.ciphers=this.ciphers,l.rejectUnauthorized=this.rejectUnauthorized,new f(l)},c.prototype.doWrite=function(l,u){var w=typeof l!="string"&&l!==void 0,A=this.request({method:"POST",data:l,isBinary:w}),k=this;A.on("success",u),A.on("error",function(B){k.onError("xhr post error",B)}),this.sendXhr=A},c.prototype.doPoll=function(){g("xhr poll");var l=this.request(),u=this;l.on("data",function(w){u.onData(w)}),l.on("error",function(w){u.onError("xhr poll error",w)}),this.pollXhr=l},p(f.prototype),f.prototype.create=function(){var l={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};l.pfx=this.pfx,l.key=this.key,l.passphrase=this.passphrase,l.cert=this.cert,l.ca=this.ca,l.ciphers=this.ciphers,l.rejectUnauthorized=this.rejectUnauthorized;var u=this.xhr=new d(l),w=this;try{if(g("xhr open %s: %s",this.method,this.uri),u.open(this.method,this.uri,this.async),this.supportsBinary&&(u.responseType="arraybuffer"),this.method=="POST")try{this.isBinary?u.setRequestHeader("Content-type","application/octet-stream"):u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}"withCredentials"in u&&(u.withCredentials=!0),this.hasXDR()?(u.onload=function(){w.onLoad()},u.onerror=function(){w.onError(u.responseText)}):u.onreadystatechange=function(){u.readyState==4&&(u.status==200||u.status==1223?w.onLoad():setTimeout(function(){w.onError(u.status)},0))},g("xhr data %s",this.data),u.send(this.data)}catch(A){return void setTimeout(function(){w.onError(A)},0)}n.document&&(this.index=f.requestsCount++,f.requests[this.index]=this)},f.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},f.prototype.onData=function(l){this.emit("data",l),this.onSuccess()},f.prototype.onError=function(l){this.emit("error",l),this.cleanup(!0)},f.prototype.cleanup=function(l){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=s:this.xhr.onreadystatechange=s,l)try{this.xhr.abort()}catch{}n.document&&delete f.requests[this.index],this.xhr=null}},f.prototype.onLoad=function(){var l;try{var u;try{u=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch{}l=u==="application/octet-stream"?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(w){this.onError(w)}l!=null&&this.onData(l)},f.prototype.hasXDR=function(){return typeof n.XDomainRequest<"u"&&!this.xs&&this.enablesXDR},f.prototype.abort=function(){this.cleanup()},n.document&&(f.requestsCount=0,f.requests={},n.attachEvent?n.attachEvent("onunload",v):n.addEventListener&&n.addEventListener("beforeunload",v,!1))}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-emitter":9,"component-inherit":21,debug:22,xmlhttprequest:20}],18:[function(r,o){function n(p){var _=p&&p.forceBase64;(!b||_)&&(this.supportsBinary=!1),s.call(this,p)}var s=r("../transport"),c=r("parseqs"),f=r("engine.io-parser"),v=r("component-inherit"),d=r("debug")("engine.io-client:polling");o.exports=n;var b=function(){var p=r("xmlhttprequest"),_=new p({xdomain:!1});return _.responseType!=null}();v(n,s),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(p){function _(){d("paused"),g.readyState="paused",p()}var g=this;if(this.readyState="pausing",this.polling||!this.writable){var l=0;this.polling&&(d("we are currently polling - waiting to pause"),l++,this.once("pollComplete",function(){d("pre-pause polling complete"),--l||_()})),this.writable||(d("we are currently writing - waiting to pause"),l++,this.once("drain",function(){d("pre-pause writing complete"),--l||_()}))}else _()},n.prototype.poll=function(){d("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(p){var _=this;d("polling got data %s",p);var g=function(l){return _.readyState=="opening"&&_.onOpen(),l.type=="close"?(_.onClose(),!1):void _.onPacket(l)};f.decodePayload(p,this.socket.binaryType,g),this.readyState!="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState=="open"?this.poll():d('ignoring poll - transport state "%s"',this.readyState))},n.prototype.doClose=function(){function p(){d("writing close packet"),_.write([{type:"close"}])}var _=this;this.readyState=="open"?(d("transport open - closing"),p()):(d("transport not open - deferring close"),this.once("open",p))},n.prototype.write=function(p){var g=this;this.writable=!1;var _=function(){g.writable=!0,g.emit("drain")},g=this;f.encodePayload(p,this.supportsBinary,function(l){g.doWrite(l,_)})},n.prototype.uri=function(){var p=this.query||{},_=this.secure?"https":"http",g="";return this.timestampRequests!==!1&&(p[this.timestampParam]=+new Date+"-"+s.timestamps++),this.supportsBinary||p.sid||(p.b64=1),p=c.encode(p),this.port&&(_=="https"&&this.port!=443||_=="http"&&this.port!=80)&&(g=":"+this.port),p.length&&(p="?"+p),_+"://"+this.hostname+g+this.path+p}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(r,o){function n(p){var _=p&&p.forceBase64;_&&(this.supportsBinary=!1),s.call(this,p)}var s=r("../transport"),c=r("engine.io-parser"),f=r("parseqs"),v=r("component-inherit"),d=r("debug")("engine.io-client:websocket"),b=r("ws");o.exports=n,v(n,s),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var p=this.uri(),_=void 0,g={agent:this.agent};g.pfx=this.pfx,g.key=this.key,g.passphrase=this.passphrase,g.cert=this.cert,g.ca=this.ca,g.ciphers=this.ciphers,g.rejectUnauthorized=this.rejectUnauthorized,this.ws=new b(p,_,g),this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var p=this;this.ws.onopen=function(){p.onOpen()},this.ws.onclose=function(){p.onClose()},this.ws.onmessage=function(_){p.onData(_.data)},this.ws.onerror=function(_){p.onError("websocket error",_)}},typeof navigator<"u"&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(p){var _=this;setTimeout(function(){s.prototype.onData.call(_,p)},0)}),n.prototype.write=function(p){function _(){g.writable=!0,g.emit("drain")}var g=this;this.writable=!1;for(var l=0,u=p.length;u>l;l++)c.encodePacket(p[l],this.supportsBinary,function(w){try{g.ws.send(w)}catch{d("websocket closed before onclose event")}});setTimeout(_,0)},n.prototype.onClose=function(){s.prototype.onClose.call(this)},n.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},n.prototype.uri=function(){var p=this.query||{},_=this.secure?"wss":"ws",g="";return this.port&&(_=="wss"&&this.port!=443||_=="ws"&&this.port!=80)&&(g=":"+this.port),this.timestampRequests&&(p[this.timestampParam]=+new Date),this.supportsBinary||(p.b64=1),p=f.encode(p),p.length&&(p="?"+p),_+"://"+this.hostname+g+this.path+p},n.prototype.check=function(){return!(!b||"__initialize"in b&&this.name===n.prototype.name)}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,ws:35}],20:[function(r,o){var n=r("has-cors");o.exports=function(s){var c=s.xdomain,f=s.xscheme,v=s.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!c||n))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!f&&v)return new XDomainRequest}catch{}if(!c)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}}},{"has-cors":38}],21:[function(r,o){o.exports=function(n,s){var c=function(){};c.prototype=s.prototype,n.prototype=new c,n.prototype.constructor=n}},{}],22:[function(r,o,n){function s(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function c(){var b=arguments,p=this.useColors;if(b[0]=(p?"%c":"")+this.namespace+(p?" %c":" ")+b[0]+(p?"%c ":" ")+"+"+n.humanize(this.diff),!p)return b;var _="color: "+this.color;b=[b[0],_,"color: inherit"].concat(Array.prototype.slice.call(b,1));var g=0,l=0;return b[0].replace(/%[a-z%]/g,function(u){u!=="%%"&&(g++,u==="%c"&&(l=g))}),b.splice(l,0,_),b}function f(){return typeof console=="object"&&typeof console.log=="function"&&Function.prototype.apply.call(console.log,console,arguments)}function v(b){try{b==null?localStorage.removeItem("debug"):localStorage.debug=b}catch{}}function d(){var b;try{b=localStorage.debug}catch{}return b}n=o.exports=r("./debug"),n.log=f,n.formatArgs=c,n.save=v,n.load=d,n.useColors=s,n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(b){return JSON.stringify(b)},n.enable(d())},{"./debug":23}],23:[function(r,o,n){function s(){return n.colors[_++%n.colors.length]}function c(g){function l(){}function u(){var A=u,k=+new Date,B=k-(p||k);A.diff=B,A.prev=p,A.curr=k,p=k,A.useColors==null&&(A.useColors=n.useColors()),A.color==null&&A.useColors&&(A.color=s());var Y=Array.prototype.slice.call(arguments);Y[0]=n.coerce(Y[0]),typeof Y[0]!="string"&&(Y=["%o"].concat(Y));var j=0;Y[0]=Y[0].replace(/%([a-z%])/g,function(U,T){if(U==="%%")return U;j++;var O=n.formatters[T];if(typeof O=="function"){var P=Y[j];U=O.call(A,P),Y.splice(j,1),j--}return U}),typeof n.formatArgs=="function"&&(Y=n.formatArgs.apply(A,Y));var N=u.log||n.log||console.log.bind(console);N.apply(A,Y)}l.enabled=!1,u.enabled=!0;var w=n.enabled(g)?u:l;return w.namespace=g,w}function f(g){n.save(g);for(var l=(g||"").split(/[\s,]+/),u=l.length,w=0;u>w;w++)l[w]&&(g=l[w].replace(/\*/g,".*?"),g[0]==="-"?n.skips.push(new RegExp("^"+g.substr(1)+"$")):n.names.push(new RegExp("^"+g+"$")))}function v(){n.enable("")}function d(g){var l,u;for(l=0,u=n.skips.length;u>l;l++)if(n.skips[l].test(g))return!1;for(l=0,u=n.names.length;u>l;l++)if(n.names[l].test(g))return!0;return!1}function b(g){return g instanceof Error?g.stack||g.message:g}n=o.exports=c,n.coerce=b,n.disable=v,n.enable=f,n.enabled=d,n.humanize=r("ms"),n.names=[],n.skips=[],n.formatters={};var p,_=0},{ms:24}],24:[function(r,o){function n(g){var l=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(g);if(l){var u=parseFloat(l[1]),w=(l[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"y":return u*_;case"days":case"day":case"d":return u*p;case"hours":case"hour":case"h":return u*b;case"minutes":case"minute":case"m":return u*d;case"seconds":case"second":case"s":return u*v;case"ms":return u}}}function s(g){return g>=p?Math.round(g/p)+"d":g>=b?Math.round(g/b)+"h":g>=d?Math.round(g/d)+"m":g>=v?Math.round(g/v)+"s":g+"ms"}function c(g){return f(g,p,"day")||f(g,b,"hour")||f(g,d,"minute")||f(g,v,"second")||g+" ms"}function f(g,l,u){return l>g?void 0:1.5*l>g?Math.floor(g/l)+" "+u:Math.ceil(g/l)+" "+u+"s"}var v=1e3,d=60*v,b=60*d,p=24*b,_=365.25*p;o.exports=function(g,l){return l=l||{},typeof g=="string"?n(g):l.long?c(g):s(g)}},{}],25:[function(r,o,n){(function(s){function c(T,O){var P="b"+n.packets[T.type]+T.data.data;return O(P)}function f(T,O,P){if(!O)return n.encodeBase64Packet(T,P);var R=T.data,L=new Uint8Array(R),H=new Uint8Array(1+R.byteLength);H[0]=Y[T.type];for(var z=0;z<L.length;z++)H[z+1]=L[z];return P(H.buffer)}function v(T,O,P){if(!O)return n.encodeBase64Packet(T,P);var R=new FileReader;return R.onload=function(){T.data=R.result,n.encodePacket(T,O,!0,P)},R.readAsArrayBuffer(T.data)}function d(T,O,P){if(!O)return n.encodeBase64Packet(T,P);if(B)return v(T,O,P);var R=new Uint8Array(1);R[0]=Y[T.type];var L=new U([R.buffer,T.data]);return P(L)}function b(T,O,P){for(var R=new Array(T.length),L=u(T.length,P),H=function(X,F,lt){O(F,function(ct,xt){R[X]=xt,lt(ct,R)})},z=0;z<T.length;z++)H(z,T[z],L)}var p=r("./keys"),_=r("has-binary"),g=r("arraybuffer.slice"),l=r("base64-arraybuffer"),u=r("after"),w=r("utf8"),A=navigator.userAgent.match(/Android/i),k=/PhantomJS/i.test(navigator.userAgent),B=A||k;n.protocol=3;var Y=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},j=p(Y),N={type:"error",data:"parser error"},U=r("blob");n.encodePacket=function(T,O,P,R){typeof O=="function"&&(R=O,O=!1),typeof P=="function"&&(R=P,P=null);var L=T.data===void 0?void 0:T.data.buffer||T.data;if(s.ArrayBuffer&&L instanceof ArrayBuffer)return f(T,O,R);if(U&&L instanceof s.Blob)return d(T,O,R);if(L&&L.base64)return c(T,R);var H=Y[T.type];return T.data!==void 0&&(H+=P?w.encode(String(T.data)):String(T.data)),R(""+H)},n.encodeBase64Packet=function(T,O){var P="b"+n.packets[T.type];if(U&&T.data instanceof U){var R=new FileReader;return R.onload=function(){var F=R.result.split(",")[1];O(P+F)},R.readAsDataURL(T.data)}var L;try{L=String.fromCharCode.apply(null,new Uint8Array(T.data))}catch{for(var H=new Uint8Array(T.data),z=new Array(H.length),X=0;X<H.length;X++)z[X]=H[X];L=String.fromCharCode.apply(null,z)}return P+=s.btoa(L),O(P)},n.decodePacket=function(T,O,P){if(typeof T=="string"||T===void 0){if(T.charAt(0)=="b")return n.decodeBase64Packet(T.substr(1),O);if(P)try{T=w.decode(T)}catch{return N}var L=T.charAt(0);return Number(L)==L&&j[L]?T.length>1?{type:j[L],data:T.substring(1)}:{type:j[L]}:N}var R=new Uint8Array(T),L=R[0],H=g(T,1);return U&&O==="blob"&&(H=new U([H])),{type:j[L],data:H}},n.decodeBase64Packet=function(T,O){var P=j[T.charAt(0)];if(!s.ArrayBuffer)return{type:P,data:{base64:!0,data:T.substr(1)}};var R=l.decode(T.substr(1));return O==="blob"&&U&&(R=new U([R])),{type:P,data:R}},n.encodePayload=function(T,O,P){function R(z){return z.length+":"+z}function L(z,X){n.encodePacket(z,H?O:!1,!0,function(F){X(null,R(F))})}typeof O=="function"&&(P=O,O=null);var H=_(T);return O&&H?U&&!B?n.encodePayloadAsBlob(T,P):n.encodePayloadAsArrayBuffer(T,P):T.length?void b(T,L,function(z,X){return P(X.join(""))}):P("0:")},n.decodePayload=function(T,O,P){if(typeof T!="string")return n.decodePayloadAsBinary(T,O,P);typeof O=="function"&&(P=O,O=null);var R;if(T=="")return P(N,0,1);for(var L,H,z="",X=0,F=T.length;F>X;X++){var lt=T.charAt(X);if(lt!=":")z+=lt;else{if(z==""||z!=(L=Number(z))||(H=T.substr(X+1,L),z!=H.length))return P(N,0,1);if(H.length){if(R=n.decodePacket(H,O,!0),N.type==R.type&&N.data==R.data)return P(N,0,1);var ct=P(R,X+L,F);if(ct===!1)return}X+=L,z=""}}return z!=""?P(N,0,1):void 0},n.encodePayloadAsArrayBuffer=function(T,O){function P(R,L){n.encodePacket(R,!0,!0,function(H){return L(null,H)})}return T.length?void b(T,P,function(R,L){var H=L.reduce(function(F,lt){var ct;return ct=typeof lt=="string"?lt.length:lt.byteLength,F+ct.toString().length+ct+2},0),z=new Uint8Array(H),X=0;return L.forEach(function(F){var lt=typeof F=="string",ct=F;if(lt){for(var xt=new Uint8Array(F.length),ut=0;ut<F.length;ut++)xt[ut]=F.charCodeAt(ut);ct=xt.buffer}z[X++]=lt?0:1;for(var Jt=ct.byteLength.toString(),ut=0;ut<Jt.length;ut++)z[X++]=parseInt(Jt[ut]);z[X++]=255;for(var xt=new Uint8Array(ct),ut=0;ut<xt.length;ut++)z[X++]=xt[ut]}),O(z.buffer)}):O(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(T,O){function P(R,L){n.encodePacket(R,!0,!0,function(H){var z=new Uint8Array(1);if(z[0]=1,typeof H=="string"){for(var X=new Uint8Array(H.length),F=0;F<H.length;F++)X[F]=H.charCodeAt(F);H=X.buffer,z[0]=0}for(var lt=H instanceof ArrayBuffer?H.byteLength:H.size,ct=lt.toString(),xt=new Uint8Array(ct.length+1),F=0;F<ct.length;F++)xt[F]=parseInt(ct[F]);if(xt[ct.length]=255,U){var ut=new U([z.buffer,xt.buffer,H]);L(null,ut)}})}b(T,P,function(R,L){return O(new U(L))})},n.decodePayloadAsBinary=function(T,O,P){typeof O=="function"&&(P=O,O=null);for(var R=T,L=[],H=!1;R.byteLength>0;){for(var z=new Uint8Array(R),X=z[0]===0,F="",lt=1;z[lt]!=255;lt++){if(F.length>310){H=!0;break}F+=z[lt]}if(H)return P(N,0,1);R=g(R,2+F.length),F=parseInt(F);var ct=g(R,0,F);if(X)try{ct=String.fromCharCode.apply(null,new Uint8Array(ct))}catch{var xt=new Uint8Array(ct);ct="";for(var lt=0;lt<xt.length;lt++)ct+=String.fromCharCode(xt[lt])}L.push(ct),R=g(R,F)}var ut=L.length;L.forEach(function(Jt,Le){P(n.decodePacket(Jt,O,!0),Le,ut)})}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./keys":26,after:27,"arraybuffer.slice":28,"base64-arraybuffer":29,blob:30,"has-binary":36,utf8:31}],26:[function(r,o){o.exports=Object.keys||function(n){var s=[],c=Object.prototype.hasOwnProperty;for(var f in n)c.call(n,f)&&s.push(f);return s}},{}],27:[function(r,o){function n(c,f,v){function d(p,_){if(d.count<=0)throw new Error("after called too many times");--d.count,p?(b=!0,f(p),f=v):d.count!==0||b||f(null,_)}var b=!1;return v=v||s,d.count=c,c===0?f():d}function s(){}o.exports=n},{}],28:[function(r,o){o.exports=function(n,s,c){var f=n.byteLength;if(s=s||0,c=c||f,n.slice)return n.slice(s,c);if(0>s&&(s+=f),0>c&&(c+=f),c>f&&(c=f),s>=f||s>=c||f===0)return new ArrayBuffer(0);for(var v=new Uint8Array(n),d=new Uint8Array(c-s),b=s,p=0;c>b;b++,p++)d[p]=v[b];return d.buffer}},{}],29:[function(r,o,n){(function(s){n.encode=function(c){var f,v=new Uint8Array(c),d=v.length,b="";for(f=0;d>f;f+=3)b+=s[v[f]>>2],b+=s[(3&v[f])<<4|v[f+1]>>4],b+=s[(15&v[f+1])<<2|v[f+2]>>6],b+=s[63&v[f+2]];return d%3===2?b=b.substring(0,b.length-1)+"=":d%3===1&&(b=b.substring(0,b.length-2)+"=="),b},n.decode=function(c){var f,v,d,b,p,_=.75*c.length,g=c.length,l=0;c[c.length-1]==="="&&(_--,c[c.length-2]==="="&&_--);var u=new ArrayBuffer(_),w=new Uint8Array(u);for(f=0;g>f;f+=4)v=s.indexOf(c[f]),d=s.indexOf(c[f+1]),b=s.indexOf(c[f+2]),p=s.indexOf(c[f+3]),w[l++]=v<<2|d>>4,w[l++]=(15&d)<<4|b>>2,w[l++]=(3&b)<<6|63&p;return u}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(r,o){(function(n){function s(_){for(var g=0;g<_.length;g++){var l=_[g];if(l.buffer instanceof ArrayBuffer){var u=l.buffer;if(l.byteLength!==u.byteLength){var w=new Uint8Array(l.byteLength);w.set(new Uint8Array(u,l.byteOffset,l.byteLength)),u=w.buffer}_[g]=u}}}function c(_,g){g=g||{};var l=new v;s(_);for(var u=0;u<_.length;u++)l.append(_[u]);return g.type?l.getBlob(g.type):l.getBlob()}function f(_,g){return s(_),new Blob(_,g||{})}var v=n.BlobBuilder||n.WebKitBlobBuilder||n.MSBlobBuilder||n.MozBlobBuilder,d=function(){try{var _=new Blob(["hi"]);return _.size===2}catch{return!1}}(),b=d&&function(){try{var _=new Blob([new Uint8Array([1,2])]);return _.size===2}catch{return!1}}(),p=v&&v.prototype.append&&v.prototype.getBlob;o.exports=function(){return d?b?n.Blob:f:p?c:void 0}()}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],31:[function(r,o,n){(function(s){(function(c){function f(R){for(var L,H,z=[],X=0,F=R.length;F>X;)L=R.charCodeAt(X++),L>=55296&&56319>=L&&F>X?(H=R.charCodeAt(X++),(64512&H)==56320?z.push(((1023&L)<<10)+(1023&H)+65536):(z.push(L),X--)):z.push(L);return z}function v(R){for(var L,H=R.length,z=-1,X="";++z<H;)L=R[z],L>65535&&(L-=65536,X+=N(L>>>10&1023|55296),L=56320|1023&L),X+=N(L);return X}function d(R){if(R>=55296&&57343>=R)throw Error("Lone surrogate U+"+R.toString(16).toUpperCase()+" is not a scalar value")}function b(R,L){return N(R>>L&63|128)}function p(R){if(!(4294967168&R))return N(R);var L="";return 4294965248&R?4294901760&R?!(4292870144&R)&&(L=N(R>>18&7|240),L+=b(R,12),L+=b(R,6)):(d(R),L=N(R>>12&15|224),L+=b(R,6)):L=N(R>>6&31|192),L+=N(63&R|128)}function _(R){for(var L,H=f(R),z=H.length,X=-1,F="";++X<z;)L=H[X],F+=p(L);return F}function g(){if(j>=Y)throw Error("Invalid byte index");var R=255&B[j];if(j++,(192&R)==128)return 63&R;throw Error("Invalid continuation byte")}function l(){var R,L,H,z,X;if(j>Y)throw Error("Invalid byte index");if(j==Y)return!1;if(R=255&B[j],j++,(128&R)==0)return R;if((224&R)==192){var L=g();if(X=(31&R)<<6|L,X>=128)return X;throw Error("Invalid continuation byte")}if((240&R)==224){if(L=g(),H=g(),X=(15&R)<<12|L<<6|H,X>=2048)return d(X),X;throw Error("Invalid continuation byte")}if((248&R)==240&&(L=g(),H=g(),z=g(),X=(15&R)<<18|L<<12|H<<6|z,X>=65536&&1114111>=X))return X;throw Error("Invalid UTF-8 detected")}function u(R){B=f(R),Y=B.length,j=0;for(var L,H=[];(L=l())!==!1;)H.push(L);return v(H)}var w=typeof n=="object"&&n,A=typeof o=="object"&&o&&o.exports==w&&o,k=typeof s=="object"&&s;(k.global===k||k.window===k)&&(c=k);var B,Y,j,N=String.fromCharCode,U={version:"2.0.0",encode:_,decode:u};if(w&&!w.nodeType)if(A)A.exports=U;else{var T={},O=T.hasOwnProperty;for(var P in U)O.call(U,P)&&(w[P]=U[P])}else c.utf8=U})(this)}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],32:[function(r,o){(function(n){var s=/^[\],:{}\s]*$/,c=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,f=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,v=/(?:^|:|,)(?:\s*\[)+/g,d=/^\s+/,b=/\s+$/;o.exports=function(p){return typeof p=="string"&&p?(p=p.replace(d,"").replace(b,""),n.JSON&&JSON.parse?JSON.parse(p):s.test(p.replace(c,"@").replace(f,"]").replace(v,""))?new Function("return "+p)():void 0):null}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],33:[function(r,o,n){n.encode=function(s){var c="";for(var f in s)s.hasOwnProperty(f)&&(c.length&&(c+="&"),c+=encodeURIComponent(f)+"="+encodeURIComponent(s[f]));return c},n.decode=function(s){for(var c={},f=s.split("&"),v=0,d=f.length;d>v;v++){var b=f[v].split("=");c[decodeURIComponent(b[0])]=decodeURIComponent(b[1])}return c}},{}],34:[function(r,o){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,s=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];o.exports=function(c){var f=c,v=c.indexOf("["),d=c.indexOf("]");v!=-1&&d!=-1&&(c=c.substring(0,v)+c.substring(v,d).replace(/:/g,";")+c.substring(d,c.length));for(var b=n.exec(c||""),p={},_=14;_--;)p[s[_]]=b[_]||"";return v!=-1&&d!=-1&&(p.source=f,p.host=p.host.substring(1,p.host.length-1).replace(/;/g,":"),p.authority=p.authority.replace("[","").replace("]","").replace(/;/g,":"),p.ipv6uri=!0),p}},{}],35:[function(r,o){function n(f,v){return v?new c(f,v):new c(f)}var s=function(){return self}(),c=s.WebSocket||s.MozWebSocket;o.exports=c?n:null,c&&(n.prototype=c.prototype)},{}],36:[function(r,o){(function(n){function s(f){function v(d){if(!d)return!1;if(n.Buffer&&n.Buffer.isBuffer(d)||n.ArrayBuffer&&d instanceof ArrayBuffer||n.Blob&&d instanceof Blob||n.File&&d instanceof File)return!0;if(c(d)){for(var b=0;b<d.length;b++)if(v(d[b]))return!0}else if(d&&typeof d=="object"){d.toJSON&&(d=d.toJSON());for(var p in d)if(Object.prototype.hasOwnProperty.call(d,p)&&v(d[p]))return!0}return!1}return v(f)}var c=r("isarray");o.exports=s}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{isarray:37}],37:[function(r,o){o.exports=Array.isArray||function(n){return Object.prototype.toString.call(n)=="[object Array]"}},{}],38:[function(r,o){var n=r("global");try{o.exports="XMLHttpRequest"in n&&"withCredentials"in new n.XMLHttpRequest}catch{o.exports=!1}},{global:39}],39:[function(r,o){o.exports=function(){return this}()},{}],40:[function(r,o){var n=[].indexOf;o.exports=function(s,c){if(n)return s.indexOf(c);for(var f=0;f<s.length;++f)if(s[f]===c)return f;return-1}},{}],41:[function(r,o,n){var s=Object.prototype.hasOwnProperty;n.keys=Object.keys||function(c){var f=[];for(var v in c)s.call(c,v)&&f.push(v);return f},n.values=function(c){var f=[];for(var v in c)s.call(c,v)&&f.push(c[v]);return f},n.merge=function(c,f){for(var v in f)s.call(f,v)&&(c[v]=f[v]);return c},n.length=function(c){return n.keys(c).length},n.isEmpty=function(c){return n.length(c)==0}},{}],42:[function(r,o){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,s=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];o.exports=function(c){for(var f=n.exec(c||""),v={},d=14;d--;)v[s[d]]=f[d]||"";return v}},{}],43:[function(r,o,n){(function(s){var c=r("isarray"),f=r("./is-buffer");n.deconstructPacket=function(v){function d(g){if(!g)return g;if(f(g)){var l={_placeholder:!0,num:b.length};return b.push(g),l}if(c(g)){for(var u=new Array(g.length),w=0;w<g.length;w++)u[w]=d(g[w]);return u}if(typeof g=="object"&&!(g instanceof Date)){var u={};for(var A in g)u[A]=d(g[A]);return u}return g}var b=[],p=v.data,_=v;return _.data=d(p),_.attachments=b.length,{packet:_,buffers:b}},n.reconstructPacket=function(v,d){function b(p){if(p&&p._placeholder){var _=d[p.num];return _}if(c(p)){for(var g=0;g<p.length;g++)p[g]=b(p[g]);return p}if(p&&typeof p=="object"){for(var l in p)p[l]=b(p[l]);return p}return p}return v.data=b(v.data),v.attachments=void 0,v},n.removeBlobs=function(v,d){function b(g,l,u){if(!g)return g;if(s.Blob&&g instanceof Blob||s.File&&g instanceof File){p++;var w=new FileReader;w.onload=function(){u?u[l]=this.result:_=this.result,--p||d(_)},w.readAsArrayBuffer(g)}else if(c(g))for(var A=0;A<g.length;A++)b(g[A],A,g);else if(g&&typeof g=="object"&&!f(g))for(var k in g)b(g[k],k,g)}var p=0,_=v;b(_),p||d(_)}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./is-buffer":45,isarray:46}],44:[function(r,o,n){function s(){}function c(A){var k="",B=!1;return k+=A.type,(n.BINARY_EVENT==A.type||n.BINARY_ACK==A.type)&&(k+=A.attachments,k+="-"),A.nsp&&A.nsp!="/"&&(B=!0,k+=A.nsp),A.id!=null&&(B&&(k+=",",B=!1),k+=A.id),A.data!=null&&(B&&(k+=","),k+=g.stringify(A.data)),_("encoded %j as %s",A,k),k}function f(A,k){function B(Y){var j=u.deconstructPacket(Y),N=c(j.packet),U=j.buffers;U.unshift(N),k(U)}u.removeBlobs(A,B)}function v(){this.reconstructor=null}function d(A){var k={},B=0;if(k.type=Number(A.charAt(0)),n.types[k.type]==null)return p();if(n.BINARY_EVENT==k.type||n.BINARY_ACK==k.type){for(var Y="";A.charAt(++B)!="-"&&(Y+=A.charAt(B),B!=A.length););if(Y!=Number(Y)||A.charAt(B)!="-")throw new Error("Illegal attachments");k.attachments=Number(Y)}if(A.charAt(B+1)=="/")for(k.nsp="";++B;){var j=A.charAt(B);if(j==","||(k.nsp+=j,B==A.length))break}else k.nsp="/";var N=A.charAt(B+1);if(N!==""&&Number(N)==N){for(k.id="";++B;){var j=A.charAt(B);if(j==null||Number(j)!=j){--B;break}if(k.id+=A.charAt(B),B==A.length)break}k.id=Number(k.id)}if(A.charAt(++B))try{k.data=g.parse(A.substr(B))}catch{return p()}return _("decoded %s as %j",A,k),k}function b(A){this.reconPack=A,this.buffers=[]}function p(){return{type:n.ERROR,data:"parser error"}}var _=r("debug")("socket.io-parser"),g=r("json3"),l=(r("isarray"),r("component-emitter")),u=r("./binary"),w=r("./is-buffer");n.protocol=4,n.types=["CONNECT","DISCONNECT","EVENT","BINARY_EVENT","ACK","BINARY_ACK","ERROR"],n.CONNECT=0,n.DISCONNECT=1,n.EVENT=2,n.ACK=3,n.ERROR=4,n.BINARY_EVENT=5,n.BINARY_ACK=6,n.Encoder=s,n.Decoder=v,s.prototype.encode=function(A,k){if(_("encoding packet %j",A),n.BINARY_EVENT==A.type||n.BINARY_ACK==A.type)f(A,k);else{var B=c(A);k([B])}},l(v.prototype),v.prototype.add=function(A){var k;if(typeof A=="string")k=d(A),n.BINARY_EVENT==k.type||n.BINARY_ACK==k.type?(this.reconstructor=new b(k),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",k)):this.emit("decoded",k);else{if(!w(A)&&!A.base64)throw new Error("Unknown type: "+A);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");k=this.reconstructor.takeBinaryData(A),k&&(this.reconstructor=null,this.emit("decoded",k))}},v.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},b.prototype.takeBinaryData=function(A){if(this.buffers.push(A),this.buffers.length==this.reconPack.attachments){var k=u.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),k}return null},b.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(r,o){(function(n){function s(c){return n.Buffer&&n.Buffer.isBuffer(c)||n.ArrayBuffer&&c instanceof ArrayBuffer}o.exports=s}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],46:[function(r,o){o.exports=r(37)},{}],47:[function(r,o,n){(function(s){function c($){if(c[$]!==d)return c[$];var Q;if($=="bug-string-char-index")Q=!1;else if($=="json")Q=c("json-stringify")&&c("json-parse");else{var G,rt='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if($=="json-stringify"){var K=_.stringify,et=typeof K=="function"&&g;if(et){(G=function(){return 1}).toJSON=G;try{et=K(0)==="0"&&K(new Number)==="0"&&K(new String)=='""'&&K(b)===d&&K(d)===d&&K()===d&&K(G)==="1"&&K([G])=="[1]"&&K([d])=="[null]"&&K(null)=="null"&&K([d,b,null])=="[null,null,null]"&&K({a:[G,!0,!1,null,`\0\b
34
- \f\r `]})==rt&&K(null,G)==="1"&&K([1,2],null,1)==`[
6
+ */var _r=function(t){return t!=null&&(De(t)||Lr(t)||!!t._isBuffer)};function De(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Lr(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&De(t.slice(0,0))}(function(){var t=Br,e=Ue.utf8,r=_r,n=Ue.bin,o=function(i,u){i.constructor==String?u&&u.encoding==="binary"?i=n.stringToBytes(i):i=e.stringToBytes(i):r(i)?i=Array.prototype.slice.call(i,0):!Array.isArray(i)&&i.constructor!==Uint8Array&&(i=i.toString());for(var h=t.bytesToWords(i),d=i.length*8,c=1732584193,l=-271733879,p=-1732584194,a=271733878,s=0;s<h.length;s++)h[s]=(h[s]<<8|h[s]>>>24)&16711935|(h[s]<<24|h[s]>>>8)&4278255360;h[d>>>5]|=128<<d%32,h[(d+64>>>9<<4)+14]=d;for(var f=o._ff,y=o._gg,g=o._hh,w=o._ii,s=0;s<h.length;s+=16){var B=c,_=l,b=p,S=a;c=f(c,l,p,a,h[s+0],7,-680876936),a=f(a,c,l,p,h[s+1],12,-389564586),p=f(p,a,c,l,h[s+2],17,606105819),l=f(l,p,a,c,h[s+3],22,-1044525330),c=f(c,l,p,a,h[s+4],7,-176418897),a=f(a,c,l,p,h[s+5],12,1200080426),p=f(p,a,c,l,h[s+6],17,-1473231341),l=f(l,p,a,c,h[s+7],22,-45705983),c=f(c,l,p,a,h[s+8],7,1770035416),a=f(a,c,l,p,h[s+9],12,-1958414417),p=f(p,a,c,l,h[s+10],17,-42063),l=f(l,p,a,c,h[s+11],22,-1990404162),c=f(c,l,p,a,h[s+12],7,1804603682),a=f(a,c,l,p,h[s+13],12,-40341101),p=f(p,a,c,l,h[s+14],17,-1502002290),l=f(l,p,a,c,h[s+15],22,1236535329),c=y(c,l,p,a,h[s+1],5,-165796510),a=y(a,c,l,p,h[s+6],9,-1069501632),p=y(p,a,c,l,h[s+11],14,643717713),l=y(l,p,a,c,h[s+0],20,-373897302),c=y(c,l,p,a,h[s+5],5,-701558691),a=y(a,c,l,p,h[s+10],9,38016083),p=y(p,a,c,l,h[s+15],14,-660478335),l=y(l,p,a,c,h[s+4],20,-405537848),c=y(c,l,p,a,h[s+9],5,568446438),a=y(a,c,l,p,h[s+14],9,-1019803690),p=y(p,a,c,l,h[s+3],14,-187363961),l=y(l,p,a,c,h[s+8],20,1163531501),c=y(c,l,p,a,h[s+13],5,-1444681467),a=y(a,c,l,p,h[s+2],9,-51403784),p=y(p,a,c,l,h[s+7],14,1735328473),l=y(l,p,a,c,h[s+12],20,-1926607734),c=g(c,l,p,a,h[s+5],4,-378558),a=g(a,c,l,p,h[s+8],11,-2022574463),p=g(p,a,c,l,h[s+11],16,1839030562),l=g(l,p,a,c,h[s+14],23,-35309556),c=g(c,l,p,a,h[s+1],4,-1530992060),a=g(a,c,l,p,h[s+4],11,1272893353),p=g(p,a,c,l,h[s+7],16,-155497632),l=g(l,p,a,c,h[s+10],23,-1094730640),c=g(c,l,p,a,h[s+13],4,681279174),a=g(a,c,l,p,h[s+0],11,-358537222),p=g(p,a,c,l,h[s+3],16,-722521979),l=g(l,p,a,c,h[s+6],23,76029189),c=g(c,l,p,a,h[s+9],4,-640364487),a=g(a,c,l,p,h[s+12],11,-421815835),p=g(p,a,c,l,h[s+15],16,530742520),l=g(l,p,a,c,h[s+2],23,-995338651),c=w(c,l,p,a,h[s+0],6,-198630844),a=w(a,c,l,p,h[s+7],10,1126891415),p=w(p,a,c,l,h[s+14],15,-1416354905),l=w(l,p,a,c,h[s+5],21,-57434055),c=w(c,l,p,a,h[s+12],6,1700485571),a=w(a,c,l,p,h[s+3],10,-1894986606),p=w(p,a,c,l,h[s+10],15,-1051523),l=w(l,p,a,c,h[s+1],21,-2054922799),c=w(c,l,p,a,h[s+8],6,1873313359),a=w(a,c,l,p,h[s+15],10,-30611744),p=w(p,a,c,l,h[s+6],15,-1560198380),l=w(l,p,a,c,h[s+13],21,1309151649),c=w(c,l,p,a,h[s+4],6,-145523070),a=w(a,c,l,p,h[s+11],10,-1120210379),p=w(p,a,c,l,h[s+2],15,718787259),l=w(l,p,a,c,h[s+9],21,-343485551),c=c+B>>>0,l=l+_>>>0,p=p+b>>>0,a=a+S>>>0}return t.endian([c,l,p,a])};o._ff=function(i,u,h,d,c,l,p){var a=i+(u&h|~u&d)+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._gg=function(i,u,h,d,c,l,p){var a=i+(u&d|h&~d)+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._hh=function(i,u,h,d,c,l,p){var a=i+(u^h^d)+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._ii=function(i,u,h,d,c,l,p){var a=i+(h^(u|~d))+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._blocksize=16,o._digestsize=16,yt.exports=function(i,u){if(i==null)throw new Error("Illegal argument "+i);var h=t.wordsToBytes(o(i,u));return u&&u.asBytes?h:u&&u.asString?n.bytesToString(h):t.bytesToHex(h)}})();var Ur=yt.exports;const Dr=ot(Ur);var bt=(t=>(t.MAIN="main",t.NEXT="next",t))(bt||{}),ct=(t=>(t.USER="User",t.TOKEN="Token",t))(ct||{});class Rt{static async getSessionStorageDataByKey(e,r=!0){if(typeof chrome<"u"&&typeof chrome.storage<"u"){const n=await chrome.storage.session.get(e);if(n[e])return r?JSON.parse(n[e]):n[e]}if(typeof window<"u"){const n=window.sessionStorage.getItem(e);if(n)return r?JSON.parse(n):n}}static async updateSessionStorageKey(e,r){typeof chrome<"u"&&typeof chrome.storage<"u"&&await chrome.storage.session.set({[e]:JSON.stringify(r)}),typeof window<"u"&&typeof window.sessionStorage<"u"&&typeof window.sessionStorage.setItem=="function"&&window.sessionStorage.setItem(e,JSON.stringify(r))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&typeof window.sessionStorage<"u"&&typeof window.sessionStorage.clear=="function"&&window.sessionStorage.clear()}}var Pr=Object.defineProperty,Fr=(t,e,r)=>e in t?Pr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V=(t,e,r)=>(Fr(t,typeof e!="symbol"?e+"":e,r),r);function jr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var Qt={exports:{}},qr=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Pe=function(t){var e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));for(var o=qr.exec(t||""),i={},u=14;u--;)i[zr[u]]=o[u]||"";return r!=-1&&n!=-1&&(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=Xr(i,i.path),i.queryKey=Kr(i,i.query),i};function Xr(t,e){var r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&n.splice(0,1),e.substr(e.length-1,1)=="/"&&n.splice(n.length-1,1),n}function Kr(t,e){var r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,i){o&&(r[o]=i)}),r}var Zt={exports:{}},te={exports:{}},It=1e3,Bt=It*60,_t=Bt*60,Lt=_t*24,Wr=Lt*365.25,Hr=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Jr(t);if(r==="number"&&isNaN(t)===!1)return e.long?$r(t):Vr(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Jr(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Wr;case"days":case"day":case"d":return r*Lt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*_t;case"minutes":case"minute":case"mins":case"min":case"m":return r*Bt;case"seconds":case"second":case"secs":case"sec":case"s":return r*It;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Vr(t){return t>=Lt?Math.round(t/Lt)+"d":t>=_t?Math.round(t/_t)+"h":t>=Bt?Math.round(t/Bt)+"m":t>=It?Math.round(t/It)+"s":t+"ms"}function $r(t){return Ft(t,Lt,"day")||Ft(t,_t,"hour")||Ft(t,Bt,"minute")||Ft(t,It,"second")||t+" ms"}function Ft(t,e,r){if(!(t<e))return t<e*1.5?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}(function(t,e){e=t.exports=n.debug=n.default=n,e.coerce=d,e.disable=u,e.enable=i,e.enabled=h,e.humanize=Hr,e.instances=[],e.names=[],e.skips=[],e.formatters={};function r(c){var l=0,p;for(p in c)l=(l<<5)-l+c.charCodeAt(p),l|=0;return e.colors[Math.abs(l)%e.colors.length]}function n(c){var l;function p(){if(p.enabled){var a=p,s=+new Date,f=s-(l||s);a.diff=f,a.prev=l,a.curr=s,l=s;for(var y=new Array(arguments.length),g=0;g<y.length;g++)y[g]=arguments[g];y[0]=e.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");var w=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,function(_,b){if(_==="%%")return _;w++;var S=e.formatters[b];if(typeof S=="function"){var m=y[w];_=S.call(a,m),y.splice(w,1),w--}return _}),e.formatArgs.call(a,y);var B=p.log||e.log||console.log.bind(console);B.apply(a,y)}}return p.namespace=c,p.enabled=e.enabled(c),p.useColors=e.useColors(),p.color=r(c),p.destroy=o,typeof e.init=="function"&&e.init(p),e.instances.push(p),p}function o(){var c=e.instances.indexOf(this);return c!==-1?(e.instances.splice(c,1),!0):!1}function i(c){e.save(c),e.names=[],e.skips=[];var l,p=(typeof c=="string"?c:"").split(/[\s,]+/),a=p.length;for(l=0;l<a;l++)p[l]&&(c=p[l].replace(/\*/g,".*?"),c[0]==="-"?e.skips.push(new RegExp("^"+c.substr(1)+"$")):e.names.push(new RegExp("^"+c+"$")));for(l=0;l<e.instances.length;l++){var s=e.instances[l];s.enabled=e.enabled(s.namespace)}}function u(){e.enable("")}function h(c){if(c[c.length-1]==="*")return!0;var l,p;for(l=0,p=e.skips.length;l<p;l++)if(e.skips[l].test(c))return!1;for(l=0,p=e.names.length;l<p;l++)if(e.names[l].test(c))return!0;return!1}function d(c){return c instanceof Error?c.stack||c.message:c}})(te,te.exports);var Gr=te.exports;(function(t,e){e=t.exports=Gr,e.log=o,e.formatArgs=n,e.save=i,e.load=u,e.useColors=r,e.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:h(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(d){try{return JSON.stringify(d)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}};function n(d){var c=this.useColors;if(d[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+d[0]+(c?"%c ":" ")+"+"+e.humanize(this.diff),!!c){var l="color: "+this.color;d.splice(1,0,l,"color: inherit");var p=0,a=0;d[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(p++,s==="%c"&&(a=p))}),d.splice(a,0,l)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(d){try{d==null?e.storage.removeItem("debug"):e.storage.debug=d}catch{}}function u(){var d;try{d=e.storage.debug}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=process.env.DEBUG),d}e.enable(u());function h(){try{return window.localStorage}catch{}}})(Zt,Zt.exports);var ft=Zt.exports,Yr=Pe,Fe=ft("socket.io-client:url"),Qr=Zr;function Zr(t,e){var r=t;e=e||typeof location<"u"&&location,t==null&&(t=e.protocol+"//"+e.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=e.protocol+t:t=e.host+t),/^(https?|wss?):\/\//.test(t)||(Fe("protocol-less url %s",t),typeof e<"u"?t=e.protocol+"//"+t:t="https://"+t),Fe("parse %s",t),r=Yr(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=r.host.indexOf(":")!==-1,o=n?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port,r.href=r.protocol+"://"+o+(e&&e.port===r.port?"":":"+r.port),r}var jt={},je={exports:{}};(function(t){t.exports=e;function e(n){if(n)return r(n)}function r(n){for(var o in e.prototype)n[o]=e.prototype[o];return n}e.prototype.on=e.prototype.addEventListener=function(n,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(o),this},e.prototype.once=function(n,o){function i(){this.off(n,i),o.apply(this,arguments)}return i.fn=o,this.on(n,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(n,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var u,h=0;h<i.length;h++)if(u=i[h],u===o||u.fn===o){i.splice(h,1);break}return i.length===0&&delete this._callbacks["$"+n],this},e.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var o=new Array(arguments.length-1),i=this._callbacks["$"+n],u=1;u<arguments.length;u++)o[u-1]=arguments[u];if(i){i=i.slice(0);for(var u=0,h=i.length;u<h;++u)i[u].apply(this,o)}return this},e.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},e.prototype.hasListeners=function(n){return!!this.listeners(n).length}})(je);var wt=je.exports,Mt={},tn={}.toString,ee=Array.isArray||function(t){return tn.call(t)=="[object Array]"},Me=on,en=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",rn=typeof ArrayBuffer=="function",nn=function(t){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer};function on(t){return en&&Buffer.isBuffer(t)||rn&&(t instanceof ArrayBuffer||nn(t))}var re=ee,qe=Me,ze=Object.prototype.toString,sn=typeof Blob=="function"||typeof Blob<"u"&&ze.call(Blob)==="[object BlobConstructor]",an=typeof File=="function"||typeof File<"u"&&ze.call(File)==="[object FileConstructor]";Mt.deconstructPacket=function(t){var e=[],r=t.data,n=t;return n.data=ne(r,e),n.attachments=e.length,{packet:n,buffers:e}};function ne(t,e){if(!t)return t;if(qe(t)){var r={_placeholder:!0,num:e.length};return e.push(t),r}else if(re(t)){for(var n=new Array(t.length),o=0;o<t.length;o++)n[o]=ne(t[o],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){var n={};for(var i in t)n[i]=ne(t[i],e);return n}return t}Mt.reconstructPacket=function(t,e){return t.data=oe(t.data,e),t.attachments=void 0,t};function oe(t,e){if(!t)return t;if(t&&t._placeholder===!0){var r=typeof t.num=="number"&&t.num>=0&&t.num<e.length;if(r)return e[t.num];throw new Error("illegal attachments")}else if(re(t))for(var n=0;n<t.length;n++)t[n]=oe(t[n],e);else if(typeof t=="object")for(var o in t)t[o]=oe(t[o],e);return t}Mt.removeBlobs=function(t,e){function r(i,u,h){if(!i)return i;if(sn&&i instanceof Blob||an&&i instanceof File){n++;var d=new FileReader;d.onload=function(){h?h[u]=this.result:o=this.result,--n||e(o)},d.readAsArrayBuffer(i)}else if(re(i))for(var c=0;c<i.length;c++)r(i[c],c,i);else if(typeof i=="object"&&!qe(i))for(var l in i)r(i[l],l,i)}var n=0,o=t;r(o),n||e(o)},function(t){var e=ft("socket.io-parser"),r=wt,n=Mt,o=ee,i=Me;t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=u,t.Decoder=p;function u(){}var h=t.ERROR+'"encode error"';u.prototype.encode=function(g,w){if(e("encoding packet %j",g),t.BINARY_EVENT===g.type||t.BINARY_ACK===g.type)l(g,w);else{var B=d(g);w([B])}};function d(g){var w=""+g.type;if((t.BINARY_EVENT===g.type||t.BINARY_ACK===g.type)&&(w+=g.attachments+"-"),g.nsp&&g.nsp!=="/"&&(w+=g.nsp+","),g.id!=null&&(w+=g.id),g.data!=null){var B=c(g.data);if(B!==!1)w+=B;else return h}return e("encoded %j as %s",g,w),w}function c(g){try{return JSON.stringify(g)}catch{return!1}}function l(g,w){function B(_){var b=n.deconstructPacket(_),S=d(b.packet),m=b.buffers;m.unshift(S),w(m)}n.removeBlobs(g,B)}function p(){this.reconstructor=null}r(p.prototype),p.prototype.add=function(g){var w;if(typeof g=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");w=a(g),t.BINARY_EVENT===w.type||t.BINARY_ACK===w.type?(this.reconstructor=new f(w),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",w)):this.emit("decoded",w)}else if(i(g)||g.base64)if(this.reconstructor)w=this.reconstructor.takeBinaryData(g),w&&(this.reconstructor=null,this.emit("decoded",w));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+g)};function a(g){var w=0,B={type:Number(g.charAt(0))};if(t.types[B.type]==null)return y("unknown packet type "+B.type);if(t.BINARY_EVENT===B.type||t.BINARY_ACK===B.type){for(var _=w+1;g.charAt(++w)!=="-"&&w!=g.length;);var b=g.substring(_,w);if(b!=Number(b)||g.charAt(w)!=="-")throw new Error("Illegal attachments");B.attachments=Number(b)}if(g.charAt(w+1)==="/"){for(var _=w+1;++w;){var S=g.charAt(w);if(S===","||w===g.length)break}B.nsp=g.substring(_,w)}else B.nsp="/";var m=g.charAt(w+1);if(m!==""&&Number(m)==m){for(var _=w+1;++w;){var S=g.charAt(w);if(S==null||Number(S)!=S){--w;break}if(w===g.length)break}B.id=Number(g.substring(_,w+1))}if(g.charAt(++w)){var C=s(g.substr(w)),E=C!==!1&&(B.type===t.ERROR||o(C));if(E)B.data=C;else return y("invalid payload")}return e("decoded %s as %j",g,B),B}function s(g){try{return JSON.parse(g)}catch{return!1}}p.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()};function f(g){this.reconPack=g,this.buffers=[]}f.prototype.takeBinaryData=function(g){if(this.buffers.push(g),this.buffers.length===this.reconPack.attachments){var w=n.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),w}return null},f.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};function y(g){return{type:t.ERROR,data:"parser error: "+g}}}(jt);var se={exports:{}},qt={},ie={exports:{}};try{ie.exports=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{ie.exports=!1}var cn=ie.exports,ae=function(){return typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}(),hn=cn,pn=ae,ce=function(t){var e=t.xdomain,r=t.xscheme,n=t.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!e||hn))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!r&&n)return new XDomainRequest}catch{}if(!e)try{return new pn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}},he={exports:{}},Ct={},un=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e},ln=ee,Xe=Object.prototype.toString,fn=typeof Blob=="function"||typeof Blob<"u"&&Xe.call(Blob)==="[object BlobConstructor]",dn=typeof File=="function"||typeof File<"u"&&Xe.call(File)==="[object FileConstructor]",Ke=zt;function zt(t){if(!t||typeof t!="object")return!1;if(ln(t)){for(var e=0,r=t.length;e<r;e++)if(zt(t[e]))return!0;return!1}if(typeof Buffer=="function"&&Buffer.isBuffer&&Buffer.isBuffer(t)||typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||fn&&t instanceof Blob||dn&&t instanceof File)return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return zt(t.toJSON(),!0);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&zt(t[n]))return!0;return!1}var yn=function(t,e,r){var n=t.byteLength;if(e=e||0,r=r||n,t.slice)return t.slice(e,r);if(e<0&&(e+=n),r<0&&(r+=n),r>n&&(r=n),e>=n||e>=r||n===0)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(r-e),u=e,h=0;u<r;u++,h++)i[h]=o[u];return i.buffer},gn=mn;function mn(t,e,r){var n=!1;return r=r||vn,o.count=t,t===0?e():o;function o(i,u){if(o.count<=0)throw new Error("after called too many times");--o.count,i?(n=!0,e(i),e=r):o.count===0&&!n&&e(null,u)}}function vn(){}/*! https://mths.be/utf8js v2.1.2 by @mathias */var gt=String.fromCharCode;function We(t){for(var e=[],r=0,n=t.length,o,i;r<n;)o=t.charCodeAt(r++),o>=55296&&o<=56319&&r<n?(i=t.charCodeAt(r++),(i&64512)==56320?e.push(((o&1023)<<10)+(i&1023)+65536):(e.push(o),r--)):e.push(o);return e}function kn(t){for(var e=t.length,r=-1,n,o="";++r<e;)n=t[r],n>65535&&(n-=65536,o+=gt(n>>>10&1023|55296),n=56320|n&1023),o+=gt(n);return o}function He(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function pe(t,e){return gt(t>>e&63|128)}function bn(t,e){if(!(t&4294967168))return gt(t);var r="";return t&4294965248?t&4294901760?t&4292870144||(r=gt(t>>18&7|240),r+=pe(t,12),r+=pe(t,6)):(He(t,e)||(t=65533),r=gt(t>>12&15|224),r+=pe(t,6)):r=gt(t>>6&31|192),r+=gt(t&63|128),r}function Cn(t,e){e=e||{};for(var r=e.strict!==!1,n=We(t),o=n.length,i=-1,u,h="";++i<o;)u=n[i],h+=bn(u,r);return h}function St(){if(mt>=Kt)throw Error("Invalid byte index");var t=Xt[mt]&255;if(mt++,(t&192)==128)return t&63;throw Error("Invalid continuation byte")}function wn(t){var e,r,n,o,i;if(mt>Kt)throw Error("Invalid byte index");if(mt==Kt)return!1;if(e=Xt[mt]&255,mt++,!(e&128))return e;if((e&224)==192){if(r=St(),i=(e&31)<<6|r,i>=128)return i;throw Error("Invalid continuation byte")}if((e&240)==224){if(r=St(),n=St(),i=(e&15)<<12|r<<6|n,i>=2048)return He(i,t)?i:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(r=St(),n=St(),o=St(),i=(e&7)<<18|r<<12|n<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}var Xt,Kt,mt;function Sn(t,e){e=e||{};var r=e.strict!==!1;Xt=We(t),Kt=Xt.length,mt=0;for(var n=[],o;(o=wn(r))!==!1;)n.push(o);return kn(n)}var En={version:"2.1.2",encode:Cn,decode:Sn},ue={},Je;function An(){return Je||(Je=1,function(t){ue.encode=function(e){var r=new Uint8Array(e),n,o=r.length,i="";for(n=0;n<o;n+=3)i+=t[r[n]>>2],i+=t[(r[n]&3)<<4|r[n+1]>>4],i+=t[(r[n+1]&15)<<2|r[n+2]>>6],i+=t[r[n+2]&63];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},ue.decode=function(e){var r=e.length*.75,n=e.length,o,i=0,u,h,d,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),p=new Uint8Array(l);for(o=0;o<n;o+=4)u=t.indexOf(e[o]),h=t.indexOf(e[o+1]),d=t.indexOf(e[o+2]),c=t.indexOf(e[o+3]),p[i++]=u<<2|h>>4,p[i++]=(h&15)<<4|d>>2,p[i++]=(d&3)<<6|c&63;return l}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),ue}var le,Ve;function Tn(){if(Ve)return le;Ve=1;var t=typeof t<"u"?t:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:!1,e=function(){try{var h=new Blob(["hi"]);return h.size===2}catch{return!1}}(),r=e&&function(){try{var h=new Blob([new Uint8Array([1,2])]);return h.size===2}catch{return!1}}(),n=t&&t.prototype.append&&t.prototype.getBlob;function o(h){return h.map(function(d){if(d.buffer instanceof ArrayBuffer){var c=d.buffer;if(d.byteLength!==c.byteLength){var l=new Uint8Array(d.byteLength);l.set(new Uint8Array(c,d.byteOffset,d.byteLength)),c=l.buffer}return c}return d})}function i(h,d){d=d||{};var c=new t;return o(h).forEach(function(l){c.append(l)}),d.type?c.getBlob(d.type):c.getBlob()}function u(h,d){return new Blob(o(h),d||{})}return typeof Blob<"u"&&(i.prototype=Blob.prototype,u.prototype=Blob.prototype),le=function(){return e?r?Blob:u:n?i:void 0}(),le}(function(t){var e=un,r=Ke,n=yn,o=gn,i=En,u;typeof ArrayBuffer<"u"&&(u=An());var h=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),d=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),c=h||d;t.protocol=3;var l=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},p=e(l),a={type:"error",data:"parser error"},s=Tn();t.encodePacket=function(b,S,m,C){typeof S=="function"&&(C=S,S=!1),typeof m=="function"&&(C=m,m=null);var E=b.data===void 0?void 0:b.data.buffer||b.data;if(typeof ArrayBuffer<"u"&&E instanceof ArrayBuffer)return y(b,S,C);if(typeof s<"u"&&E instanceof s)return w(b,S,C);if(E&&E.base64)return f(b,C);var v=l[b.type];return b.data!==void 0&&(v+=m?i.encode(String(b.data),{strict:!1}):String(b.data)),C(""+v)};function f(b,S){var m="b"+t.packets[b.type]+b.data.data;return S(m)}function y(b,S,m){if(!S)return t.encodeBase64Packet(b,m);var C=b.data,E=new Uint8Array(C),v=new Uint8Array(1+C.byteLength);v[0]=l[b.type];for(var k=0;k<E.length;k++)v[k+1]=E[k];return m(v.buffer)}function g(b,S,m){if(!S)return t.encodeBase64Packet(b,m);var C=new FileReader;return C.onload=function(){t.encodePacket({type:b.type,data:C.result},S,!0,m)},C.readAsArrayBuffer(b.data)}function w(b,S,m){if(!S)return t.encodeBase64Packet(b,m);if(c)return g(b,S,m);var C=new Uint8Array(1);C[0]=l[b.type];var E=new s([C.buffer,b.data]);return m(E)}t.encodeBase64Packet=function(b,S){var m="b"+t.packets[b.type];if(typeof s<"u"&&b.data instanceof s){var C=new FileReader;return C.onload=function(){var x=C.result.split(",")[1];S(m+x)},C.readAsDataURL(b.data)}var E;try{E=String.fromCharCode.apply(null,new Uint8Array(b.data))}catch{for(var v=new Uint8Array(b.data),k=new Array(v.length),T=0;T<v.length;T++)k[T]=v[T];E=String.fromCharCode.apply(null,k)}return m+=btoa(E),S(m)},t.decodePacket=function(b,S,m){if(b===void 0)return a;if(typeof b=="string"){if(b.charAt(0)==="b")return t.decodeBase64Packet(b.substr(1),S);if(m&&(b=B(b),b===!1))return a;var E=b.charAt(0);return Number(E)!=E||!p[E]?a:b.length>1?{type:p[E],data:b.substring(1)}:{type:p[E]}}var C=new Uint8Array(b),E=C[0],v=n(b,1);return s&&S==="blob"&&(v=new s([v])),{type:p[E],data:v}};function B(b){try{b=i.decode(b,{strict:!1})}catch{return!1}return b}t.decodeBase64Packet=function(b,S){var m=p[b.charAt(0)];if(!u)return{type:m,data:{base64:!0,data:b.substr(1)}};var C=u.decode(b.substr(1));return S==="blob"&&s&&(C=new s([C])),{type:m,data:C}},t.encodePayload=function(b,S,m){typeof S=="function"&&(m=S,S=null);var C=r(b);if(S&&C)return s&&!c?t.encodePayloadAsBlob(b,m):t.encodePayloadAsArrayBuffer(b,m);if(!b.length)return m("0:");function E(k){return k.length+":"+k}function v(k,T){t.encodePacket(k,C?S:!1,!1,function(x){T(null,E(x))})}_(b,v,function(k,T){return m(T.join(""))})};function _(b,S,m){for(var C=new Array(b.length),E=o(b.length,m),v=function(T,x,O){S(x,function(A,q){C[T]=q,O(A,C)})},k=0;k<b.length;k++)v(k,b[k],E)}t.decodePayload=function(b,S,m){if(typeof b!="string")return t.decodePayloadAsBinary(b,S,m);typeof S=="function"&&(m=S,S=null);var C;if(b==="")return m(a,0,1);for(var E="",v,k,T=0,x=b.length;T<x;T++){var O=b.charAt(T);if(O!==":"){E+=O;continue}if(E===""||E!=(v=Number(E))||(k=b.substr(T+1,v),E!=k.length))return m(a,0,1);if(k.length){if(C=t.decodePacket(k,S,!1),a.type===C.type&&a.data===C.data)return m(a,0,1);var A=m(C,T+v,x);if(A===!1)return}T+=v,E=""}if(E!=="")return m(a,0,1)},t.encodePayloadAsArrayBuffer=function(b,S){if(!b.length)return S(new ArrayBuffer(0));function m(C,E){t.encodePacket(C,!0,!0,function(v){return E(null,v)})}_(b,m,function(C,E){var v=E.reduce(function(x,O){var A;return typeof O=="string"?A=O.length:A=O.byteLength,x+A.toString().length+A+2},0),k=new Uint8Array(v),T=0;return E.forEach(function(x){var O=typeof x=="string",A=x;if(O){for(var q=new Uint8Array(x.length),j=0;j<x.length;j++)q[j]=x.charCodeAt(j);A=q.buffer}O?k[T++]=0:k[T++]=1;for(var G=A.byteLength.toString(),j=0;j<G.length;j++)k[T++]=parseInt(G[j]);k[T++]=255;for(var q=new Uint8Array(A),j=0;j<q.length;j++)k[T++]=q[j]}),S(k.buffer)})},t.encodePayloadAsBlob=function(b,S){function m(C,E){t.encodePacket(C,!0,!0,function(v){var k=new Uint8Array(1);if(k[0]=1,typeof v=="string"){for(var T=new Uint8Array(v.length),x=0;x<v.length;x++)T[x]=v.charCodeAt(x);v=T.buffer,k[0]=0}for(var O=v instanceof ArrayBuffer?v.byteLength:v.size,A=O.toString(),q=new Uint8Array(A.length+1),x=0;x<A.length;x++)q[x]=parseInt(A[x]);if(q[A.length]=255,s){var j=new s([k.buffer,q.buffer,v]);E(null,j)}})}_(b,m,function(C,E){return S(new s(E))})},t.decodePayloadAsBinary=function(b,S,m){typeof S=="function"&&(m=S,S=null);for(var C=b,E=[];C.byteLength>0;){for(var v=new Uint8Array(C),k=v[0]===0,T="",x=1;v[x]!==255;x++){if(T.length>310)return m(a,0,1);T+=v[x]}C=n(C,2+T.length),T=parseInt(T);var O=n(C,0,T);if(k)try{O=String.fromCharCode.apply(null,new Uint8Array(O))}catch{var A=new Uint8Array(O);O="";for(var x=0;x<A.length;x++)O+=String.fromCharCode(A[x])}E.push(O),C=n(C,T)}var q=E.length;E.forEach(function(j,G){m(t.decodePacket(j,S,!0),G,q)})}})(Ct);var fe,$e;function de(){if($e)return fe;$e=1;var t=Ct,e=wt;fe=r;function r(n){this.path=n.path,this.hostname=n.hostname,this.port=n.port,this.secure=n.secure,this.query=n.query,this.timestampParam=n.timestampParam,this.timestampRequests=n.timestampRequests,this.readyState="",this.agent=n.agent||!1,this.socket=n.socket,this.enablesXDR=n.enablesXDR,this.withCredentials=n.withCredentials,this.pfx=n.pfx,this.key=n.key,this.passphrase=n.passphrase,this.cert=n.cert,this.ca=n.ca,this.ciphers=n.ciphers,this.rejectUnauthorized=n.rejectUnauthorized,this.forceNode=n.forceNode,this.isReactNative=n.isReactNative,this.extraHeaders=n.extraHeaders,this.localAddress=n.localAddress}return e(r.prototype),r.prototype.onError=function(n,o){var i=new Error(n);return i.type="TransportError",i.description=o,this.emit("error",i),this},r.prototype.open=function(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this},r.prototype.send=function(n){if(this.readyState==="open")this.write(n);else throw new Error("Transport not open")},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(n){var o=t.decodePacket(n,this.socket.binaryType);this.onPacket(o)},r.prototype.onPacket=function(n){this.emit("packet",n)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")},fe}var Et={};Et.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e},Et.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e};var Wt=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},Ge="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ht=64,Ye={},Qe=0,vt=0,Ze;function ye(t){var e="";do e=Ge[t%Ht]+e,t=Math.floor(t/Ht);while(t>0);return e}function Nn(t){var e=0;for(vt=0;vt<t.length;vt++)e=e*Ht+Ye[t.charAt(vt)];return e}function ge(){var t=ye(+new Date);return t!==Ze?(Qe=0,Ze=t):t+"."+ye(Qe++)}for(;vt<Ht;vt++)Ye[Ge[vt]]=vt;ge.encode=ye,ge.decode=Nn;var tr=ge,er=de(),xn=Et,rr=Ct,On=Wt,Rn=tr,ht=ft("engine.io-client:polling"),nr=lt,In=function(){var t=ce,e=new t({xdomain:!1});return e.responseType!=null}();function lt(t){var e=t&&t.forceBase64;(!In||e)&&(this.supportsBinary=!1),er.call(this,t)}On(lt,er),lt.prototype.name="polling",lt.prototype.doOpen=function(){this.poll()},lt.prototype.pause=function(t){var e=this;this.readyState="pausing";function r(){ht("paused"),e.readyState="paused",t()}if(this.polling||!this.writable){var n=0;this.polling&&(ht("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){ht("pre-pause polling complete"),--n||r()})),this.writable||(ht("we are currently writing - waiting to pause"),n++,this.once("drain",function(){ht("pre-pause writing complete"),--n||r()}))}else r()},lt.prototype.poll=function(){ht("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},lt.prototype.onData=function(t){var e=this;ht("polling got data %s",t);var r=function(n,o,i){if(e.readyState==="opening"&&n.type==="open"&&e.onOpen(),n.type==="close")return e.onClose(),!1;e.onPacket(n)};rr.decodePayload(t,this.socket.binaryType,r),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():ht('ignoring poll - transport state "%s"',this.readyState))},lt.prototype.doClose=function(){var t=this;function e(){ht("writing close packet"),t.write([{type:"close"}])}this.readyState==="open"?(ht("transport open - closing"),e()):(ht("transport not open - deferring close"),this.once("open",e))},lt.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};rr.encodePayload(t,this.supportsBinary,function(n){e.doWrite(n,r)})},lt.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";this.timestampRequests!==!1&&(t[this.timestampParam]=Rn()),!this.supportsBinary&&!t.sid&&(t.b64=1),t=xn.encode(t),this.port&&(e==="https"&&Number(this.port)!==443||e==="http"&&Number(this.port)!==80)&&(r=":"+this.port),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t};var Bn=ce,or=nr,_n=wt,Ln=Wt,me=ft("engine.io-client:polling-xhr"),Un=ae;he.exports=At,he.exports.Request=Q;function sr(){}function At(t){if(or.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,typeof location<"u"){var e=location.protocol==="https:",r=location.port;r||(r=e?443:80),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port,this.xs=t.secure!==e}}Ln(At,or),At.prototype.supportsBinary=!0,At.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.withCredentials=this.withCredentials,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new Q(t)},At.prototype.doWrite=function(t,e){var r=typeof t!="string"&&t!==void 0,n=this.request({method:"POST",data:t,isBinary:r}),o=this;n.on("success",e),n.on("error",function(i){o.onError("xhr post error",i)}),this.sendXhr=n},At.prototype.doPoll=function(){me("xhr poll");var t=this.request(),e=this;t.on("data",function(r){e.onData(r)}),t.on("error",function(r){e.onError("xhr poll error",r)}),this.pollXhr=t};function Q(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}if(_n(Q.prototype),Q.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new Bn(t),r=this;try{me("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(var n in this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&e.setRequestHeader(n,this.extraHeaders[n])}}catch{}if(this.method==="POST")try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{e.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in e&&(e.withCredentials=this.withCredentials),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){r.onLoad()},e.onerror=function(){r.onError(e.responseText)}):e.onreadystatechange=function(){if(e.readyState===2)try{var o=e.getResponseHeader("Content-Type");(r.supportsBinary&&o==="application/octet-stream"||o==="application/octet-stream; charset=UTF-8")&&(e.responseType="arraybuffer")}catch{}e.readyState===4&&(e.status===200||e.status===1223?r.onLoad():setTimeout(function(){r.onError(typeof e.status=="number"?e.status:0)},0))},me("xhr data %s",this.data),e.send(this.data)}catch(o){setTimeout(function(){r.onError(o)},0);return}typeof document<"u"&&(this.index=Q.requestsCount++,Q.requests[this.index]=this)},Q.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Q.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},Q.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},Q.prototype.cleanup=function(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=sr:this.xhr.onreadystatechange=sr,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Q.requests[this.index],this.xhr=null}},Q.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch{}e==="application/octet-stream"||e==="application/octet-stream; charset=UTF-8"?t=this.xhr.response||this.xhr.responseText:t=this.xhr.responseText}catch(r){this.onError(r)}t!=null&&this.onData(t)},Q.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR},Q.prototype.abort=function(){this.cleanup()},Q.requestsCount=0,Q.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ir);else if(typeof addEventListener=="function"){var Dn="onpagehide"in Un?"pagehide":"unload";addEventListener(Dn,ir,!1)}}function ir(){for(var t in Q.requests)Q.requests.hasOwnProperty(t)&&Q.requests[t].abort()}var Pn=he.exports,ve=nr,Fn=Wt,ar=ae,jn=Tt,Mn=/\n/g,qn=/\\n/g,Jt;function zn(){}function Tt(t){ve.call(this,t),this.query=this.query||{},Jt||(Jt=ar.___eio=ar.___eio||[]),this.index=Jt.length;var e=this;Jt.push(function(r){e.onData(r)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){e.script&&(e.script.onerror=zn)},!1)}Fn(Tt,ve),Tt.prototype.supportsBinary=!1,Tt.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),ve.prototype.doClose.call(this)},Tt.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(o){t.onError("jsonp poll error",o)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e;var n=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var o=document.createElement("iframe");document.body.appendChild(o),document.body.removeChild(o)},100)},Tt.prototype.doWrite=function(t,e){var r=this;if(!this.form){var n=document.createElement("form"),o=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,u;n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=i,n.method="POST",n.setAttribute("accept-charset","utf-8"),o.name="d",n.appendChild(o),document.body.appendChild(n),this.form=n,this.area=o}this.form.action=this.uri();function h(){d(),e()}function d(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(l){r.onError("jsonp polling iframe removal error",l)}try{var c='<iframe src="javascript:0" name="'+r.iframeId+'">';u=document.createElement(c)}catch{u=document.createElement("iframe"),u.name=r.iframeId,u.src="javascript:0"}u.id=r.iframeId,r.form.appendChild(u),r.iframe=u}d(),t=t.replace(qn,`\\
7
+ `),this.area.value=t.replace(Mn,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){r.iframe.readyState==="complete"&&h()}:this.iframe.onload=h};const Xn={},Kn=Object.freeze(Object.defineProperty({__proto__:null,default:Xn},Symbol.toStringTag,{value:"Module"})),Wn=Mr(Kn);var ke=de(),Hn=Ct,Jn=Et,Vn=Wt,$n=tr,Gn=ft("engine.io-client:websocket"),Vt,be;if(typeof WebSocket<"u"?Vt=WebSocket:typeof self<"u"&&(Vt=self.WebSocket||self.MozWebSocket),typeof window>"u")try{be=Wn}catch{}var Nt=Vt||be,Yn=it;function it(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=Vt&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(Nt=be),ke.call(this,t)}Vn(it,ke),it.prototype.name="websocket",it.prototype.supportsBinary=!0,it.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={};this.isReactNative||(r.agent=this.agent,r.perMessageDeflate=this.perMessageDeflate,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new Nt(t,e):new Nt(t):new Nt(t,e,r)}catch(n){return this.emit("error",n)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},it.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},it.prototype.write=function(t){var e=this;this.writable=!1;for(var r=t.length,n=0,o=r;n<o;n++)(function(u){Hn.encodePacket(u,e.supportsBinary,function(h){if(!e.usingBrowserWebSocket){var d={};if(u.options&&(d.compress=u.options.compress),e.perMessageDeflate){var c=typeof h=="string"?Buffer.byteLength(h):h.length;c<e.perMessageDeflate.threshold&&(d.compress=!1)}}try{e.usingBrowserWebSocket?e.ws.send(h):e.ws.send(h,d)}catch{Gn("websocket closed before onclose event")}--r||i()})})(t[n]);function i(){e.emit("flush"),setTimeout(function(){e.writable=!0,e.emit("drain")},0)}},it.prototype.onClose=function(){ke.prototype.onClose.call(this)},it.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},it.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";this.port&&(e==="wss"&&Number(this.port)!==443||e==="ws"&&Number(this.port)!==80)&&(r=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=$n()),this.supportsBinary||(t.b64=1),t=Jn.encode(t),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t},it.prototype.check=function(){return!!Nt&&!("__initialize"in Nt&&this.name===it.prototype.name)};var Qn=ce,Zn=Pn,to=jn,eo=Yn;qt.polling=ro,qt.websocket=eo;function ro(t){var e,r=!1,n=!1,o=t.jsonp!==!1;if(typeof location<"u"){var i=location.protocol==="https:",u=location.port;u||(u=i?443:80),r=t.hostname!==location.hostname||u!==t.port,n=t.secure!==i}if(t.xdomain=r,t.xscheme=n,e=new Qn(t),"open"in e&&!t.forceJSONP)return new Zn(t);if(!o)throw new Error("JSONP disabled");return new to(t)}var no=[].indexOf,cr=function(t,e){if(no)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1},oo=qt,so=wt,Y=ft("engine.io-client:socket"),io=cr,hr=Ct,pr=Pe,ao=Et,co=X;function X(t,e){if(!(this instanceof X))return new X(t,e);e=e||{},t&&typeof t=="object"&&(e=t,t=null),t?(t=pr(t),e.hostname=t.host,e.secure=t.protocol==="https"||t.protocol==="wss",e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=pr(e.host).host),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?443:80),this.query=e.query||{},typeof this.query=="string"&&(this.query=ao.decode(this.query)),this.upgrade=e.upgrade!==!1,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=e.jsonp!==!1,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.withCredentials=e.withCredentials!==!1,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=e.perMessageDeflate!==!1?e.perMessageDeflate||{}:!1,this.perMessageDeflate===!0&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||void 0,this.key=e.key||void 0,this.passphrase=e.passphrase||void 0,this.cert=e.cert||void 0,this.ca=e.ca||void 0,this.ciphers=e.ciphers||void 0,this.rejectUnauthorized=e.rejectUnauthorized===void 0?!0:e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",(typeof self>"u"||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}X.priorWebsocketSuccess=!1,so(X.prototype),X.protocol=hr.protocol,X.Socket=X,X.Transport=de(),X.transports=qt,X.parser=Ct,X.prototype.createTransport=function(t){Y('creating transport "%s"',t);var e=ho(this.query);e.EIO=hr.protocol,e.transport=t;var r=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var n=new oo[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative});return n};function ho(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}X.prototype.open=function(){var t;if(this.rememberUpgrade&&X.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){var e=this;setTimeout(function(){e.emit("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)},X.prototype.setTransport=function(t){Y("setting transport %s",t.name);var e=this;this.transport&&(Y("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(r){e.onPacket(r)}).on("error",function(r){e.onError(r)}).on("close",function(){e.onClose("transport close")})},X.prototype.probe=function(t){Y('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,n=this;X.priorWebsocketSuccess=!1;function o(){if(n.onlyBinaryUpgrades){var p=!this.supportsBinary&&n.transport.supportsBinary;r=r||p}r||(Y('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(a){if(!r)if(a.type==="pong"&&a.data==="probe"){if(Y('probe transport "%s" pong',t),n.upgrading=!0,n.emit("upgrading",e),!e)return;X.priorWebsocketSuccess=e.name==="websocket",Y('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||n.readyState!=="closed"&&(Y("changing transport and sending upgrade packet"),l(),n.setTransport(e),e.send([{type:"upgrade"}]),n.emit("upgrade",e),e=null,n.upgrading=!1,n.flush())})}else{Y('probe transport "%s" failed',t);var s=new Error("probe error");s.transport=e.name,n.emit("upgradeError",s)}}))}function i(){r||(r=!0,l(),e.close(),e=null)}function u(p){var a=new Error("probe error: "+p);a.transport=e.name,i(),Y('probe transport "%s" failed because of error: %s',t,p),n.emit("upgradeError",a)}function h(){u("transport closed")}function d(){u("socket closed")}function c(p){e&&p.name!==e.name&&(Y('"%s" works - aborting "%s"',p.name,e.name),i())}function l(){e.removeListener("open",o),e.removeListener("error",u),e.removeListener("close",h),n.removeListener("close",d),n.removeListener("upgrading",c)}e.once("open",o),e.once("error",u),e.once("close",h),this.once("close",d),this.once("upgrading",c),e.open()},X.prototype.onOpen=function(){if(Y("socket open"),this.readyState="open",X.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){Y("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},X.prototype.onPacket=function(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Y('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data);break}else Y('packet received with socket readyState "%s"',this.readyState)},X.prototype.onHandshake=function(t){this.emit("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.onOpen(),this.readyState!=="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},X.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){e.readyState!=="closed"&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},X.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){Y("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},X.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},X.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()},X.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(Y("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},X.prototype.write=X.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this},X.prototype.sendPacket=function(t,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),!(this.readyState==="closing"||this.readyState==="closed")){r=r||{},r.compress=r.compress!==!1;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},X.prototype.close=function(){if(this.readyState==="opening"||this.readyState==="open"){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}function e(){t.onClose("forced close"),Y("socket closing - telling transport to close"),t.transport.close()}function r(){t.removeListener("upgrade",r),t.removeListener("upgradeError",r),e()}function n(){t.once("upgrade",r),t.once("upgradeError",r)}return this},X.prototype.onError=function(t){Y("socket error %j",t),X.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},X.prototype.onClose=function(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){Y('socket close with reason: "%s"',t);var r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),r.writeBuffer=[],r.prevBufferLen=0}},X.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~io(this.transports,t[r])&&e.push(t[r]);return e},se.exports=co,se.exports.parser=Ct;var po=se.exports,ur={exports:{}},uo=lo;function lo(t,e){var r=[];e=e||0;for(var n=e||0;n<t.length;n++)r[n-e]=t[n];return r}var lr=fo;function fo(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}var fr=[].slice,dr=function(t,e){if(typeof e=="string"&&(e=t[e]),typeof e!="function")throw new Error("bind() requires a function");var r=fr.call(arguments,2);return function(){return e.apply(t,r.concat(fr.call(arguments)))}};(function(t,e){var r=jt,n=wt,o=uo,i=lr,u=dr,h=ft("socket.io-client:socket"),d=Et,c=Ke;t.exports=a;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=n.prototype.emit;function a(s,f,y){this.io=s,this.nsp=f,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},y&&y.query&&(this.query=y.query),this.io.autoConnect&&this.open()}n(a.prototype),a.prototype.subEvents=function(){if(!this.subs){var s=this.io;this.subs=[i(s,"open",u(this,"onopen")),i(s,"packet",u(this,"onpacket")),i(s,"close",u(this,"onclose"))]}},a.prototype.open=a.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState==="open"&&this.onopen(),this.emit("connecting"),this)},a.prototype.send=function(){var s=o(arguments);return s.unshift("message"),this.emit.apply(this,s),this},a.prototype.emit=function(s){if(l.hasOwnProperty(s))return p.apply(this,arguments),this;var f=o(arguments),y={type:(this.flags.binary!==void 0?this.flags.binary:c(f))?r.BINARY_EVENT:r.EVENT,data:f};return y.options={},y.options.compress=!this.flags||this.flags.compress!==!1,typeof f[f.length-1]=="function"&&(h("emitting packet with ack id %d",this.ids),this.acks[this.ids]=f.pop(),y.id=this.ids++),this.connected?this.packet(y):this.sendBuffer.push(y),this.flags={},this},a.prototype.packet=function(s){s.nsp=this.nsp,this.io.packet(s)},a.prototype.onopen=function(){if(h("transport is open - connecting"),this.nsp!=="/")if(this.query){var s=typeof this.query=="object"?d.encode(this.query):this.query;h("sending connect packet with query %s",s),this.packet({type:r.CONNECT,query:s})}else this.packet({type:r.CONNECT})},a.prototype.onclose=function(s){h("close (%s)",s),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",s)},a.prototype.onpacket=function(s){var f=s.nsp===this.nsp,y=s.type===r.ERROR&&s.nsp==="/";if(!(!f&&!y))switch(s.type){case r.CONNECT:this.onconnect();break;case r.EVENT:this.onevent(s);break;case r.BINARY_EVENT:this.onevent(s);break;case r.ACK:this.onack(s);break;case r.BINARY_ACK:this.onack(s);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",s.data);break}},a.prototype.onevent=function(s){var f=s.data||[];h("emitting event %j",f),s.id!=null&&(h("attaching ack callback to event"),f.push(this.ack(s.id))),this.connected?p.apply(this,f):this.receiveBuffer.push(f)},a.prototype.ack=function(s){var f=this,y=!1;return function(){if(!y){y=!0;var g=o(arguments);h("sending ack %j",g),f.packet({type:c(g)?r.BINARY_ACK:r.ACK,id:s,data:g})}}},a.prototype.onack=function(s){var f=this.acks[s.id];typeof f=="function"?(h("calling ack %s with %j",s.id,s.data),f.apply(this,s.data),delete this.acks[s.id]):h("bad ack %s",s.id)},a.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit("connect")},a.prototype.emitBuffered=function(){var s;for(s=0;s<this.receiveBuffer.length;s++)p.apply(this,this.receiveBuffer[s]);for(this.receiveBuffer=[],s=0;s<this.sendBuffer.length;s++)this.packet(this.sendBuffer[s]);this.sendBuffer=[]},a.prototype.ondisconnect=function(){h("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},a.prototype.destroy=function(){if(this.subs){for(var s=0;s<this.subs.length;s++)this.subs[s].destroy();this.subs=null}this.io.destroy(this)},a.prototype.close=a.prototype.disconnect=function(){return this.connected&&(h("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},a.prototype.compress=function(s){return this.flags.compress=s,this},a.prototype.binary=function(s){return this.flags.binary=s,this}})(ur);var yr=ur.exports,yo=xt;function xt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}xt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+r:t-r}return Math.min(t,this.max)|0},xt.prototype.reset=function(){this.attempts=0},xt.prototype.setMin=function(t){this.ms=t},xt.prototype.setMax=function(t){this.max=t},xt.prototype.setJitter=function(t){this.jitter=t};var go=po,mo=yr,vo=wt,ko=jt,kt=lr,Ot=dr,tt=ft("socket.io-client:manager"),gr=cr,bo=yo,mr=Object.prototype.hasOwnProperty,vr=W;function W(t,e){if(!(this instanceof W))return new W(t,e);t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new bo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=e.parser||ko;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}W.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)mr.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},W.prototype.updateSocketIds=function(){for(var t in this.nsps)mr.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},W.prototype.generateId=function(t){return(t==="/"?"":t+"#")+this.engine.id},vo(W.prototype),W.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},W.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},W.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},W.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},W.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},W.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},W.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},W.prototype.open=W.prototype.connect=function(t,e){if(tt("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;tt("opening %s",this.uri),this.engine=go(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var o=kt(r,"open",function(){n.onopen(),t&&t()}),i=kt(r,"error",function(d){if(tt("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",d),t){var c=new Error("Connection error");c.data=d,t(c)}else n.maybeReconnectOnOpen()});if(this._timeout!==!1){var u=this._timeout;tt("connect attempt will timeout after %d",u),u===0&&o.destroy();var h=setTimeout(function(){tt("connect attempt timed out after %d",u),o.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",u)},u);this.subs.push({destroy:function(){clearTimeout(h)}})}return this.subs.push(o),this.subs.push(i),this},W.prototype.onopen=function(){tt("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(kt(t,"data",Ot(this,"ondata"))),this.subs.push(kt(t,"ping",Ot(this,"onping"))),this.subs.push(kt(t,"pong",Ot(this,"onpong"))),this.subs.push(kt(t,"error",Ot(this,"onerror"))),this.subs.push(kt(t,"close",Ot(this,"onclose"))),this.subs.push(kt(this.decoder,"decoded",Ot(this,"ondecoded")))},W.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},W.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},W.prototype.ondata=function(t){this.decoder.add(t)},W.prototype.ondecoded=function(t){this.emit("packet",t)},W.prototype.onerror=function(t){tt("error",t),this.emitAll("error",t)},W.prototype.socket=function(t,e){var r=this.nsps[t];if(!r){r=new mo(this,t,e),this.nsps[t]=r;var n=this;r.on("connecting",o),r.on("connect",function(){r.id=n.generateId(t)}),this.autoConnect&&o()}function o(){~gr(n.connecting,r)||n.connecting.push(r)}return r},W.prototype.destroy=function(t){var e=gr(this.connecting,t);~e&&this.connecting.splice(e,1),!this.connecting.length&&this.close()},W.prototype.packet=function(t){tt("writing packet %j",t);var e=this;t.query&&t.type===0&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(r){for(var n=0;n<r.length;n++)e.engine.write(r[n],t.options);e.encoding=!1,e.processPacketQueue()}))},W.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},W.prototype.cleanup=function(){tt("cleanup");for(var t=this.subs.length,e=0;e<t;e++){var r=this.subs.shift();r.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},W.prototype.close=W.prototype.disconnect=function(){tt("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},W.prototype.onclose=function(t){tt("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},W.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)tt("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();tt("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(tt("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),!t.skipReconnect&&t.open(function(n){n?(tt("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",n.data)):(tt("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}},W.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)},function(t,e){var r=Qr,n=jt,o=vr,i=ft("socket.io-client");t.exports=e=h;var u=e.managers={};function h(d,c){typeof d=="object"&&(c=d,d=void 0),c=c||{};var l=r(d),p=l.source,a=l.id,s=l.path,f=u[a]&&s in u[a].nsps,y=c.forceNew||c["force new connection"]||c.multiplex===!1||f,g;return y?(i("ignoring socket cache for %s",p),g=o(p,c)):(u[a]||(i("new io instance for %s",p),u[a]=o(p,c)),g=u[a]),l.query&&!c.query&&(c.query=l.query),g.socket(l.path,c)}e.protocol=n.protocol,e.connect=h,e.Manager=vr,e.Socket=yr}(Qt,Qt.exports);var Co=Qt.exports;const wo=jr(Co);let $t;const So=new Uint8Array(16);function Eo(){if(!$t&&($t=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $t(So)}const Z=[];for(let t=0;t<256;++t)Z.push((t+256).toString(16).slice(1));function Ao(t,e=0){return Z[t[e+0]]+Z[t[e+1]]+Z[t[e+2]]+Z[t[e+3]]+"-"+Z[t[e+4]]+Z[t[e+5]]+"-"+Z[t[e+6]]+Z[t[e+7]]+"-"+Z[t[e+8]]+Z[t[e+9]]+"-"+Z[t[e+10]]+Z[t[e+11]]+Z[t[e+12]]+Z[t[e+13]]+Z[t[e+14]]+Z[t[e+15]]}const To=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kr={randomUUID:To};function No(t,e,r){if(kr.randomUUID&&!e&&!t)return kr.randomUUID();t=t||{};const n=t.random||(t.rng||Eo)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return Ao(n)}function xo(t,e){const r=e.map(o=>JSON.stringify(o)).join(" "),n=new Date().toISOString();return JSON.stringify({level:t,time:n,message:r})}function Oo(t,e){const r=JSON.parse(t);return e.forEach(n=>delete r[n]),r}function Ro(t){if(typeof t=="object"&&t!==null)return t;try{return JSON.parse(t)}catch{return{extraData:t}}}function Io(t){const e=/\(([^)]+)\)/,r=t.match(e);if(r&&r[1]){const n=r[1].split(";");for(let o of n)if(o=o.trim(),o.startsWith("Windows")||o.startsWith("Macintosh")||o.startsWith("Linux"))return o}return"Unknown"}function br(t){return(...e)=>new Promise((r,n)=>{try{const o=t(...e);r(o)}catch(o){n(o)}})}const Bo={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},Ce={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4},pt={CREATE:"Create",READ:"Read",UPDATE:"Update",DELETE:"Delete",CONVERT:"Convert",DOWNLOAD:"Download",UPLOAD:"Upload",ENCRYPT:"Encrypt",DECRYPT:"Decrypt",FILTER:"Filter",INPUT:"Input",OUTPUT:"Output",PLUGIN:"Plugin",LOGIN:"Login",LOGOUT:"Logout",REFRESH:"Refresh",CHECK:"Check",WEBHOOK:"Webhook",WSCONNECT:"WSConnect"},_o={Create:1,Read:2,Update:3,Delete:4,Convert:5,Download:6,Upload:7,Encrypt:8,Decrypt:9,Filter:10,Input:11,Output:12,Plugin:13,Login:14,Logout:15,Refresh:16,Check:17,Webhook:18,WSConnect:19},ut={INFO:"info",WARNING:"warning",MODIFY:"modify",ERROR:"error",VIEW:"view"},et={INFO:"info",WARNING:"warning",ERROR:"error",DEBUG:"debug"};let rt=console;class Lo{constructor(e){V(this,"logToConsole"),V(this,"overloadGlobalConsole"),V(this,"system"),V(this,"socketEmitInterval"),V(this,"storageId"),V(this,"emitInProgress"),V(this,"queue"),V(this,"processing"),V(this,"storageInitialized"),V(this,"interval"),V(this,"logIndex"),V(this,"socket"),V(this,"staticObject",{}),V(this,"localObject",{}),V(this,"isGetItemAsync"),V(this,"isSetItemAsync"),V(this,"getItem"),V(this,"setItem"),V(this,"parseLog"),V(this,"_logMethod"),V(this,"_warnMethod"),V(this,"_errorMethod"),V(this,"_debugMethod");const{loggerOptions:r}=e;if(!r.system)throw new Error("Config property 'system' should be provided!");this.isGetItemAsync=r.isGetItemAsync||!1,this.isSetItemAsync=r.isSetItemAsync||!1,this.setupStorageFunctions(r.getItem,r.setItem,r.parseLog),this.system=r.system,this.socketEmitInterval=r.socketEmitInterval||Ce.socketEmitInterval,this.logToConsole=r.logToConsole!==void 0?r.logToConsole:Ce.logToConsole,this.overloadGlobalConsole=r.overloadGlobalConsole!==void 0?r.overloadGlobalConsole:Ce.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.storageInitialized=!1,this.emitInProgress=!1,this.logIndex=0,this.init(e)}setupStorageFunctions(e,r,n){this.getItem=e&&typeof e=="function"?this.isGetItemAsync?e:br(e):this.defaultGetItemFunction,this.setItem=r&&typeof r=="function"?this.isSetItemAsync?r:br(r):this.defaultSetItemFunction,this.parseLog=n&&typeof n=="function"?n:xo}init(e){const{socket:r,url:n,socketOptions:o={}}=e;this._logMethod=rt.log.bind(rt),this._warnMethod=rt.warn.bind(rt),this._errorMethod=rt.error.bind(rt),this._debugMethod=rt.debug.bind(rt),this.initStorage().then(()=>{if(r)this.socket=r;else if(n)this.socket=this.createConnection(n,o);else throw new Error("Must provide either a 'socket' or a 'url' for socket connection");this.interval=setInterval(async()=>{await this.emitLogs()},this.socketEmitInterval),this.overloadGlobalConsole&&this._overloadConsole()})}createConnection(e,r={}){const n={...Bo,...r};return wo(e,n)}async emitLogs(){if(!this.emitInProgress)try{const e=await this.getItem(this.storageId),r=JSON.parse(e||"{}"),n={...this.localObject,...r};if(!Object.keys(n).length)return;const o=[];this.emitInProgress=!0;const i=Object.keys(n);if(!i.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const d of i){const c=Ro(n[d]),l={...this.staticObject,...c},p=this.populateSendingLog(l);await this.socket.emit("Log",JSON.stringify(p)),o.push(d)}const u=await this.getItem(this.storageId);if(!u)return;const h=Oo(u,o);this.localObject={},await this.setItem(this.storageId,JSON.stringify(h))}catch(e){this._errorMethod(e)}finally{this.emitInProgress=!1}}populateSendingLog(e){const r={...e},n=r.ActionName;return n&&(r.ActionID=_o[n]),r}setupStaticFields(e){this.staticObject={...e}}populateMetaData(){const e=new Date;let r;typeof window<"u"&&typeof window.document<"u"?r=window==null?void 0:window.navigator.userAgent:typeof self<"u"&&self.navigator&&(r=self.navigator.userAgent);let n;return r&&(n=Io(r)),{System:this.system,DateTime:e,UserAgent:r,OSVersion:n}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){rt=Object.assign(rt,{log:e=>{this.log(e)},warn:e=>{this.warn(e)},error:e=>{this.error(e)},debug:e=>{this.debug(e)}})}async initStorage(){const e=await this.getItem(this.storageId);(!e||typeof e!="string")&&(await this.setItem(this.storageId,JSON.stringify({})),this.storageInitialized=!0)}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const e=No();return this.system.toString().toUpperCase()+e+Date.now()}async processLog(...e){try{if(e.length<2)return;const r=e[0],n=e[1],o=this.formItemKey(r);if(!this.storageInitialized){this.localObject={...this.localObject,[o]:n};return}const i=await this.getItem(this.storageId);if(!i)return;const u=JSON.parse(i);u[o]=JSON.stringify(n),await this.setItem(this.storageId,JSON.stringify(u))}catch(r){this._errorMethod(r)}}async processQueue(){if(this.processing||this.queue.length===0)return;const e=this.queue.shift();e&&(this.processing=!0,await this.processLog(...e).finally(()=>{this.processing=!1,this.processQueue()}))}log(e){const r={...this.populateMetaData(),...e},n=["INFO",r];this.queue.push(n),this.logToConsole&&this._logMethod.apply(rt,[r]),this.processQueue()}warn(e){const r=["WARN",e];this.queue.push(r),this.logToConsole&&this._warnMethod.apply(rt,[e]),this.processQueue()}error(e){const r=["ERROR",e];this.queue.push(r),this.logToConsole&&this._errorMethod.apply(rt,[e]),this.processQueue()}debug(e){const r=["DEBUG",e];this.queue.push(r),this.logToConsole&&this._debugMethod.apply(rt,[e]),this.processQueue()}async defaultGetItemFunction(e){return localStorage.getItem(e)}async defaultSetItemFunction(e,r){try{localStorage.setItem(e,r)}catch(n){this._errorMethod(n)}}formItemKey(e){const r=new Date().toISOString();return this.logIndex++,`${e}-${this.system}-${r}-${this.logIndex}`}}class Uo{constructor(e){H(this,"delay",1e3);H(this,"lastLoginTimestamp");H(this,"token");H(this,"storageKey");this.eventsSdkClass=e,this.eventsSdkClass=e,this.storageKey=""}async login(e){const r={token:e.token,email:e.email,password:e.password};if(this.storageKey=Dr(JSON.stringify({...e,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp(),await this.checkLoginStatus(this.storageKey)||(Rt.clearSessionStorage(),await this.userLoginFunction(r,this.storageKey,e.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(e){const r=await Rt.getSessionStorageDataByKey(e);return r?(this.onLoginResponse(r),!0):!1}async userLoginFunction(e,r,n){let o,i,u;this.eventsSdkClass.options.isNewStack?(o=await this.externalLogin(this.eventsSdkClass.options.loginUrl,e,n),i=await this.getSettings(o.Data.AccessToken),u={...o.Data,...i}):(o=await this.externalLogin(this.eventsSdkClass.options.loginUrl,e,n),u={...o.Data.Socket}),this.onLoginResponse(u),await Rt.updateSessionStorageKey(r,u)}onLoginResponse(e){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),e.MonitorList&&e.MonitorList.length&&(this.eventsSdkClass.servers=[...e.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&e.URLList&&(this.eventsSdkClass.URLList=e.URLList),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.URLList.length&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");if(this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");this.eventsSdkClass.server&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${this.eventsSdkClass.server.Version}`),!this.eventsSdkClass.server&&this.eventsSdkClass.URLList.length&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${e.Version}`),e.IdentityCode&&(this.token=e.IdentityCode,this.eventsSdkClass.connect(bt.MAIN)),e.Token&&(this.token=e.Token,this.eventsSdkClass.connect(bt.MAIN)),e.RefreshToken&&e.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===ct.USER&&(this.eventsSdkClass.options.refreshToken=e.RefreshToken,this.eventsSdkClass.options.tokenExpiry=e.IdentityCodeExpiry,this.handleTokenExpiry()),e.RefreshToken&&e.TokenExpiry&&this.normalizeLoginType(this.eventsSdkClass.options.loginType)===ct.USER&&(this.eventsSdkClass.options.refreshToken=e.RefreshToken,this.eventsSdkClass.options.tokenExpiry=e.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let e;if(this.eventsSdkClass.options.tokenExpiry)e=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const r=e.getTime()-new Date().getTime()-5e3,n=Math.min(r,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let o,i;if(this.eventsSdkClass.options.isNewStack){const u=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);o=await this.getSettings(u.Data.AccessToken),i={...u.Data,...o}}else i={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(i),await Rt.updateSessionStorageKey(this.storageKey,i)}},n)}async externalLogin(e,{password:r,token:n,email:o},i){if(!e)throw new Error("loginUrl not provided");let u;this.eventsSdkClass.options.isNewStack?i===ct.TOKEN?u=JSON.stringify({identityType:ct.TOKEN,token:n}):u=JSON.stringify({identityType:ct.USER,username:o,password:r}):this.eventsSdkClass.options.loginType===ct.TOKEN?(u=JSON.stringify({token:n}),e=`${e}/${ct.TOKEN}`):(u=JSON.stringify({email:o,pin:r}),e=`${e}/${ct.USER}`);try{const h=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:u});if(!h.ok&&h.status===400)throw new Error("Bad body request. Login type or isNewStack values not correct or not provided");if(!h.ok&&h.status===401)throw new Error("Unauthorized. Invalid token provided");if(!h.ok&&h.status===403)throw new Error("Forbidden. Identity token not provided or not valid");const d=await h.json();if(d.error)throw new Error(d.error);return d}catch(h){throw this.eventsSdkClass.loggerClass.log({Message:`External login request error with the login type ${ct} ${i===ct.TOKEN?{token:n}:{email:o,pin:r}}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"External login error",StatusCode:400,Level:et.ERROR,LogType:ut.ERROR}),h}}async getSettings(e){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const r=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok&&r.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return r.json()}catch(r){throw this.eventsSdkClass.loggerClass.log({Message:`Get settings error with token ${e}, error: ${r}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:et.ERROR,LogType:ut.ERROR}),r}}async refreshToken(e,r){try{return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}})).json()}catch(n){throw this.eventsSdkClass.loggerClass.log({Message:`Refresh token error with old refresh token ${r}, url: ${e}, error: ${n}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:et.ERROR,LogType:ut.ERROR}),n}}normalizeLoginType(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}}const Do={loginUrl:"https://loginapi.voicenter.co.il/monitorAPI/Login",refreshTokenUrl:"https://loginapi.voicenter.co.il/monitorAPI/RefreshIdentityToken",isNewStack:!1,forceNew:!0,reconnectionDelay:1e4,reconnectionDelayMax:1e4,maxReconnectAttempts:5,timeout:1e4,keepAliveTimeout:6e4,idleInterval:6e4*5,protocol:"https",transports:["websocket"],upgrade:!1,serverFetchStrategy:"static",serverType:0,useLogger:!0,loggerServer:"https://socketlog.voicenter.co",loggerConfig:{logToConsole:!0,overloadGlobalConsole:!1,system:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function Po(){return(typeof window.navigator>"u"||typeof window.navigator.userAgent>"u")&&(window.navigator.userAgent="react-native"),function t(e,r,n){function o(h,d){if(!r[h]){if(!e[h]){var c=typeof require=="function"&&require;if(!d&&c)return c(h,!0);if(i)return i(h,!0);throw new Error("Cannot find module '"+h+"'")}var l=r[h]={exports:{}};e[h][0].call(l.exports,function(p){var a=e[h][1][p];return o(a||p)},l,l.exports,t,e,r,n)}return r[h].exports}for(var i=typeof require=="function"&&require,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(t,e){e.exports=t("./lib/")},{"./lib/":2}],2:[function(t,e,r){function n(c,l){typeof c=="object"&&(l=c,c=void 0),l=l||{};var p,a=o(c),s=a.source,f=a.id;return l.forceNew||l["force new connection"]||l.multiplex===!1?(h("ignoring socket cache for %s",s),p=u(s,l)):(d[f]||(h("new io instance for %s",s),d[f]=u(s,l)),p=d[f]),p.socket(a.path)}var o=t("./url"),i=t("socket.io-parser"),u=t("./manager"),h=t("debug")("socket.io-client");e.exports=r=n;var d=r.managers={};r.protocol=i.protocol,r.connect=n,r.Manager=t("./manager"),r.Socket=t("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(t,e){function r(a,s){return this instanceof r?(a&&typeof a=="object"&&(s=a,a=void 0),s=s||{},s.path=s.path||"/socket.io",this.nsps={},this.subs=[],this.opts=s,this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor(s.randomizationFactor||.5),this.backoff=new p({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this.readyState="closed",this.uri=a,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new u.Encoder,this.decoder=new u.Decoder,this.autoConnect=s.autoConnect!==!1,void(this.autoConnect&&this.open())):new r(a,s)}var n=(t("./url"),t("engine.io-client")),o=t("./socket"),i=t("component-emitter"),u=t("socket.io-parser"),h=t("./on"),d=t("component-bind"),c=(t("object-component"),t("debug")("socket.io-client:manager")),l=t("indexof"),p=t("backo2");e.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var a in this.nsps)this.nsps[a].emit.apply(this.nsps[a],arguments)},r.prototype.updateSocketIds=function(){for(var a in this.nsps)this.nsps[a].id=this.engine.id},i(r.prototype),r.prototype.reconnection=function(a){return arguments.length?(this._reconnection=!!a,this):this._reconnection},r.prototype.reconnectionAttempts=function(a){return arguments.length?(this._reconnectionAttempts=a,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(a){return arguments.length?(this._reconnectionDelay=a,this.backoff&&this.backoff.setMin(a),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(a){return arguments.length?(this._randomizationFactor=a,this.backoff&&this.backoff.setJitter(a),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(a){return arguments.length?(this._reconnectionDelayMax=a,this.backoff&&this.backoff.setMax(a),this):this._reconnectionDelayMax},r.prototype.timeout=function(a){return arguments.length?(this._timeout=a,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},r.prototype.open=r.prototype.connect=function(a){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=n(this.uri,this.opts);var s=this.engine,f=this;this.readyState="opening",this.skipReconnect=!1;var y=h(s,"open",function(){f.onopen(),a&&a()}),g=h(s,"error",function(_){if(c("connect_error"),f.cleanup(),f.readyState="closed",f.emitAll("connect_error",_),a){var b=new Error("Connection error");b.data=_,a(b)}else f.maybeReconnectOnOpen()});if(this._timeout!==!1){var w=this._timeout;c("connect attempt will timeout after %d",w);var B=setTimeout(function(){c("connect attempt timed out after %d",w),y.destroy(),s.close(),s.emit("error","timeout"),f.emitAll("connect_timeout",w)},w);this.subs.push({destroy:function(){clearTimeout(B)}})}return this.subs.push(y),this.subs.push(g),this},r.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var a=this.engine;this.subs.push(h(a,"data",d(this,"ondata"))),this.subs.push(h(this.decoder,"decoded",d(this,"ondecoded"))),this.subs.push(h(a,"error",d(this,"onerror"))),this.subs.push(h(a,"close",d(this,"onclose")))},r.prototype.ondata=function(a){this.decoder.add(a)},r.prototype.ondecoded=function(a){this.emit("packet",a)},r.prototype.onerror=function(a){c("error",a),this.emitAll("error",a)},r.prototype.socket=function(a){var s=this.nsps[a];if(!s){s=new o(this,a),this.nsps[a]=s;var f=this;s.on("connect",function(){s.id=f.engine.id,~l(f.connected,s)||f.connected.push(s)})}return s},r.prototype.destroy=function(a){var s=l(this.connected,a);~s&&this.connected.splice(s,1),this.connected.length||this.close()},r.prototype.packet=function(a){c("writing packet %j",a);var s=this;s.encoding?s.packetBuffer.push(a):(s.encoding=!0,this.encoder.encode(a,function(f){for(var y=0;y<f.length;y++)s.engine.write(f[y]);s.encoding=!1,s.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var a=this.packetBuffer.shift();this.packet(a)}},r.prototype.cleanup=function(){for(var a;a=this.subs.shift();)a.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(a){c("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",a),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var a=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var s=this.backoff.duration();c("will wait %dms before reconnect attempt",s),this.reconnecting=!0;var f=setTimeout(function(){a.skipReconnect||(c("attempting reconnect"),a.emitAll("reconnect_attempt",a.backoff.attempts),a.emitAll("reconnecting",a.backoff.attempts),a.skipReconnect||a.open(function(y){y?(c("reconnect attempt error"),a.reconnecting=!1,a.reconnect(),a.emitAll("reconnect_error",y.data)):(c("reconnect success"),a.onreconnect())}))},s);this.subs.push({destroy:function(){clearTimeout(f)}})}},r.prototype.onreconnect=function(){var a=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",a)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e){function r(n,o,i){return n.on(o,i),{destroy:function(){n.removeListener(o,i)}}}e.exports=r},{}],5:[function(t,e,r){function n(s,f){this.io=s,this.nsp=f,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var o=t("socket.io-parser"),i=t("component-emitter"),u=t("to-array"),h=t("./on"),d=t("component-bind"),c=t("debug")("socket.io-client:socket"),l=t("has-binary");e.exports=n;var p={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},a=i.prototype.emit;i(n.prototype),n.prototype.subEvents=function(){if(!this.subs){var s=this.io;this.subs=[h(s,"open",d(this,"onopen")),h(s,"packet",d(this,"onpacket")),h(s,"close",d(this,"onclose"))]}},n.prototype.open=n.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},n.prototype.send=function(){var s=u(arguments);return s.unshift("message"),this.emit.apply(this,s),this},n.prototype.emit=function(s){if(p.hasOwnProperty(s))return a.apply(this,arguments),this;var f=u(arguments),y=o.EVENT;l(f)&&(y=o.BINARY_EVENT);var g={type:y,data:f};return typeof f[f.length-1]=="function"&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=f.pop(),g.id=this.ids++),this.connected?this.packet(g):this.sendBuffer.push(g),this},n.prototype.packet=function(s){s.nsp=this.nsp,this.io.packet(s)},n.prototype.onopen=function(){c("transport is open - connecting"),this.nsp!="/"&&this.packet({type:o.CONNECT})},n.prototype.onclose=function(s){c("close (%s)",s),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",s)},n.prototype.onpacket=function(s){if(s.nsp==this.nsp)switch(s.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(s);break;case o.BINARY_EVENT:this.onevent(s);break;case o.ACK:this.onack(s);break;case o.BINARY_ACK:this.onack(s);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",s.data)}},n.prototype.onevent=function(s){var f=s.data||[];c("emitting event %j",f),s.id!=null&&(c("attaching ack callback to event"),f.push(this.ack(s.id))),this.connected?a.apply(this,f):this.receiveBuffer.push(f)},n.prototype.ack=function(s){var f=this,y=!1;return function(){if(!y){y=!0;var g=u(arguments);c("sending ack %j",g);var w=l(g)?o.BINARY_ACK:o.ACK;f.packet({type:w,id:s,data:g})}}},n.prototype.onack=function(s){c("calling ack %s with %j",s.id,s.data);var f=this.acks[s.id];f.apply(this,s.data),delete this.acks[s.id]},n.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},n.prototype.emitBuffered=function(){var s;for(s=0;s<this.receiveBuffer.length;s++)a.apply(this,this.receiveBuffer[s]);for(this.receiveBuffer=[],s=0;s<this.sendBuffer.length;s++)this.packet(this.sendBuffer[s]);this.sendBuffer=[]},n.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},n.prototype.destroy=function(){if(this.subs){for(var s=0;s<this.subs.length;s++)this.subs[s].destroy();this.subs=null}this.io.destroy(this)},n.prototype.close=n.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:o.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{"./on":4,"component-bind":8,"component-emitter":9,debug:10,"has-binary":36,"socket.io-parser":44,"to-array":48}],6:[function(t,e){(function(r){function n(u,c){var d=u,c=c||r.location;return u==null&&(u=c.protocol+"//"+c.host),typeof u=="string"&&(u.charAt(0)=="/"&&(u=u.charAt(1)=="/"?c.protocol+u:c.hostname+u),/^(https?|wss?):\/\//.test(u)||(i("protocol-less url %s",u),u=typeof c<"u"?c.protocol+"//"+u:"https://"+u),i("parse %s",u),d=o(u)),d.port||(/^(http|ws)$/.test(d.protocol)?d.port="80":/^(http|ws)s$/.test(d.protocol)&&(d.port="443")),d.path=d.path||"/",d.id=d.protocol+"://"+d.host+":"+d.port,d.href=d.protocol+"://"+d.host+(c&&c.port==d.port?"":":"+d.port),d}var o=t("parseuri"),i=t("debug")("socket.io-client:url");e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(t,e){function r(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}e.exports=r,r.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),i=Math.floor(o*this.jitter*n);n=1&Math.floor(10*o)?n+i:n-i}return 0|Math.min(n,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(n){this.ms=n},r.prototype.setMax=function(n){this.max=n},r.prototype.setJitter=function(n){this.jitter=n}},{}],8:[function(t,e){var r=[].slice;e.exports=function(n,o){if(typeof o=="string"&&(o=n[o]),typeof o!="function")throw new Error("bind() requires a function");var i=r.call(arguments,2);return function(){return o.apply(n,i.concat(r.call(arguments)))}}},{}],9:[function(t,e){function r(o){return o?n(o):void 0}function n(o){for(var i in r.prototype)o[i]=r.prototype[i];return o}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(o,i){return this._callbacks=this._callbacks||{},(this._callbacks[o]=this._callbacks[o]||[]).push(i),this},r.prototype.once=function(o,i){function u(){h.off(o,u),i.apply(this,arguments)}var h=this;return this._callbacks=this._callbacks||{},u.fn=i,this.on(o,u),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(o,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks[o];if(!u)return this;if(arguments.length==1)return delete this._callbacks[o],this;for(var h,d=0;d<u.length;d++)if(h=u[d],h===i||h.fn===i){u.splice(d,1);break}return this},r.prototype.emit=function(o){this._callbacks=this._callbacks||{};var i=[].slice.call(arguments,1),u=this._callbacks[o];if(u){u=u.slice(0);for(var h=0,d=u.length;d>h;++h)u[h].apply(this,i)}return this},r.prototype.listeners=function(o){return this._callbacks=this._callbacks||{},this._callbacks[o]||[]},r.prototype.hasListeners=function(o){return!!this.listeners(o).length}},{}],10:[function(t,e){function r(o){return r.enabled(o)?function(i){i=n(i);var u=new Date,h=u-(r[o]||u);r[o]=u,i=o+" "+i+" +"+r.humanize(h),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function n(o){return o instanceof Error?o.stack||o.message:o}e.exports=r,r.names=[],r.skips=[],r.enable=function(o){try{localStorage.debug=o}catch{}for(var i=(o||"").split(/[\s,]+/),u=i.length,h=0;u>h;h++)o=i[h].replace("*",".*?"),o[0]==="-"?r.skips.push(new RegExp("^"+o.substr(1)+"$")):r.names.push(new RegExp("^"+o+"$"))},r.disable=function(){r.enable("")},r.humanize=function(o){var i=1e3,u=6e4,h=60*u;return o>=h?(o/h).toFixed(1)+"h":o>=u?(o/u).toFixed(1)+"m":o>=i?(o/i|0)+"s":o+"ms"},r.enabled=function(o){for(var i=0,u=r.skips.length;u>i;i++)if(r.skips[i].test(o))return!1;for(var i=0,u=r.names.length;u>i;i++)if(r.names[i].test(o))return!0;return!1};try{window.localStorage&&r.enable(localStorage.debug)}catch{}},{}],11:[function(t,e){e.exports=t("./lib/")},{"./lib/":12}],12:[function(t,e){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(t,e){(function(r){function n(s,f){if(!(this instanceof n))return new n(s,f);if(f=f||{},s&&typeof s=="object"&&(f=s,s=null),s&&(s=l(s),f.host=s.host,f.secure=s.protocol=="https"||s.protocol=="wss",f.port=s.port,s.query&&(f.query=s.query)),this.secure=f.secure!=null?f.secure:r.location&&location.protocol=="https:",f.host){var y=f.host.split(":");f.hostname=y.shift(),y.length?f.port=y.pop():f.port||(f.port=this.secure?"443":"80")}this.agent=f.agent||!1,this.hostname=f.hostname||(r.location?location.hostname:"localhost"),this.port=f.port||(r.location&&location.port?location.port:this.secure?443:80),this.query=f.query||{},typeof this.query=="string"&&(this.query=a.decode(this.query)),this.upgrade=f.upgrade!==!1,this.path=(f.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!f.forceJSONP,this.jsonp=f.jsonp!==!1,this.forceBase64=!!f.forceBase64,this.enablesXDR=!!f.enablesXDR,this.timestampParam=f.timestampParam||"t",this.timestampRequests=f.timestampRequests,this.transports=f.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=f.policyPort||843,this.rememberUpgrade=f.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=f.onlyBinaryUpgrades,this.pfx=f.pfx||null,this.key=f.key||null,this.passphrase=f.passphrase||null,this.cert=f.cert||null,this.ca=f.ca||null,this.ciphers=f.ciphers||null,this.rejectUnauthorized=f.rejectUnauthorized||null,this.open()}function o(s){var f={};for(var y in s)s.hasOwnProperty(y)&&(f[y]=s[y]);return f}var i=t("./transports"),u=t("component-emitter"),h=t("debug")("engine.io-client:socket"),d=t("indexof"),c=t("engine.io-parser"),l=t("parseuri"),p=t("parsejson"),a=t("parseqs");e.exports=n,n.priorWebsocketSuccess=!1,u(n.prototype),n.protocol=c.protocol,n.Socket=n,n.Transport=t("./transport"),n.transports=t("./transports"),n.parser=t("engine.io-parser"),n.prototype.createTransport=function(s){h('creating transport "%s"',s);var f=o(this.query);f.EIO=c.protocol,f.transport=s,this.id&&(f.sid=this.id);var y=new i[s]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:f,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return y},n.prototype.open=function(){var f;if(this.rememberUpgrade&&n.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)f="websocket";else{if(this.transports.length==0){var s=this;return void setTimeout(function(){s.emit("error","No transports available")},0)}f=this.transports[0]}this.readyState="opening";var f;try{f=this.createTransport(f)}catch{return this.transports.shift(),void this.open()}f.open(),this.setTransport(f)},n.prototype.setTransport=function(s){h("setting transport %s",s.name);var f=this;this.transport&&(h("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=s,s.on("drain",function(){f.onDrain()}).on("packet",function(y){f.onPacket(y)}).on("error",function(y){f.onError(y)}).on("close",function(){f.onClose("transport close")})},n.prototype.probe=function(s){function f(){if(C.onlyBinaryUpgrades){var E=!this.supportsBinary&&C.transport.supportsBinary;m=m||E}m||(h('probe transport "%s" opened',s),S.send([{type:"ping",data:"probe"}]),S.once("packet",function(v){if(!m)if(v.type=="pong"&&v.data=="probe"){if(h('probe transport "%s" pong',s),C.upgrading=!0,C.emit("upgrading",S),!S)return;n.priorWebsocketSuccess=S.name=="websocket",h('pausing current transport "%s"',C.transport.name),C.transport.pause(function(){m||C.readyState!="closed"&&(h("changing transport and sending upgrade packet"),b(),C.setTransport(S),S.send([{type:"upgrade"}]),C.emit("upgrade",S),S=null,C.upgrading=!1,C.flush())})}else{h('probe transport "%s" failed',s);var k=new Error("probe error");k.transport=S.name,C.emit("upgradeError",k)}}))}function y(){m||(m=!0,b(),S.close(),S=null)}function g(E){var v=new Error("probe error: "+E);v.transport=S.name,y(),h('probe transport "%s" failed because of error: %s',s,E),C.emit("upgradeError",v)}function w(){g("transport closed")}function B(){g("socket closed")}function _(E){S&&E.name!=S.name&&(h('"%s" works - aborting "%s"',E.name,S.name),y())}function b(){S.removeListener("open",f),S.removeListener("error",g),S.removeListener("close",w),C.removeListener("close",B),C.removeListener("upgrading",_)}h('probing transport "%s"',s);var S=this.createTransport(s,{probe:1}),m=!1,C=this;n.priorWebsocketSuccess=!1,S.once("open",f),S.once("error",g),S.once("close",w),this.once("close",B),this.once("upgrading",_),S.open()},n.prototype.onOpen=function(){if(h("socket open"),this.readyState="open",n.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){h("starting upgrade probes");for(var s=0,f=this.upgrades.length;f>s;s++)this.probe(this.upgrades[s])}},n.prototype.onPacket=function(s){if(this.readyState=="opening"||this.readyState=="open")switch(h('socket receive: type "%s", data "%s"',s.type,s.data),this.emit("packet",s),this.emit("heartbeat"),s.type){case"open":this.onHandshake(p(s.data));break;case"pong":this.setPing();break;case"error":var f=new Error("server error");f.code=s.data,this.emit("error",f);break;case"message":this.emit("data",s.data),this.emit("message",s.data)}else h('packet received with socket readyState "%s"',this.readyState)},n.prototype.onHandshake=function(s){this.emit("handshake",s),this.id=s.sid,this.transport.query.sid=s.sid,this.upgrades=this.filterUpgrades(s.upgrades),this.pingInterval=s.pingInterval,this.pingTimeout=s.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},n.prototype.onHeartbeat=function(s){clearTimeout(this.pingTimeoutTimer);var f=this;f.pingTimeoutTimer=setTimeout(function(){f.readyState!="closed"&&f.onClose("ping timeout")},s||f.pingInterval+f.pingTimeout)},n.prototype.setPing=function(){var s=this;clearTimeout(s.pingIntervalTimer),s.pingIntervalTimer=setTimeout(function(){h("writing ping packet - expecting pong within %sms",s.pingTimeout),s.ping(),s.onHeartbeat(s.pingTimeout)},s.pingInterval)},n.prototype.ping=function(){this.sendPacket("ping")},n.prototype.onDrain=function(){for(var s=0;s<this.prevBufferLen;s++)this.callbackBuffer[s]&&this.callbackBuffer[s]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},n.prototype.flush=function(){this.readyState!="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(h("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},n.prototype.write=n.prototype.send=function(s,f){return this.sendPacket("message",s,f),this},n.prototype.sendPacket=function(s,f,y){if(this.readyState!="closing"&&this.readyState!="closed"){var g={type:s,data:f};this.emit("packetCreate",g),this.writeBuffer.push(g),this.callbackBuffer.push(y),this.flush()}},n.prototype.close=function(){function s(){g.onClose("forced close"),h("socket closing - telling transport to close"),g.transport.close()}function f(){g.removeListener("upgrade",f),g.removeListener("upgradeError",f),s()}function y(){g.once("upgrade",f),g.once("upgradeError",f)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var g=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?y():s()}):this.upgrading?y():s()}return this},n.prototype.onError=function(s){h("socket error %j",s),n.priorWebsocketSuccess=!1,this.emit("error",s),this.onClose("transport error",s)},n.prototype.onClose=function(s,f){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){h('socket close with reason: "%s"',s);var y=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){y.writeBuffer=[],y.callbackBuffer=[],y.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",s,f)}},n.prototype.filterUpgrades=function(s){for(var f=[],y=0,g=s.length;g>y;y++)~d(this.transports,s[y])&&f.push(s[y]);return f}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:40,parsejson:32,parseqs:33,parseuri:34}],14:[function(t,e){function r(i){this.path=i.path,this.hostname=i.hostname,this.port=i.port,this.secure=i.secure,this.query=i.query,this.timestampParam=i.timestampParam,this.timestampRequests=i.timestampRequests,this.readyState="",this.agent=i.agent||!1,this.socket=i.socket,this.enablesXDR=i.enablesXDR,this.pfx=i.pfx,this.key=i.key,this.passphrase=i.passphrase,this.cert=i.cert,this.ca=i.ca,this.ciphers=i.ciphers,this.rejectUnauthorized=i.rejectUnauthorized}var n=t("engine.io-parser"),o=t("component-emitter");e.exports=r,o(r.prototype),r.timestamps=0,r.prototype.onError=function(i,u){var h=new Error(i);return h.type="TransportError",h.description=u,this.emit("error",h),this},r.prototype.open=function(){return(this.readyState=="closed"||this.readyState=="")&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return(this.readyState=="opening"||this.readyState=="open")&&(this.doClose(),this.onClose()),this},r.prototype.send=function(i){if(this.readyState!="open")throw new Error("Transport not open");this.write(i)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(i){var u=n.decodePacket(i,this.socket.binaryType);this.onPacket(u)},r.prototype.onPacket=function(i){this.emit("packet",i)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(t,e,r){(function(n){function o(c){var l,p=!1,a=!1,s=c.jsonp!==!1;if(n.location){var f=location.protocol=="https:",y=location.port;y||(y=f?443:80),p=c.hostname!=location.hostname||y!=c.port,a=c.secure!=f}if(c.xdomain=p,c.xscheme=a,l=new i(c),"open"in l&&!c.forceJSONP)return new u(c);if(!s)throw new Error("JSONP disabled");return new h(c)}var i=t("xmlhttprequest"),u=t("./polling-xhr"),h=t("./polling-jsonp"),d=t("./websocket");r.polling=o,r.websocket=d}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(t,e){(function(r){function n(){}function o(l){i.call(this,l),this.query=this.query||{},h||(r.___eio||(r.___eio=[]),h=r.___eio),this.index=h.length;var p=this;h.push(function(a){p.onData(a)}),this.query.j=this.index,r.document&&r.addEventListener&&r.addEventListener("beforeunload",function(){p.script&&(p.script.onerror=n)},!1)}var i=t("./polling"),u=t("component-inherit");e.exports=o;var h,d=/\n/g,c=/\\n/g;u(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var l=this,p=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),p.async=!0,p.src=this.uri(),p.onerror=function(f){l.onError("jsonp poll error",f)};var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(p,a),this.script=p;var s=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);s&&setTimeout(function(){var f=document.createElement("iframe");document.body.appendChild(f),document.body.removeChild(f)},100)},o.prototype.doWrite=function(l,p){function a(){s(),p()}function s(){if(f.iframe)try{f.form.removeChild(f.iframe)}catch(b){f.onError("jsonp polling iframe removal error",b)}try{var _='<iframe src="javascript:0" name="'+f.iframeId+'">';y=document.createElement(_)}catch{y=document.createElement("iframe"),y.name=f.iframeId,y.src="javascript:0"}y.id=f.iframeId,f.form.appendChild(y),f.iframe=y}var f=this;if(!this.form){var y,g=document.createElement("form"),w=document.createElement("textarea"),B=this.iframeId="eio_iframe_"+this.index;g.className="socketio",g.style.position="absolute",g.style.top="-1000px",g.style.left="-1000px",g.target=B,g.method="POST",g.setAttribute("accept-charset","utf-8"),w.name="d",g.appendChild(w),document.body.appendChild(g),this.form=g,this.area=w}this.form.action=this.uri(),s(),l=l.replace(c,`\\
8
+ `),this.area.value=l.replace(d,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){f.iframe.readyState=="complete"&&a()}:this.iframe.onload=a}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-inherit":21}],17:[function(t,e){(function(r){function n(){}function o(a){if(d.call(this,a),r.location){var s=location.protocol=="https:",f=location.port;f||(f=s?443:80),this.xd=a.hostname!=r.location.hostname||f!=a.port,this.xs=a.secure!=s}}function i(a){this.method=a.method||"GET",this.uri=a.uri,this.xd=!!a.xd,this.xs=!!a.xs,this.async=a.async!==!1,this.data=a.data!=null?a.data:null,this.agent=a.agent,this.isBinary=a.isBinary,this.supportsBinary=a.supportsBinary,this.enablesXDR=a.enablesXDR,this.pfx=a.pfx,this.key=a.key,this.passphrase=a.passphrase,this.cert=a.cert,this.ca=a.ca,this.ciphers=a.ciphers,this.rejectUnauthorized=a.rejectUnauthorized,this.create()}function u(){for(var a in i.requests)i.requests.hasOwnProperty(a)&&i.requests[a].abort()}var h=t("xmlhttprequest"),d=t("./polling"),c=t("component-emitter"),l=t("component-inherit"),p=t("debug")("engine.io-client:polling-xhr");e.exports=o,e.exports.Request=i,l(o,d),o.prototype.supportsBinary=!0,o.prototype.request=function(a){return a=a||{},a.uri=this.uri(),a.xd=this.xd,a.xs=this.xs,a.agent=this.agent||!1,a.supportsBinary=this.supportsBinary,a.enablesXDR=this.enablesXDR,a.pfx=this.pfx,a.key=this.key,a.passphrase=this.passphrase,a.cert=this.cert,a.ca=this.ca,a.ciphers=this.ciphers,a.rejectUnauthorized=this.rejectUnauthorized,new i(a)},o.prototype.doWrite=function(a,s){var f=typeof a!="string"&&a!==void 0,y=this.request({method:"POST",data:a,isBinary:f}),g=this;y.on("success",s),y.on("error",function(w){g.onError("xhr post error",w)}),this.sendXhr=y},o.prototype.doPoll=function(){p("xhr poll");var a=this.request(),s=this;a.on("data",function(f){s.onData(f)}),a.on("error",function(f){s.onError("xhr poll error",f)}),this.pollXhr=a},c(i.prototype),i.prototype.create=function(){var a={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};a.pfx=this.pfx,a.key=this.key,a.passphrase=this.passphrase,a.cert=this.cert,a.ca=this.ca,a.ciphers=this.ciphers,a.rejectUnauthorized=this.rejectUnauthorized;var s=this.xhr=new h(a),f=this;try{if(p("xhr open %s: %s",this.method,this.uri),s.open(this.method,this.uri,this.async),this.supportsBinary&&(s.responseType="arraybuffer"),this.method=="POST")try{this.isBinary?s.setRequestHeader("Content-type","application/octet-stream"):s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}"withCredentials"in s&&(s.withCredentials=!0),this.hasXDR()?(s.onload=function(){f.onLoad()},s.onerror=function(){f.onError(s.responseText)}):s.onreadystatechange=function(){s.readyState==4&&(s.status==200||s.status==1223?f.onLoad():setTimeout(function(){f.onError(s.status)},0))},p("xhr data %s",this.data),s.send(this.data)}catch(y){return void setTimeout(function(){f.onError(y)},0)}r.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(a){this.emit("data",a),this.onSuccess()},i.prototype.onError=function(a){this.emit("error",a),this.cleanup(!0)},i.prototype.cleanup=function(a){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,a)try{this.xhr.abort()}catch{}r.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var a;try{var s;try{s=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch{}a=s==="application/octet-stream"?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(f){this.onError(f)}a!=null&&this.onData(a)},i.prototype.hasXDR=function(){return typeof r.XDomainRequest<"u"&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},r.document&&(i.requestsCount=0,i.requests={},r.attachEvent?r.attachEvent("onunload",u):r.addEventListener&&r.addEventListener("beforeunload",u,!1))}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-emitter":9,"component-inherit":21,debug:22,xmlhttprequest:20}],18:[function(t,e){function r(c){var l=c&&c.forceBase64;(!d||l)&&(this.supportsBinary=!1),n.call(this,c)}var n=t("../transport"),o=t("parseqs"),i=t("engine.io-parser"),u=t("component-inherit"),h=t("debug")("engine.io-client:polling");e.exports=r;var d=function(){var c=t("xmlhttprequest"),l=new c({xdomain:!1});return l.responseType!=null}();u(r,n),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(c){function l(){h("paused"),p.readyState="paused",c()}var p=this;if(this.readyState="pausing",this.polling||!this.writable){var a=0;this.polling&&(h("we are currently polling - waiting to pause"),a++,this.once("pollComplete",function(){h("pre-pause polling complete"),--a||l()})),this.writable||(h("we are currently writing - waiting to pause"),a++,this.once("drain",function(){h("pre-pause writing complete"),--a||l()}))}else l()},r.prototype.poll=function(){h("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(c){var l=this;h("polling got data %s",c);var p=function(a){return l.readyState=="opening"&&l.onOpen(),a.type=="close"?(l.onClose(),!1):void l.onPacket(a)};i.decodePayload(c,this.socket.binaryType,p),this.readyState!="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState=="open"?this.poll():h('ignoring poll - transport state "%s"',this.readyState))},r.prototype.doClose=function(){function c(){h("writing close packet"),l.write([{type:"close"}])}var l=this;this.readyState=="open"?(h("transport open - closing"),c()):(h("transport not open - deferring close"),this.once("open",c))},r.prototype.write=function(c){var p=this;this.writable=!1;var l=function(){p.writable=!0,p.emit("drain")},p=this;i.encodePayload(c,this.supportsBinary,function(a){p.doWrite(a,l)})},r.prototype.uri=function(){var c=this.query||{},l=this.secure?"https":"http",p="";return this.timestampRequests!==!1&&(c[this.timestampParam]=+new Date+"-"+n.timestamps++),this.supportsBinary||c.sid||(c.b64=1),c=o.encode(c),this.port&&(l=="https"&&this.port!=443||l=="http"&&this.port!=80)&&(p=":"+this.port),c.length&&(c="?"+c),l+"://"+this.hostname+p+this.path+c}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(t,e){function r(c){var l=c&&c.forceBase64;l&&(this.supportsBinary=!1),n.call(this,c)}var n=t("../transport"),o=t("engine.io-parser"),i=t("parseqs"),u=t("component-inherit"),h=t("debug")("engine.io-client:websocket"),d=t("ws");e.exports=r,u(r,n),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var c=this.uri(),l=void 0,p={agent:this.agent};p.pfx=this.pfx,p.key=this.key,p.passphrase=this.passphrase,p.cert=this.cert,p.ca=this.ca,p.ciphers=this.ciphers,p.rejectUnauthorized=this.rejectUnauthorized,this.ws=new d(c,l,p),this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var c=this;this.ws.onopen=function(){c.onOpen()},this.ws.onclose=function(){c.onClose()},this.ws.onmessage=function(l){c.onData(l.data)},this.ws.onerror=function(l){c.onError("websocket error",l)}},typeof navigator<"u"&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(r.prototype.onData=function(c){var l=this;setTimeout(function(){n.prototype.onData.call(l,c)},0)}),r.prototype.write=function(c){function l(){p.writable=!0,p.emit("drain")}var p=this;this.writable=!1;for(var a=0,s=c.length;s>a;a++)o.encodePacket(c[a],this.supportsBinary,function(f){try{p.ws.send(f)}catch{h("websocket closed before onclose event")}});setTimeout(l,0)},r.prototype.onClose=function(){n.prototype.onClose.call(this)},r.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},r.prototype.uri=function(){var c=this.query||{},l=this.secure?"wss":"ws",p="";return this.port&&(l=="wss"&&this.port!=443||l=="ws"&&this.port!=80)&&(p=":"+this.port),this.timestampRequests&&(c[this.timestampParam]=+new Date),this.supportsBinary||(c.b64=1),c=i.encode(c),c.length&&(c="?"+c),l+"://"+this.hostname+p+this.path+c},r.prototype.check=function(){return!(!d||"__initialize"in d&&this.name===r.prototype.name)}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,ws:35}],20:[function(t,e){var r=t("has-cors");e.exports=function(n){var o=n.xdomain,i=n.xscheme,u=n.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!o||r))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!i&&u)return new XDomainRequest}catch{}if(!o)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}}},{"has-cors":38}],21:[function(t,e){e.exports=function(r,n){var o=function(){};o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r}},{}],22:[function(t,e,r){function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var d=arguments,c=this.useColors;if(d[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+d[0]+(c?"%c ":" ")+"+"+r.humanize(this.diff),!c)return d;var l="color: "+this.color;d=[d[0],l,"color: inherit"].concat(Array.prototype.slice.call(d,1));var p=0,a=0;return d[0].replace(/%[a-z%]/g,function(s){s!=="%%"&&(p++,s==="%c"&&(a=p))}),d.splice(a,0,l),d}function i(){return typeof console=="object"&&typeof console.log=="function"&&Function.prototype.apply.call(console.log,console,arguments)}function u(d){try{d==null?localStorage.removeItem("debug"):localStorage.debug=d}catch{}}function h(){var d;try{d=localStorage.debug}catch{}return d}r=e.exports=t("./debug"),r.log=i,r.formatArgs=o,r.save=u,r.load=h,r.useColors=n,r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(d){return JSON.stringify(d)},r.enable(h())},{"./debug":23}],23:[function(t,e,r){function n(){return r.colors[l++%r.colors.length]}function o(p){function a(){}function s(){var y=s,g=+new Date,w=g-(c||g);y.diff=w,y.prev=c,y.curr=g,c=g,y.useColors==null&&(y.useColors=r.useColors()),y.color==null&&y.useColors&&(y.color=n());var B=Array.prototype.slice.call(arguments);B[0]=r.coerce(B[0]),typeof B[0]!="string"&&(B=["%o"].concat(B));var _=0;B[0]=B[0].replace(/%([a-z%])/g,function(S,m){if(S==="%%")return S;_++;var C=r.formatters[m];if(typeof C=="function"){var E=B[_];S=C.call(y,E),B.splice(_,1),_--}return S}),typeof r.formatArgs=="function"&&(B=r.formatArgs.apply(y,B));var b=s.log||r.log||console.log.bind(console);b.apply(y,B)}a.enabled=!1,s.enabled=!0;var f=r.enabled(p)?s:a;return f.namespace=p,f}function i(p){r.save(p);for(var a=(p||"").split(/[\s,]+/),s=a.length,f=0;s>f;f++)a[f]&&(p=a[f].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.substr(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function u(){r.enable("")}function h(p){var a,s;for(a=0,s=r.skips.length;s>a;a++)if(r.skips[a].test(p))return!1;for(a=0,s=r.names.length;s>a;a++)if(r.names[a].test(p))return!0;return!1}function d(p){return p instanceof Error?p.stack||p.message:p}r=e.exports=o,r.coerce=d,r.disable=u,r.enable=i,r.enabled=h,r.humanize=t("ms"),r.names=[],r.skips=[],r.formatters={};var c,l=0},{ms:24}],24:[function(t,e){function r(p){var a=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(p);if(a){var s=parseFloat(a[1]),f=(a[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"y":return s*l;case"days":case"day":case"d":return s*c;case"hours":case"hour":case"h":return s*d;case"minutes":case"minute":case"m":return s*h;case"seconds":case"second":case"s":return s*u;case"ms":return s}}}function n(p){return p>=c?Math.round(p/c)+"d":p>=d?Math.round(p/d)+"h":p>=h?Math.round(p/h)+"m":p>=u?Math.round(p/u)+"s":p+"ms"}function o(p){return i(p,c,"day")||i(p,d,"hour")||i(p,h,"minute")||i(p,u,"second")||p+" ms"}function i(p,a,s){return a>p?void 0:1.5*a>p?Math.floor(p/a)+" "+s:Math.ceil(p/a)+" "+s+"s"}var u=1e3,h=60*u,d=60*h,c=24*d,l=365.25*c;e.exports=function(p,a){return a=a||{},typeof p=="string"?r(p):a.long?o(p):n(p)}},{}],25:[function(t,e,r){(function(n){function o(m,C){var E="b"+r.packets[m.type]+m.data.data;return C(E)}function i(m,C,E){if(!C)return r.encodeBase64Packet(m,E);var v=m.data,k=new Uint8Array(v),T=new Uint8Array(1+v.byteLength);T[0]=B[m.type];for(var x=0;x<k.length;x++)T[x+1]=k[x];return E(T.buffer)}function u(m,C,E){if(!C)return r.encodeBase64Packet(m,E);var v=new FileReader;return v.onload=function(){m.data=v.result,r.encodePacket(m,C,!0,E)},v.readAsArrayBuffer(m.data)}function h(m,C,E){if(!C)return r.encodeBase64Packet(m,E);if(w)return u(m,C,E);var v=new Uint8Array(1);v[0]=B[m.type];var k=new S([v.buffer,m.data]);return E(k)}function d(m,C,E){for(var v=new Array(m.length),k=s(m.length,E),T=function(O,A,q){C(A,function(j,G){v[O]=G,q(j,v)})},x=0;x<m.length;x++)T(x,m[x],k)}var c=t("./keys"),l=t("has-binary"),p=t("arraybuffer.slice"),a=t("base64-arraybuffer"),s=t("after"),f=t("utf8"),y=navigator.userAgent.match(/Android/i),g=/PhantomJS/i.test(navigator.userAgent),w=y||g;r.protocol=3;var B=r.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},_=c(B),b={type:"error",data:"parser error"},S=t("blob");r.encodePacket=function(m,C,E,v){typeof C=="function"&&(v=C,C=!1),typeof E=="function"&&(v=E,E=null);var k=m.data===void 0?void 0:m.data.buffer||m.data;if(n.ArrayBuffer&&k instanceof ArrayBuffer)return i(m,C,v);if(S&&k instanceof n.Blob)return h(m,C,v);if(k&&k.base64)return o(m,v);var T=B[m.type];return m.data!==void 0&&(T+=E?f.encode(String(m.data)):String(m.data)),v(""+T)},r.encodeBase64Packet=function(m,C){var E="b"+r.packets[m.type];if(S&&m.data instanceof S){var v=new FileReader;return v.onload=function(){var A=v.result.split(",")[1];C(E+A)},v.readAsDataURL(m.data)}var k;try{k=String.fromCharCode.apply(null,new Uint8Array(m.data))}catch{for(var T=new Uint8Array(m.data),x=new Array(T.length),O=0;O<T.length;O++)x[O]=T[O];k=String.fromCharCode.apply(null,x)}return E+=n.btoa(k),C(E)},r.decodePacket=function(m,C,E){if(typeof m=="string"||m===void 0){if(m.charAt(0)=="b")return r.decodeBase64Packet(m.substr(1),C);if(E)try{m=f.decode(m)}catch{return b}var k=m.charAt(0);return Number(k)==k&&_[k]?m.length>1?{type:_[k],data:m.substring(1)}:{type:_[k]}:b}var v=new Uint8Array(m),k=v[0],T=p(m,1);return S&&C==="blob"&&(T=new S([T])),{type:_[k],data:T}},r.decodeBase64Packet=function(m,C){var E=_[m.charAt(0)];if(!n.ArrayBuffer)return{type:E,data:{base64:!0,data:m.substr(1)}};var v=a.decode(m.substr(1));return C==="blob"&&S&&(v=new S([v])),{type:E,data:v}},r.encodePayload=function(m,C,E){function v(x){return x.length+":"+x}function k(x,O){r.encodePacket(x,T?C:!1,!0,function(A){O(null,v(A))})}typeof C=="function"&&(E=C,C=null);var T=l(m);return C&&T?S&&!w?r.encodePayloadAsBlob(m,E):r.encodePayloadAsArrayBuffer(m,E):m.length?void d(m,k,function(x,O){return E(O.join(""))}):E("0:")},r.decodePayload=function(m,C,E){if(typeof m!="string")return r.decodePayloadAsBinary(m,C,E);typeof C=="function"&&(E=C,C=null);var v;if(m=="")return E(b,0,1);for(var k,T,x="",O=0,A=m.length;A>O;O++){var q=m.charAt(O);if(q!=":")x+=q;else{if(x==""||x!=(k=Number(x))||(T=m.substr(O+1,k),x!=T.length))return E(b,0,1);if(T.length){if(v=r.decodePacket(T,C,!0),b.type==v.type&&b.data==v.data)return E(b,0,1);var j=E(v,O+k,A);if(j===!1)return}O+=k,x=""}}return x!=""?E(b,0,1):void 0},r.encodePayloadAsArrayBuffer=function(m,C){function E(v,k){r.encodePacket(v,!0,!0,function(T){return k(null,T)})}return m.length?void d(m,E,function(v,k){var T=k.reduce(function(A,q){var j;return j=typeof q=="string"?q.length:q.byteLength,A+j.toString().length+j+2},0),x=new Uint8Array(T),O=0;return k.forEach(function(A){var q=typeof A=="string",j=A;if(q){for(var G=new Uint8Array(A.length),K=0;K<A.length;K++)G[K]=A.charCodeAt(K);j=G.buffer}x[O++]=q?0:1;for(var nt=j.byteLength.toString(),K=0;K<nt.length;K++)x[O++]=parseInt(nt[K]);x[O++]=255;for(var G=new Uint8Array(j),K=0;K<G.length;K++)x[O++]=G[K]}),C(x.buffer)}):C(new ArrayBuffer(0))},r.encodePayloadAsBlob=function(m,C){function E(v,k){r.encodePacket(v,!0,!0,function(T){var x=new Uint8Array(1);if(x[0]=1,typeof T=="string"){for(var O=new Uint8Array(T.length),A=0;A<T.length;A++)O[A]=T.charCodeAt(A);T=O.buffer,x[0]=0}for(var q=T instanceof ArrayBuffer?T.byteLength:T.size,j=q.toString(),G=new Uint8Array(j.length+1),A=0;A<j.length;A++)G[A]=parseInt(j[A]);if(G[j.length]=255,S){var K=new S([x.buffer,G.buffer,T]);k(null,K)}})}d(m,E,function(v,k){return C(new S(k))})},r.decodePayloadAsBinary=function(m,C,E){typeof C=="function"&&(E=C,C=null);for(var v=m,k=[],T=!1;v.byteLength>0;){for(var x=new Uint8Array(v),O=x[0]===0,A="",q=1;x[q]!=255;q++){if(A.length>310){T=!0;break}A+=x[q]}if(T)return E(b,0,1);v=p(v,2+A.length),A=parseInt(A);var j=p(v,0,A);if(O)try{j=String.fromCharCode.apply(null,new Uint8Array(j))}catch{var G=new Uint8Array(j);j="";for(var q=0;q<G.length;q++)j+=String.fromCharCode(G[q])}k.push(j),v=p(v,A)}var K=k.length;k.forEach(function(nt,Ut){E(r.decodePacket(nt,C,!0),Ut,K)})}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./keys":26,after:27,"arraybuffer.slice":28,"base64-arraybuffer":29,blob:30,"has-binary":36,utf8:31}],26:[function(t,e){e.exports=Object.keys||function(r){var n=[],o=Object.prototype.hasOwnProperty;for(var i in r)o.call(r,i)&&n.push(i);return n}},{}],27:[function(t,e){function r(o,i,u){function h(c,l){if(h.count<=0)throw new Error("after called too many times");--h.count,c?(d=!0,i(c),i=u):h.count!==0||d||i(null,l)}var d=!1;return u=u||n,h.count=o,o===0?i():h}function n(){}e.exports=r},{}],28:[function(t,e){e.exports=function(r,n,o){var i=r.byteLength;if(n=n||0,o=o||i,r.slice)return r.slice(n,o);if(0>n&&(n+=i),0>o&&(o+=i),o>i&&(o=i),n>=i||n>=o||i===0)return new ArrayBuffer(0);for(var u=new Uint8Array(r),h=new Uint8Array(o-n),d=n,c=0;o>d;d++,c++)h[c]=u[d];return h.buffer}},{}],29:[function(t,e,r){(function(n){r.encode=function(o){var i,u=new Uint8Array(o),h=u.length,d="";for(i=0;h>i;i+=3)d+=n[u[i]>>2],d+=n[(3&u[i])<<4|u[i+1]>>4],d+=n[(15&u[i+1])<<2|u[i+2]>>6],d+=n[63&u[i+2]];return h%3===2?d=d.substring(0,d.length-1)+"=":h%3===1&&(d=d.substring(0,d.length-2)+"=="),d},r.decode=function(o){var i,u,h,d,c,l=.75*o.length,p=o.length,a=0;o[o.length-1]==="="&&(l--,o[o.length-2]==="="&&l--);var s=new ArrayBuffer(l),f=new Uint8Array(s);for(i=0;p>i;i+=4)u=n.indexOf(o[i]),h=n.indexOf(o[i+1]),d=n.indexOf(o[i+2]),c=n.indexOf(o[i+3]),f[a++]=u<<2|h>>4,f[a++]=(15&h)<<4|d>>2,f[a++]=(3&d)<<6|63&c;return s}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(t,e){(function(r){function n(l){for(var p=0;p<l.length;p++){var a=l[p];if(a.buffer instanceof ArrayBuffer){var s=a.buffer;if(a.byteLength!==s.byteLength){var f=new Uint8Array(a.byteLength);f.set(new Uint8Array(s,a.byteOffset,a.byteLength)),s=f.buffer}l[p]=s}}}function o(l,p){p=p||{};var a=new u;n(l);for(var s=0;s<l.length;s++)a.append(l[s]);return p.type?a.getBlob(p.type):a.getBlob()}function i(l,p){return n(l),new Blob(l,p||{})}var u=r.BlobBuilder||r.WebKitBlobBuilder||r.MSBlobBuilder||r.MozBlobBuilder,h=function(){try{var l=new Blob(["hi"]);return l.size===2}catch{return!1}}(),d=h&&function(){try{var l=new Blob([new Uint8Array([1,2])]);return l.size===2}catch{return!1}}(),c=u&&u.prototype.append&&u.prototype.getBlob;e.exports=function(){return h?d?r.Blob:i:c?o:void 0}()}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],31:[function(t,e,r){(function(n){(function(o){function i(v){for(var k,T,x=[],O=0,A=v.length;A>O;)k=v.charCodeAt(O++),k>=55296&&56319>=k&&A>O?(T=v.charCodeAt(O++),(64512&T)==56320?x.push(((1023&k)<<10)+(1023&T)+65536):(x.push(k),O--)):x.push(k);return x}function u(v){for(var k,T=v.length,x=-1,O="";++x<T;)k=v[x],k>65535&&(k-=65536,O+=b(k>>>10&1023|55296),k=56320|1023&k),O+=b(k);return O}function h(v){if(v>=55296&&57343>=v)throw Error("Lone surrogate U+"+v.toString(16).toUpperCase()+" is not a scalar value")}function d(v,k){return b(v>>k&63|128)}function c(v){if(!(4294967168&v))return b(v);var k="";return 4294965248&v?4294901760&v?!(4292870144&v)&&(k=b(v>>18&7|240),k+=d(v,12),k+=d(v,6)):(h(v),k=b(v>>12&15|224),k+=d(v,6)):k=b(v>>6&31|192),k+=b(63&v|128)}function l(v){for(var k,T=i(v),x=T.length,O=-1,A="";++O<x;)k=T[O],A+=c(k);return A}function p(){if(_>=B)throw Error("Invalid byte index");var v=255&w[_];if(_++,(192&v)==128)return 63&v;throw Error("Invalid continuation byte")}function a(){var v,k,T,x,O;if(_>B)throw Error("Invalid byte index");if(_==B)return!1;if(v=255&w[_],_++,(128&v)==0)return v;if((224&v)==192){var k=p();if(O=(31&v)<<6|k,O>=128)return O;throw Error("Invalid continuation byte")}if((240&v)==224){if(k=p(),T=p(),O=(15&v)<<12|k<<6|T,O>=2048)return h(O),O;throw Error("Invalid continuation byte")}if((248&v)==240&&(k=p(),T=p(),x=p(),O=(15&v)<<18|k<<12|T<<6|x,O>=65536&&1114111>=O))return O;throw Error("Invalid UTF-8 detected")}function s(v){w=i(v),B=w.length,_=0;for(var k,T=[];(k=a())!==!1;)T.push(k);return u(T)}var f=typeof r=="object"&&r,y=typeof e=="object"&&e&&e.exports==f&&e,g=typeof n=="object"&&n;(g.global===g||g.window===g)&&(o=g);var w,B,_,b=String.fromCharCode,S={version:"2.0.0",encode:l,decode:s};if(f&&!f.nodeType)if(y)y.exports=S;else{var m={},C=m.hasOwnProperty;for(var E in S)C.call(S,E)&&(f[E]=S[E])}else o.utf8=S})(this)}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],32:[function(t,e){(function(r){var n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,u=/(?:^|:|,)(?:\s*\[)+/g,h=/^\s+/,d=/\s+$/;e.exports=function(c){return typeof c=="string"&&c?(c=c.replace(h,"").replace(d,""),r.JSON&&JSON.parse?JSON.parse(c):n.test(c.replace(o,"@").replace(i,"]").replace(u,""))?new Function("return "+c)():void 0):null}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],33:[function(t,e,r){r.encode=function(n){var o="";for(var i in n)n.hasOwnProperty(i)&&(o.length&&(o+="&"),o+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return o},r.decode=function(n){for(var o={},i=n.split("&"),u=0,h=i.length;h>u;u++){var d=i[u].split("=");o[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return o}},{}],34:[function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(o){var i=o,u=o.indexOf("["),h=o.indexOf("]");u!=-1&&h!=-1&&(o=o.substring(0,u)+o.substring(u,h).replace(/:/g,";")+o.substring(h,o.length));for(var d=r.exec(o||""),c={},l=14;l--;)c[n[l]]=d[l]||"";return u!=-1&&h!=-1&&(c.source=i,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c}},{}],35:[function(t,e){function r(i,u){return u?new o(i,u):new o(i)}var n=function(){return self}(),o=n.WebSocket||n.MozWebSocket;e.exports=o?r:null,o&&(r.prototype=o.prototype)},{}],36:[function(t,e){(function(r){function n(i){function u(h){if(!h)return!1;if(r.Buffer&&r.Buffer.isBuffer(h)||r.ArrayBuffer&&h instanceof ArrayBuffer||r.Blob&&h instanceof Blob||r.File&&h instanceof File)return!0;if(o(h)){for(var d=0;d<h.length;d++)if(u(h[d]))return!0}else if(h&&typeof h=="object"){h.toJSON&&(h=h.toJSON());for(var c in h)if(Object.prototype.hasOwnProperty.call(h,c)&&u(h[c]))return!0}return!1}return u(i)}var o=t("isarray");e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{isarray:37}],37:[function(t,e){e.exports=Array.isArray||function(r){return Object.prototype.toString.call(r)=="[object Array]"}},{}],38:[function(t,e){var r=t("global");try{e.exports="XMLHttpRequest"in r&&"withCredentials"in new r.XMLHttpRequest}catch{e.exports=!1}},{global:39}],39:[function(t,e){e.exports=function(){return this}()},{}],40:[function(t,e){var r=[].indexOf;e.exports=function(n,o){if(r)return n.indexOf(o);for(var i=0;i<n.length;++i)if(n[i]===o)return i;return-1}},{}],41:[function(t,e,r){var n=Object.prototype.hasOwnProperty;r.keys=Object.keys||function(o){var i=[];for(var u in o)n.call(o,u)&&i.push(u);return i},r.values=function(o){var i=[];for(var u in o)n.call(o,u)&&i.push(o[u]);return i},r.merge=function(o,i){for(var u in i)n.call(i,u)&&(o[u]=i[u]);return o},r.length=function(o){return r.keys(o).length},r.isEmpty=function(o){return r.length(o)==0}},{}],42:[function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(o){for(var i=r.exec(o||""),u={},h=14;h--;)u[n[h]]=i[h]||"";return u}},{}],43:[function(t,e,r){(function(n){var o=t("isarray"),i=t("./is-buffer");r.deconstructPacket=function(u){function h(p){if(!p)return p;if(i(p)){var a={_placeholder:!0,num:d.length};return d.push(p),a}if(o(p)){for(var s=new Array(p.length),f=0;f<p.length;f++)s[f]=h(p[f]);return s}if(typeof p=="object"&&!(p instanceof Date)){var s={};for(var y in p)s[y]=h(p[y]);return s}return p}var d=[],c=u.data,l=u;return l.data=h(c),l.attachments=d.length,{packet:l,buffers:d}},r.reconstructPacket=function(u,h){function d(c){if(c&&c._placeholder){var l=h[c.num];return l}if(o(c)){for(var p=0;p<c.length;p++)c[p]=d(c[p]);return c}if(c&&typeof c=="object"){for(var a in c)c[a]=d(c[a]);return c}return c}return u.data=d(u.data),u.attachments=void 0,u},r.removeBlobs=function(u,h){function d(p,a,s){if(!p)return p;if(n.Blob&&p instanceof Blob||n.File&&p instanceof File){c++;var f=new FileReader;f.onload=function(){s?s[a]=this.result:l=this.result,--c||h(l)},f.readAsArrayBuffer(p)}else if(o(p))for(var y=0;y<p.length;y++)d(p[y],y,p);else if(p&&typeof p=="object"&&!i(p))for(var g in p)d(p[g],g,p)}var c=0,l=u;d(l),c||h(l)}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./is-buffer":45,isarray:46}],44:[function(t,e,r){function n(){}function o(y){var g="",w=!1;return g+=y.type,(r.BINARY_EVENT==y.type||r.BINARY_ACK==y.type)&&(g+=y.attachments,g+="-"),y.nsp&&y.nsp!="/"&&(w=!0,g+=y.nsp),y.id!=null&&(w&&(g+=",",w=!1),g+=y.id),y.data!=null&&(w&&(g+=","),g+=p.stringify(y.data)),l("encoded %j as %s",y,g),g}function i(y,g){function w(B){var _=s.deconstructPacket(B),b=o(_.packet),S=_.buffers;S.unshift(b),g(S)}s.removeBlobs(y,w)}function u(){this.reconstructor=null}function h(y){var g={},w=0;if(g.type=Number(y.charAt(0)),r.types[g.type]==null)return c();if(r.BINARY_EVENT==g.type||r.BINARY_ACK==g.type){for(var B="";y.charAt(++w)!="-"&&(B+=y.charAt(w),w!=y.length););if(B!=Number(B)||y.charAt(w)!="-")throw new Error("Illegal attachments");g.attachments=Number(B)}if(y.charAt(w+1)=="/")for(g.nsp="";++w;){var _=y.charAt(w);if(_==","||(g.nsp+=_,w==y.length))break}else g.nsp="/";var b=y.charAt(w+1);if(b!==""&&Number(b)==b){for(g.id="";++w;){var _=y.charAt(w);if(_==null||Number(_)!=_){--w;break}if(g.id+=y.charAt(w),w==y.length)break}g.id=Number(g.id)}if(y.charAt(++w))try{g.data=p.parse(y.substr(w))}catch{return c()}return l("decoded %s as %j",y,g),g}function d(y){this.reconPack=y,this.buffers=[]}function c(){return{type:r.ERROR,data:"parser error"}}var l=t("debug")("socket.io-parser"),p=t("json3"),a=(t("isarray"),t("component-emitter")),s=t("./binary"),f=t("./is-buffer");r.protocol=4,r.types=["CONNECT","DISCONNECT","EVENT","BINARY_EVENT","ACK","BINARY_ACK","ERROR"],r.CONNECT=0,r.DISCONNECT=1,r.EVENT=2,r.ACK=3,r.ERROR=4,r.BINARY_EVENT=5,r.BINARY_ACK=6,r.Encoder=n,r.Decoder=u,n.prototype.encode=function(y,g){if(l("encoding packet %j",y),r.BINARY_EVENT==y.type||r.BINARY_ACK==y.type)i(y,g);else{var w=o(y);g([w])}},a(u.prototype),u.prototype.add=function(y){var g;if(typeof y=="string")g=h(y),r.BINARY_EVENT==g.type||r.BINARY_ACK==g.type?(this.reconstructor=new d(g),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",g)):this.emit("decoded",g);else{if(!f(y)&&!y.base64)throw new Error("Unknown type: "+y);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");g=this.reconstructor.takeBinaryData(y),g&&(this.reconstructor=null,this.emit("decoded",g))}},u.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},d.prototype.takeBinaryData=function(y){if(this.buffers.push(y),this.buffers.length==this.reconPack.attachments){var g=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),g}return null},d.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(t,e){(function(r){function n(o){return r.Buffer&&r.Buffer.isBuffer(o)||r.ArrayBuffer&&o instanceof ArrayBuffer}e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],46:[function(t,e){e.exports=t(37)},{}],47:[function(t,e,r){(function(n){function o(R){if(o[R]!==h)return o[R];var U;if(R=="bug-string-char-index")U=!1;else if(R=="json")U=o("json-stringify")&&o("json-parse");else{var I,F='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(R=="json-stringify"){var N=l.stringify,D=typeof N=="function"&&p;if(D){(I=function(){return 1}).toJSON=I;try{D=N(0)==="0"&&N(new Number)==="0"&&N(new String)=='""'&&N(d)===h&&N(h)===h&&N()===h&&N(I)==="1"&&N([I])=="[1]"&&N([h])=="[null]"&&N(null)=="null"&&N([h,d,null])=="[null,null,null]"&&N({a:[I,!0,!1,null,`\0\b
9
+ \f\r `]})==F&&N(null,I)==="1"&&N([1,2],null,1)==`[
35
10
  1,
36
11
  2
37
- ]`&&K(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&K(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&K(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&K(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch{et=!1}}Q=et}if($=="json-parse"){var nt=_.parse;if(typeof nt=="function")try{if(nt("0")===0&&!nt(!1)){G=nt(rt);var Z=G.a.length==5&&G.a[0]===1;if(Z){try{Z=!nt('" "')}catch{}if(Z)try{Z=nt("01")!==1}catch{}if(Z)try{Z=nt("1.")!==1}catch{}}}}catch{Z=!1}Q=Z}}return c[$]=!!Q}var f,v,d,b={}.toString,p=typeof JSON=="object"&&JSON,_=typeof n=="object"&&n&&!n.nodeType&&n;_&&p?(_.stringify=p.stringify,_.parse=p.parse):_=s.JSON=p||{};var g=new Date(-0xc782b5b800cec);try{g=g.getUTCFullYear()==-109252&&g.getUTCMonth()===0&&g.getUTCDate()===1&&g.getUTCHours()==10&&g.getUTCMinutes()==37&&g.getUTCSeconds()==6&&g.getUTCMilliseconds()==708}catch{}if(!c("json")){var l="[object Function]",u="[object Date]",w="[object Number]",A="[object String]",k="[object Array]",B="[object Boolean]",Y=c("bug-string-char-index");if(!g)var j=Math.floor,N=[0,31,59,90,120,151,181,212,243,273,304,334],U=function($,Q){return N[Q]+365*($-1970)+j(($-1969+(Q=+(Q>1)))/4)-j(($-1901+Q)/100)+j(($-1601+Q)/400)};(f={}.hasOwnProperty)||(f=function($){var Q,G={};return(G.__proto__=null,G.__proto__={toString:1},G).toString!=b?f=function(rt){var K=this.__proto__,et=rt in(this.__proto__=null,this);return this.__proto__=K,et}:(Q=G.constructor,f=function(rt){var K=(this.constructor||Q).prototype;return rt in this&&!(rt in K&&this[rt]===K[rt])}),G=null,f.call(this,$)});var T={boolean:1,number:1,string:1,undefined:1},O=function($,Q){var G=typeof $[Q];return G=="object"?!!$[Q]:!T[G]};if(v=function($,Q){var G,rt,K,et=0;(G=function(){this.valueOf=0}).prototype.valueOf=0,rt=new G;for(K in rt)f.call(rt,K)&&et++;return G=rt=null,et?v=et==2?function(nt,Z){var at,St={},Yt=b.call(nt)==l;for(at in nt)Yt&&at=="prototype"||f.call(St,at)||!(St[at]=1)||!f.call(nt,at)||Z(at)}:function(nt,Z){var at,St,Yt=b.call(nt)==l;for(at in nt)Yt&&at=="prototype"||!f.call(nt,at)||(St=at==="constructor")||Z(at);(St||f.call(nt,at="constructor"))&&Z(at)}:(rt=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],v=function(nt,Z){var at,St,Yt=b.call(nt)==l,Ot=!Yt&&typeof nt.constructor!="function"&&O(nt,"hasOwnProperty")?nt.hasOwnProperty:f;for(at in nt)Yt&&at=="prototype"||!Ot.call(nt,at)||Z(at);for(St=rt.length;at=rt[--St];Ot.call(nt,at)&&Z(at));}),v($,Q)},!c("json-stringify")){var P={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},R="000000",L=function($,Q){return(R+(Q||0)).slice(-$)},H="\\u00",z=function($){var Q,G='"',rt=0,K=$.length,et=K>10&&Y;for(et&&(Q=$.split(""));K>rt;rt++){var nt=$.charCodeAt(rt);switch(nt){case 8:case 9:case 10:case 12:case 13:case 34:case 92:G+=P[nt];break;default:if(32>nt){G+=H+L(2,nt.toString(16));break}G+=et?Q[rt]:Y?$.charAt(rt):$[rt]}}return G+'"'},X=function($,Q,G,rt,K,et,nt){var Z,at,St,Yt,Ot,Ee,tr,fe,Nn,er,Qt,te,Be,Ue,nr,We;try{Z=Q[$]}catch{}if(typeof Z=="object"&&Z)if(at=b.call(Z),at!=u||f.call(Z,"toJSON"))typeof Z.toJSON=="function"&&(at!=w&&at!=A&&at!=k||f.call(Z,"toJSON"))&&(Z=Z.toJSON($));else if(Z>-1/0&&1/0>Z){if(U){for(Ot=j(Z/864e5),St=j(Ot/365.2425)+1970-1;U(St+1,0)<=Ot;St++);for(Yt=j((Ot-U(St,0))/30.42);U(St,Yt+1)<=Ot;Yt++);Ot=1+Ot-U(St,Yt),Ee=(Z%864e5+864e5)%864e5,tr=j(Ee/36e5)%24,fe=j(Ee/6e4)%60,Nn=j(Ee/1e3)%60,er=Ee%1e3}else St=Z.getUTCFullYear(),Yt=Z.getUTCMonth(),Ot=Z.getUTCDate(),tr=Z.getUTCHours(),fe=Z.getUTCMinutes(),Nn=Z.getUTCSeconds(),er=Z.getUTCMilliseconds();Z=(0>=St||St>=1e4?(0>St?"-":"+")+L(6,0>St?-St:St):L(4,St))+"-"+L(2,Yt+1)+"-"+L(2,Ot)+"T"+L(2,tr)+":"+L(2,fe)+":"+L(2,Nn)+"."+L(3,er)+"Z"}else Z=null;if(G&&(Z=G.call(Q,$,Z)),Z===null)return"null";if(at=b.call(Z),at==B)return""+Z;if(at==w)return Z>-1/0&&1/0>Z?""+Z:"null";if(at==A)return z(""+Z);if(typeof Z=="object"){for(Ue=nt.length;Ue--;)if(nt[Ue]===Z)throw TypeError();if(nt.push(Z),Qt=[],nr=et,et+=K,at==k){for(Be=0,Ue=Z.length;Ue>Be;Be++)te=X(Be,Z,G,rt,K,et,nt),Qt.push(te===d?"null":te);We=Qt.length?K?`[
38
- `+et+Qt.join(`,
39
- `+et)+`
40
- `+nr+"]":"["+Qt.join(",")+"]":"[]"}else v(rt||Z,function(rr){var en=X(rr,Z,G,rt,K,et,nt);en!==d&&Qt.push(z(rr)+":"+(K?" ":"")+en)}),We=Qt.length?K?`{
41
- `+et+Qt.join(`,
42
- `+et)+`
43
- `+nr+"}":"{"+Qt.join(",")+"}":"{}";return nt.pop(),We}};_.stringify=function($,Q,G){var rt,K,et,nt;if(typeof Q=="function"||typeof Q=="object"&&Q){if((nt=b.call(Q))==l)K=Q;else if(nt==k){et={};for(var Z,at=0,St=Q.length;St>at;Z=Q[at++],nt=b.call(Z),(nt==A||nt==w)&&(et[Z]=1));}}if(G)if((nt=b.call(G))==w){if((G-=G%1)>0)for(rt="",G>10&&(G=10);rt.length<G;rt+=" ");}else nt==A&&(rt=G.length<=10?G:G.slice(0,10));return X("",(Z={},Z[""]=$,Z),K,et,rt,"",[])}}if(!c("json-parse")){var F,lt,ct=String.fromCharCode,xt={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:`
44
- `,102:"\f",114:"\r"},ut=function(){throw F=lt=null,SyntaxError()},Jt=function(){for(var $,Q,G,rt,K,et=lt,nt=et.length;nt>F;)switch(K=et.charCodeAt(F)){case 9:case 10:case 13:case 32:F++;break;case 123:case 125:case 91:case 93:case 58:case 44:return $=Y?et.charAt(F):et[F],F++,$;case 34:for($="@",F++;nt>F;)if(K=et.charCodeAt(F),32>K)ut();else if(K==92)switch(K=et.charCodeAt(++F)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:$+=xt[K],F++;break;case 117:for(Q=++F,G=F+4;G>F;F++)K=et.charCodeAt(F),K>=48&&57>=K||K>=97&&102>=K||K>=65&&70>=K||ut();$+=ct("0x"+et.slice(Q,F));break;default:ut()}else{if(K==34)break;for(K=et.charCodeAt(F),Q=F;K>=32&&K!=92&&K!=34;)K=et.charCodeAt(++F);$+=et.slice(Q,F)}if(et.charCodeAt(F)==34)return F++,$;ut();default:if(Q=F,K==45&&(rt=!0,K=et.charCodeAt(++F)),K>=48&&57>=K){for(K==48&&(K=et.charCodeAt(F+1),K>=48&&57>=K)&&ut(),rt=!1;nt>F&&(K=et.charCodeAt(F),K>=48&&57>=K);F++);if(et.charCodeAt(F)==46){for(G=++F;nt>G&&(K=et.charCodeAt(G),K>=48&&57>=K);G++);G==F&&ut(),F=G}if(K=et.charCodeAt(F),K==101||K==69){for(K=et.charCodeAt(++F),(K==43||K==45)&&F++,G=F;nt>G&&(K=et.charCodeAt(G),K>=48&&57>=K);G++);G==F&&ut(),F=G}return+et.slice(Q,F)}if(rt&&ut(),et.slice(F,F+4)=="true")return F+=4,!0;if(et.slice(F,F+5)=="false")return F+=5,!1;if(et.slice(F,F+4)=="null")return F+=4,null;ut()}return"$"},Le=function($){var Q,G;if($=="$"&&ut(),typeof $=="string"){if((Y?$.charAt(0):$[0])=="@")return $.slice(1);if($=="["){for(Q=[];$=Jt(),$!="]";G||(G=!0))G&&($==","?($=Jt(),$=="]"&&ut()):ut()),$==","&&ut(),Q.push(Le($));return Q}if($=="{"){for(Q={};$=Jt(),$!="}";G||(G=!0))G&&($==","?($=Jt(),$=="}"&&ut()):ut()),($==","||typeof $!="string"||(Y?$.charAt(0):$[0])!="@"||Jt()!=":")&&ut(),Q[$.slice(1)]=Le(Jt());return Q}ut()}return $},ue=function($,Q,G){var rt=Nr($,Q,G);rt===d?delete $[Q]:$[Q]=rt},Nr=function($,Q,G){var rt,K=$[Q];if(typeof K=="object"&&K)if(b.call(K)==k)for(rt=K.length;rt--;)ue(K,rt,G);else v(K,function(et){ue(K,et,G)});return G.call($,Q,K)};_.parse=function($,Q){var G,rt;return F=0,lt=""+$,G=Le(Jt()),Jt()!="$"&&ut(),F=lt=null,Q&&b.call(Q)==l?Nr((rt={},rt[""]=G,rt),"",Q):G}}}})(this)},{}],48:[function(r,o){function n(s,c){var f=[];c=c||0;for(var v=c||0;v<s.length;v++)f[v-c]=s[v];return f}o.exports=n},{}]},{},[1])(1)}const Zu=Object.assign({"./v1_3_7.js":Object.freeze(Object.defineProperty({__proto__:null,default:Vu},Symbol.toStringTag,{value:"Module"}))}),Qu=/v\d+_\d+_\d+/;function tf(r){return typeof r=="function"}const Ci=Object.entries(Zu).reduce((r,o)=>{var c;const n=o[1].default,s=(c=o[0].match(Qu))==null?void 0:c[0];return tf(n)&&s&&(r[s]=n()),r},{}),Cs=r=>{if(r in Ci)return Ci[r];throw new Error(`Socket version ${r} not found`)},ef={...Ci,getSocketVersion:Cs,makeSocketVersion:(r,...o)=>Cs(r)(...o)};var Ss=(r=>(r.RINGING="Ringing",r.TALKING="Talking",r.DIALING="Dialing",r.HOLD="Hold",r))(Ss||{}),ks=(r=>(r.INCOMING="Incoming",r.OUTGOING="Outgoing",r))(ks||{}),As=(r=>(r.AUTOMATIC="Automatic",r.IVR="IVR",r))(As||{}),xs=(r=>(r.INCOMINC="Incoming",r.OUTGOING="Outgoing",r.SPY="Spy",r.CLICK2CALL="Click2Call",r))(xs||{}),Es=(r=>(r.RESPONSE_FROM_API_VALID="RESPONSE_FROM_API_VALID",r.RESPONSE_FROM_API_INVALID="RESPONSE_FROM_API_INVALID",r))(Es||{}),yt=(r=>(r.ALL_DIALER_STATUS="AllDialersStatus",r.ALL_EXTENSION_STATUS="AllExtensionsStatus",r.ALL_USERS_STATUS="AllUsersStatus",r.CONNECT="connect",r.DISCONNECT="disconnect",r.CONNECT_ERROR_EVENT="connect_error",r.EXTENSION_EVENT="ExtensionEvent",r.KEEP_ALIVE="keepalive",r.KEEP_ALIVE_RESPONSE="keepaliveResponse",r.LOGIN_STATUS="loginStatus",r.LOGIN_SUCCESS="loginSuccess",r.QUEUE_EVENT="QueueEvent",r.ONLINE_STATUS_EVENT="onlineStatusEvent",r.DIALER_EVENT="DialerEvent",r.EXTENSIONS_UPDATED="ExtensionsUpdated",r))(yt||{}),Si=(r=>(r.NEWCALL="NEWCALL",r.ANSWER="ANSWER",r.HOLD="HOLD",r.UNHOLD="UNHOLD",r.HANGUP="HANGUP",r.USER_STATUS_UPDATE="userStatusUpdate",r))(Si||{}),Ts=(r=>(r.NORMAL_HANGUP="Normal hangup",r.USER_BUSY="User busy",r.CALL_REJECTED="Call Rejected",r.UNALLOCATED_NUMBER="Unallocated (unassigned) number",r.UNKNOWN="Unknown",r.NO_USER_RESPONDING="No user responding",r.USER_ALERTING="User alerting, no answer",r.ANSWERED_ELSEWHERE="Answered elsewhere",r))(Ts||{}),Rs=(r=>(r.ANSWER="ANSWER",r.ABANDONED="ABANDONED",r.EXIT="EXIT",r.JOIN="JOIN",r))(Rs||{});class ki{static mapExtensionEvent(o){var v,d;const n=o.reason;let s,c;o.data.currentCall&&(c=this.mapExtensionCall(o,o.data.currentCall));const f=this.mapExtensionData(o,o.data);return n===Si.HANGUP?s={...o,reason:n,data:{...f,currentCall:c?{...c,duration:Date.now()-((c==null?void 0:c.callAnswered_UTC_CLIENT)??0)}:void 0,calls:(v=o.data.calls)==null?void 0:v.map(b=>{const p=this.mapExtensionCall(o,b);return{...p,duration:Date.now()-(p.callAnswered_UTC_CLIENT??0)}})}}:s={...o,data:{...f,currentCall:c,calls:(d=o.data.calls)==null?void 0:d.map(b=>this.mapExtensionCall(o,b))},reason:n},s}static mapAllExtensionStatus(o){return{...o,extensions:o.extensions.map(n=>{var s;return{...this.mapExtensionData(o,n),currentCall:n.currentCall?this.mapExtensionCall(o,n.currentCall):void 0,calls:(s=n.calls)==null?void 0:s.map(c=>this.mapExtensionCall(o,c))}})}}static mapExtensionData(o,n){return this.configureUTCForObject(n,[{key:"lastAnsweredCallEventEpoch",format:"sec"},{key:"lastCallEventEpoch",format:"sec"},{key:"lastHangupCallEpoch",format:"sec"},{key:"representativeUpdated",format:"ms"}],o.servertime,o.servertimeoffset)}static mapExtensionCall(o,n){return this.configureUTCForObject(n,[{key:"callAnswered",format:"sec"},{key:"callStarted",format:"sec"}],o.servertime,o.servertimeoffset)}static mapQueueEvent(o){var n;return{...o,data:{...o.data,Calls:(n=o.data.Calls)==null?void 0:n.map(s=>this.configureUTCForObject(s,[{key:"JoinTimeStamp",format:"sec"}],o.servertime,o.servertimeoffset))}}}static assignProperty(o,n,s){o[n]=s}static configureUTCForObject(o,n,s,c){const f=(s-c*60)*1e3,v=Date.now()-f,d={};return n.forEach(b=>{const p=o[b.key],_=b.key;if(p!==0&&typeof p=="number"&&!isNaN(p)){let g=p;b.format==="ms"&&(g=Math.floor(g/1e3));const l=(g-c*60)*1e3;this.assignProperty(d,`${_}_UTC`,l),this.assignProperty(d,`${_}_UTC_CLIENT`,l+v)}else this.assignProperty(d,`${_}_UTC`,0),this.assignProperty(d,`${_}_UTC_CLIENT`,0)}),{...o,...d}}}var Ai=(r=>(r.UPDATE_MONITORED_EXTENSIONS="updateMonitoredExtensions",r.KEEP_ALIVE="keepAlive",r))(Ai||{});class nf{constructor(o){At(this,"io");At(this,"ioFunction");At(this,"lastEventTimestamp",new Date().getTime());At(this,"doReconnect",!0);At(this,"keepAliveInterval");At(this,"keepReconnectInterval");At(this,"connected",!1);this.eventsSdkClass=o,this.eventsSdkClass=o}getSocketIoFunction(o){const n=o.split("v="),s="v".concat(n[n.length-1]).replaceAll(".","_");this.ioFunction=ef.getSocketVersion(s)}initSocketConnection(){const o=this.eventsSdkClass.authClass.token,n=this.eventsSdkClass.options.protocol,s=this.eventsSdkClass.server;try{const c=s?s.Domain:this.eventsSdkClass.URL,f=s?`${n}://${c}`:this.eventsSdkClass.URL;this.eventsSdkClass.eventEmitterClass.emit(yt.ONLINE_STATUS_EVENT,{isSocketConnected:!1,attemptToConnect:f,doReconnect:this.doReconnect});const v={reconnection:!1,upgrade:!1,transports:["websocket"],forceNew:!0,query:{token:o},timeout:this.eventsSdkClass.options.timeout};if(o&&(v.query={token:o}),this.ioFunction&&f)this.io=this.ioFunction(f,v);else throw new Error("Socket server url no defined")}catch{}}clearKeepAliveInterval(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval)}initKeepAlive(){this.clearKeepAliveInterval(),this.keepAliveInterval=setInterval(async()=>{if(new Date().getTime()>this.lastEventTimestamp+this.eventsSdkClass.options.keepAliveTimeout&&this.io&&this.eventsSdkClass.authClass.token){this.eventsSdkClass.emit(Ai.KEEP_ALIVE,this.eventsSdkClass.authClass.token);return}},this.eventsSdkClass.options.keepAliveTimeout)}closeAllConnections(){var o;this.io&&(this.io.close(),(o=this.io)==null||o.disconnect(),this.io=void 0),jn.clearSessionStorage()}initSocketEvents(){this.io&&this.io.on(yt.LOGIN_SUCCESS,o=>this.onLoginSuccessEvent(o)).on(yt.QUEUE_EVENT,o=>this.onQueueEvent(o)).on(yt.EXTENSION_EVENT,o=>this.onExtensionEvent(o)).on(yt.DIALER_EVENT,o=>this.onDialerEvent(o)).on(yt.LOGIN_STATUS,o=>this.onLoginStatusEvent(o)).on(yt.ALL_EXTENSION_STATUS,o=>this.onAllExtensionStatus(o)).on(yt.ALL_DIALER_STATUS,o=>this.onAllDialerStatus(o)).on(yt.KEEP_ALIVE_RESPONSE,o=>this.onKeepAliveResponse(o)).on(yt.EXTENSIONS_UPDATED,o=>this.onExtensionsUpdatedEvent(o)).on(yt.CONNECT,()=>this.onConnect()).on(yt.DISCONNECT,o=>this.onDisconnect(o)).on(yt.CONNECT_ERROR_EVENT,o=>this.onConnectError(o))}onLoginSuccessEvent(o){this.eventsSdkClass.eventEmitterClass.emit(yt.LOGIN_SUCCESS,o)}onQueueEvent(o){this.eventsSdkClass.eventEmitterClass.emit(yt.QUEUE_EVENT,ki.mapQueueEvent(o))}onExtensionEvent(o){const n=ki.mapExtensionEvent(o);n&&this.eventsSdkClass.eventEmitterClass.emit(yt.EXTENSION_EVENT,n)}onDialerEvent(o){this.eventsSdkClass.eventEmitterClass.emit(yt.DIALER_EVENT,o)}onLoginStatusEvent(o){this.eventsSdkClass.eventEmitterClass.emit(yt.LOGIN_STATUS,o)}onAllExtensionStatus(o){const n=ki.mapAllExtensionStatus(o);this.eventsSdkClass.eventEmitterClass.emit(yt.ALL_EXTENSION_STATUS,n)}onAllDialerStatus(o){this.eventsSdkClass.eventEmitterClass.emit(yt.ALL_DIALER_STATUS,o)}onKeepAliveResponse(o){if(o.errorCode){this.initSocketConnection();return}this.connected?this.lastEventTimestamp=new Date().getTime():this.initSocketConnection()}onExtensionsUpdatedEvent(o){this.eventsSdkClass.eventEmitterClass.emit(yt.EXTENSIONS_UPDATED,o)}onConnect(){this.keepReconnectInterval&&clearInterval(this.keepReconnectInterval),this.connected=!0,this.eventsSdkClass.eventEmitterClass.emit(yt.ONLINE_STATUS_EVENT,{isSocketConnected:!0,doReconnect:this.doReconnect})}onDisconnect(o){this.connected=!1,this.closeAllConnections(),this.eventsSdkClass.eventEmitterClass.emit(yt.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.doReconnect&&this.eventsSdkClass.connect(pn.NEXT)}onConnectError(o){this.eventsSdkClass.eventEmitterClass.emit(yt.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),setTimeout(()=>{this.eventsSdkClass.connect(pn.NEXT)},this.eventsSdkClass.options.reconnectionDelay)}}var Jn=(r=>(r.INFO="INFO",r.WARN="WARN",r.ERROR="ERROR",r))(Jn||{}),rf=Object.defineProperty,of=(r,o,n)=>o in r?rf(r,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[o]=n,Dt=(r,o,n)=>(of(r,typeof o!="symbol"?o+"":o,n),n);function sf(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function af(r){if(r.__esModule)return r;var o=r.default;if(typeof o=="function"){var n=function s(){return this instanceof s?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};n.prototype=o.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var c=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(n,s,c.get?c:{enumerable:!0,get:function(){return r[s]}})}),n}var xi={exports:{}},cf=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,uf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Is=function(r){var o=r,n=r.indexOf("["),s=r.indexOf("]");n!=-1&&s!=-1&&(r=r.substring(0,n)+r.substring(n,s).replace(/:/g,";")+r.substring(s,r.length));for(var c=cf.exec(r||""),f={},v=14;v--;)f[uf[v]]=c[v]||"";return n!=-1&&s!=-1&&(f.source=o,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=ff(f,f.path),f.queryKey=hf(f,f.query),f};function ff(r,o){var n=/\/{2,9}/g,s=o.replace(n,"/").split("/");return(o.substr(0,1)=="/"||o.length===0)&&s.splice(0,1),o.substr(o.length-1,1)=="/"&&s.splice(s.length-1,1),s}function hf(r,o){var n={};return o.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,c,f){c&&(n[c]=f)}),n}var Ei={exports:{}},Ti={exports:{}},Yn=1e3,Vn=Yn*60,Zn=Vn*60,Qn=Zn*24,lf=Qn*365.25,pf=function(r,o){o=o||{};var n=typeof r;if(n==="string"&&r.length>0)return df(r);if(n==="number"&&isNaN(r)===!1)return o.long?yf(r):gf(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function df(r){if(r=String(r),!(r.length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(o){var n=parseFloat(o[1]),s=(o[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return n*lf;case"days":case"day":case"d":return n*Qn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Zn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Vn;case"seconds":case"second":case"secs":case"sec":case"s":return n*Yn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function gf(r){return r>=Qn?Math.round(r/Qn)+"d":r>=Zn?Math.round(r/Zn)+"h":r>=Vn?Math.round(r/Vn)+"m":r>=Yn?Math.round(r/Yn)+"s":r+"ms"}function yf(r){return wr(r,Qn,"day")||wr(r,Zn,"hour")||wr(r,Vn,"minute")||wr(r,Yn,"second")||r+" ms"}function wr(r,o,n){if(!(r<o))return r<o*1.5?Math.floor(r/o)+" "+n:Math.ceil(r/o)+" "+n+"s"}(function(r,o){o=r.exports=s.debug=s.default=s,o.coerce=b,o.disable=v,o.enable=f,o.enabled=d,o.humanize=pf,o.instances=[],o.names=[],o.skips=[],o.formatters={};function n(p){var _=0,g;for(g in p)_=(_<<5)-_+p.charCodeAt(g),_|=0;return o.colors[Math.abs(_)%o.colors.length]}function s(p){var _;function g(){if(g.enabled){var l=g,u=+new Date,w=u-(_||u);l.diff=w,l.prev=_,l.curr=u,_=u;for(var A=new Array(arguments.length),k=0;k<A.length;k++)A[k]=arguments[k];A[0]=o.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");var B=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,function(j,N){if(j==="%%")return j;B++;var U=o.formatters[N];if(typeof U=="function"){var T=A[B];j=U.call(l,T),A.splice(B,1),B--}return j}),o.formatArgs.call(l,A);var Y=g.log||o.log||console.log.bind(console);Y.apply(l,A)}}return g.namespace=p,g.enabled=o.enabled(p),g.useColors=o.useColors(),g.color=n(p),g.destroy=c,typeof o.init=="function"&&o.init(g),o.instances.push(g),g}function c(){var p=o.instances.indexOf(this);return p!==-1?(o.instances.splice(p,1),!0):!1}function f(p){o.save(p),o.names=[],o.skips=[];var _,g=(typeof p=="string"?p:"").split(/[\s,]+/),l=g.length;for(_=0;_<l;_++)g[_]&&(p=g[_].replace(/\*/g,".*?"),p[0]==="-"?o.skips.push(new RegExp("^"+p.substr(1)+"$")):o.names.push(new RegExp("^"+p+"$")));for(_=0;_<o.instances.length;_++){var u=o.instances[_];u.enabled=o.enabled(u.namespace)}}function v(){o.enable("")}function d(p){if(p[p.length-1]==="*")return!0;var _,g;for(_=0,g=o.skips.length;_<g;_++)if(o.skips[_].test(p))return!1;for(_=0,g=o.names.length;_<g;_++)if(o.names[_].test(p))return!0;return!1}function b(p){return p instanceof Error?p.stack||p.message:p}})(Ti,Ti.exports);var vf=Ti.exports;(function(r,o){o=r.exports=vf,o.log=c,o.formatArgs=s,o.save=f,o.load=v,o.useColors=n,o.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:d(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o.formatters.j=function(b){try{return JSON.stringify(b)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}};function s(b){var p=this.useColors;if(b[0]=(p?"%c":"")+this.namespace+(p?" %c":" ")+b[0]+(p?"%c ":" ")+"+"+o.humanize(this.diff),!!p){var _="color: "+this.color;b.splice(1,0,_,"color: inherit");var g=0,l=0;b[0].replace(/%[a-zA-Z%]/g,function(u){u!=="%%"&&(g++,u==="%c"&&(l=g))}),b.splice(l,0,_)}}function c(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function f(b){try{b==null?o.storage.removeItem("debug"):o.storage.debug=b}catch{}}function v(){var b;try{b=o.storage.debug}catch{}return!b&&typeof process<"u"&&"env"in process&&(b=process.env.DEBUG),b}o.enable(v());function d(){try{return window.localStorage}catch{}}})(Ei,Ei.exports);var qe=Ei.exports,mf=Is,Os=qe("socket.io-client:url"),_f=wf;function wf(r,o){var n=r;o=o||typeof location<"u"&&location,r==null&&(r=o.protocol+"//"+o.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=o.protocol+r:r=o.host+r),/^(https?|wss?):\/\//.test(r)||(Os("protocol-less url %s",r),typeof o<"u"?r=o.protocol+"//"+r:r="https://"+r),Os("parse %s",r),n=mf(r)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var s=n.host.indexOf(":")!==-1,c=s?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+c+":"+n.port,n.href=n.protocol+"://"+c+(o&&o.port===n.port?"":":"+n.port),n}var br={},Ns={exports:{}};(function(r){r.exports=o;function o(s){if(s)return n(s)}function n(s){for(var c in o.prototype)s[c]=o.prototype[c];return s}o.prototype.on=o.prototype.addEventListener=function(s,c){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(c),this},o.prototype.once=function(s,c){function f(){this.off(s,f),c.apply(this,arguments)}return f.fn=c,this.on(s,f),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(s,c){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+s];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var v,d=0;d<f.length;d++)if(v=f[d],v===c||v.fn===c){f.splice(d,1);break}return f.length===0&&delete this._callbacks["$"+s],this},o.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var c=new Array(arguments.length-1),f=this._callbacks["$"+s],v=1;v<arguments.length;v++)c[v-1]=arguments[v];if(f){f=f.slice(0);for(var v=0,d=f.length;v<d;++v)f[v].apply(this,c)}return this},o.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]},o.prototype.hasListeners=function(s){return!!this.listeners(s).length}})(Ns);var kn=Ns.exports,Cr={},bf={}.toString,Ri=Array.isArray||function(r){return bf.call(r)=="[object Array]"},Ls=Af,Cf=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",Sf=typeof ArrayBuffer=="function",kf=function(r){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer};function Af(r){return Cf&&Buffer.isBuffer(r)||Sf&&(r instanceof ArrayBuffer||kf(r))}var Ii=Ri,Bs=Ls,Us=Object.prototype.toString,xf=typeof Blob=="function"||typeof Blob<"u"&&Us.call(Blob)==="[object BlobConstructor]",Ef=typeof File=="function"||typeof File<"u"&&Us.call(File)==="[object FileConstructor]";Cr.deconstructPacket=function(r){var o=[],n=r.data,s=r;return s.data=Oi(n,o),s.attachments=o.length,{packet:s,buffers:o}};function Oi(r,o){if(!r)return r;if(Bs(r)){var n={_placeholder:!0,num:o.length};return o.push(r),n}else if(Ii(r)){for(var s=new Array(r.length),c=0;c<r.length;c++)s[c]=Oi(r[c],o);return s}else if(typeof r=="object"&&!(r instanceof Date)){var s={};for(var f in r)s[f]=Oi(r[f],o);return s}return r}Cr.reconstructPacket=function(r,o){return r.data=Ni(r.data,o),r.attachments=void 0,r};function Ni(r,o){if(!r)return r;if(r&&r._placeholder===!0){var n=typeof r.num=="number"&&r.num>=0&&r.num<o.length;if(n)return o[r.num];throw new Error("illegal attachments")}else if(Ii(r))for(var s=0;s<r.length;s++)r[s]=Ni(r[s],o);else if(typeof r=="object")for(var c in r)r[c]=Ni(r[c],o);return r}Cr.removeBlobs=function(r,o){function n(f,v,d){if(!f)return f;if(xf&&f instanceof Blob||Ef&&f instanceof File){s++;var b=new FileReader;b.onload=function(){d?d[v]=this.result:c=this.result,--s||o(c)},b.readAsArrayBuffer(f)}else if(Ii(f))for(var p=0;p<f.length;p++)n(f[p],p,f);else if(typeof f=="object"&&!Bs(f))for(var _ in f)n(f[_],_,f)}var s=0,c=r;n(c),s||o(c)},function(r){var o=qe("socket.io-parser"),n=kn,s=Cr,c=Ri,f=Ls;r.protocol=4,r.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],r.CONNECT=0,r.DISCONNECT=1,r.EVENT=2,r.ACK=3,r.ERROR=4,r.BINARY_EVENT=5,r.BINARY_ACK=6,r.Encoder=v,r.Decoder=g;function v(){}var d=r.ERROR+'"encode error"';v.prototype.encode=function(k,B){if(o("encoding packet %j",k),r.BINARY_EVENT===k.type||r.BINARY_ACK===k.type)_(k,B);else{var Y=b(k);B([Y])}};function b(k){var B=""+k.type;if((r.BINARY_EVENT===k.type||r.BINARY_ACK===k.type)&&(B+=k.attachments+"-"),k.nsp&&k.nsp!=="/"&&(B+=k.nsp+","),k.id!=null&&(B+=k.id),k.data!=null){var Y=p(k.data);if(Y!==!1)B+=Y;else return d}return o("encoded %j as %s",k,B),B}function p(k){try{return JSON.stringify(k)}catch{return!1}}function _(k,B){function Y(j){var N=s.deconstructPacket(j),U=b(N.packet),T=N.buffers;T.unshift(U),B(T)}s.removeBlobs(k,Y)}function g(){this.reconstructor=null}n(g.prototype),g.prototype.add=function(k){var B;if(typeof k=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");B=l(k),r.BINARY_EVENT===B.type||r.BINARY_ACK===B.type?(this.reconstructor=new w(B),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",B)):this.emit("decoded",B)}else if(f(k)||k.base64)if(this.reconstructor)B=this.reconstructor.takeBinaryData(k),B&&(this.reconstructor=null,this.emit("decoded",B));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+k)};function l(k){var B=0,Y={type:Number(k.charAt(0))};if(r.types[Y.type]==null)return A("unknown packet type "+Y.type);if(r.BINARY_EVENT===Y.type||r.BINARY_ACK===Y.type){for(var j=B+1;k.charAt(++B)!=="-"&&B!=k.length;);var N=k.substring(j,B);if(N!=Number(N)||k.charAt(B)!=="-")throw new Error("Illegal attachments");Y.attachments=Number(N)}if(k.charAt(B+1)==="/"){for(var j=B+1;++B;){var U=k.charAt(B);if(U===","||B===k.length)break}Y.nsp=k.substring(j,B)}else Y.nsp="/";var T=k.charAt(B+1);if(T!==""&&Number(T)==T){for(var j=B+1;++B;){var U=k.charAt(B);if(U==null||Number(U)!=U){--B;break}if(B===k.length)break}Y.id=Number(k.substring(j,B+1))}if(k.charAt(++B)){var O=u(k.substr(B)),P=O!==!1&&(Y.type===r.ERROR||c(O));if(P)Y.data=O;else return A("invalid payload")}return o("decoded %s as %j",k,Y),Y}function u(k){try{return JSON.parse(k)}catch{return!1}}g.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()};function w(k){this.reconPack=k,this.buffers=[]}w.prototype.takeBinaryData=function(k){if(this.buffers.push(k),this.buffers.length===this.reconPack.attachments){var B=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),B}return null},w.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};function A(k){return{type:r.ERROR,data:"parser error: "+k}}}(br);var Li={exports:{}},Sr={},Bi={exports:{}};try{Bi.exports=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{Bi.exports=!1}var Tf=Bi.exports,Ui=function(){return typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}(),Rf=Tf,If=Ui,Di=function(r){var o=r.xdomain,n=r.xscheme,s=r.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!o||Rf))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!n&&s)return new XDomainRequest}catch{}if(!o)try{return new If[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}},Pi={exports:{}},dn={},Of=Object.keys||function(r){var o=[],n=Object.prototype.hasOwnProperty;for(var s in r)n.call(r,s)&&o.push(s);return o},Nf=Ri,Ds=Object.prototype.toString,Lf=typeof Blob=="function"||typeof Blob<"u"&&Ds.call(Blob)==="[object BlobConstructor]",Bf=typeof File=="function"||typeof File<"u"&&Ds.call(File)==="[object FileConstructor]",Ps=kr;function kr(r){if(!r||typeof r!="object")return!1;if(Nf(r)){for(var o=0,n=r.length;o<n;o++)if(kr(r[o]))return!0;return!1}if(typeof Buffer=="function"&&Buffer.isBuffer&&Buffer.isBuffer(r)||typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Lf&&r instanceof Blob||Bf&&r instanceof File)return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return kr(r.toJSON(),!0);for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&kr(r[s]))return!0;return!1}var Uf=function(r,o,n){var s=r.byteLength;if(o=o||0,n=n||s,r.slice)return r.slice(o,n);if(o<0&&(o+=s),n<0&&(n+=s),n>s&&(n=s),o>=s||o>=n||s===0)return new ArrayBuffer(0);for(var c=new Uint8Array(r),f=new Uint8Array(n-o),v=o,d=0;v<n;v++,d++)f[d]=c[v];return f.buffer},Df=Pf;function Pf(r,o,n){var s=!1;return n=n||Ff,c.count=r,r===0?o():c;function c(f,v){if(c.count<=0)throw new Error("after called too many times");--c.count,f?(s=!0,o(f),o=n):c.count===0&&!s&&o(null,v)}}function Ff(){}/*! https://mths.be/utf8js v2.1.2 by @mathias */var Ve=String.fromCharCode;function Fs(r){for(var o=[],n=0,s=r.length,c,f;n<s;)c=r.charCodeAt(n++),c>=55296&&c<=56319&&n<s?(f=r.charCodeAt(n++),(f&64512)==56320?o.push(((c&1023)<<10)+(f&1023)+65536):(o.push(c),n--)):o.push(c);return o}function Mf(r){for(var o=r.length,n=-1,s,c="";++n<o;)s=r[n],s>65535&&(s-=65536,c+=Ve(s>>>10&1023|55296),s=56320|s&1023),c+=Ve(s);return c}function Ms(r,o){if(r>=55296&&r<=57343){if(o)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Fi(r,o){return Ve(r>>o&63|128)}function qf(r,o){if(!(r&4294967168))return Ve(r);var n="";return r&4294965248?r&4294901760?r&4292870144||(n=Ve(r>>18&7|240),n+=Fi(r,12),n+=Fi(r,6)):(Ms(r,o)||(r=65533),n=Ve(r>>12&15|224),n+=Fi(r,6)):n=Ve(r>>6&31|192),n+=Ve(r&63|128),n}function Wf(r,o){o=o||{};for(var n=o.strict!==!1,s=Fs(r),c=s.length,f=-1,v,d="";++f<c;)v=s[f],d+=qf(v,n);return d}function An(){if(Ze>=xr)throw Error("Invalid byte index");var r=Ar[Ze]&255;if(Ze++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function Hf(r){var o,n,s,c,f;if(Ze>xr)throw Error("Invalid byte index");if(Ze==xr)return!1;if(o=Ar[Ze]&255,Ze++,!(o&128))return o;if((o&224)==192){if(n=An(),f=(o&31)<<6|n,f>=128)return f;throw Error("Invalid continuation byte")}if((o&240)==224){if(n=An(),s=An(),f=(o&15)<<12|n<<6|s,f>=2048)return Ms(f,r)?f:65533;throw Error("Invalid continuation byte")}if((o&248)==240&&(n=An(),s=An(),c=An(),f=(o&7)<<18|n<<12|s<<6|c,f>=65536&&f<=1114111))return f;throw Error("Invalid UTF-8 detected")}var Ar,xr,Ze;function Kf(r,o){o=o||{};var n=o.strict!==!1;Ar=Fs(r),xr=Ar.length,Ze=0;for(var s=[],c;(c=Hf(n))!==!1;)s.push(c);return Mf(s)}var zf={version:"2.1.2",encode:Wf,decode:Kf},Mi={},qs;function Gf(){return qs||(qs=1,function(r){Mi.encode=function(o){var n=new Uint8Array(o),s,c=n.length,f="";for(s=0;s<c;s+=3)f+=r[n[s]>>2],f+=r[(n[s]&3)<<4|n[s+1]>>4],f+=r[(n[s+1]&15)<<2|n[s+2]>>6],f+=r[n[s+2]&63];return c%3===2?f=f.substring(0,f.length-1)+"=":c%3===1&&(f=f.substring(0,f.length-2)+"=="),f},Mi.decode=function(o){var n=o.length*.75,s=o.length,c,f=0,v,d,b,p;o[o.length-1]==="="&&(n--,o[o.length-2]==="="&&n--);var _=new ArrayBuffer(n),g=new Uint8Array(_);for(c=0;c<s;c+=4)v=r.indexOf(o[c]),d=r.indexOf(o[c+1]),b=r.indexOf(o[c+2]),p=r.indexOf(o[c+3]),g[f++]=v<<2|d>>4,g[f++]=(d&15)<<4|b>>2,g[f++]=(b&3)<<6|p&63;return _}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),Mi}var qi,Ws;function Xf(){if(Ws)return qi;Ws=1;var r=typeof r<"u"?r:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:!1,o=function(){try{var d=new Blob(["hi"]);return d.size===2}catch{return!1}}(),n=o&&function(){try{var d=new Blob([new Uint8Array([1,2])]);return d.size===2}catch{return!1}}(),s=r&&r.prototype.append&&r.prototype.getBlob;function c(d){return d.map(function(b){if(b.buffer instanceof ArrayBuffer){var p=b.buffer;if(b.byteLength!==p.byteLength){var _=new Uint8Array(b.byteLength);_.set(new Uint8Array(p,b.byteOffset,b.byteLength)),p=_.buffer}return p}return b})}function f(d,b){b=b||{};var p=new r;return c(d).forEach(function(_){p.append(_)}),b.type?p.getBlob(b.type):p.getBlob()}function v(d,b){return new Blob(c(d),b||{})}return typeof Blob<"u"&&(f.prototype=Blob.prototype,v.prototype=Blob.prototype),qi=function(){return o?n?Blob:v:s?f:void 0}(),qi}(function(r){var o=Of,n=Ps,s=Uf,c=Df,f=zf,v;typeof ArrayBuffer<"u"&&(v=Gf());var d=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),b=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),p=d||b;r.protocol=3;var _=r.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},g=o(_),l={type:"error",data:"parser error"},u=Xf();r.encodePacket=function(N,U,T,O){typeof U=="function"&&(O=U,U=!1),typeof T=="function"&&(O=T,T=null);var P=N.data===void 0?void 0:N.data.buffer||N.data;if(typeof ArrayBuffer<"u"&&P instanceof ArrayBuffer)return A(N,U,O);if(typeof u<"u"&&P instanceof u)return B(N,U,O);if(P&&P.base64)return w(N,O);var R=_[N.type];return N.data!==void 0&&(R+=T?f.encode(String(N.data),{strict:!1}):String(N.data)),O(""+R)};function w(N,U){var T="b"+r.packets[N.type]+N.data.data;return U(T)}function A(N,U,T){if(!U)return r.encodeBase64Packet(N,T);var O=N.data,P=new Uint8Array(O),R=new Uint8Array(1+O.byteLength);R[0]=_[N.type];for(var L=0;L<P.length;L++)R[L+1]=P[L];return T(R.buffer)}function k(N,U,T){if(!U)return r.encodeBase64Packet(N,T);var O=new FileReader;return O.onload=function(){r.encodePacket({type:N.type,data:O.result},U,!0,T)},O.readAsArrayBuffer(N.data)}function B(N,U,T){if(!U)return r.encodeBase64Packet(N,T);if(p)return k(N,U,T);var O=new Uint8Array(1);O[0]=_[N.type];var P=new u([O.buffer,N.data]);return T(P)}r.encodeBase64Packet=function(N,U){var T="b"+r.packets[N.type];if(typeof u<"u"&&N.data instanceof u){var O=new FileReader;return O.onload=function(){var z=O.result.split(",")[1];U(T+z)},O.readAsDataURL(N.data)}var P;try{P=String.fromCharCode.apply(null,new Uint8Array(N.data))}catch{for(var R=new Uint8Array(N.data),L=new Array(R.length),H=0;H<R.length;H++)L[H]=R[H];P=String.fromCharCode.apply(null,L)}return T+=btoa(P),U(T)},r.decodePacket=function(N,U,T){if(N===void 0)return l;if(typeof N=="string"){if(N.charAt(0)==="b")return r.decodeBase64Packet(N.substr(1),U);if(T&&(N=Y(N),N===!1))return l;var P=N.charAt(0);return Number(P)!=P||!g[P]?l:N.length>1?{type:g[P],data:N.substring(1)}:{type:g[P]}}var O=new Uint8Array(N),P=O[0],R=s(N,1);return u&&U==="blob"&&(R=new u([R])),{type:g[P],data:R}};function Y(N){try{N=f.decode(N,{strict:!1})}catch{return!1}return N}r.decodeBase64Packet=function(N,U){var T=g[N.charAt(0)];if(!v)return{type:T,data:{base64:!0,data:N.substr(1)}};var O=v.decode(N.substr(1));return U==="blob"&&u&&(O=new u([O])),{type:T,data:O}},r.encodePayload=function(N,U,T){typeof U=="function"&&(T=U,U=null);var O=n(N);if(U&&O)return u&&!p?r.encodePayloadAsBlob(N,T):r.encodePayloadAsArrayBuffer(N,T);if(!N.length)return T("0:");function P(L){return L.length+":"+L}function R(L,H){r.encodePacket(L,O?U:!1,!1,function(z){H(null,P(z))})}j(N,R,function(L,H){return T(H.join(""))})};function j(N,U,T){for(var O=new Array(N.length),P=c(N.length,T),R=function(H,z,X){U(z,function(F,lt){O[H]=lt,X(F,O)})},L=0;L<N.length;L++)R(L,N[L],P)}r.decodePayload=function(N,U,T){if(typeof N!="string")return r.decodePayloadAsBinary(N,U,T);typeof U=="function"&&(T=U,U=null);var O;if(N==="")return T(l,0,1);for(var P="",R,L,H=0,z=N.length;H<z;H++){var X=N.charAt(H);if(X!==":"){P+=X;continue}if(P===""||P!=(R=Number(P))||(L=N.substr(H+1,R),P!=L.length))return T(l,0,1);if(L.length){if(O=r.decodePacket(L,U,!1),l.type===O.type&&l.data===O.data)return T(l,0,1);var F=T(O,H+R,z);if(F===!1)return}H+=R,P=""}if(P!=="")return T(l,0,1)},r.encodePayloadAsArrayBuffer=function(N,U){if(!N.length)return U(new ArrayBuffer(0));function T(O,P){r.encodePacket(O,!0,!0,function(R){return P(null,R)})}j(N,T,function(O,P){var R=P.reduce(function(z,X){var F;return typeof X=="string"?F=X.length:F=X.byteLength,z+F.toString().length+F+2},0),L=new Uint8Array(R),H=0;return P.forEach(function(z){var X=typeof z=="string",F=z;if(X){for(var lt=new Uint8Array(z.length),ct=0;ct<z.length;ct++)lt[ct]=z.charCodeAt(ct);F=lt.buffer}X?L[H++]=0:L[H++]=1;for(var xt=F.byteLength.toString(),ct=0;ct<xt.length;ct++)L[H++]=parseInt(xt[ct]);L[H++]=255;for(var lt=new Uint8Array(F),ct=0;ct<lt.length;ct++)L[H++]=lt[ct]}),U(L.buffer)})},r.encodePayloadAsBlob=function(N,U){function T(O,P){r.encodePacket(O,!0,!0,function(R){var L=new Uint8Array(1);if(L[0]=1,typeof R=="string"){for(var H=new Uint8Array(R.length),z=0;z<R.length;z++)H[z]=R.charCodeAt(z);R=H.buffer,L[0]=0}for(var X=R instanceof ArrayBuffer?R.byteLength:R.size,F=X.toString(),lt=new Uint8Array(F.length+1),z=0;z<F.length;z++)lt[z]=parseInt(F[z]);if(lt[F.length]=255,u){var ct=new u([L.buffer,lt.buffer,R]);P(null,ct)}})}j(N,T,function(O,P){return U(new u(P))})},r.decodePayloadAsBinary=function(N,U,T){typeof U=="function"&&(T=U,U=null);for(var O=N,P=[];O.byteLength>0;){for(var R=new Uint8Array(O),L=R[0]===0,H="",z=1;R[z]!==255;z++){if(H.length>310)return T(l,0,1);H+=R[z]}O=s(O,2+H.length),H=parseInt(H);var X=s(O,0,H);if(L)try{X=String.fromCharCode.apply(null,new Uint8Array(X))}catch{var F=new Uint8Array(X);X="";for(var z=0;z<F.length;z++)X+=String.fromCharCode(F[z])}P.push(X),O=s(O,H)}var lt=P.length;P.forEach(function(ct,xt){T(r.decodePacket(ct,U,!0),xt,lt)})}})(dn);var Wi,Hs;function Hi(){if(Hs)return Wi;Hs=1;var r=dn,o=kn;Wi=n;function n(s){this.path=s.path,this.hostname=s.hostname,this.port=s.port,this.secure=s.secure,this.query=s.query,this.timestampParam=s.timestampParam,this.timestampRequests=s.timestampRequests,this.readyState="",this.agent=s.agent||!1,this.socket=s.socket,this.enablesXDR=s.enablesXDR,this.withCredentials=s.withCredentials,this.pfx=s.pfx,this.key=s.key,this.passphrase=s.passphrase,this.cert=s.cert,this.ca=s.ca,this.ciphers=s.ciphers,this.rejectUnauthorized=s.rejectUnauthorized,this.forceNode=s.forceNode,this.isReactNative=s.isReactNative,this.extraHeaders=s.extraHeaders,this.localAddress=s.localAddress}return o(n.prototype),n.prototype.onError=function(s,c){var f=new Error(s);return f.type="TransportError",f.description=c,this.emit("error",f),this},n.prototype.open=function(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this},n.prototype.send=function(s){if(this.readyState==="open")this.write(s);else throw new Error("Transport not open")},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(s){var c=r.decodePacket(s,this.socket.binaryType);this.onPacket(c)},n.prototype.onPacket=function(s){this.emit("packet",s)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")},Wi}var xn={};xn.encode=function(r){var o="";for(var n in r)r.hasOwnProperty(n)&&(o.length&&(o+="&"),o+=encodeURIComponent(n)+"="+encodeURIComponent(r[n]));return o},xn.decode=function(r){for(var o={},n=r.split("&"),s=0,c=n.length;s<c;s++){var f=n[s].split("=");o[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return o};var Er=function(r,o){var n=function(){};n.prototype=o.prototype,r.prototype=new n,r.prototype.constructor=r},Ks="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Tr=64,zs={},Gs=0,Qe=0,Xs;function Ki(r){var o="";do o=Ks[r%Tr]+o,r=Math.floor(r/Tr);while(r>0);return o}function $f(r){var o=0;for(Qe=0;Qe<r.length;Qe++)o=o*Tr+zs[r.charAt(Qe)];return o}function zi(){var r=Ki(+new Date);return r!==Xs?(Gs=0,Xs=r):r+"."+Ki(Gs++)}for(;Qe<Tr;Qe++)zs[Ks[Qe]]=Qe;zi.encode=Ki,zi.decode=$f;var $s=zi,js=Hi(),jf=xn,Js=dn,Jf=Er,Yf=$s,xe=qe("engine.io-client:polling"),Ys=Ne,Vf=function(){var r=Di,o=new r({xdomain:!1});return o.responseType!=null}();function Ne(r){var o=r&&r.forceBase64;(!Vf||o)&&(this.supportsBinary=!1),js.call(this,r)}Jf(Ne,js),Ne.prototype.name="polling",Ne.prototype.doOpen=function(){this.poll()},Ne.prototype.pause=function(r){var o=this;this.readyState="pausing";function n(){xe("paused"),o.readyState="paused",r()}if(this.polling||!this.writable){var s=0;this.polling&&(xe("we are currently polling - waiting to pause"),s++,this.once("pollComplete",function(){xe("pre-pause polling complete"),--s||n()})),this.writable||(xe("we are currently writing - waiting to pause"),s++,this.once("drain",function(){xe("pre-pause writing complete"),--s||n()}))}else n()},Ne.prototype.poll=function(){xe("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Ne.prototype.onData=function(r){var o=this;xe("polling got data %s",r);var n=function(s,c,f){if(o.readyState==="opening"&&s.type==="open"&&o.onOpen(),s.type==="close")return o.onClose(),!1;o.onPacket(s)};Js.decodePayload(r,this.socket.binaryType,n),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():xe('ignoring poll - transport state "%s"',this.readyState))},Ne.prototype.doClose=function(){var r=this;function o(){xe("writing close packet"),r.write([{type:"close"}])}this.readyState==="open"?(xe("transport open - closing"),o()):(xe("transport not open - deferring close"),this.once("open",o))},Ne.prototype.write=function(r){var o=this;this.writable=!1;var n=function(){o.writable=!0,o.emit("drain")};Js.encodePayload(r,this.supportsBinary,function(s){o.doWrite(s,n)})},Ne.prototype.uri=function(){var r=this.query||{},o=this.secure?"https":"http",n="";this.timestampRequests!==!1&&(r[this.timestampParam]=Yf()),!this.supportsBinary&&!r.sid&&(r.b64=1),r=jf.encode(r),this.port&&(o==="https"&&Number(this.port)!==443||o==="http"&&Number(this.port)!==80)&&(n=":"+this.port),r.length&&(r="?"+r);var s=this.hostname.indexOf(":")!==-1;return o+"://"+(s?"["+this.hostname+"]":this.hostname)+n+this.path+r};var Zf=Di,Vs=Ys,Qf=kn,th=Er,Gi=qe("engine.io-client:polling-xhr"),eh=Ui;Pi.exports=En,Pi.exports.Request=qt;function Zs(){}function En(r){if(Vs.call(this,r),this.requestTimeout=r.requestTimeout,this.extraHeaders=r.extraHeaders,typeof location<"u"){var o=location.protocol==="https:",n=location.port;n||(n=o?443:80),this.xd=typeof location<"u"&&r.hostname!==location.hostname||n!==r.port,this.xs=r.secure!==o}}th(En,Vs),En.prototype.supportsBinary=!0,En.prototype.request=function(r){return r=r||{},r.uri=this.uri(),r.xd=this.xd,r.xs=this.xs,r.agent=this.agent||!1,r.supportsBinary=this.supportsBinary,r.enablesXDR=this.enablesXDR,r.withCredentials=this.withCredentials,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,r.requestTimeout=this.requestTimeout,r.extraHeaders=this.extraHeaders,new qt(r)},En.prototype.doWrite=function(r,o){var n=typeof r!="string"&&r!==void 0,s=this.request({method:"POST",data:r,isBinary:n}),c=this;s.on("success",o),s.on("error",function(f){c.onError("xhr post error",f)}),this.sendXhr=s},En.prototype.doPoll=function(){Gi("xhr poll");var r=this.request(),o=this;r.on("data",function(n){o.onData(n)}),r.on("error",function(n){o.onError("xhr poll error",n)}),this.pollXhr=r};function qt(r){this.method=r.method||"GET",this.uri=r.uri,this.xd=!!r.xd,this.xs=!!r.xs,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.agent=r.agent,this.isBinary=r.isBinary,this.supportsBinary=r.supportsBinary,this.enablesXDR=r.enablesXDR,this.withCredentials=r.withCredentials,this.requestTimeout=r.requestTimeout,this.pfx=r.pfx,this.key=r.key,this.passphrase=r.passphrase,this.cert=r.cert,this.ca=r.ca,this.ciphers=r.ciphers,this.rejectUnauthorized=r.rejectUnauthorized,this.extraHeaders=r.extraHeaders,this.create()}if(Qf(qt.prototype),qt.prototype.create=function(){var r={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized;var o=this.xhr=new Zf(r),n=this;try{Gi("xhr open %s: %s",this.method,this.uri),o.open(this.method,this.uri,this.async);try{if(this.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(var s in this.extraHeaders)this.extraHeaders.hasOwnProperty(s)&&o.setRequestHeader(s,this.extraHeaders[s])}}catch{}if(this.method==="POST")try{this.isBinary?o.setRequestHeader("Content-type","application/octet-stream"):o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in o&&(o.withCredentials=this.withCredentials),this.requestTimeout&&(o.timeout=this.requestTimeout),this.hasXDR()?(o.onload=function(){n.onLoad()},o.onerror=function(){n.onError(o.responseText)}):o.onreadystatechange=function(){if(o.readyState===2)try{var c=o.getResponseHeader("Content-Type");(n.supportsBinary&&c==="application/octet-stream"||c==="application/octet-stream; charset=UTF-8")&&(o.responseType="arraybuffer")}catch{}o.readyState===4&&(o.status===200||o.status===1223?n.onLoad():setTimeout(function(){n.onError(typeof o.status=="number"?o.status:0)},0))},Gi("xhr data %s",this.data),o.send(this.data)}catch(c){setTimeout(function(){n.onError(c)},0);return}typeof document<"u"&&(this.index=qt.requestsCount++,qt.requests[this.index]=this)},qt.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},qt.prototype.onData=function(r){this.emit("data",r),this.onSuccess()},qt.prototype.onError=function(r){this.emit("error",r),this.cleanup(!0)},qt.prototype.cleanup=function(r){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Zs:this.xhr.onreadystatechange=Zs,r)try{this.xhr.abort()}catch{}typeof document<"u"&&delete qt.requests[this.index],this.xhr=null}},qt.prototype.onLoad=function(){var r;try{var o;try{o=this.xhr.getResponseHeader("Content-Type")}catch{}o==="application/octet-stream"||o==="application/octet-stream; charset=UTF-8"?r=this.xhr.response||this.xhr.responseText:r=this.xhr.responseText}catch(n){this.onError(n)}r!=null&&this.onData(r)},qt.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR},qt.prototype.abort=function(){this.cleanup()},qt.requestsCount=0,qt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Qs);else if(typeof addEventListener=="function"){var nh="onpagehide"in eh?"pagehide":"unload";addEventListener(nh,Qs,!1)}}function Qs(){for(var r in qt.requests)qt.requests.hasOwnProperty(r)&&qt.requests[r].abort()}var rh=Pi.exports,Xi=Ys,ih=Er,ta=Ui,oh=Tn,sh=/\n/g,ah=/\\n/g,Rr;function ch(){}function Tn(r){Xi.call(this,r),this.query=this.query||{},Rr||(Rr=ta.___eio=ta.___eio||[]),this.index=Rr.length;var o=this;Rr.push(function(n){o.onData(n)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){o.script&&(o.script.onerror=ch)},!1)}ih(Tn,Xi),Tn.prototype.supportsBinary=!1,Tn.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Xi.prototype.doClose.call(this)},Tn.prototype.doPoll=function(){var r=this,o=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),o.async=!0,o.src=this.uri(),o.onerror=function(c){r.onError("jsonp poll error",c)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(o,n):(document.head||document.body).appendChild(o),this.script=o;var s=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);s&&setTimeout(function(){var c=document.createElement("iframe");document.body.appendChild(c),document.body.removeChild(c)},100)},Tn.prototype.doWrite=function(r,o){var n=this;if(!this.form){var s=document.createElement("form"),c=document.createElement("textarea"),f=this.iframeId="eio_iframe_"+this.index,v;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=f,s.method="POST",s.setAttribute("accept-charset","utf-8"),c.name="d",s.appendChild(c),document.body.appendChild(s),this.form=s,this.area=c}this.form.action=this.uri();function d(){b(),o()}function b(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(_){n.onError("jsonp polling iframe removal error",_)}try{var p='<iframe src="javascript:0" name="'+n.iframeId+'">';v=document.createElement(p)}catch{v=document.createElement("iframe"),v.name=n.iframeId,v.src="javascript:0"}v.id=n.iframeId,n.form.appendChild(v),n.iframe=v}b(),r=r.replace(ah,`\\
45
- `),this.area.value=r.replace(sh,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){n.iframe.readyState==="complete"&&d()}:this.iframe.onload=d};const uh={},fh=Object.freeze(Object.defineProperty({__proto__:null,default:uh},Symbol.toStringTag,{value:"Module"})),hh=af(fh);var $i=Hi(),lh=dn,ph=xn,dh=Er,gh=$s,yh=qe("engine.io-client:websocket"),Ir,ji;if(typeof WebSocket<"u"?Ir=WebSocket:typeof self<"u"&&(Ir=self.WebSocket||self.MozWebSocket),typeof window>"u")try{ji=hh}catch{}var Rn=Ir||ji,vh=ve;function ve(r){var o=r&&r.forceBase64;o&&(this.supportsBinary=!1),this.perMessageDeflate=r.perMessageDeflate,this.usingBrowserWebSocket=Ir&&!r.forceNode,this.protocols=r.protocols,this.usingBrowserWebSocket||(Rn=ji),$i.call(this,r)}dh(ve,$i),ve.prototype.name="websocket",ve.prototype.supportsBinary=!0,ve.prototype.doOpen=function(){if(this.check()){var r=this.uri(),o=this.protocols,n={};this.isReactNative||(n.agent=this.agent,n.perMessageDeflate=this.perMessageDeflate,n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?o?new Rn(r,o):new Rn(r):new Rn(r,o,n)}catch(s){return this.emit("error",s)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},ve.prototype.addEventListeners=function(){var r=this;this.ws.onopen=function(){r.onOpen()},this.ws.onclose=function(){r.onClose()},this.ws.onmessage=function(o){r.onData(o.data)},this.ws.onerror=function(o){r.onError("websocket error",o)}},ve.prototype.write=function(r){var o=this;this.writable=!1;for(var n=r.length,s=0,c=n;s<c;s++)(function(v){lh.encodePacket(v,o.supportsBinary,function(d){if(!o.usingBrowserWebSocket){var b={};if(v.options&&(b.compress=v.options.compress),o.perMessageDeflate){var p=typeof d=="string"?Buffer.byteLength(d):d.length;p<o.perMessageDeflate.threshold&&(b.compress=!1)}}try{o.usingBrowserWebSocket?o.ws.send(d):o.ws.send(d,b)}catch{yh("websocket closed before onclose event")}--n||f()})})(r[s]);function f(){o.emit("flush"),setTimeout(function(){o.writable=!0,o.emit("drain")},0)}},ve.prototype.onClose=function(){$i.prototype.onClose.call(this)},ve.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},ve.prototype.uri=function(){var r=this.query||{},o=this.secure?"wss":"ws",n="";this.port&&(o==="wss"&&Number(this.port)!==443||o==="ws"&&Number(this.port)!==80)&&(n=":"+this.port),this.timestampRequests&&(r[this.timestampParam]=gh()),this.supportsBinary||(r.b64=1),r=ph.encode(r),r.length&&(r="?"+r);var s=this.hostname.indexOf(":")!==-1;return o+"://"+(s?"["+this.hostname+"]":this.hostname)+n+this.path+r},ve.prototype.check=function(){return!!Rn&&!("__initialize"in Rn&&this.name===ve.prototype.name)};var mh=Di,_h=rh,wh=oh,bh=vh;Sr.polling=Ch,Sr.websocket=bh;function Ch(r){var o,n=!1,s=!1,c=r.jsonp!==!1;if(typeof location<"u"){var f=location.protocol==="https:",v=location.port;v||(v=f?443:80),n=r.hostname!==location.hostname||v!==r.port,s=r.secure!==f}if(r.xdomain=n,r.xscheme=s,o=new mh(r),"open"in o&&!r.forceJSONP)return new _h(r);if(!c)throw new Error("JSONP disabled");return new wh(r)}var Sh=[].indexOf,ea=function(r,o){if(Sh)return r.indexOf(o);for(var n=0;n<r.length;++n)if(r[n]===o)return n;return-1},kh=Sr,Ah=kn,Mt=qe("engine.io-client:socket"),xh=ea,na=dn,ra=Is,Eh=xn,Th=_t;function _t(r,o){if(!(this instanceof _t))return new _t(r,o);o=o||{},r&&typeof r=="object"&&(o=r,r=null),r?(r=ra(r),o.hostname=r.host,o.secure=r.protocol==="https"||r.protocol==="wss",o.port=r.port,r.query&&(o.query=r.query)):o.host&&(o.hostname=ra(o.host).host),this.secure=o.secure!=null?o.secure:typeof location<"u"&&location.protocol==="https:",o.hostname&&!o.port&&(o.port=this.secure?"443":"80"),this.agent=o.agent||!1,this.hostname=o.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=o.port||(typeof location<"u"&&location.port?location.port:this.secure?443:80),this.query=o.query||{},typeof this.query=="string"&&(this.query=Eh.decode(this.query)),this.upgrade=o.upgrade!==!1,this.path=(o.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!o.forceJSONP,this.jsonp=o.jsonp!==!1,this.forceBase64=!!o.forceBase64,this.enablesXDR=!!o.enablesXDR,this.withCredentials=o.withCredentials!==!1,this.timestampParam=o.timestampParam||"t",this.timestampRequests=o.timestampRequests,this.transports=o.transports||["polling","websocket"],this.transportOptions=o.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=o.policyPort||843,this.rememberUpgrade=o.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=o.onlyBinaryUpgrades,this.perMessageDeflate=o.perMessageDeflate!==!1?o.perMessageDeflate||{}:!1,this.perMessageDeflate===!0&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=o.pfx||void 0,this.key=o.key||void 0,this.passphrase=o.passphrase||void 0,this.cert=o.cert||void 0,this.ca=o.ca||void 0,this.ciphers=o.ciphers||void 0,this.rejectUnauthorized=o.rejectUnauthorized===void 0?!0:o.rejectUnauthorized,this.forceNode=!!o.forceNode,this.isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",(typeof self>"u"||this.isReactNative)&&(o.extraHeaders&&Object.keys(o.extraHeaders).length>0&&(this.extraHeaders=o.extraHeaders),o.localAddress&&(this.localAddress=o.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}_t.priorWebsocketSuccess=!1,Ah(_t.prototype),_t.protocol=na.protocol,_t.Socket=_t,_t.Transport=Hi(),_t.transports=Sr,_t.parser=dn,_t.prototype.createTransport=function(r){Mt('creating transport "%s"',r);var o=Rh(this.query);o.EIO=na.protocol,o.transport=r;var n=this.transportOptions[r]||{};this.id&&(o.sid=this.id);var s=new kh[r]({query:o,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,withCredentials:n.withCredentials||this.withCredentials,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative});return s};function Rh(r){var o={};for(var n in r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o}_t.prototype.open=function(){var r;if(this.rememberUpgrade&&_t.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)r="websocket";else if(this.transports.length===0){var o=this;setTimeout(function(){o.emit("error","No transports available")},0);return}else r=this.transports[0];this.readyState="opening";try{r=this.createTransport(r)}catch{this.transports.shift(),this.open();return}r.open(),this.setTransport(r)},_t.prototype.setTransport=function(r){Mt("setting transport %s",r.name);var o=this;this.transport&&(Mt("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=r,r.on("drain",function(){o.onDrain()}).on("packet",function(n){o.onPacket(n)}).on("error",function(n){o.onError(n)}).on("close",function(){o.onClose("transport close")})},_t.prototype.probe=function(r){Mt('probing transport "%s"',r);var o=this.createTransport(r,{probe:1}),n=!1,s=this;_t.priorWebsocketSuccess=!1;function c(){if(s.onlyBinaryUpgrades){var g=!this.supportsBinary&&s.transport.supportsBinary;n=n||g}n||(Mt('probe transport "%s" opened',r),o.send([{type:"ping",data:"probe"}]),o.once("packet",function(l){if(!n)if(l.type==="pong"&&l.data==="probe"){if(Mt('probe transport "%s" pong',r),s.upgrading=!0,s.emit("upgrading",o),!o)return;_t.priorWebsocketSuccess=o.name==="websocket",Mt('pausing current transport "%s"',s.transport.name),s.transport.pause(function(){n||s.readyState!=="closed"&&(Mt("changing transport and sending upgrade packet"),_(),s.setTransport(o),o.send([{type:"upgrade"}]),s.emit("upgrade",o),o=null,s.upgrading=!1,s.flush())})}else{Mt('probe transport "%s" failed',r);var u=new Error("probe error");u.transport=o.name,s.emit("upgradeError",u)}}))}function f(){n||(n=!0,_(),o.close(),o=null)}function v(g){var l=new Error("probe error: "+g);l.transport=o.name,f(),Mt('probe transport "%s" failed because of error: %s',r,g),s.emit("upgradeError",l)}function d(){v("transport closed")}function b(){v("socket closed")}function p(g){o&&g.name!==o.name&&(Mt('"%s" works - aborting "%s"',g.name,o.name),f())}function _(){o.removeListener("open",c),o.removeListener("error",v),o.removeListener("close",d),s.removeListener("close",b),s.removeListener("upgrading",p)}o.once("open",c),o.once("error",v),o.once("close",d),this.once("close",b),this.once("upgrading",p),o.open()},_t.prototype.onOpen=function(){if(Mt("socket open"),this.readyState="open",_t.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){Mt("starting upgrade probes");for(var r=0,o=this.upgrades.length;r<o;r++)this.probe(this.upgrades[r])}},_t.prototype.onPacket=function(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Mt('socket receive: type "%s", data "%s"',r.type,r.data),this.emit("packet",r),this.emit("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var o=new Error("server error");o.code=r.data,this.onError(o);break;case"message":this.emit("data",r.data),this.emit("message",r.data);break}else Mt('packet received with socket readyState "%s"',this.readyState)},_t.prototype.onHandshake=function(r){this.emit("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this.upgrades=this.filterUpgrades(r.upgrades),this.pingInterval=r.pingInterval,this.pingTimeout=r.pingTimeout,this.onOpen(),this.readyState!=="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},_t.prototype.onHeartbeat=function(r){clearTimeout(this.pingTimeoutTimer);var o=this;o.pingTimeoutTimer=setTimeout(function(){o.readyState!=="closed"&&o.onClose("ping timeout")},r||o.pingInterval+o.pingTimeout)},_t.prototype.setPing=function(){var r=this;clearTimeout(r.pingIntervalTimer),r.pingIntervalTimer=setTimeout(function(){Mt("writing ping packet - expecting pong within %sms",r.pingTimeout),r.ping(),r.onHeartbeat(r.pingTimeout)},r.pingInterval)},_t.prototype.ping=function(){var r=this;this.sendPacket("ping",function(){r.emit("ping")})},_t.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()},_t.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(Mt("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},_t.prototype.write=_t.prototype.send=function(r,o,n){return this.sendPacket("message",r,o,n),this},_t.prototype.sendPacket=function(r,o,n,s){if(typeof o=="function"&&(s=o,o=void 0),typeof n=="function"&&(s=n,n=null),!(this.readyState==="closing"||this.readyState==="closed")){n=n||{},n.compress=n.compress!==!1;var c={type:r,data:o,options:n};this.emit("packetCreate",c),this.writeBuffer.push(c),s&&this.once("flush",s),this.flush()}},_t.prototype.close=function(){if(this.readyState==="opening"||this.readyState==="open"){this.readyState="closing";var r=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?s():o()}):this.upgrading?s():o()}function o(){r.onClose("forced close"),Mt("socket closing - telling transport to close"),r.transport.close()}function n(){r.removeListener("upgrade",n),r.removeListener("upgradeError",n),o()}function s(){r.once("upgrade",n),r.once("upgradeError",n)}return this},_t.prototype.onError=function(r){Mt("socket error %j",r),_t.priorWebsocketSuccess=!1,this.emit("error",r),this.onClose("transport error",r)},_t.prototype.onClose=function(r,o){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){Mt('socket close with reason: "%s"',r);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",r,o),n.writeBuffer=[],n.prevBufferLen=0}},_t.prototype.filterUpgrades=function(r){for(var o=[],n=0,s=r.length;n<s;n++)~xh(this.transports,r[n])&&o.push(r[n]);return o},Li.exports=Th,Li.exports.parser=dn;var Ih=Li.exports,ia={exports:{}},Oh=Nh;function Nh(r,o){var n=[];o=o||0;for(var s=o||0;s<r.length;s++)n[s-o]=r[s];return n}var oa=Lh;function Lh(r,o,n){return r.on(o,n),{destroy:function(){r.removeListener(o,n)}}}var sa=[].slice,aa=function(r,o){if(typeof o=="string"&&(o=r[o]),typeof o!="function")throw new Error("bind() requires a function");var n=sa.call(arguments,2);return function(){return o.apply(r,n.concat(sa.call(arguments)))}};(function(r,o){var n=br,s=kn,c=Oh,f=oa,v=aa,d=qe("socket.io-client:socket"),b=xn,p=Ps;r.exports=l;var _={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},g=s.prototype.emit;function l(u,w,A){this.io=u,this.nsp=w,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},A&&A.query&&(this.query=A.query),this.io.autoConnect&&this.open()}s(l.prototype),l.prototype.subEvents=function(){if(!this.subs){var u=this.io;this.subs=[f(u,"open",v(this,"onopen")),f(u,"packet",v(this,"onpacket")),f(u,"close",v(this,"onclose"))]}},l.prototype.open=l.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState==="open"&&this.onopen(),this.emit("connecting"),this)},l.prototype.send=function(){var u=c(arguments);return u.unshift("message"),this.emit.apply(this,u),this},l.prototype.emit=function(u){if(_.hasOwnProperty(u))return g.apply(this,arguments),this;var w=c(arguments),A={type:(this.flags.binary!==void 0?this.flags.binary:p(w))?n.BINARY_EVENT:n.EVENT,data:w};return A.options={},A.options.compress=!this.flags||this.flags.compress!==!1,typeof w[w.length-1]=="function"&&(d("emitting packet with ack id %d",this.ids),this.acks[this.ids]=w.pop(),A.id=this.ids++),this.connected?this.packet(A):this.sendBuffer.push(A),this.flags={},this},l.prototype.packet=function(u){u.nsp=this.nsp,this.io.packet(u)},l.prototype.onopen=function(){if(d("transport is open - connecting"),this.nsp!=="/")if(this.query){var u=typeof this.query=="object"?b.encode(this.query):this.query;d("sending connect packet with query %s",u),this.packet({type:n.CONNECT,query:u})}else this.packet({type:n.CONNECT})},l.prototype.onclose=function(u){d("close (%s)",u),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",u)},l.prototype.onpacket=function(u){var w=u.nsp===this.nsp,A=u.type===n.ERROR&&u.nsp==="/";if(!(!w&&!A))switch(u.type){case n.CONNECT:this.onconnect();break;case n.EVENT:this.onevent(u);break;case n.BINARY_EVENT:this.onevent(u);break;case n.ACK:this.onack(u);break;case n.BINARY_ACK:this.onack(u);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",u.data);break}},l.prototype.onevent=function(u){var w=u.data||[];d("emitting event %j",w),u.id!=null&&(d("attaching ack callback to event"),w.push(this.ack(u.id))),this.connected?g.apply(this,w):this.receiveBuffer.push(w)},l.prototype.ack=function(u){var w=this,A=!1;return function(){if(!A){A=!0;var k=c(arguments);d("sending ack %j",k),w.packet({type:p(k)?n.BINARY_ACK:n.ACK,id:u,data:k})}}},l.prototype.onack=function(u){var w=this.acks[u.id];typeof w=="function"?(d("calling ack %s with %j",u.id,u.data),w.apply(this,u.data),delete this.acks[u.id]):d("bad ack %s",u.id)},l.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit("connect")},l.prototype.emitBuffered=function(){var u;for(u=0;u<this.receiveBuffer.length;u++)g.apply(this,this.receiveBuffer[u]);for(this.receiveBuffer=[],u=0;u<this.sendBuffer.length;u++)this.packet(this.sendBuffer[u]);this.sendBuffer=[]},l.prototype.ondisconnect=function(){d("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},l.prototype.destroy=function(){if(this.subs){for(var u=0;u<this.subs.length;u++)this.subs[u].destroy();this.subs=null}this.io.destroy(this)},l.prototype.close=l.prototype.disconnect=function(){return this.connected&&(d("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},l.prototype.compress=function(u){return this.flags.compress=u,this},l.prototype.binary=function(u){return this.flags.binary=u,this}})(ia);var ca=ia.exports,Bh=In;function In(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}In.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),n=Math.floor(o*this.jitter*r);r=Math.floor(o*10)&1?r+n:r-n}return Math.min(r,this.max)|0},In.prototype.reset=function(){this.attempts=0},In.prototype.setMin=function(r){this.ms=r},In.prototype.setMax=function(r){this.max=r},In.prototype.setJitter=function(r){this.jitter=r};var Uh=Ih,Dh=ca,Ph=kn,Fh=br,tn=oa,On=aa,jt=qe("socket.io-client:manager"),ua=ea,Mh=Bh,fa=Object.prototype.hasOwnProperty,ha=bt;function bt(r,o){if(!(this instanceof bt))return new bt(r,o);r&&typeof r=="object"&&(o=r,r=void 0),o=o||{},o.path=o.path||"/socket.io",this.nsps={},this.subs=[],this.opts=o,this.reconnection(o.reconnection!==!1),this.reconnectionAttempts(o.reconnectionAttempts||1/0),this.reconnectionDelay(o.reconnectionDelay||1e3),this.reconnectionDelayMax(o.reconnectionDelayMax||5e3),this.randomizationFactor(o.randomizationFactor||.5),this.backoff=new Mh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(o.timeout==null?2e4:o.timeout),this.readyState="closed",this.uri=r,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=o.parser||Fh;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=o.autoConnect!==!1,this.autoConnect&&this.open()}bt.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var r in this.nsps)fa.call(this.nsps,r)&&this.nsps[r].emit.apply(this.nsps[r],arguments)},bt.prototype.updateSocketIds=function(){for(var r in this.nsps)fa.call(this.nsps,r)&&(this.nsps[r].id=this.generateId(r))},bt.prototype.generateId=function(r){return(r==="/"?"":r+"#")+this.engine.id},Ph(bt.prototype),bt.prototype.reconnection=function(r){return arguments.length?(this._reconnection=!!r,this):this._reconnection},bt.prototype.reconnectionAttempts=function(r){return arguments.length?(this._reconnectionAttempts=r,this):this._reconnectionAttempts},bt.prototype.reconnectionDelay=function(r){return arguments.length?(this._reconnectionDelay=r,this.backoff&&this.backoff.setMin(r),this):this._reconnectionDelay},bt.prototype.randomizationFactor=function(r){return arguments.length?(this._randomizationFactor=r,this.backoff&&this.backoff.setJitter(r),this):this._randomizationFactor},bt.prototype.reconnectionDelayMax=function(r){return arguments.length?(this._reconnectionDelayMax=r,this.backoff&&this.backoff.setMax(r),this):this._reconnectionDelayMax},bt.prototype.timeout=function(r){return arguments.length?(this._timeout=r,this):this._timeout},bt.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},bt.prototype.open=bt.prototype.connect=function(r,o){if(jt("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;jt("opening %s",this.uri),this.engine=Uh(this.uri,this.opts);var n=this.engine,s=this;this.readyState="opening",this.skipReconnect=!1;var c=tn(n,"open",function(){s.onopen(),r&&r()}),f=tn(n,"error",function(b){if(jt("connect_error"),s.cleanup(),s.readyState="closed",s.emitAll("connect_error",b),r){var p=new Error("Connection error");p.data=b,r(p)}else s.maybeReconnectOnOpen()});if(this._timeout!==!1){var v=this._timeout;jt("connect attempt will timeout after %d",v),v===0&&c.destroy();var d=setTimeout(function(){jt("connect attempt timed out after %d",v),c.destroy(),n.close(),n.emit("error","timeout"),s.emitAll("connect_timeout",v)},v);this.subs.push({destroy:function(){clearTimeout(d)}})}return this.subs.push(c),this.subs.push(f),this},bt.prototype.onopen=function(){jt("open"),this.cleanup(),this.readyState="open",this.emit("open");var r=this.engine;this.subs.push(tn(r,"data",On(this,"ondata"))),this.subs.push(tn(r,"ping",On(this,"onping"))),this.subs.push(tn(r,"pong",On(this,"onpong"))),this.subs.push(tn(r,"error",On(this,"onerror"))),this.subs.push(tn(r,"close",On(this,"onclose"))),this.subs.push(tn(this.decoder,"decoded",On(this,"ondecoded")))},bt.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},bt.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},bt.prototype.ondata=function(r){this.decoder.add(r)},bt.prototype.ondecoded=function(r){this.emit("packet",r)},bt.prototype.onerror=function(r){jt("error",r),this.emitAll("error",r)},bt.prototype.socket=function(r,o){var n=this.nsps[r];if(!n){n=new Dh(this,r,o),this.nsps[r]=n;var s=this;n.on("connecting",c),n.on("connect",function(){n.id=s.generateId(r)}),this.autoConnect&&c()}function c(){~ua(s.connecting,n)||s.connecting.push(n)}return n},bt.prototype.destroy=function(r){var o=ua(this.connecting,r);~o&&this.connecting.splice(o,1),!this.connecting.length&&this.close()},bt.prototype.packet=function(r){jt("writing packet %j",r);var o=this;r.query&&r.type===0&&(r.nsp+="?"+r.query),o.encoding?o.packetBuffer.push(r):(o.encoding=!0,this.encoder.encode(r,function(n){for(var s=0;s<n.length;s++)o.engine.write(n[s],r.options);o.encoding=!1,o.processPacketQueue()}))},bt.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var r=this.packetBuffer.shift();this.packet(r)}},bt.prototype.cleanup=function(){jt("cleanup");for(var r=this.subs.length,o=0;o<r;o++){var n=this.subs.shift();n.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},bt.prototype.close=bt.prototype.disconnect=function(){jt("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},bt.prototype.onclose=function(r){jt("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",r),this._reconnection&&!this.skipReconnect&&this.reconnect()},bt.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var r=this;if(this.backoff.attempts>=this._reconnectionAttempts)jt("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var o=this.backoff.duration();jt("will wait %dms before reconnect attempt",o),this.reconnecting=!0;var n=setTimeout(function(){r.skipReconnect||(jt("attempting reconnect"),r.emitAll("reconnect_attempt",r.backoff.attempts),r.emitAll("reconnecting",r.backoff.attempts),!r.skipReconnect&&r.open(function(s){s?(jt("reconnect attempt error"),r.reconnecting=!1,r.reconnect(),r.emitAll("reconnect_error",s.data)):(jt("reconnect success"),r.onreconnect())}))},o);this.subs.push({destroy:function(){clearTimeout(n)}})}},bt.prototype.onreconnect=function(){var r=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",r)},function(r,o){var n=_f,s=br,c=ha,f=qe("socket.io-client");r.exports=o=d;var v=o.managers={};function d(b,p){typeof b=="object"&&(p=b,b=void 0),p=p||{};var _=n(b),g=_.source,l=_.id,u=_.path,w=v[l]&&u in v[l].nsps,A=p.forceNew||p["force new connection"]||p.multiplex===!1||w,k;return A?(f("ignoring socket cache for %s",g),k=c(g,p)):(v[l]||(f("new io instance for %s",g),v[l]=c(g,p)),k=v[l]),_.query&&!p.query&&(p.query=_.query),k.socket(_.path,p)}o.protocol=s.protocol,o.connect=d,o.Manager=ha,o.Socket=ca}(xi,xi.exports);var qh=xi.exports;const Wh=sf(qh);let Or;const Hh=new Uint8Array(16);function Kh(){if(!Or&&(Or=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Or))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Or(Hh)}const Gt=[];for(let r=0;r<256;++r)Gt.push((r+256).toString(16).slice(1));function zh(r,o=0){return Gt[r[o+0]]+Gt[r[o+1]]+Gt[r[o+2]]+Gt[r[o+3]]+"-"+Gt[r[o+4]]+Gt[r[o+5]]+"-"+Gt[r[o+6]]+Gt[r[o+7]]+"-"+Gt[r[o+8]]+Gt[r[o+9]]+"-"+Gt[r[o+10]]+Gt[r[o+11]]+Gt[r[o+12]]+Gt[r[o+13]]+Gt[r[o+14]]+Gt[r[o+15]]}const Gh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),la={randomUUID:Gh};function Xh(r,o,n){if(la.randomUUID&&!o&&!r)return la.randomUUID();r=r||{};const s=r.random||(r.rng||Kh)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,o){n=n||0;for(let c=0;c<16;++c)o[n+c]=s[c];return o}return zh(s)}function $h(r,o){const n=o.map(c=>JSON.stringify(c)).join(" "),s=new Date().toISOString();return JSON.stringify({level:r,time:s,message:n})}function jh(r){const o=String(r[0]),n=r.slice(1);return{level:o,logs:n}}function Jh(r,o){const n=JSON.parse(r);return o.forEach(s=>delete n[s]),n}function Yh(r){if(typeof r=="object"&&r!==null)return r;try{return JSON.parse(r)}catch{return{extraData:r}}}function Vh(r){const o=/\(([^)]+)\)/,n=r.match(o);if(n&&n[1]){const s=n[1].split(";");for(let c of s)if(c=c.trim(),c.startsWith("Windows")||c.startsWith("Macintosh")||c.startsWith("Linux"))return c}return"Unknown"}function pa(r){return(...o)=>new Promise((n,s)=>{try{const c=r(...o);n(c)}catch(c){s(c)}})}const Zh={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},Ji={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4};let ie=console;class Qh{constructor(o){Dt(this,"logToConsole"),Dt(this,"overloadGlobalConsole"),Dt(this,"system"),Dt(this,"socketEmitInterval"),Dt(this,"storageId"),Dt(this,"emitInProgress"),Dt(this,"queue"),Dt(this,"processing"),Dt(this,"interval"),Dt(this,"logIndex"),Dt(this,"socket"),Dt(this,"staticObject",{}),Dt(this,"isGetItemAsync"),Dt(this,"isSetItemAsync"),Dt(this,"getItem"),Dt(this,"setItem"),Dt(this,"parseLog"),Dt(this,"_logMethod"),Dt(this,"_warnMethod"),Dt(this,"_errorMethod"),Dt(this,"_debugMethod");const{loggerOptions:n}=o;if(!n.system)throw new Error("Config property 'system' should be provided!");this.isGetItemAsync=n.isGetItemAsync||!1,this.isSetItemAsync=n.isSetItemAsync||!1,this.setupStorageFunctions(n.getItem,n.setItem,n.parseLog),this.system=n.system,this.socketEmitInterval=n.socketEmitInterval||Ji.socketEmitInterval,this.logToConsole=n.logToConsole!==void 0?n.logToConsole:Ji.logToConsole,this.overloadGlobalConsole=n.overloadGlobalConsole!==void 0?n.overloadGlobalConsole:Ji.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.emitInProgress=!1,this.logIndex=0,this.init(o)}setupStorageFunctions(o,n,s){this.getItem=o&&typeof o=="function"?this.isGetItemAsync?o:pa(o):this.defaultGetItemFunction,this.setItem=n&&typeof n=="function"?this.isSetItemAsync?n:pa(n):this.defaultSetItemFunction,this.parseLog=s&&typeof s=="function"?s:$h}init(o){const{socket:n,url:s,socketOptions:c={}}=o;this._logMethod=ie.log.bind(ie),this._warnMethod=ie.warn.bind(ie),this._errorMethod=ie.error.bind(ie),this._debugMethod=ie.debug.bind(ie),this.initStorage().then(()=>{if(n)this.socket=n;else if(s)this.socket=this.createConnection(s,c);else throw new Error("Must provide either a 'socket' or a 'url' for socket connection");this.interval=setInterval(async()=>{await this.emitLogs()},this.socketEmitInterval),this.overloadGlobalConsole&&this._overloadConsole()})}createConnection(o,n={}){const s={...Zh,...n};return Wh(o,s)}async emitLogs(){if(!this.emitInProgress)try{const o=await this.getItem(this.storageId);if(!o)return;const n=[];this.emitInProgress=!0;const s=JSON.parse(o),c=Object.keys(s);if(!c.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const d of c){const b=Yh(s[d]),p={...this.populateMetaData(),...this.staticObject,...b};await this.socket.emit("Log",JSON.stringify(p)),n.push(d)}const f=await this.getItem(this.storageId);if(!f)return;const v=Jh(f,n);await this.setItem(this.storageId,JSON.stringify(v))}catch(o){this._errorMethod(o)}finally{this.emitInProgress=!1}}setupStaticFields(o){this.staticObject={...o}}populateMetaData(){const o=new Date;let n;typeof window<"u"&&typeof window.document<"u"?n=window==null?void 0:window.navigator.userAgent:typeof self<"u"&&self.navigator&&(n=self.navigator.userAgent);let s;return n&&(s=Vh(n)),{System:this.system,DateTime:o,UserAgent:n,OSVersion:s}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){ie=Object.assign(ie,{log:o=>{this.log(o)},warn:o=>{this.warn(o)},error:o=>{this.error(o)},debug:o=>{this.debug(o)}})}async initStorage(){const o=await this.getItem(this.storageId);(!o||typeof o!="string")&&await this.setItem(this.storageId,JSON.stringify({}))}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const o=Xh();return this.system.toString().toUpperCase()+o+Date.now()}async processLog(...o){try{if(o.length<2)return;const n=await this.getItem(this.storageId);if(!n)return;const{level:s,logs:c}=jh(o),f=JSON.parse(n),v=this.formItemKey(s);f[v]=this.parseLog(s,c),await this.setItem(this.storageId,JSON.stringify(f))}catch(n){this._errorMethod(n)}}async processQueue(){if(this.processing||this.queue.length===0)return;const o=this.queue.shift();o&&(this.processing=!0,await this.processLog(...o).finally(()=>{this.processing=!1,this.processQueue()}))}log(o){const n=["INFO",o];this.queue.push(n),this.logToConsole&&this._logMethod.apply(ie,[o]),this.processQueue()}warn(o){const n=["WARN",o];this.queue.push(n),this.logToConsole&&this._warnMethod.apply(ie,[o]),this.processQueue()}error(o){const n=["ERROR",o];this.queue.push(n),this.logToConsole&&this._errorMethod.apply(ie,[o]),this.processQueue()}debug(o){const n=["DEBUG",o];this.queue.push(n),this.logToConsole&&this._debugMethod.apply(ie,[o]),this.processQueue()}async defaultGetItemFunction(o){return localStorage.getItem(o)}async defaultSetItemFunction(o,n){try{localStorage.setItem(o,n)}catch(s){this._errorMethod(s)}}formItemKey(o){const n=new Date().toISOString();return this.logIndex++,`${o}-${this.system}-${n}-${this.logIndex}`}}class tl{constructor(o){At(this,"storageLogger");this.eventsSdkClass=o,this.eventsSdkClass=o}init(){if(!this.eventsSdkClass.options.useLogger)return;if(this.eventsSdkClass.options.storageLoggerInstance){this.storageLogger=this.eventsSdkClass.options.storageLoggerInstance;return}let o;this.eventsSdkClass.options.loggerSocketConnection&&(o=this.eventsSdkClass.options.loggerSocketConnection),this.eventsSdkClass.socketIoClass.ioFunction&&!o&&(o=this.eventsSdkClass.socketIoClass.ioFunction(this.eventsSdkClass.options.loggerServer,this.eventsSdkClass.options.loggerConnectOptions)),o&&(this.storageLogger=new Qh({socket:o,loggerOptions:this.eventsSdkClass.options.loggerConfig}))}log(o){this.storageLogger?o.Level===Jn.INFO?this.storageLogger.log(o):o.Level===Jn.ERROR&&this.storageLogger.error(o):o.Level===Jn.INFO?console.log(o):o.Level===Jn.ERROR&&console.error(o)}}class el{constructor(o){At(this,"listeners",{[yt.ALL_EXTENSION_STATUS]:[],[yt.ALL_DIALER_STATUS]:[],[yt.ALL_USERS_STATUS]:[],[yt.QUEUE_EVENT]:[],[yt.EXTENSION_EVENT]:[],[yt.DIALER_EVENT]:[],[yt.LOGIN_SUCCESS]:[],[yt.LOGIN_STATUS]:[],[yt.KEEP_ALIVE_RESPONSE]:[],[yt.ONLINE_STATUS_EVENT]:[],[yt.EXTENSIONS_UPDATED]:[]});At(this,"allListeners",[]);this.eventsSdkClass=o,this.eventsSdkClass=o}on(o,n){o==="*"?this.allListeners.push(n):this.listeners[o].push(n)}off(o,n){if(o==="*")this.allListeners=this.allListeners.filter(s=>s!==n);else{const c=this.listeners[o].filter(f=>f!==n);this.listeners={...this.listeners,[o]:c}}}emit(o,n){this.eventsSdkClass.socketIoClass.lastEventTimestamp=new Date().getTime(),this.listeners[o].forEach(c=>c({name:o,data:n}));const s={name:o,data:n};this.allListeners.forEach(c=>c(s))}}class nl{constructor(o){At(this,"argumentOptions");At(this,"options");At(this,"servers",[]);At(this,"URLList",[]);At(this,"server");At(this,"URL");At(this,"socket");At(this,"mainServer");At(this,"alreadyAttemptedOtherServers",[]);At(this,"authClass",new ju(this));At(this,"socketIoClass",new nf(this));At(this,"loggerClass",new tl(this));At(this,"eventEmitterClass",new el(this));At(this,"reconnectOptions");At(this,"retryConnection");this.options={...Yu,...o},this.reconnectOptions={retryCount:1,maxReconnectAttempts:this.options.maxReconnectAttempts,reconnectionDelay:this.options.reconnectionDelay,minReconnectionDelay:this.options.reconnectionDelay,maxReconnectionDelay:6e4*5},this.server=this.options.fallbackServer,this.retryConnection=Ju.debounce(this.connect.bind(this),this.reconnectOptions.reconnectionDelay,{leading:!0,trailing:!1}),this.argumentOptions={...o}}on(o,n){this.eventEmitterClass.on(o,n)}emit(o,...n){this.socketIoClass.io&&this.socketIoClass.io.emit(o,...n)}connect(o){o===pn.MAIN&&this.findMainServer(),o===pn.NEXT&&this.findNextServer(),this.socketIoClass.doReconnect=!0,this.socketIoClass.initSocketConnection(),this.socketIoClass.initSocketEvents(),this.socketIoClass.initKeepAlive(),this.loggerClass.init()}disconnect(){this.socketIoClass.doReconnect=!1,this.socketIoClass.closeAllConnections()}clearKeepAliveInterval(){this.socketIoClass.clearKeepAliveInterval()}findMainServer(){this.servers.length?(this.mainServer=this.servers.reduce((o,n)=>n.Priority>o.Priority?n:o),this.server=this.mainServer):this.URLList.length&&(this.URL=this.URLList[0])}findNextServer(){if(this.servers.length)if(this.server.Priority===this.mainServer.Priority){let o=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0);o.length||(this.alreadyAttemptedOtherServers=[],o=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0)),o.length&&(this.server=o.reduce((n,s)=>s.Priority>n.Priority?s:n),this.alreadyAttemptedOtherServers.push(this.server.Priority))}else this.server=this.mainServer;else if(this.URLList.length)if(this.URL===this.URLList[0]){let o=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0);o.length||(this.alreadyAttemptedOtherServers=[],o=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0)),o.length&&(this.URL=o[0],this.alreadyAttemptedOtherServers.push(this.URL))}else this.URL=this.URLList[0]}async init(){return this.socket,await this.authClass.login(this.options),this.getServers(),!0}getServers(){this.options.serverFetchStrategy==="static"&&this.argumentOptions.servers&&Array.isArray(this.argumentOptions.servers)&&this.argumentOptions.servers.length>1&&(this.servers=this.argumentOptions.servers)}}Bt.CallStatusEnum=Ss,Bt.CallTypeEnum=ks,Bt.DialerTypeEnum=As,Bt.DirectionEnum=xs,Bt.DoNotCallMeStatusCodeEnum=Es,Bt.EventsEnum=yt,Bt.ExtensionEventReasonEnum=Si,Bt.ExtensionHangupCauseEnum=Ts,Bt.QueueEventReasonEnum=Rs,Bt.ServerListenerEventsEnum=Ai,Bt.default=nl,Object.defineProperties(Bt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
12
+ ]`&&N(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&N(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&N(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&N(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch{D=!1}}U=D}if(R=="json-parse"){var P=l.parse;if(typeof P=="function")try{if(P("0")===0&&!P(!1)){I=P(F);var L=I.a.length==5&&I.a[0]===1;if(L){try{L=!P('" "')}catch{}if(L)try{L=P("01")!==1}catch{}if(L)try{L=P("1.")!==1}catch{}}}}catch{L=!1}U=L}}return o[R]=!!U}var i,u,h,d={}.toString,c=typeof JSON=="object"&&JSON,l=typeof r=="object"&&r&&!r.nodeType&&r;l&&c?(l.stringify=c.stringify,l.parse=c.parse):l=n.JSON=c||{};var p=new Date(-0xc782b5b800cec);try{p=p.getUTCFullYear()==-109252&&p.getUTCMonth()===0&&p.getUTCDate()===1&&p.getUTCHours()==10&&p.getUTCMinutes()==37&&p.getUTCSeconds()==6&&p.getUTCMilliseconds()==708}catch{}if(!o("json")){var a="[object Function]",s="[object Date]",f="[object Number]",y="[object String]",g="[object Array]",w="[object Boolean]",B=o("bug-string-char-index");if(!p)var _=Math.floor,b=[0,31,59,90,120,151,181,212,243,273,304,334],S=function(R,U){return b[U]+365*(R-1970)+_((R-1969+(U=+(U>1)))/4)-_((R-1901+U)/100)+_((R-1601+U)/400)};(i={}.hasOwnProperty)||(i=function(R){var U,I={};return(I.__proto__=null,I.__proto__={toString:1},I).toString!=d?i=function(F){var N=this.__proto__,D=F in(this.__proto__=null,this);return this.__proto__=N,D}:(U=I.constructor,i=function(F){var N=(this.constructor||U).prototype;return F in this&&!(F in N&&this[F]===N[F])}),I=null,i.call(this,R)});var m={boolean:1,number:1,string:1,undefined:1},C=function(R,U){var I=typeof R[U];return I=="object"?!!R[U]:!m[I]};if(u=function(R,U){var I,F,N,D=0;(I=function(){this.valueOf=0}).prototype.valueOf=0,F=new I;for(N in F)i.call(F,N)&&D++;return I=F=null,D?u=D==2?function(P,L){var M,J={},st=d.call(P)==a;for(M in P)st&&M=="prototype"||i.call(J,M)||!(J[M]=1)||!i.call(P,M)||L(M)}:function(P,L){var M,J,st=d.call(P)==a;for(M in P)st&&M=="prototype"||!i.call(P,M)||(J=M==="constructor")||L(M);(J||i.call(P,M="constructor"))&&L(M)}:(F=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],u=function(P,L){var M,J,st=d.call(P)==a,at=!st&&typeof P.constructor!="function"&&C(P,"hasOwnProperty")?P.hasOwnProperty:i;for(M in P)st&&M=="prototype"||!at.call(P,M)||L(M);for(J=F.length;M=F[--J];at.call(P,M)&&L(M));}),u(R,U)},!o("json-stringify")){var E={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},v="000000",k=function(R,U){return(v+(U||0)).slice(-R)},T="\\u00",x=function(R){var U,I='"',F=0,N=R.length,D=N>10&&B;for(D&&(U=R.split(""));N>F;F++){var P=R.charCodeAt(F);switch(P){case 8:case 9:case 10:case 12:case 13:case 34:case 92:I+=E[P];break;default:if(32>P){I+=T+k(2,P.toString(16));break}I+=D?U[F]:B?R.charAt(F):R[F]}}return I+'"'},O=function(R,U,I,F,N,D,P){var L,M,J,st,at,Dt,Te,Ne,xe,Oe,dt,Re,Gt,Pt,Ie,Be;try{L=U[R]}catch{}if(typeof L=="object"&&L)if(M=d.call(L),M!=s||i.call(L,"toJSON"))typeof L.toJSON=="function"&&(M!=f&&M!=y&&M!=g||i.call(L,"toJSON"))&&(L=L.toJSON(R));else if(L>-1/0&&1/0>L){if(S){for(at=_(L/864e5),J=_(at/365.2425)+1970-1;S(J+1,0)<=at;J++);for(st=_((at-S(J,0))/30.42);S(J,st+1)<=at;st++);at=1+at-S(J,st),Dt=(L%864e5+864e5)%864e5,Te=_(Dt/36e5)%24,Ne=_(Dt/6e4)%60,xe=_(Dt/1e3)%60,Oe=Dt%1e3}else J=L.getUTCFullYear(),st=L.getUTCMonth(),at=L.getUTCDate(),Te=L.getUTCHours(),Ne=L.getUTCMinutes(),xe=L.getUTCSeconds(),Oe=L.getUTCMilliseconds();L=(0>=J||J>=1e4?(0>J?"-":"+")+k(6,0>J?-J:J):k(4,J))+"-"+k(2,st+1)+"-"+k(2,at)+"T"+k(2,Te)+":"+k(2,Ne)+":"+k(2,xe)+"."+k(3,Oe)+"Z"}else L=null;if(I&&(L=I.call(U,R,L)),L===null)return"null";if(M=d.call(L),M==w)return""+L;if(M==f)return L>-1/0&&1/0>L?""+L:"null";if(M==y)return x(""+L);if(typeof L=="object"){for(Pt=P.length;Pt--;)if(P[Pt]===L)throw TypeError();if(P.push(L),dt=[],Ie=D,D+=N,M==g){for(Gt=0,Pt=L.length;Pt>Gt;Gt++)Re=O(Gt,L,I,F,N,D,P),dt.push(Re===h?"null":Re);Be=dt.length?N?`[
13
+ `+D+dt.join(`,
14
+ `+D)+`
15
+ `+Ie+"]":"["+dt.join(",")+"]":"[]"}else u(F||L,function(_e){var Ir=O(_e,L,I,F,N,D,P);Ir!==h&&dt.push(x(_e)+":"+(N?" ":"")+Ir)}),Be=dt.length?N?`{
16
+ `+D+dt.join(`,
17
+ `+D)+`
18
+ `+Ie+"}":"{"+dt.join(",")+"}":"{}";return P.pop(),Be}};l.stringify=function(R,U,I){var F,N,D,P;if(typeof U=="function"||typeof U=="object"&&U){if((P=d.call(U))==a)N=U;else if(P==g){D={};for(var L,M=0,J=U.length;J>M;L=U[M++],P=d.call(L),(P==y||P==f)&&(D[L]=1));}}if(I)if((P=d.call(I))==f){if((I-=I%1)>0)for(F="",I>10&&(I=10);F.length<I;F+=" ");}else P==y&&(F=I.length<=10?I:I.slice(0,10));return O("",(L={},L[""]=R,L),N,D,F,"",[])}}if(!o("json-parse")){var A,q,j=String.fromCharCode,G={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:`
19
+ `,102:"\f",114:"\r"},K=function(){throw A=q=null,SyntaxError()},nt=function(){for(var R,U,I,F,N,D=q,P=D.length;P>A;)switch(N=D.charCodeAt(A)){case 9:case 10:case 13:case 32:A++;break;case 123:case 125:case 91:case 93:case 58:case 44:return R=B?D.charAt(A):D[A],A++,R;case 34:for(R="@",A++;P>A;)if(N=D.charCodeAt(A),32>N)K();else if(N==92)switch(N=D.charCodeAt(++A)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:R+=G[N],A++;break;case 117:for(U=++A,I=A+4;I>A;A++)N=D.charCodeAt(A),N>=48&&57>=N||N>=97&&102>=N||N>=65&&70>=N||K();R+=j("0x"+D.slice(U,A));break;default:K()}else{if(N==34)break;for(N=D.charCodeAt(A),U=A;N>=32&&N!=92&&N!=34;)N=D.charCodeAt(++A);R+=D.slice(U,A)}if(D.charCodeAt(A)==34)return A++,R;K();default:if(U=A,N==45&&(F=!0,N=D.charCodeAt(++A)),N>=48&&57>=N){for(N==48&&(N=D.charCodeAt(A+1),N>=48&&57>=N)&&K(),F=!1;P>A&&(N=D.charCodeAt(A),N>=48&&57>=N);A++);if(D.charCodeAt(A)==46){for(I=++A;P>I&&(N=D.charCodeAt(I),N>=48&&57>=N);I++);I==A&&K(),A=I}if(N=D.charCodeAt(A),N==101||N==69){for(N=D.charCodeAt(++A),(N==43||N==45)&&A++,I=A;P>I&&(N=D.charCodeAt(I),N>=48&&57>=N);I++);I==A&&K(),A=I}return+D.slice(U,A)}if(F&&K(),D.slice(A,A+4)=="true")return A+=4,!0;if(D.slice(A,A+5)=="false")return A+=5,!1;if(D.slice(A,A+4)=="null")return A+=4,null;K()}return"$"},Ut=function(R){var U,I;if(R=="$"&&K(),typeof R=="string"){if((B?R.charAt(0):R[0])=="@")return R.slice(1);if(R=="["){for(U=[];R=nt(),R!="]";I||(I=!0))I&&(R==","?(R=nt(),R=="]"&&K()):K()),R==","&&K(),U.push(Ut(R));return U}if(R=="{"){for(U={};R=nt(),R!="}";I||(I=!0))I&&(R==","?(R=nt(),R=="}"&&K()):K()),(R==","||typeof R!="string"||(B?R.charAt(0):R[0])!="@"||nt()!=":")&&K(),U[R.slice(1)]=Ut(nt());return U}K()}return R},Or=function(R,U,I){var F=Rr(R,U,I);F===h?delete R[U]:R[U]=F},Rr=function(R,U,I){var F,N=R[U];if(typeof N=="object"&&N)if(d.call(N)==g)for(F=N.length;F--;)Or(N,F,I);else u(N,function(D){Or(N,D,I)});return I.call(R,U,N)};l.parse=function(R,U){var I,F;return A=0,q=""+R,I=Ut(nt()),nt()!="$"&&K(),A=q=null,U&&d.call(U)==a?Rr((F={},F[""]=I,F),"",U):I}}}})(this)},{}],48:[function(t,e){function r(n,o){var i=[];o=o||0;for(var u=o||0;u<n.length;u++)i[u-o]=n[u];return i}e.exports=r},{}]},{},[1])(1)}const Fo=Object.assign({"./v1_3_7.js":Object.freeze(Object.defineProperty({__proto__:null,default:Po},Symbol.toStringTag,{value:"Module"}))}),jo=/v\d+_\d+_\d+/;function Mo(t){return typeof t=="function"}const we=Object.entries(Fo).reduce((t,e)=>{var o;const r=e[1].default,n=(o=e[0].match(jo))==null?void 0:o[0];return Mo(r)&&n&&(t[n]=r()),t},{}),Cr=t=>{if(t in we)return we[t];throw new Error(`Socket version ${t} not found`)},qo={...we,getSocketVersion:Cr,makeSocketVersion:(t,...e)=>Cr(t)(...e)};var wr=(t=>(t.RINGING="Ringing",t.TALKING="Talking",t.DIALING="Dialing",t.HOLD="Hold",t))(wr||{}),Sr=(t=>(t.INCOMING="Incoming",t.OUTGOING="Outgoing",t))(Sr||{}),Er=(t=>(t.AUTOMATIC="Automatic",t.IVR="IVR",t))(Er||{}),Ar=(t=>(t.INCOMINC="Incoming",t.OUTGOING="Outgoing",t.SPY="Spy",t.CLICK2CALL="Click2Call",t))(Ar||{}),Tr=(t=>(t.RESPONSE_FROM_API_VALID="RESPONSE_FROM_API_VALID",t.RESPONSE_FROM_API_INVALID="RESPONSE_FROM_API_INVALID",t))(Tr||{}),z=(t=>(t.ALL_DIALER_STATUS="AllDialersStatus",t.ALL_EXTENSION_STATUS="AllExtensionsStatus",t.ALL_USERS_STATUS="AllUsersStatus",t.CONNECT="connect",t.DISCONNECT="disconnect",t.CONNECT_ERROR_EVENT="connect_error",t.EXTENSION_EVENT="ExtensionEvent",t.KEEP_ALIVE="keepalive",t.KEEP_ALIVE_RESPONSE="keepaliveResponse",t.LOGIN_STATUS="loginStatus",t.LOGIN_SUCCESS="loginSuccess",t.QUEUE_EVENT="QueueEvent",t.ONLINE_STATUS_EVENT="onlineStatusEvent",t.DIALER_EVENT="DialerEvent",t.EXTENSIONS_UPDATED="ExtensionsUpdated",t))(z||{}),Se=(t=>(t.NEWCALL="NEWCALL",t.ANSWER="ANSWER",t.HOLD="HOLD",t.UNHOLD="UNHOLD",t.HANGUP="HANGUP",t.USER_STATUS_UPDATE="userStatusUpdate",t))(Se||{}),Nr=(t=>(t.NORMAL_HANGUP="Normal hangup",t.USER_BUSY="User busy",t.CALL_REJECTED="Call Rejected",t.UNALLOCATED_NUMBER="Unallocated (unassigned) number",t.UNKNOWN="Unknown",t.NO_USER_RESPONDING="No user responding",t.USER_ALERTING="User alerting, no answer",t.ANSWERED_ELSEWHERE="Answered elsewhere",t))(Nr||{}),xr=(t=>(t.ANSWER="ANSWER",t.ABANDONED="ABANDONED",t.EXIT="EXIT",t.JOIN="JOIN",t))(xr||{});class Ee{static mapExtensionEvent(e){var u,h;const r=e.reason;let n,o;e.data.currentCall&&(o=this.mapExtensionCall(e,e.data.currentCall));const i=this.mapExtensionData(e,e.data);return r===Se.HANGUP?n={...e,reason:r,data:{...i,currentCall:o?{...o,duration:Date.now()-((o==null?void 0:o.callAnswered_UTC_CLIENT)??0)}:void 0,calls:(u=e.data.calls)==null?void 0:u.map(d=>{const c=this.mapExtensionCall(e,d);return{...c,duration:Date.now()-(c.callAnswered_UTC_CLIENT??0)}})}}:n={...e,data:{...i,currentCall:o,calls:(h=e.data.calls)==null?void 0:h.map(d=>this.mapExtensionCall(e,d))},reason:r},n}static mapAllExtensionStatus(e){return{...e,extensions:e.extensions.map(r=>{var n;return{...this.mapExtensionData(e,r),currentCall:r.currentCall?this.mapExtensionCall(e,r.currentCall):void 0,calls:(n=r.calls)==null?void 0:n.map(o=>this.mapExtensionCall(e,o))}})}}static mapExtensionData(e,r){return this.configureUTCForObject(r,[{key:"lastAnsweredCallEventEpoch",format:"sec"},{key:"lastCallEventEpoch",format:"sec"},{key:"lastHangupCallEpoch",format:"sec"},{key:"representativeUpdated",format:"ms"}],e.servertime,e.servertimeoffset)}static mapExtensionCall(e,r){return this.configureUTCForObject(r,[{key:"callAnswered",format:"sec"},{key:"callStarted",format:"sec"}],e.servertime,e.servertimeoffset)}static mapQueueEvent(e){var r;return{...e,data:{...e.data,Calls:(r=e.data.Calls)==null?void 0:r.map(n=>this.configureUTCForObject(n,[{key:"JoinTimeStamp",format:"sec"}],e.servertime,e.servertimeoffset))}}}static assignProperty(e,r,n){e[r]=n}static configureUTCForObject(e,r,n,o){const i=(n-o*60)*1e3,u=Date.now()-i,h={};return r.forEach(d=>{const c=e[d.key],l=d.key;if(c!==0&&typeof c=="number"&&!isNaN(c)){let p=c;d.format==="ms"&&(p=Math.floor(p/1e3));const a=(p-o*60)*1e3;this.assignProperty(h,`${l}_UTC`,a),this.assignProperty(h,`${l}_UTC_CLIENT`,a+u)}else this.assignProperty(h,`${l}_UTC`,0),this.assignProperty(h,`${l}_UTC_CLIENT`,0)}),{...e,...h}}}var Ae=(t=>(t.UPDATE_MONITORED_EXTENSIONS="updateMonitoredExtensions",t.KEEP_ALIVE="keepAlive",t))(Ae||{});class zo{constructor(e){H(this,"io");H(this,"ioFunction");H(this,"lastEventTimestamp",new Date().getTime());H(this,"doReconnect",!0);H(this,"keepAliveInterval");H(this,"keepReconnectInterval");H(this,"connected",!1);this.eventsSdkClass=e,this.eventsSdkClass=e}getSocketIoFunction(e){const r=e.split("v="),n="v".concat(r[r.length-1]).replaceAll(".","_");this.ioFunction=qo.getSocketVersion(n)}initSocketConnection(){const e=this.eventsSdkClass.authClass.token,r=this.eventsSdkClass.options.protocol,n=this.eventsSdkClass.server;try{const o=n?n.Domain:this.eventsSdkClass.URL,i=n?`${r}://${o}`:this.eventsSdkClass.URL;this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!1,attemptToConnect:i,doReconnect:this.doReconnect});const u={reconnection:!1,upgrade:!1,transports:["websocket"],forceNew:!0,query:{token:e},timeout:this.eventsSdkClass.options.timeout};if(e&&(u.query={token:e}),this.ioFunction&&i)this.io=this.ioFunction(i,u),this.eventsSdkClass.loggerClass.log({Message:`${this.eventsSdkClass.options.loggerConfig.system} tries to connect to WS server ${o}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Switching Protocols",StatusCode:101,Level:et.INFO,LogType:ut.INFO});else throw new Error("Socket server url no defined")}catch(o){this.eventsSdkClass.loggerClass.log({Message:`${o}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection error",StatusCode:500,Level:et.ERROR,LogType:ut.ERROR})}}clearKeepAliveInterval(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval)}initKeepAlive(){this.clearKeepAliveInterval(),this.keepAliveInterval=setInterval(async()=>{if(new Date().getTime()>this.lastEventTimestamp+this.eventsSdkClass.options.keepAliveTimeout&&this.io&&this.eventsSdkClass.authClass.token){this.eventsSdkClass.emit(Ae.KEEP_ALIVE,this.eventsSdkClass.authClass.token),this.eventsSdkClass.loggerClass.log({Message:`Keep alive event emitted with this token: ${this.eventsSdkClass.authClass.token}`,ActionName:pt.WSCONNECT,isShowClient:!1,Level:et.INFO,LogType:ut.INFO});return}},this.eventsSdkClass.options.keepAliveTimeout)}closeAllConnections(){var e;this.io&&(this.io.close(),(e=this.io)==null||e.disconnect(),this.io=void 0),Rt.clearSessionStorage()}initSocketEvents(){this.io&&this.io.on(z.LOGIN_SUCCESS,e=>this.onLoginSuccessEvent(e)).on(z.QUEUE_EVENT,e=>this.onQueueEvent(e)).on(z.EXTENSION_EVENT,e=>this.onExtensionEvent(e)).on(z.DIALER_EVENT,e=>this.onDialerEvent(e)).on(z.LOGIN_STATUS,e=>this.onLoginStatusEvent(e)).on(z.ALL_EXTENSION_STATUS,e=>this.onAllExtensionStatus(e)).on(z.ALL_DIALER_STATUS,e=>this.onAllDialerStatus(e)).on(z.KEEP_ALIVE_RESPONSE,e=>this.onKeepAliveResponse(e)).on(z.EXTENSIONS_UPDATED,e=>this.onExtensionsUpdatedEvent(e)).on(z.CONNECT,()=>this.onConnect()).on(z.DISCONNECT,e=>this.onDisconnect(e)).on(z.CONNECT_ERROR_EVENT,e=>this.onConnectError(e))}onLoginSuccessEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.LOGIN_SUCCESS,e)}onQueueEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.QUEUE_EVENT,Ee.mapQueueEvent(e))}onExtensionEvent(e){const r=Ee.mapExtensionEvent(e);r&&this.eventsSdkClass.eventEmitterClass.emit(z.EXTENSION_EVENT,r)}onDialerEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.DIALER_EVENT,e)}onLoginStatusEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.LOGIN_STATUS,e)}onAllExtensionStatus(e){const r=Ee.mapAllExtensionStatus(e);this.eventsSdkClass.eventEmitterClass.emit(z.ALL_EXTENSION_STATUS,r)}onAllDialerStatus(e){this.eventsSdkClass.eventEmitterClass.emit(z.ALL_DIALER_STATUS,e)}onKeepAliveResponse(e){if(e.errorCode){this.initSocketConnection();return}this.eventsSdkClass.loggerClass.log({Message:`Keep alive response: ${e}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Successful",StatusCode:200,Level:et.INFO,LogType:ut.INFO}),this.connected?this.lastEventTimestamp=new Date().getTime():this.initSocketConnection()}onExtensionsUpdatedEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.EXTENSIONS_UPDATED,e)}onConnect(){this.keepReconnectInterval&&clearInterval(this.keepReconnectInterval),this.connected=!0,this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!0,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log({Message:`Sdk connected to the socket server ${this.eventsSdkClass.server&&this.eventsSdkClass.server.Domain?this.eventsSdkClass.server.Domain:this.eventsSdkClass.URL}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection established",StatusCode:200,Level:et.INFO,LogType:ut.INFO})}onDisconnect(e){this.connected=!1,this.closeAllConnections(),this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log({Message:`Sdk disconnected from the socket server ${this.eventsSdkClass.server&&this.eventsSdkClass.server.Domain?this.eventsSdkClass.server.Domain:this.eventsSdkClass.URL} (${e})`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection closed",StatusCode:200,Level:et.INFO,LogType:ut.INFO}),this.doReconnect&&this.eventsSdkClass.connect(bt.NEXT)}onConnectError(e){this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log({Message:`Sdk tries to connect to the socket server ${this.eventsSdkClass.URL} but error (${e})`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection attempt error",StatusCode:500,Level:et.ERROR,LogType:ut.ERROR}),setTimeout(()=>{this.eventsSdkClass.connect(bt.NEXT)},this.eventsSdkClass.options.reconnectionDelay)}}class Xo{constructor(e){H(this,"storageLogger");this.eventsSdkClass=e,this.eventsSdkClass=e}init(){if(!this.eventsSdkClass.options.useLogger)return;if(this.eventsSdkClass.options.storageLoggerInstance){this.storageLogger=this.eventsSdkClass.options.storageLoggerInstance;return}let e;this.eventsSdkClass.options.loggerSocketConnection&&(e=this.eventsSdkClass.options.loggerSocketConnection),this.eventsSdkClass.socketIoClass.ioFunction&&!e&&(e=this.eventsSdkClass.socketIoClass.ioFunction(this.eventsSdkClass.options.loggerServer,this.eventsSdkClass.options.loggerConnectOptions)),e&&(this.storageLogger=new Lo({socket:e,loggerOptions:this.eventsSdkClass.options.loggerConfig}))}log(e){this.storageLogger?e.Level===et.INFO?this.storageLogger.log(e):e.Level===et.ERROR&&this.storageLogger.error(e):e.Level===et.INFO?console.log(e):e.Level===et.ERROR&&console.error(e)}sdkInitializedLog(e){const r={...e,token:"CENSORED",password:"CENSORED"};this.log({Message:"Sdk initialized with provided options",Body:JSON.stringify(r),ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Sdk initialized",StatusCode:200,Level:et.INFO,LogType:ut.INFO})}}class Ko{constructor(e){H(this,"listeners",{[z.ALL_EXTENSION_STATUS]:[],[z.ALL_DIALER_STATUS]:[],[z.ALL_USERS_STATUS]:[],[z.QUEUE_EVENT]:[],[z.EXTENSION_EVENT]:[],[z.DIALER_EVENT]:[],[z.LOGIN_SUCCESS]:[],[z.LOGIN_STATUS]:[],[z.KEEP_ALIVE_RESPONSE]:[],[z.ONLINE_STATUS_EVENT]:[],[z.EXTENSIONS_UPDATED]:[]});H(this,"allListeners",[]);this.eventsSdkClass=e,this.eventsSdkClass=e}on(e,r){e==="*"?this.allListeners.push(r):this.listeners[e].push(r)}off(e,r){if(e==="*")this.allListeners=this.allListeners.filter(n=>n!==r);else{const o=this.listeners[e].filter(i=>i!==r);this.listeners={...this.listeners,[e]:o}}}emit(e,r){this.eventsSdkClass.socketIoClass.lastEventTimestamp=new Date().getTime(),this.listeners[e].forEach(o=>o({name:e,data:r}));const n={name:e,data:r};this.allListeners.forEach(o=>o(n))}}class Wo{constructor(e){H(this,"options");H(this,"servers",[]);H(this,"URLList",[]);H(this,"server");H(this,"URL");H(this,"socket");H(this,"mainServer");H(this,"alreadyAttemptedOtherServers",[]);H(this,"authClass",new Uo(this));H(this,"socketIoClass",new zo(this));H(this,"loggerClass",new Xo(this));H(this,"eventEmitterClass",new Ko(this));this.options={...Do,...e}}on(e,r){this.eventEmitterClass.on(e,r)}emit(e,...r){this.socketIoClass.io&&this.socketIoClass.io.emit(e,...r)}connect(e){e===bt.MAIN&&this.findMainServer(),e===bt.NEXT&&this.findNextServer(),this.socketIoClass.doReconnect=!0,this.loggerClass.init(),this.socketIoClass.initSocketConnection(),this.socketIoClass.initSocketEvents(),this.socketIoClass.initKeepAlive()}disconnect(){this.socketIoClass.doReconnect=!1,this.socketIoClass.closeAllConnections()}clearKeepAliveInterval(){this.socketIoClass.clearKeepAliveInterval()}findMainServer(){this.servers.length?(this.mainServer=this.servers.reduce((e,r)=>r.Priority>e.Priority?r:e),this.server=this.mainServer):this.URLList.length&&(this.URL=this.URLList[0])}findNextServer(){if(this.servers.length&&this.server)if(this.server.Priority===this.mainServer.Priority){let e=this.servers.filter(r=>r.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(r.Priority)+1===0);e.length||(this.alreadyAttemptedOtherServers=[],e=this.servers.filter(r=>r.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(r.Priority)+1===0)),e.length&&(this.server=e.reduce((r,n)=>n.Priority>r.Priority?n:r),this.alreadyAttemptedOtherServers.push(this.server.Priority))}else this.server=this.mainServer;else if(this.URLList.length)if(this.URL===this.URLList[0]){let e=this.URLList.filter(r=>r!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(r)+1===0);e.length||(this.alreadyAttemptedOtherServers=[],e=this.URLList.filter(r=>r!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(r)+1===0)),e.length&&(this.URL=e[0],this.alreadyAttemptedOtherServers.push(this.URL))}else this.URL=this.URLList[0]}async init(){return await this.authClass.login(this.options),this.loggerClass.sdkInitializedLog(this.options),!0}}$.CallStatusEnum=wr,$.CallTypeEnum=Sr,$.DialerTypeEnum=Er,$.DirectionEnum=Ar,$.DoNotCallMeStatusCodeEnum=Tr,$.EventsEnum=z,$.ExtensionEventReasonEnum=Se,$.ExtensionHangupCauseEnum=Nr,$.QueueEventReasonEnum=xr,$.ServerListenerEventsEnum=Ae,$.default=Wo,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
46
20
  //# sourceMappingURL=voicenter-events-sdk.umd.js.map