@voicenter-team/events-sdk 0.0.50 → 0.0.51

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,21 +1,21 @@
1
- "use strict";var Uv=Object.defineProperty;var Dv=(s,i,n)=>i in s?Uv(s,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[i]=n;var wt=(s,i,n)=>(Dv(s,typeof i!="symbol"?i+"":i,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pv(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ou={exports:{}},Iu={exports:{}};(function(){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return i.rotl(n,8)&16711935|i.rotl(n,24)&4278255360;for(var o=0;o<n.length;o++)n[o]=i.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(Math.random()*256));return o},bytesToWords:function(n){for(var o=[],u=0,h=0;u<n.length;u++,h+=8)o[h>>>5]|=n[u]<<24-h%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<n.length*32;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((n[u]&15).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var h=n[u]<<16|n[u+1]<<8|n[u+2],m=0;m<4;m++)u*8+m*6<=n.length*8?o.push(s.charAt(h>>>6*(3-m)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var o=[],u=0,h=0;u<n.length;h=++u%4)h!=0&&o.push((s.indexOf(n.charAt(u-1))&Math.pow(2,-2*h+8)-1)<<h*2|s.indexOf(n.charAt(u))>>>6-h*2);return o}};Iu.exports=i})();var Fv=Iu.exports,As={utf8:{stringToBytes:function(s){return As.bin.stringToBytes(unescape(encodeURIComponent(s)))},bytesToString:function(s){return decodeURIComponent(escape(As.bin.bytesToString(s)))}},bin:{stringToBytes:function(s){for(var i=[],n=0;n<s.length;n++)i.push(s.charCodeAt(n)&255);return i},bytesToString:function(s){for(var i=[],n=0;n<s.length;n++)i.push(String.fromCharCode(s[n]));return i.join("")}}},vu=As;/*!
1
+ "use strict";var Uv=Object.defineProperty;var Dv=(s,i,n)=>i in s?Uv(s,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[i]=n;var wt=(s,i,n)=>(Dv(s,typeof i!="symbol"?i+"":i,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pv(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ou={exports:{}},Iu={exports:{}};(function(){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return i.rotl(n,8)&16711935|i.rotl(n,24)&4278255360;for(var o=0;o<n.length;o++)n[o]=i.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(Math.random()*256));return o},bytesToWords:function(n){for(var o=[],u=0,h=0;u<n.length;u++,h+=8)o[h>>>5]|=n[u]<<24-h%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<n.length*32;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((n[u]&15).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var h=n[u]<<16|n[u+1]<<8|n[u+2],m=0;m<4;m++)u*8+m*6<=n.length*8?o.push(s.charAt(h>>>6*(3-m)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var o=[],u=0,h=0;u<n.length;h=++u%4)h!=0&&o.push((s.indexOf(n.charAt(u-1))&Math.pow(2,-2*h+8)-1)<<h*2|s.indexOf(n.charAt(u))>>>6-h*2);return o}};Iu.exports=i})();var Fv=Iu.exports,Es={utf8:{stringToBytes:function(s){return Es.bin.stringToBytes(unescape(encodeURIComponent(s)))},bytesToString:function(s){return decodeURIComponent(escape(Es.bin.bytesToString(s)))}},bin:{stringToBytes:function(s){for(var i=[],n=0;n<s.length;n++)i.push(s.charCodeAt(n)&255);return i},bytesToString:function(s){for(var i=[],n=0;n<s.length;n++)i.push(String.fromCharCode(s[n]));return i.join("")}}},vu=Es;/*!
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 Mv=function(s){return s!=null&&(Lu(s)||qv(s)||!!s._isBuffer)};function Lu(s){return!!s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function qv(s){return typeof s.readFloatLE=="function"&&typeof s.slice=="function"&&Lu(s.slice(0,0))}(function(){var s=Fv,i=vu.utf8,n=Mv,o=vu.bin,u=function(h,m){h.constructor==String?m&&m.encoding==="binary"?h=o.stringToBytes(h):h=i.stringToBytes(h):n(h)?h=Array.prototype.slice.call(h,0):!Array.isArray(h)&&h.constructor!==Uint8Array&&(h=h.toString());for(var d=s.bytesToWords(h),S=h.length*8,v=1732584193,_=-271733879,y=-1732584194,l=271733878,f=0;f<d.length;f++)d[f]=(d[f]<<8|d[f]>>>24)&16711935|(d[f]<<24|d[f]>>>8)&4278255360;d[S>>>5]|=128<<S%32,d[(S+64>>>9<<4)+14]=S;for(var b=u._ff,E=u._gg,x=u._hh,W=u._ii,f=0;f<d.length;f+=16){var st=v,V=_,ot=y,H=l;v=b(v,_,y,l,d[f+0],7,-680876936),l=b(l,v,_,y,d[f+1],12,-389564586),y=b(y,l,v,_,d[f+2],17,606105819),_=b(_,y,l,v,d[f+3],22,-1044525330),v=b(v,_,y,l,d[f+4],7,-176418897),l=b(l,v,_,y,d[f+5],12,1200080426),y=b(y,l,v,_,d[f+6],17,-1473231341),_=b(_,y,l,v,d[f+7],22,-45705983),v=b(v,_,y,l,d[f+8],7,1770035416),l=b(l,v,_,y,d[f+9],12,-1958414417),y=b(y,l,v,_,d[f+10],17,-42063),_=b(_,y,l,v,d[f+11],22,-1990404162),v=b(v,_,y,l,d[f+12],7,1804603682),l=b(l,v,_,y,d[f+13],12,-40341101),y=b(y,l,v,_,d[f+14],17,-1502002290),_=b(_,y,l,v,d[f+15],22,1236535329),v=E(v,_,y,l,d[f+1],5,-165796510),l=E(l,v,_,y,d[f+6],9,-1069501632),y=E(y,l,v,_,d[f+11],14,643717713),_=E(_,y,l,v,d[f+0],20,-373897302),v=E(v,_,y,l,d[f+5],5,-701558691),l=E(l,v,_,y,d[f+10],9,38016083),y=E(y,l,v,_,d[f+15],14,-660478335),_=E(_,y,l,v,d[f+4],20,-405537848),v=E(v,_,y,l,d[f+9],5,568446438),l=E(l,v,_,y,d[f+14],9,-1019803690),y=E(y,l,v,_,d[f+3],14,-187363961),_=E(_,y,l,v,d[f+8],20,1163531501),v=E(v,_,y,l,d[f+13],5,-1444681467),l=E(l,v,_,y,d[f+2],9,-51403784),y=E(y,l,v,_,d[f+7],14,1735328473),_=E(_,y,l,v,d[f+12],20,-1926607734),v=x(v,_,y,l,d[f+5],4,-378558),l=x(l,v,_,y,d[f+8],11,-2022574463),y=x(y,l,v,_,d[f+11],16,1839030562),_=x(_,y,l,v,d[f+14],23,-35309556),v=x(v,_,y,l,d[f+1],4,-1530992060),l=x(l,v,_,y,d[f+4],11,1272893353),y=x(y,l,v,_,d[f+7],16,-155497632),_=x(_,y,l,v,d[f+10],23,-1094730640),v=x(v,_,y,l,d[f+13],4,681279174),l=x(l,v,_,y,d[f+0],11,-358537222),y=x(y,l,v,_,d[f+3],16,-722521979),_=x(_,y,l,v,d[f+6],23,76029189),v=x(v,_,y,l,d[f+9],4,-640364487),l=x(l,v,_,y,d[f+12],11,-421815835),y=x(y,l,v,_,d[f+15],16,530742520),_=x(_,y,l,v,d[f+2],23,-995338651),v=W(v,_,y,l,d[f+0],6,-198630844),l=W(l,v,_,y,d[f+7],10,1126891415),y=W(y,l,v,_,d[f+14],15,-1416354905),_=W(_,y,l,v,d[f+5],21,-57434055),v=W(v,_,y,l,d[f+12],6,1700485571),l=W(l,v,_,y,d[f+3],10,-1894986606),y=W(y,l,v,_,d[f+10],15,-1051523),_=W(_,y,l,v,d[f+1],21,-2054922799),v=W(v,_,y,l,d[f+8],6,1873313359),l=W(l,v,_,y,d[f+15],10,-30611744),y=W(y,l,v,_,d[f+6],15,-1560198380),_=W(_,y,l,v,d[f+13],21,1309151649),v=W(v,_,y,l,d[f+4],6,-145523070),l=W(l,v,_,y,d[f+11],10,-1120210379),y=W(y,l,v,_,d[f+2],15,718787259),_=W(_,y,l,v,d[f+9],21,-343485551),v=v+st>>>0,_=_+V>>>0,y=y+ot>>>0,l=l+H>>>0}return s.endian([v,_,y,l])};u._ff=function(h,m,d,S,v,_,y){var l=h+(m&d|~m&S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._gg=function(h,m,d,S,v,_,y){var l=h+(m&S|d&~S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._hh=function(h,m,d,S,v,_,y){var l=h+(m^d^S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._ii=function(h,m,d,S,v,_,y){var l=h+(d^(m|~S))+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._blocksize=16,u._digestsize=16,Ou.exports=function(h,m){if(h==null)throw new Error("Illegal argument "+h);var d=s.wordsToBytes(u(h,m));return m&&m.asBytes?d:m&&m.asString?o.bytesToString(d):s.bytesToHex(d)}})();var Wv=Ou.exports;const Kv=Pv(Wv);var pn=(s=>(s.MAIN="main",s.NEXT="next",s))(pn||{}),ze=(s=>(s.USER="User",s.TOKEN="Token",s))(ze||{});class Qn{static async getSessionStorageDataByKey(i,n=!0){if(typeof chrome<"u"&&typeof chrome.storage<"u"){const o=await chrome.storage.session.get(i);if(o[i])return n?JSON.parse(o[i]):o[i]}if(typeof window<"u"){const o=window.sessionStorage.getItem(i);if(o)return n?JSON.parse(o):o}}static async updateSessionStorageKey(i,n){typeof chrome<"u"&&typeof chrome.storage<"u"&&await chrome.storage.session.set({[i]:JSON.stringify(n)}),typeof window<"u"&&window.sessionStorage.setItem(i,JSON.stringify(n))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&window.sessionStorage.clear()}}var Jt=(s=>(s.INFO="INFO",s.WARN="WARN",s.ERROR="ERROR",s))(Jt||{});class Gv{constructor(i){wt(this,"delay",1e3);wt(this,"lastLoginTimestamp");wt(this,"token");wt(this,"storageKey");this.eventsSdkClass=i,this.eventsSdkClass=i,this.storageKey=""}async login(i){const n={token:i.token,email:i.email,password:i.password};if(this.storageKey=Kv(JSON.stringify({...i,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp(),await this.checkLoginStatus(this.storageKey)||(Qn.clearSessionStorage(),await this.userLoginFunction(n,this.storageKey,i.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(i){const n=await Qn.getSessionStorageDataByKey(i);return n?(this.eventsSdkClass.loggerClass.log(Jt.INFO,"got data from session",n),this.onLoginResponse(n),!0):!1}async userLoginFunction(i,n,o){let u,h,m;this.eventsSdkClass.options.isNewStack?(u=await this.externalLogin(this.eventsSdkClass.options.loginUrl,i,o),h=await this.getSettings(u.Data.AccessToken),m={...u.Data,...h}):(u=await this.externalLogin(this.eventsSdkClass.options.loginUrl,i,o),m={...u.Data.Socket}),this.onLoginResponse(m),await Qn.updateSessionStorageKey(n,m)}onLoginResponse(i){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),i.MonitorList&&i.MonitorList.length&&(this.eventsSdkClass.servers=[...i.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&i.URLList&&(this.eventsSdkClass.URLList=i.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=${i.Client}`),i.IdentityCode&&(this.token=i.IdentityCode,this.eventsSdkClass.connect(pn.MAIN)),i.Token&&(this.token=i.Token,this.eventsSdkClass.connect(pn.MAIN)),i.RefreshToken&&i.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===ze.USER&&(this.eventsSdkClass.options.refreshToken=i.RefreshToken,this.eventsSdkClass.options.tokenExpiry=i.IdentityCodeExpiry,this.handleTokenExpiry()),i.RefreshToken&&i.TokenExpiry&&this.eventsSdkClass.options.loginType===ze.USER&&(this.eventsSdkClass.options.refreshToken=i.RefreshToken,this.eventsSdkClass.options.tokenExpiry=i.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let i;if(this.eventsSdkClass.options.tokenExpiry)i=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const n=i.getTime()-new Date().getTime()-5e3,o=Math.min(n,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let u,h;if(this.eventsSdkClass.options.isNewStack){const m=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);u=await this.getSettings(m.Data.AccessToken),h={...m.Data,...u}}else h={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(h),await Qn.updateSessionStorageKey(this.storageKey,h)}},o)}async externalLogin(i,{password:n,token:o,email:u},h){if(!i)throw new Error("loginUrl not provided");let m;this.eventsSdkClass.options.isNewStack?h===ze.TOKEN?m=JSON.stringify({identityType:ze.TOKEN,token:o}):m=JSON.stringify({identityType:ze.USER,username:u,password:n}):this.eventsSdkClass.options.loginType===ze.TOKEN?(m=JSON.stringify({token:o}),i=`${i}/${ze.TOKEN}`):(m=JSON.stringify({email:u,pin:n}),i=`${i}/${ze.USER}`);try{const d=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:m});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 S=await d.json();if(S.error)throw new Error(S.error);return S}catch(d){throw this.eventsSdkClass.loggerClass.log(Jt.ERROR,`External login ${i}`,d),d}}async getSettings(i){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const n=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${i}`}});if(!n.ok&&n.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return n.json()}catch(n){throw this.eventsSdkClass.loggerClass.log(Jt.ERROR,`Get settings ${this.eventsSdkClass.options.getSettingsUrl}`,n),n}}async refreshToken(i,n){try{return(await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).json()}catch(o){throw this.eventsSdkClass.loggerClass.log(Jt.ERROR,`Refresh token ${i}`,o),o}}}var Zr={exports:{}};/**
6
+ */var Mv=function(s){return s!=null&&(Lu(s)||qv(s)||!!s._isBuffer)};function Lu(s){return!!s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function qv(s){return typeof s.readFloatLE=="function"&&typeof s.slice=="function"&&Lu(s.slice(0,0))}(function(){var s=Fv,i=vu.utf8,n=Mv,o=vu.bin,u=function(h,m){h.constructor==String?m&&m.encoding==="binary"?h=o.stringToBytes(h):h=i.stringToBytes(h):n(h)?h=Array.prototype.slice.call(h,0):!Array.isArray(h)&&h.constructor!==Uint8Array&&(h=h.toString());for(var g=s.bytesToWords(h),S=h.length*8,v=1732584193,_=-271733879,y=-1732584194,l=271733878,f=0;f<g.length;f++)g[f]=(g[f]<<8|g[f]>>>24)&16711935|(g[f]<<24|g[f]>>>8)&4278255360;g[S>>>5]|=128<<S%32,g[(S+64>>>9<<4)+14]=S;for(var b=u._ff,k=u._gg,x=u._hh,W=u._ii,f=0;f<g.length;f+=16){var st=v,V=_,ot=y,H=l;v=b(v,_,y,l,g[f+0],7,-680876936),l=b(l,v,_,y,g[f+1],12,-389564586),y=b(y,l,v,_,g[f+2],17,606105819),_=b(_,y,l,v,g[f+3],22,-1044525330),v=b(v,_,y,l,g[f+4],7,-176418897),l=b(l,v,_,y,g[f+5],12,1200080426),y=b(y,l,v,_,g[f+6],17,-1473231341),_=b(_,y,l,v,g[f+7],22,-45705983),v=b(v,_,y,l,g[f+8],7,1770035416),l=b(l,v,_,y,g[f+9],12,-1958414417),y=b(y,l,v,_,g[f+10],17,-42063),_=b(_,y,l,v,g[f+11],22,-1990404162),v=b(v,_,y,l,g[f+12],7,1804603682),l=b(l,v,_,y,g[f+13],12,-40341101),y=b(y,l,v,_,g[f+14],17,-1502002290),_=b(_,y,l,v,g[f+15],22,1236535329),v=k(v,_,y,l,g[f+1],5,-165796510),l=k(l,v,_,y,g[f+6],9,-1069501632),y=k(y,l,v,_,g[f+11],14,643717713),_=k(_,y,l,v,g[f+0],20,-373897302),v=k(v,_,y,l,g[f+5],5,-701558691),l=k(l,v,_,y,g[f+10],9,38016083),y=k(y,l,v,_,g[f+15],14,-660478335),_=k(_,y,l,v,g[f+4],20,-405537848),v=k(v,_,y,l,g[f+9],5,568446438),l=k(l,v,_,y,g[f+14],9,-1019803690),y=k(y,l,v,_,g[f+3],14,-187363961),_=k(_,y,l,v,g[f+8],20,1163531501),v=k(v,_,y,l,g[f+13],5,-1444681467),l=k(l,v,_,y,g[f+2],9,-51403784),y=k(y,l,v,_,g[f+7],14,1735328473),_=k(_,y,l,v,g[f+12],20,-1926607734),v=x(v,_,y,l,g[f+5],4,-378558),l=x(l,v,_,y,g[f+8],11,-2022574463),y=x(y,l,v,_,g[f+11],16,1839030562),_=x(_,y,l,v,g[f+14],23,-35309556),v=x(v,_,y,l,g[f+1],4,-1530992060),l=x(l,v,_,y,g[f+4],11,1272893353),y=x(y,l,v,_,g[f+7],16,-155497632),_=x(_,y,l,v,g[f+10],23,-1094730640),v=x(v,_,y,l,g[f+13],4,681279174),l=x(l,v,_,y,g[f+0],11,-358537222),y=x(y,l,v,_,g[f+3],16,-722521979),_=x(_,y,l,v,g[f+6],23,76029189),v=x(v,_,y,l,g[f+9],4,-640364487),l=x(l,v,_,y,g[f+12],11,-421815835),y=x(y,l,v,_,g[f+15],16,530742520),_=x(_,y,l,v,g[f+2],23,-995338651),v=W(v,_,y,l,g[f+0],6,-198630844),l=W(l,v,_,y,g[f+7],10,1126891415),y=W(y,l,v,_,g[f+14],15,-1416354905),_=W(_,y,l,v,g[f+5],21,-57434055),v=W(v,_,y,l,g[f+12],6,1700485571),l=W(l,v,_,y,g[f+3],10,-1894986606),y=W(y,l,v,_,g[f+10],15,-1051523),_=W(_,y,l,v,g[f+1],21,-2054922799),v=W(v,_,y,l,g[f+8],6,1873313359),l=W(l,v,_,y,g[f+15],10,-30611744),y=W(y,l,v,_,g[f+6],15,-1560198380),_=W(_,y,l,v,g[f+13],21,1309151649),v=W(v,_,y,l,g[f+4],6,-145523070),l=W(l,v,_,y,g[f+11],10,-1120210379),y=W(y,l,v,_,g[f+2],15,718787259),_=W(_,y,l,v,g[f+9],21,-343485551),v=v+st>>>0,_=_+V>>>0,y=y+ot>>>0,l=l+H>>>0}return s.endian([v,_,y,l])};u._ff=function(h,m,g,S,v,_,y){var l=h+(m&g|~m&S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._gg=function(h,m,g,S,v,_,y){var l=h+(m&S|g&~S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._hh=function(h,m,g,S,v,_,y){var l=h+(m^g^S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._ii=function(h,m,g,S,v,_,y){var l=h+(g^(m|~S))+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._blocksize=16,u._digestsize=16,Ou.exports=function(h,m){if(h==null)throw new Error("Illegal argument "+h);var g=s.wordsToBytes(u(h,m));return m&&m.asBytes?g:m&&m.asString?o.bytesToString(g):s.bytesToHex(g)}})();var Wv=Ou.exports;const Kv=Pv(Wv);var pn=(s=>(s.MAIN="main",s.NEXT="next",s))(pn||{}),ze=(s=>(s.USER="User",s.TOKEN="Token",s))(ze||{});class Qn{static async getSessionStorageDataByKey(i,n=!0){if(typeof chrome<"u"&&typeof chrome.storage<"u"){const o=await chrome.storage.session.get(i);if(o[i])return n?JSON.parse(o[i]):o[i]}if(typeof window<"u"){const o=window.sessionStorage.getItem(i);if(o)return n?JSON.parse(o):o}}static async updateSessionStorageKey(i,n){typeof chrome<"u"&&typeof chrome.storage<"u"&&await chrome.storage.session.set({[i]:JSON.stringify(n)}),typeof window<"u"&&window.sessionStorage.setItem(i,JSON.stringify(n))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&window.sessionStorage.clear()}}var Jt=(s=>(s.INFO="INFO",s.WARN="WARN",s.ERROR="ERROR",s))(Jt||{});class Gv{constructor(i){wt(this,"delay",1e3);wt(this,"lastLoginTimestamp");wt(this,"token");wt(this,"storageKey");this.eventsSdkClass=i,this.eventsSdkClass=i,this.storageKey=""}async login(i){const n={token:i.token,email:i.email,password:i.password};if(this.storageKey=Kv(JSON.stringify({...i,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp(),await this.checkLoginStatus(this.storageKey)||(Qn.clearSessionStorage(),await this.userLoginFunction(n,this.storageKey,i.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(i){const n=await Qn.getSessionStorageDataByKey(i);return n?(this.eventsSdkClass.loggerClass.log(Jt.INFO,"got data from session",n),this.onLoginResponse(n),!0):!1}async userLoginFunction(i,n,o){let u,h,m;this.eventsSdkClass.options.isNewStack?(u=await this.externalLogin(this.eventsSdkClass.options.loginUrl,i,o),h=await this.getSettings(u.Data.AccessToken),m={...u.Data,...h}):(u=await this.externalLogin(this.eventsSdkClass.options.loginUrl,i,o),m={...u.Data.Socket}),this.onLoginResponse(m),await Qn.updateSessionStorageKey(n,m)}onLoginResponse(i){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),i.MonitorList&&i.MonitorList.length&&(this.eventsSdkClass.servers=[...i.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&i.URLList&&(this.eventsSdkClass.URLList=i.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=${i.Client}`),i.IdentityCode&&(this.token=i.IdentityCode,this.eventsSdkClass.connect(pn.MAIN)),i.Token&&(this.token=i.Token,this.eventsSdkClass.connect(pn.MAIN)),i.RefreshToken&&i.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===ze.USER&&(this.eventsSdkClass.options.refreshToken=i.RefreshToken,this.eventsSdkClass.options.tokenExpiry=i.IdentityCodeExpiry,this.handleTokenExpiry()),i.RefreshToken&&i.TokenExpiry&&this.eventsSdkClass.options.loginType===ze.USER&&(this.eventsSdkClass.options.refreshToken=i.RefreshToken,this.eventsSdkClass.options.tokenExpiry=i.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let i;if(this.eventsSdkClass.options.tokenExpiry)i=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const n=i.getTime()-new Date().getTime()-5e3,o=Math.min(n,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let u,h;if(this.eventsSdkClass.options.isNewStack){const m=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);u=await this.getSettings(m.Data.AccessToken),h={...m.Data,...u}}else h={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(h),await Qn.updateSessionStorageKey(this.storageKey,h)}},o)}async externalLogin(i,{password:n,token:o,email:u},h){if(!i)throw new Error("loginUrl not provided");let m;this.eventsSdkClass.options.isNewStack?h===ze.TOKEN?m=JSON.stringify({identityType:ze.TOKEN,token:o}):m=JSON.stringify({identityType:ze.USER,username:u,password:n}):this.eventsSdkClass.options.loginType===ze.TOKEN?(m=JSON.stringify({token:o}),i=`${i}/${ze.TOKEN}`):(m=JSON.stringify({email:u,pin:n}),i=`${i}/${ze.USER}`);try{const g=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:m});if(!g.ok&&g.status===400)throw new Error("Bad body request. Login type or isNewStack values not correct or not provided");if(!g.ok&&g.status===401)throw new Error("Unauthorized. Invalid token provided");if(!g.ok&&g.status===403)throw new Error("Forbidden. Identity token not provided or not valid");const S=await g.json();if(S.error)throw new Error(S.error);return S}catch(g){throw this.eventsSdkClass.loggerClass.log(Jt.ERROR,`External login ${i}`,g),g}}async getSettings(i){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const n=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${i}`}});if(!n.ok&&n.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return n.json()}catch(n){throw this.eventsSdkClass.loggerClass.log(Jt.ERROR,`Get settings ${this.eventsSdkClass.options.getSettingsUrl}`,n),n}}async refreshToken(i,n){try{return(await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).json()}catch(o){throw this.eventsSdkClass.loggerClass.log(Jt.ERROR,`Refresh token ${i}`,o),o}}}var Zr={exports:{}};/**
7
7
  * @license
8
8
  * Lodash <https://lodash.com/>
9
9
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
10
10
  * Released under MIT license <https://lodash.com/license>
11
11
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
12
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
- */Zr.exports;(function(s,i){(function(){var n,o="4.17.21",u=200,h="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",m="Expected a function",d="Invalid `variable` option passed into `_.template`",S="__lodash_hash_undefined__",v=500,_="__lodash_placeholder__",y=1,l=2,f=4,b=1,E=2,x=1,W=2,st=4,V=8,ot=16,H=32,D=64,M=128,G=256,L=512,U=30,X="...",Q=800,j=16,B=1,At=2,kt=3,Rt=1/0,ut=9007199254740991,Ht=17976931348623157e292,xe=NaN,se=4294967295,er=se-1,q=se>>>1,J=[["ary",M],["bind",x],["bindKey",W],["curry",V],["curryRight",ot],["flip",L],["partial",H],["partialRight",D],["rearg",G]],F="[object Arguments]",et="[object Array]",P="[object AsyncFunction]",Z="[object Boolean]",tt="[object Date]",z="[object DOMException]",at="[object Error]",bt="[object Function]",$t="[object GeneratorFunction]",Ot="[object Map]",Se="[object Number]",Ln="[object Null]",oe="[object Object]",dn="[object Promise]",Nn="[object Proxy]",Vt="[object RegExp]",Yt="[object Set]",Re="[object String]",Oe="[object Symbol]",Bn="[object Undefined]",De="[object WeakMap]",Un="[object WeakSet]",Xe="[object ArrayBuffer]",gn="[object DataView]",ti="[object Float32Array]",ei="[object Float64Array]",ni="[object Int8Array]",ri="[object Int16Array]",ii="[object Int32Array]",si="[object Uint8Array]",oi="[object Uint8ClampedArray]",ai="[object Uint16Array]",ui="[object Uint32Array]",ec=/\b__p \+= '';/g,nc=/\b(__p \+=) '' \+/g,rc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qs=/&(?:amp|lt|gt|quot|#39);/g,Ws=/[&<>"']/g,ic=RegExp(qs.source),sc=RegExp(Ws.source),oc=/<%-([\s\S]+?)%>/g,ac=/<%([\s\S]+?)%>/g,Ks=/<%=([\s\S]+?)%>/g,uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cc=/^\w*$/,hc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ci=/[\\^$.*+?()[\]{}|]/g,fc=RegExp(ci.source),hi=/^\s+/,lc=/\s/,pc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dc=/\{\n\/\* \[wrapped with (.+)\] \*/,gc=/,? & /,vc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yc=/[()=,{}\[\]\/\s]/,mc=/\\(\\)?/g,_c=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gs=/\w*$/,wc=/^[-+]0x[0-9a-f]+$/i,bc=/^0b[01]+$/i,Sc=/^\[object .+?Constructor\]$/,Cc=/^0o[0-7]+$/i,Ac=/^(?:0|[1-9]\d*)$/,kc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nr=/($^)/,Ec=/['\n\r\u2028\u2029\\]/g,rr="\\ud800-\\udfff",Tc="\\u0300-\\u036f",xc="\\ufe20-\\ufe2f",Rc="\\u20d0-\\u20ff",Hs=Tc+xc+Rc,$s="\\u2700-\\u27bf",zs="a-z\\xdf-\\xf6\\xf8-\\xff",Oc="\\xac\\xb1\\xd7\\xf7",Ic="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lc="\\u2000-\\u206f",Nc=" \\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",Xs="A-Z\\xc0-\\xd6\\xd8-\\xde",Js="\\ufe0e\\ufe0f",Vs=Oc+Ic+Lc+Nc,fi="['’]",Bc="["+rr+"]",Ys="["+Vs+"]",ir="["+Hs+"]",js="\\d+",Uc="["+$s+"]",Zs="["+zs+"]",Qs="[^"+rr+Vs+js+$s+zs+Xs+"]",li="\\ud83c[\\udffb-\\udfff]",Dc="(?:"+ir+"|"+li+")",to="[^"+rr+"]",pi="(?:\\ud83c[\\udde6-\\uddff]){2}",di="[\\ud800-\\udbff][\\udc00-\\udfff]",vn="["+Xs+"]",eo="\\u200d",no="(?:"+Zs+"|"+Qs+")",Pc="(?:"+vn+"|"+Qs+")",ro="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",io="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",so=Dc+"?",oo="["+Js+"]?",Fc="(?:"+eo+"(?:"+[to,pi,di].join("|")+")"+oo+so+")*",Mc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ao=oo+so+Fc,Wc="(?:"+[Uc,pi,di].join("|")+")"+ao,Kc="(?:"+[to+ir+"?",ir,pi,di,Bc].join("|")+")",Gc=RegExp(fi,"g"),Hc=RegExp(ir,"g"),gi=RegExp(li+"(?="+li+")|"+Kc+ao,"g"),$c=RegExp([vn+"?"+Zs+"+"+ro+"(?="+[Ys,vn,"$"].join("|")+")",Pc+"+"+io+"(?="+[Ys,vn+no,"$"].join("|")+")",vn+"?"+no+"+"+ro,vn+"+"+io,qc,Mc,js,Wc].join("|"),"g"),zc=RegExp("["+eo+rr+Hs+Js+"]"),Xc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jc=["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"],Vc=-1,xt={};xt[ti]=xt[ei]=xt[ni]=xt[ri]=xt[ii]=xt[si]=xt[oi]=xt[ai]=xt[ui]=!0,xt[F]=xt[et]=xt[Xe]=xt[Z]=xt[gn]=xt[tt]=xt[at]=xt[bt]=xt[Ot]=xt[Se]=xt[oe]=xt[Vt]=xt[Yt]=xt[Re]=xt[De]=!1;var Tt={};Tt[F]=Tt[et]=Tt[Xe]=Tt[gn]=Tt[Z]=Tt[tt]=Tt[ti]=Tt[ei]=Tt[ni]=Tt[ri]=Tt[ii]=Tt[Ot]=Tt[Se]=Tt[oe]=Tt[Vt]=Tt[Yt]=Tt[Re]=Tt[Oe]=Tt[si]=Tt[oi]=Tt[ai]=Tt[ui]=!0,Tt[at]=Tt[bt]=Tt[De]=!1;var Yc={À:"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"},jc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zc={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Qc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},th=parseFloat,eh=parseInt,uo=typeof jn=="object"&&jn&&jn.Object===Object&&jn,nh=typeof self=="object"&&self&&self.Object===Object&&self,Wt=uo||nh||Function("return this")(),vi=i&&!i.nodeType&&i,rn=vi&&!0&&s&&!s.nodeType&&s,co=rn&&rn.exports===vi,yi=co&&uo.process,pe=function(){try{var A=rn&&rn.require&&rn.require("util").types;return A||yi&&yi.binding&&yi.binding("util")}catch{}}(),ho=pe&&pe.isArrayBuffer,fo=pe&&pe.isDate,lo=pe&&pe.isMap,po=pe&&pe.isRegExp,go=pe&&pe.isSet,vo=pe&&pe.isTypedArray;function ae(A,R,T){switch(T.length){case 0:return A.call(R);case 1:return A.call(R,T[0]);case 2:return A.call(R,T[0],T[1]);case 3:return A.call(R,T[0],T[1],T[2])}return A.apply(R,T)}function rh(A,R,T,$){for(var ct=-1,_t=A==null?0:A.length;++ct<_t;){var Pt=A[ct];R($,Pt,T(Pt),A)}return $}function de(A,R){for(var T=-1,$=A==null?0:A.length;++T<$&&R(A[T],T,A)!==!1;);return A}function ih(A,R){for(var T=A==null?0:A.length;T--&&R(A[T],T,A)!==!1;);return A}function yo(A,R){for(var T=-1,$=A==null?0:A.length;++T<$;)if(!R(A[T],T,A))return!1;return!0}function Je(A,R){for(var T=-1,$=A==null?0:A.length,ct=0,_t=[];++T<$;){var Pt=A[T];R(Pt,T,A)&&(_t[ct++]=Pt)}return _t}function sr(A,R){var T=A==null?0:A.length;return!!T&&yn(A,R,0)>-1}function mi(A,R,T){for(var $=-1,ct=A==null?0:A.length;++$<ct;)if(T(R,A[$]))return!0;return!1}function It(A,R){for(var T=-1,$=A==null?0:A.length,ct=Array($);++T<$;)ct[T]=R(A[T],T,A);return ct}function Ve(A,R){for(var T=-1,$=R.length,ct=A.length;++T<$;)A[ct+T]=R[T];return A}function _i(A,R,T,$){var ct=-1,_t=A==null?0:A.length;for($&&_t&&(T=A[++ct]);++ct<_t;)T=R(T,A[ct],ct,A);return T}function sh(A,R,T,$){var ct=A==null?0:A.length;for($&&ct&&(T=A[--ct]);ct--;)T=R(T,A[ct],ct,A);return T}function wi(A,R){for(var T=-1,$=A==null?0:A.length;++T<$;)if(R(A[T],T,A))return!0;return!1}var oh=bi("length");function ah(A){return A.split("")}function uh(A){return A.match(vc)||[]}function mo(A,R,T){var $;return T(A,function(ct,_t,Pt){if(R(ct,_t,Pt))return $=_t,!1}),$}function or(A,R,T,$){for(var ct=A.length,_t=T+($?1:-1);$?_t--:++_t<ct;)if(R(A[_t],_t,A))return _t;return-1}function yn(A,R,T){return R===R?wh(A,R,T):or(A,_o,T)}function ch(A,R,T,$){for(var ct=T-1,_t=A.length;++ct<_t;)if($(A[ct],R))return ct;return-1}function _o(A){return A!==A}function wo(A,R){var T=A==null?0:A.length;return T?Ci(A,R)/T:xe}function bi(A){return function(R){return R==null?n:R[A]}}function Si(A){return function(R){return A==null?n:A[R]}}function bo(A,R,T,$,ct){return ct(A,function(_t,Pt,Et){T=$?($=!1,_t):R(T,_t,Pt,Et)}),T}function hh(A,R){var T=A.length;for(A.sort(R);T--;)A[T]=A[T].value;return A}function Ci(A,R){for(var T,$=-1,ct=A.length;++$<ct;){var _t=R(A[$]);_t!==n&&(T=T===n?_t:T+_t)}return T}function Ai(A,R){for(var T=-1,$=Array(A);++T<A;)$[T]=R(T);return $}function fh(A,R){return It(R,function(T){return[T,A[T]]})}function So(A){return A&&A.slice(0,Eo(A)+1).replace(hi,"")}function ue(A){return function(R){return A(R)}}function ki(A,R){return It(R,function(T){return A[T]})}function Dn(A,R){return A.has(R)}function Co(A,R){for(var T=-1,$=A.length;++T<$&&yn(R,A[T],0)>-1;);return T}function Ao(A,R){for(var T=A.length;T--&&yn(R,A[T],0)>-1;);return T}function lh(A,R){for(var T=A.length,$=0;T--;)A[T]===R&&++$;return $}var ph=Si(Yc),dh=Si(jc);function gh(A){return"\\"+Qc[A]}function vh(A,R){return A==null?n:A[R]}function mn(A){return zc.test(A)}function yh(A){return Xc.test(A)}function mh(A){for(var R,T=[];!(R=A.next()).done;)T.push(R.value);return T}function Ei(A){var R=-1,T=Array(A.size);return A.forEach(function($,ct){T[++R]=[ct,$]}),T}function ko(A,R){return function(T){return A(R(T))}}function Ye(A,R){for(var T=-1,$=A.length,ct=0,_t=[];++T<$;){var Pt=A[T];(Pt===R||Pt===_)&&(A[T]=_,_t[ct++]=T)}return _t}function ar(A){var R=-1,T=Array(A.size);return A.forEach(function($){T[++R]=$}),T}function _h(A){var R=-1,T=Array(A.size);return A.forEach(function($){T[++R]=[$,$]}),T}function wh(A,R,T){for(var $=T-1,ct=A.length;++$<ct;)if(A[$]===R)return $;return-1}function bh(A,R,T){for(var $=T+1;$--;)if(A[$]===R)return $;return $}function _n(A){return mn(A)?Ch(A):oh(A)}function Ce(A){return mn(A)?Ah(A):ah(A)}function Eo(A){for(var R=A.length;R--&&lc.test(A.charAt(R)););return R}var Sh=Si(Zc);function Ch(A){for(var R=gi.lastIndex=0;gi.test(A);)++R;return R}function Ah(A){return A.match(gi)||[]}function kh(A){return A.match($c)||[]}var Eh=function A(R){R=R==null?Wt:wn.defaults(Wt.Object(),R,wn.pick(Wt,Jc));var T=R.Array,$=R.Date,ct=R.Error,_t=R.Function,Pt=R.Math,Et=R.Object,Ti=R.RegExp,Th=R.String,ge=R.TypeError,ur=T.prototype,xh=_t.prototype,bn=Et.prototype,cr=R["__core-js_shared__"],hr=xh.toString,Ct=bn.hasOwnProperty,Rh=0,To=function(){var t=/[^.]+$/.exec(cr&&cr.keys&&cr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),fr=bn.toString,Oh=hr.call(Et),Ih=Wt._,Lh=Ti("^"+hr.call(Ct).replace(ci,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lr=co?R.Buffer:n,je=R.Symbol,pr=R.Uint8Array,xo=lr?lr.allocUnsafe:n,dr=ko(Et.getPrototypeOf,Et),Ro=Et.create,Oo=bn.propertyIsEnumerable,gr=ur.splice,Io=je?je.isConcatSpreadable:n,Pn=je?je.iterator:n,sn=je?je.toStringTag:n,vr=function(){try{var t=hn(Et,"defineProperty");return t({},"",{}),t}catch{}}(),Nh=R.clearTimeout!==Wt.clearTimeout&&R.clearTimeout,Bh=$&&$.now!==Wt.Date.now&&$.now,Uh=R.setTimeout!==Wt.setTimeout&&R.setTimeout,yr=Pt.ceil,mr=Pt.floor,xi=Et.getOwnPropertySymbols,Dh=lr?lr.isBuffer:n,Lo=R.isFinite,Ph=ur.join,Fh=ko(Et.keys,Et),Ft=Pt.max,zt=Pt.min,Mh=$.now,qh=R.parseInt,No=Pt.random,Wh=ur.reverse,Ri=hn(R,"DataView"),Fn=hn(R,"Map"),Oi=hn(R,"Promise"),Sn=hn(R,"Set"),Mn=hn(R,"WeakMap"),qn=hn(Et,"create"),_r=Mn&&new Mn,Cn={},Kh=fn(Ri),Gh=fn(Fn),Hh=fn(Oi),$h=fn(Sn),zh=fn(Mn),wr=je?je.prototype:n,Wn=wr?wr.valueOf:n,Bo=wr?wr.toString:n;function p(t){if(Nt(t)&&!ht(t)&&!(t instanceof vt)){if(t instanceof ve)return t;if(Ct.call(t,"__wrapped__"))return Ua(t)}return new ve(t)}var An=function(){function t(){}return function(e){if(!Lt(e))return{};if(Ro)return Ro(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function br(){}function ve(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}p.templateSettings={escape:oc,evaluate:ac,interpolate:Ks,variable:"",imports:{_:p}},p.prototype=br.prototype,p.prototype.constructor=p,ve.prototype=An(br.prototype),ve.prototype.constructor=ve;function vt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=se,this.__views__=[]}function Xh(){var t=new vt(this.__wrapped__);return t.__actions__=te(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=te(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=te(this.__views__),t}function Jh(){if(this.__filtered__){var t=new vt(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function Vh(){var t=this.__wrapped__.value(),e=this.__dir__,r=ht(t),a=e<0,c=r?t.length:0,g=ul(0,c,this.__views__),w=g.start,C=g.end,k=C-w,O=a?C:w-1,I=this.__iteratees__,N=I.length,K=0,Y=zt(k,this.__takeCount__);if(!r||!a&&c==k&&Y==k)return ia(t,this.__actions__);var rt=[];t:for(;k--&&K<Y;){O+=e;for(var pt=-1,it=t[O];++pt<N;){var gt=I[pt],yt=gt.iteratee,fe=gt.type,Qt=yt(it);if(fe==At)it=Qt;else if(!Qt){if(fe==B)continue t;break t}}rt[K++]=it}return rt}vt.prototype=An(br.prototype),vt.prototype.constructor=vt;function on(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function Yh(){this.__data__=qn?qn(null):{},this.size=0}function jh(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Zh(t){var e=this.__data__;if(qn){var r=e[t];return r===S?n:r}return Ct.call(e,t)?e[t]:n}function Qh(t){var e=this.__data__;return qn?e[t]!==n:Ct.call(e,t)}function tf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=qn&&e===n?S:e,this}on.prototype.clear=Yh,on.prototype.delete=jh,on.prototype.get=Zh,on.prototype.has=Qh,on.prototype.set=tf;function Pe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function ef(){this.__data__=[],this.size=0}function nf(t){var e=this.__data__,r=Sr(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():gr.call(e,r,1),--this.size,!0}function rf(t){var e=this.__data__,r=Sr(e,t);return r<0?n:e[r][1]}function sf(t){return Sr(this.__data__,t)>-1}function of(t,e){var r=this.__data__,a=Sr(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}Pe.prototype.clear=ef,Pe.prototype.delete=nf,Pe.prototype.get=rf,Pe.prototype.has=sf,Pe.prototype.set=of;function Fe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function af(){this.size=0,this.__data__={hash:new on,map:new(Fn||Pe),string:new on}}function uf(t){var e=Br(this,t).delete(t);return this.size-=e?1:0,e}function cf(t){return Br(this,t).get(t)}function hf(t){return Br(this,t).has(t)}function ff(t,e){var r=Br(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}Fe.prototype.clear=af,Fe.prototype.delete=uf,Fe.prototype.get=cf,Fe.prototype.has=hf,Fe.prototype.set=ff;function an(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Fe;++e<r;)this.add(t[e])}function lf(t){return this.__data__.set(t,S),this}function pf(t){return this.__data__.has(t)}an.prototype.add=an.prototype.push=lf,an.prototype.has=pf;function Ae(t){var e=this.__data__=new Pe(t);this.size=e.size}function df(){this.__data__=new Pe,this.size=0}function gf(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function vf(t){return this.__data__.get(t)}function yf(t){return this.__data__.has(t)}function mf(t,e){var r=this.__data__;if(r instanceof Pe){var a=r.__data__;if(!Fn||a.length<u-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new Fe(a)}return r.set(t,e),this.size=r.size,this}Ae.prototype.clear=df,Ae.prototype.delete=gf,Ae.prototype.get=vf,Ae.prototype.has=yf,Ae.prototype.set=mf;function Uo(t,e){var r=ht(t),a=!r&&ln(t),c=!r&&!a&&nn(t),g=!r&&!a&&!c&&xn(t),w=r||a||c||g,C=w?Ai(t.length,Th):[],k=C.length;for(var O in t)(e||Ct.call(t,O))&&!(w&&(O=="length"||c&&(O=="offset"||O=="parent")||g&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||Ke(O,k)))&&C.push(O);return C}function Do(t){var e=t.length;return e?t[Wi(0,e-1)]:n}function _f(t,e){return Ur(te(t),un(e,0,t.length))}function wf(t){return Ur(te(t))}function Ii(t,e,r){(r!==n&&!ke(t[e],r)||r===n&&!(e in t))&&Me(t,e,r)}function Kn(t,e,r){var a=t[e];(!(Ct.call(t,e)&&ke(a,r))||r===n&&!(e in t))&&Me(t,e,r)}function Sr(t,e){for(var r=t.length;r--;)if(ke(t[r][0],e))return r;return-1}function bf(t,e,r,a){return Ze(t,function(c,g,w){e(a,c,r(c),w)}),a}function Po(t,e){return t&&Le(e,Mt(e),t)}function Sf(t,e){return t&&Le(e,ne(e),t)}function Me(t,e,r){e=="__proto__"&&vr?vr(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Li(t,e){for(var r=-1,a=e.length,c=T(a),g=t==null;++r<a;)c[r]=g?n:ls(t,e[r]);return c}function un(t,e,r){return t===t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function ye(t,e,r,a,c,g){var w,C=e&y,k=e&l,O=e&f;if(r&&(w=c?r(t,a,c,g):r(t)),w!==n)return w;if(!Lt(t))return t;var I=ht(t);if(I){if(w=hl(t),!C)return te(t,w)}else{var N=Xt(t),K=N==bt||N==$t;if(nn(t))return aa(t,C);if(N==oe||N==F||K&&!c){if(w=k||K?{}:Ea(t),!C)return k?Qf(t,Sf(w,t)):Zf(t,Po(w,t))}else{if(!Tt[N])return c?t:{};w=fl(t,N,C)}}g||(g=new Ae);var Y=g.get(t);if(Y)return Y;g.set(t,w),eu(t)?t.forEach(function(it){w.add(ye(it,e,r,it,t,g))}):Qa(t)&&t.forEach(function(it,gt){w.set(gt,ye(it,e,r,gt,t,g))});var rt=O?k?Zi:ji:k?ne:Mt,pt=I?n:rt(t);return de(pt||t,function(it,gt){pt&&(gt=it,it=t[gt]),Kn(w,gt,ye(it,e,r,gt,t,g))}),w}function Cf(t){var e=Mt(t);return function(r){return Fo(r,t,e)}}function Fo(t,e,r){var a=r.length;if(t==null)return!a;for(t=Et(t);a--;){var c=r[a],g=e[c],w=t[c];if(w===n&&!(c in t)||!g(w))return!1}return!0}function Mo(t,e,r){if(typeof t!="function")throw new ge(m);return Vn(function(){t.apply(n,r)},e)}function Gn(t,e,r,a){var c=-1,g=sr,w=!0,C=t.length,k=[],O=e.length;if(!C)return k;r&&(e=It(e,ue(r))),a?(g=mi,w=!1):e.length>=u&&(g=Dn,w=!1,e=new an(e));t:for(;++c<C;){var I=t[c],N=r==null?I:r(I);if(I=a||I!==0?I:0,w&&N===N){for(var K=O;K--;)if(e[K]===N)continue t;k.push(I)}else g(e,N,a)||k.push(I)}return k}var Ze=la(Ie),qo=la(Bi,!0);function Af(t,e){var r=!0;return Ze(t,function(a,c,g){return r=!!e(a,c,g),r}),r}function Cr(t,e,r){for(var a=-1,c=t.length;++a<c;){var g=t[a],w=e(g);if(w!=null&&(C===n?w===w&&!he(w):r(w,C)))var C=w,k=g}return k}function kf(t,e,r,a){var c=t.length;for(r=lt(r),r<0&&(r=-r>c?0:c+r),a=a===n||a>c?c:lt(a),a<0&&(a+=c),a=r>a?0:ru(a);r<a;)t[r++]=e;return t}function Wo(t,e){var r=[];return Ze(t,function(a,c,g){e(a,c,g)&&r.push(a)}),r}function Kt(t,e,r,a,c){var g=-1,w=t.length;for(r||(r=pl),c||(c=[]);++g<w;){var C=t[g];e>0&&r(C)?e>1?Kt(C,e-1,r,a,c):Ve(c,C):a||(c[c.length]=C)}return c}var Ni=pa(),Ko=pa(!0);function Ie(t,e){return t&&Ni(t,e,Mt)}function Bi(t,e){return t&&Ko(t,e,Mt)}function Ar(t,e){return Je(e,function(r){return Ge(t[r])})}function cn(t,e){e=tn(e,t);for(var r=0,a=e.length;t!=null&&r<a;)t=t[Ne(e[r++])];return r&&r==a?t:n}function Go(t,e,r){var a=e(t);return ht(t)?a:Ve(a,r(t))}function jt(t){return t==null?t===n?Bn:Ln:sn&&sn in Et(t)?al(t):wl(t)}function Ui(t,e){return t>e}function Ef(t,e){return t!=null&&Ct.call(t,e)}function Tf(t,e){return t!=null&&e in Et(t)}function xf(t,e,r){return t>=zt(e,r)&&t<Ft(e,r)}function Di(t,e,r){for(var a=r?mi:sr,c=t[0].length,g=t.length,w=g,C=T(g),k=1/0,O=[];w--;){var I=t[w];w&&e&&(I=It(I,ue(e))),k=zt(I.length,k),C[w]=!r&&(e||c>=120&&I.length>=120)?new an(w&&I):n}I=t[0];var N=-1,K=C[0];t:for(;++N<c&&O.length<k;){var Y=I[N],rt=e?e(Y):Y;if(Y=r||Y!==0?Y:0,!(K?Dn(K,rt):a(O,rt,r))){for(w=g;--w;){var pt=C[w];if(!(pt?Dn(pt,rt):a(t[w],rt,r)))continue t}K&&K.push(rt),O.push(Y)}}return O}function Rf(t,e,r,a){return Ie(t,function(c,g,w){e(a,r(c),g,w)}),a}function Hn(t,e,r){e=tn(e,t),t=Oa(t,e);var a=t==null?t:t[Ne(_e(e))];return a==null?n:ae(a,t,r)}function Ho(t){return Nt(t)&&jt(t)==F}function Of(t){return Nt(t)&&jt(t)==Xe}function If(t){return Nt(t)&&jt(t)==tt}function $n(t,e,r,a,c){return t===e?!0:t==null||e==null||!Nt(t)&&!Nt(e)?t!==t&&e!==e:Lf(t,e,r,a,$n,c)}function Lf(t,e,r,a,c,g){var w=ht(t),C=ht(e),k=w?et:Xt(t),O=C?et:Xt(e);k=k==F?oe:k,O=O==F?oe:O;var I=k==oe,N=O==oe,K=k==O;if(K&&nn(t)){if(!nn(e))return!1;w=!0,I=!1}if(K&&!I)return g||(g=new Ae),w||xn(t)?Ca(t,e,r,a,c,g):sl(t,e,k,r,a,c,g);if(!(r&b)){var Y=I&&Ct.call(t,"__wrapped__"),rt=N&&Ct.call(e,"__wrapped__");if(Y||rt){var pt=Y?t.value():t,it=rt?e.value():e;return g||(g=new Ae),c(pt,it,r,a,g)}}return K?(g||(g=new Ae),ol(t,e,r,a,c,g)):!1}function Nf(t){return Nt(t)&&Xt(t)==Ot}function Pi(t,e,r,a){var c=r.length,g=c,w=!a;if(t==null)return!g;for(t=Et(t);c--;){var C=r[c];if(w&&C[2]?C[1]!==t[C[0]]:!(C[0]in t))return!1}for(;++c<g;){C=r[c];var k=C[0],O=t[k],I=C[1];if(w&&C[2]){if(O===n&&!(k in t))return!1}else{var N=new Ae;if(a)var K=a(O,I,k,t,e,N);if(!(K===n?$n(I,O,b|E,a,N):K))return!1}}return!0}function $o(t){if(!Lt(t)||gl(t))return!1;var e=Ge(t)?Lh:Sc;return e.test(fn(t))}function Bf(t){return Nt(t)&&jt(t)==Vt}function Uf(t){return Nt(t)&&Xt(t)==Yt}function Df(t){return Nt(t)&&Wr(t.length)&&!!xt[jt(t)]}function zo(t){return typeof t=="function"?t:t==null?re:typeof t=="object"?ht(t)?Vo(t[0],t[1]):Jo(t):du(t)}function Fi(t){if(!Jn(t))return Fh(t);var e=[];for(var r in Et(t))Ct.call(t,r)&&r!="constructor"&&e.push(r);return e}function Pf(t){if(!Lt(t))return _l(t);var e=Jn(t),r=[];for(var a in t)a=="constructor"&&(e||!Ct.call(t,a))||r.push(a);return r}function Mi(t,e){return t<e}function Xo(t,e){var r=-1,a=ee(t)?T(t.length):[];return Ze(t,function(c,g,w){a[++r]=e(c,g,w)}),a}function Jo(t){var e=ts(t);return e.length==1&&e[0][2]?xa(e[0][0],e[0][1]):function(r){return r===t||Pi(r,t,e)}}function Vo(t,e){return ns(t)&&Ta(e)?xa(Ne(t),e):function(r){var a=ls(r,t);return a===n&&a===e?ps(r,t):$n(e,a,b|E)}}function kr(t,e,r,a,c){t!==e&&Ni(e,function(g,w){if(c||(c=new Ae),Lt(g))Ff(t,e,w,r,kr,a,c);else{var C=a?a(is(t,w),g,w+"",t,e,c):n;C===n&&(C=g),Ii(t,w,C)}},ne)}function Ff(t,e,r,a,c,g,w){var C=is(t,r),k=is(e,r),O=w.get(k);if(O){Ii(t,r,O);return}var I=g?g(C,k,r+"",t,e,w):n,N=I===n;if(N){var K=ht(k),Y=!K&&nn(k),rt=!K&&!Y&&xn(k);I=k,K||Y||rt?ht(C)?I=C:Bt(C)?I=te(C):Y?(N=!1,I=aa(k,!0)):rt?(N=!1,I=ua(k,!0)):I=[]:Yn(k)||ln(k)?(I=C,ln(C)?I=iu(C):(!Lt(C)||Ge(C))&&(I=Ea(k))):N=!1}N&&(w.set(k,I),c(I,k,a,g,w),w.delete(k)),Ii(t,r,I)}function Yo(t,e){var r=t.length;if(r)return e+=e<0?r:0,Ke(e,r)?t[e]:n}function jo(t,e,r){e.length?e=It(e,function(g){return ht(g)?function(w){return cn(w,g.length===1?g[0]:g)}:g}):e=[re];var a=-1;e=It(e,ue(nt()));var c=Xo(t,function(g,w,C){var k=It(e,function(O){return O(g)});return{criteria:k,index:++a,value:g}});return hh(c,function(g,w){return jf(g,w,r)})}function Mf(t,e){return Zo(t,e,function(r,a){return ps(t,a)})}function Zo(t,e,r){for(var a=-1,c=e.length,g={};++a<c;){var w=e[a],C=cn(t,w);r(C,w)&&zn(g,tn(w,t),C)}return g}function qf(t){return function(e){return cn(e,t)}}function qi(t,e,r,a){var c=a?ch:yn,g=-1,w=e.length,C=t;for(t===e&&(e=te(e)),r&&(C=It(t,ue(r)));++g<w;)for(var k=0,O=e[g],I=r?r(O):O;(k=c(C,I,k,a))>-1;)C!==t&&gr.call(C,k,1),gr.call(t,k,1);return t}function Qo(t,e){for(var r=t?e.length:0,a=r-1;r--;){var c=e[r];if(r==a||c!==g){var g=c;Ke(c)?gr.call(t,c,1):Hi(t,c)}}return t}function Wi(t,e){return t+mr(No()*(e-t+1))}function Wf(t,e,r,a){for(var c=-1,g=Ft(yr((e-t)/(r||1)),0),w=T(g);g--;)w[a?g:++c]=t,t+=r;return w}function Ki(t,e){var r="";if(!t||e<1||e>ut)return r;do e%2&&(r+=t),e=mr(e/2),e&&(t+=t);while(e);return r}function dt(t,e){return ss(Ra(t,e,re),t+"")}function Kf(t){return Do(Rn(t))}function Gf(t,e){var r=Rn(t);return Ur(r,un(e,0,r.length))}function zn(t,e,r,a){if(!Lt(t))return t;e=tn(e,t);for(var c=-1,g=e.length,w=g-1,C=t;C!=null&&++c<g;){var k=Ne(e[c]),O=r;if(k==="__proto__"||k==="constructor"||k==="prototype")return t;if(c!=w){var I=C[k];O=a?a(I,k,C):n,O===n&&(O=Lt(I)?I:Ke(e[c+1])?[]:{})}Kn(C,k,O),C=C[k]}return t}var ta=_r?function(t,e){return _r.set(t,e),t}:re,Hf=vr?function(t,e){return vr(t,"toString",{configurable:!0,enumerable:!1,value:gs(e),writable:!0})}:re;function $f(t){return Ur(Rn(t))}function me(t,e,r){var a=-1,c=t.length;e<0&&(e=-e>c?0:c+e),r=r>c?c:r,r<0&&(r+=c),c=e>r?0:r-e>>>0,e>>>=0;for(var g=T(c);++a<c;)g[a]=t[a+e];return g}function zf(t,e){var r;return Ze(t,function(a,c,g){return r=e(a,c,g),!r}),!!r}function Er(t,e,r){var a=0,c=t==null?a:t.length;if(typeof e=="number"&&e===e&&c<=q){for(;a<c;){var g=a+c>>>1,w=t[g];w!==null&&!he(w)&&(r?w<=e:w<e)?a=g+1:c=g}return c}return Gi(t,e,re,r)}function Gi(t,e,r,a){var c=0,g=t==null?0:t.length;if(g===0)return 0;e=r(e);for(var w=e!==e,C=e===null,k=he(e),O=e===n;c<g;){var I=mr((c+g)/2),N=r(t[I]),K=N!==n,Y=N===null,rt=N===N,pt=he(N);if(w)var it=a||rt;else O?it=rt&&(a||K):C?it=rt&&K&&(a||!Y):k?it=rt&&K&&!Y&&(a||!pt):Y||pt?it=!1:it=a?N<=e:N<e;it?c=I+1:g=I}return zt(g,er)}function ea(t,e){for(var r=-1,a=t.length,c=0,g=[];++r<a;){var w=t[r],C=e?e(w):w;if(!r||!ke(C,k)){var k=C;g[c++]=w===0?0:w}}return g}function na(t){return typeof t=="number"?t:he(t)?xe:+t}function ce(t){if(typeof t=="string")return t;if(ht(t))return It(t,ce)+"";if(he(t))return Bo?Bo.call(t):"";var e=t+"";return e=="0"&&1/t==-Rt?"-0":e}function Qe(t,e,r){var a=-1,c=sr,g=t.length,w=!0,C=[],k=C;if(r)w=!1,c=mi;else if(g>=u){var O=e?null:rl(t);if(O)return ar(O);w=!1,c=Dn,k=new an}else k=e?[]:C;t:for(;++a<g;){var I=t[a],N=e?e(I):I;if(I=r||I!==0?I:0,w&&N===N){for(var K=k.length;K--;)if(k[K]===N)continue t;e&&k.push(N),C.push(I)}else c(k,N,r)||(k!==C&&k.push(N),C.push(I))}return C}function Hi(t,e){return e=tn(e,t),t=Oa(t,e),t==null||delete t[Ne(_e(e))]}function ra(t,e,r,a){return zn(t,e,r(cn(t,e)),a)}function Tr(t,e,r,a){for(var c=t.length,g=a?c:-1;(a?g--:++g<c)&&e(t[g],g,t););return r?me(t,a?0:g,a?g+1:c):me(t,a?g+1:0,a?c:g)}function ia(t,e){var r=t;return r instanceof vt&&(r=r.value()),_i(e,function(a,c){return c.func.apply(c.thisArg,Ve([a],c.args))},r)}function $i(t,e,r){var a=t.length;if(a<2)return a?Qe(t[0]):[];for(var c=-1,g=T(a);++c<a;)for(var w=t[c],C=-1;++C<a;)C!=c&&(g[c]=Gn(g[c]||w,t[C],e,r));return Qe(Kt(g,1),e,r)}function sa(t,e,r){for(var a=-1,c=t.length,g=e.length,w={};++a<c;){var C=a<g?e[a]:n;r(w,t[a],C)}return w}function zi(t){return Bt(t)?t:[]}function Xi(t){return typeof t=="function"?t:re}function tn(t,e){return ht(t)?t:ns(t,e)?[t]:Ba(St(t))}var Xf=dt;function en(t,e,r){var a=t.length;return r=r===n?a:r,!e&&r>=a?t:me(t,e,r)}var oa=Nh||function(t){return Wt.clearTimeout(t)};function aa(t,e){if(e)return t.slice();var r=t.length,a=xo?xo(r):new t.constructor(r);return t.copy(a),a}function Ji(t){var e=new t.constructor(t.byteLength);return new pr(e).set(new pr(t)),e}function Jf(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function Vf(t){var e=new t.constructor(t.source,Gs.exec(t));return e.lastIndex=t.lastIndex,e}function Yf(t){return Wn?Et(Wn.call(t)):{}}function ua(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ca(t,e){if(t!==e){var r=t!==n,a=t===null,c=t===t,g=he(t),w=e!==n,C=e===null,k=e===e,O=he(e);if(!C&&!O&&!g&&t>e||g&&w&&k&&!C&&!O||a&&w&&k||!r&&k||!c)return 1;if(!a&&!g&&!O&&t<e||O&&r&&c&&!a&&!g||C&&r&&c||!w&&c||!k)return-1}return 0}function jf(t,e,r){for(var a=-1,c=t.criteria,g=e.criteria,w=c.length,C=r.length;++a<w;){var k=ca(c[a],g[a]);if(k){if(a>=C)return k;var O=r[a];return k*(O=="desc"?-1:1)}}return t.index-e.index}function ha(t,e,r,a){for(var c=-1,g=t.length,w=r.length,C=-1,k=e.length,O=Ft(g-w,0),I=T(k+O),N=!a;++C<k;)I[C]=e[C];for(;++c<w;)(N||c<g)&&(I[r[c]]=t[c]);for(;O--;)I[C++]=t[c++];return I}function fa(t,e,r,a){for(var c=-1,g=t.length,w=-1,C=r.length,k=-1,O=e.length,I=Ft(g-C,0),N=T(I+O),K=!a;++c<I;)N[c]=t[c];for(var Y=c;++k<O;)N[Y+k]=e[k];for(;++w<C;)(K||c<g)&&(N[Y+r[w]]=t[c++]);return N}function te(t,e){var r=-1,a=t.length;for(e||(e=T(a));++r<a;)e[r]=t[r];return e}function Le(t,e,r,a){var c=!r;r||(r={});for(var g=-1,w=e.length;++g<w;){var C=e[g],k=a?a(r[C],t[C],C,r,t):n;k===n&&(k=t[C]),c?Me(r,C,k):Kn(r,C,k)}return r}function Zf(t,e){return Le(t,es(t),e)}function Qf(t,e){return Le(t,Aa(t),e)}function xr(t,e){return function(r,a){var c=ht(r)?rh:bf,g=e?e():{};return c(r,t,nt(a,2),g)}}function kn(t){return dt(function(e,r){var a=-1,c=r.length,g=c>1?r[c-1]:n,w=c>2?r[2]:n;for(g=t.length>3&&typeof g=="function"?(c--,g):n,w&&Zt(r[0],r[1],w)&&(g=c<3?n:g,c=1),e=Et(e);++a<c;){var C=r[a];C&&t(e,C,a,g)}return e})}function la(t,e){return function(r,a){if(r==null)return r;if(!ee(r))return t(r,a);for(var c=r.length,g=e?c:-1,w=Et(r);(e?g--:++g<c)&&a(w[g],g,w)!==!1;);return r}}function pa(t){return function(e,r,a){for(var c=-1,g=Et(e),w=a(e),C=w.length;C--;){var k=w[t?C:++c];if(r(g[k],k,g)===!1)break}return e}}function tl(t,e,r){var a=e&x,c=Xn(t);function g(){var w=this&&this!==Wt&&this instanceof g?c:t;return w.apply(a?r:this,arguments)}return g}function da(t){return function(e){e=St(e);var r=mn(e)?Ce(e):n,a=r?r[0]:e.charAt(0),c=r?en(r,1).join(""):e.slice(1);return a[t]()+c}}function En(t){return function(e){return _i(lu(fu(e).replace(Gc,"")),t,"")}}function Xn(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 r=An(t.prototype),a=t.apply(r,e);return Lt(a)?a:r}}function el(t,e,r){var a=Xn(t);function c(){for(var g=arguments.length,w=T(g),C=g,k=Tn(c);C--;)w[C]=arguments[C];var O=g<3&&w[0]!==k&&w[g-1]!==k?[]:Ye(w,k);if(g-=O.length,g<r)return _a(t,e,Rr,c.placeholder,n,w,O,n,n,r-g);var I=this&&this!==Wt&&this instanceof c?a:t;return ae(I,this,w)}return c}function ga(t){return function(e,r,a){var c=Et(e);if(!ee(e)){var g=nt(r,3);e=Mt(e),r=function(C){return g(c[C],C,c)}}var w=t(e,r,a);return w>-1?c[g?e[w]:w]:n}}function va(t){return We(function(e){var r=e.length,a=r,c=ve.prototype.thru;for(t&&e.reverse();a--;){var g=e[a];if(typeof g!="function")throw new ge(m);if(c&&!w&&Nr(g)=="wrapper")var w=new ve([],!0)}for(a=w?a:r;++a<r;){g=e[a];var C=Nr(g),k=C=="wrapper"?Qi(g):n;k&&rs(k[0])&&k[1]==(M|V|H|G)&&!k[4].length&&k[9]==1?w=w[Nr(k[0])].apply(w,k[3]):w=g.length==1&&rs(g)?w[C]():w.thru(g)}return function(){var O=arguments,I=O[0];if(w&&O.length==1&&ht(I))return w.plant(I).value();for(var N=0,K=r?e[N].apply(this,O):I;++N<r;)K=e[N].call(this,K);return K}})}function Rr(t,e,r,a,c,g,w,C,k,O){var I=e&M,N=e&x,K=e&W,Y=e&(V|ot),rt=e&L,pt=K?n:Xn(t);function it(){for(var gt=arguments.length,yt=T(gt),fe=gt;fe--;)yt[fe]=arguments[fe];if(Y)var Qt=Tn(it),le=lh(yt,Qt);if(a&&(yt=ha(yt,a,c,Y)),g&&(yt=fa(yt,g,w,Y)),gt-=le,Y&&gt<O){var Ut=Ye(yt,Qt);return _a(t,e,Rr,it.placeholder,r,yt,Ut,C,k,O-gt)}var Ee=N?r:this,$e=K?Ee[t]:t;return gt=yt.length,C?yt=bl(yt,C):rt&&gt>1&&yt.reverse(),I&&k<gt&&(yt.length=k),this&&this!==Wt&&this instanceof it&&($e=pt||Xn($e)),$e.apply(Ee,yt)}return it}function ya(t,e){return function(r,a){return Rf(r,t,e(a),{})}}function Or(t,e){return function(r,a){var c;if(r===n&&a===n)return e;if(r!==n&&(c=r),a!==n){if(c===n)return a;typeof r=="string"||typeof a=="string"?(r=ce(r),a=ce(a)):(r=na(r),a=na(a)),c=t(r,a)}return c}}function Vi(t){return We(function(e){return e=It(e,ue(nt())),dt(function(r){var a=this;return t(e,function(c){return ae(c,a,r)})})})}function Ir(t,e){e=e===n?" ":ce(e);var r=e.length;if(r<2)return r?Ki(e,t):e;var a=Ki(e,yr(t/_n(e)));return mn(e)?en(Ce(a),0,t).join(""):a.slice(0,t)}function nl(t,e,r,a){var c=e&x,g=Xn(t);function w(){for(var C=-1,k=arguments.length,O=-1,I=a.length,N=T(I+k),K=this&&this!==Wt&&this instanceof w?g:t;++O<I;)N[O]=a[O];for(;k--;)N[O++]=arguments[++C];return ae(K,c?r:this,N)}return w}function ma(t){return function(e,r,a){return a&&typeof a!="number"&&Zt(e,r,a)&&(r=a=n),e=He(e),r===n?(r=e,e=0):r=He(r),a=a===n?e<r?1:-1:He(a),Wf(e,r,a,t)}}function Lr(t){return function(e,r){return typeof e=="string"&&typeof r=="string"||(e=we(e),r=we(r)),t(e,r)}}function _a(t,e,r,a,c,g,w,C,k,O){var I=e&V,N=I?w:n,K=I?n:w,Y=I?g:n,rt=I?n:g;e|=I?H:D,e&=~(I?D:H),e&st||(e&=~(x|W));var pt=[t,e,c,Y,N,rt,K,C,k,O],it=r.apply(n,pt);return rs(t)&&Ia(it,pt),it.placeholder=a,La(it,t,e)}function Yi(t){var e=Pt[t];return function(r,a){if(r=we(r),a=a==null?0:zt(lt(a),292),a&&Lo(r)){var c=(St(r)+"e").split("e"),g=e(c[0]+"e"+(+c[1]+a));return c=(St(g)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return e(r)}}var rl=Sn&&1/ar(new Sn([,-0]))[1]==Rt?function(t){return new Sn(t)}:ms;function wa(t){return function(e){var r=Xt(e);return r==Ot?Ei(e):r==Yt?_h(e):fh(e,t(e))}}function qe(t,e,r,a,c,g,w,C){var k=e&W;if(!k&&typeof t!="function")throw new ge(m);var O=a?a.length:0;if(O||(e&=~(H|D),a=c=n),w=w===n?w:Ft(lt(w),0),C=C===n?C:lt(C),O-=c?c.length:0,e&D){var I=a,N=c;a=c=n}var K=k?n:Qi(t),Y=[t,e,r,a,c,I,N,g,w,C];if(K&&ml(Y,K),t=Y[0],e=Y[1],r=Y[2],a=Y[3],c=Y[4],C=Y[9]=Y[9]===n?k?0:t.length:Ft(Y[9]-O,0),!C&&e&(V|ot)&&(e&=~(V|ot)),!e||e==x)var rt=tl(t,e,r);else e==V||e==ot?rt=el(t,e,C):(e==H||e==(x|H))&&!c.length?rt=nl(t,e,r,a):rt=Rr.apply(n,Y);var pt=K?ta:Ia;return La(pt(rt,Y),t,e)}function ba(t,e,r,a){return t===n||ke(t,bn[r])&&!Ct.call(a,r)?e:t}function Sa(t,e,r,a,c,g){return Lt(t)&&Lt(e)&&(g.set(e,t),kr(t,e,n,Sa,g),g.delete(e)),t}function il(t){return Yn(t)?n:t}function Ca(t,e,r,a,c,g){var w=r&b,C=t.length,k=e.length;if(C!=k&&!(w&&k>C))return!1;var O=g.get(t),I=g.get(e);if(O&&I)return O==e&&I==t;var N=-1,K=!0,Y=r&E?new an:n;for(g.set(t,e),g.set(e,t);++N<C;){var rt=t[N],pt=e[N];if(a)var it=w?a(pt,rt,N,e,t,g):a(rt,pt,N,t,e,g);if(it!==n){if(it)continue;K=!1;break}if(Y){if(!wi(e,function(gt,yt){if(!Dn(Y,yt)&&(rt===gt||c(rt,gt,r,a,g)))return Y.push(yt)})){K=!1;break}}else if(!(rt===pt||c(rt,pt,r,a,g))){K=!1;break}}return g.delete(t),g.delete(e),K}function sl(t,e,r,a,c,g,w){switch(r){case gn:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xe:return!(t.byteLength!=e.byteLength||!g(new pr(t),new pr(e)));case Z:case tt:case Se:return ke(+t,+e);case at:return t.name==e.name&&t.message==e.message;case Vt:case Re:return t==e+"";case Ot:var C=Ei;case Yt:var k=a&b;if(C||(C=ar),t.size!=e.size&&!k)return!1;var O=w.get(t);if(O)return O==e;a|=E,w.set(t,e);var I=Ca(C(t),C(e),a,c,g,w);return w.delete(t),I;case Oe:if(Wn)return Wn.call(t)==Wn.call(e)}return!1}function ol(t,e,r,a,c,g){var w=r&b,C=ji(t),k=C.length,O=ji(e),I=O.length;if(k!=I&&!w)return!1;for(var N=k;N--;){var K=C[N];if(!(w?K in e:Ct.call(e,K)))return!1}var Y=g.get(t),rt=g.get(e);if(Y&&rt)return Y==e&&rt==t;var pt=!0;g.set(t,e),g.set(e,t);for(var it=w;++N<k;){K=C[N];var gt=t[K],yt=e[K];if(a)var fe=w?a(yt,gt,K,e,t,g):a(gt,yt,K,t,e,g);if(!(fe===n?gt===yt||c(gt,yt,r,a,g):fe)){pt=!1;break}it||(it=K=="constructor")}if(pt&&!it){var Qt=t.constructor,le=e.constructor;Qt!=le&&"constructor"in t&&"constructor"in e&&!(typeof Qt=="function"&&Qt instanceof Qt&&typeof le=="function"&&le instanceof le)&&(pt=!1)}return g.delete(t),g.delete(e),pt}function We(t){return ss(Ra(t,n,Fa),t+"")}function ji(t){return Go(t,Mt,es)}function Zi(t){return Go(t,ne,Aa)}var Qi=_r?function(t){return _r.get(t)}:ms;function Nr(t){for(var e=t.name+"",r=Cn[e],a=Ct.call(Cn,e)?r.length:0;a--;){var c=r[a],g=c.func;if(g==null||g==t)return c.name}return e}function Tn(t){var e=Ct.call(p,"placeholder")?p:t;return e.placeholder}function nt(){var t=p.iteratee||vs;return t=t===vs?zo:t,arguments.length?t(arguments[0],arguments[1]):t}function Br(t,e){var r=t.__data__;return dl(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ts(t){for(var e=Mt(t),r=e.length;r--;){var a=e[r],c=t[a];e[r]=[a,c,Ta(c)]}return e}function hn(t,e){var r=vh(t,e);return $o(r)?r:n}function al(t){var e=Ct.call(t,sn),r=t[sn];try{t[sn]=n;var a=!0}catch{}var c=fr.call(t);return a&&(e?t[sn]=r:delete t[sn]),c}var es=xi?function(t){return t==null?[]:(t=Et(t),Je(xi(t),function(e){return Oo.call(t,e)}))}:_s,Aa=xi?function(t){for(var e=[];t;)Ve(e,es(t)),t=dr(t);return e}:_s,Xt=jt;(Ri&&Xt(new Ri(new ArrayBuffer(1)))!=gn||Fn&&Xt(new Fn)!=Ot||Oi&&Xt(Oi.resolve())!=dn||Sn&&Xt(new Sn)!=Yt||Mn&&Xt(new Mn)!=De)&&(Xt=function(t){var e=jt(t),r=e==oe?t.constructor:n,a=r?fn(r):"";if(a)switch(a){case Kh:return gn;case Gh:return Ot;case Hh:return dn;case $h:return Yt;case zh:return De}return e});function ul(t,e,r){for(var a=-1,c=r.length;++a<c;){var g=r[a],w=g.size;switch(g.type){case"drop":t+=w;break;case"dropRight":e-=w;break;case"take":e=zt(e,t+w);break;case"takeRight":t=Ft(t,e-w);break}}return{start:t,end:e}}function cl(t){var e=t.match(dc);return e?e[1].split(gc):[]}function ka(t,e,r){e=tn(e,t);for(var a=-1,c=e.length,g=!1;++a<c;){var w=Ne(e[a]);if(!(g=t!=null&&r(t,w)))break;t=t[w]}return g||++a!=c?g:(c=t==null?0:t.length,!!c&&Wr(c)&&Ke(w,c)&&(ht(t)||ln(t)))}function hl(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Ct.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Ea(t){return typeof t.constructor=="function"&&!Jn(t)?An(dr(t)):{}}function fl(t,e,r){var a=t.constructor;switch(e){case Xe:return Ji(t);case Z:case tt:return new a(+t);case gn:return Jf(t,r);case ti:case ei:case ni:case ri:case ii:case si:case oi:case ai:case ui:return ua(t,r);case Ot:return new a;case Se:case Re:return new a(t);case Vt:return Vf(t);case Yt:return new a;case Oe:return Yf(t)}}function ll(t,e){var r=e.length;if(!r)return t;var a=r-1;return e[a]=(r>1?"& ":"")+e[a],e=e.join(r>2?", ":" "),t.replace(pc,`{
13
+ */Zr.exports;(function(s,i){(function(){var n,o="4.17.21",u=200,h="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",m="Expected a function",g="Invalid `variable` option passed into `_.template`",S="__lodash_hash_undefined__",v=500,_="__lodash_placeholder__",y=1,l=2,f=4,b=1,k=2,x=1,W=2,st=4,V=8,ot=16,H=32,D=64,M=128,G=256,L=512,U=30,X="...",Q=800,j=16,B=1,Et=2,At=3,Rt=1/0,ut=9007199254740991,Ht=17976931348623157e292,xe=NaN,se=4294967295,er=se-1,q=se>>>1,J=[["ary",M],["bind",x],["bindKey",W],["curry",V],["curryRight",ot],["flip",L],["partial",H],["partialRight",D],["rearg",G]],F="[object Arguments]",et="[object Array]",P="[object AsyncFunction]",Z="[object Boolean]",tt="[object Date]",z="[object DOMException]",at="[object Error]",bt="[object Function]",$t="[object GeneratorFunction]",Ot="[object Map]",Se="[object Number]",Ln="[object Null]",oe="[object Object]",dn="[object Promise]",Nn="[object Proxy]",Vt="[object RegExp]",Yt="[object Set]",Re="[object String]",Oe="[object Symbol]",Bn="[object Undefined]",De="[object WeakMap]",Un="[object WeakSet]",Xe="[object ArrayBuffer]",gn="[object DataView]",ti="[object Float32Array]",ei="[object Float64Array]",ni="[object Int8Array]",ri="[object Int16Array]",ii="[object Int32Array]",si="[object Uint8Array]",oi="[object Uint8ClampedArray]",ai="[object Uint16Array]",ui="[object Uint32Array]",ec=/\b__p \+= '';/g,nc=/\b(__p \+=) '' \+/g,rc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qs=/&(?:amp|lt|gt|quot|#39);/g,Ws=/[&<>"']/g,ic=RegExp(qs.source),sc=RegExp(Ws.source),oc=/<%-([\s\S]+?)%>/g,ac=/<%([\s\S]+?)%>/g,Ks=/<%=([\s\S]+?)%>/g,uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cc=/^\w*$/,hc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ci=/[\\^$.*+?()[\]{}|]/g,fc=RegExp(ci.source),hi=/^\s+/,lc=/\s/,pc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dc=/\{\n\/\* \[wrapped with (.+)\] \*/,gc=/,? & /,vc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yc=/[()=,{}\[\]\/\s]/,mc=/\\(\\)?/g,_c=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gs=/\w*$/,wc=/^[-+]0x[0-9a-f]+$/i,bc=/^0b[01]+$/i,Sc=/^\[object .+?Constructor\]$/,Cc=/^0o[0-7]+$/i,Ec=/^(?:0|[1-9]\d*)$/,Ac=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nr=/($^)/,kc=/['\n\r\u2028\u2029\\]/g,rr="\\ud800-\\udfff",Tc="\\u0300-\\u036f",xc="\\ufe20-\\ufe2f",Rc="\\u20d0-\\u20ff",Hs=Tc+xc+Rc,$s="\\u2700-\\u27bf",zs="a-z\\xdf-\\xf6\\xf8-\\xff",Oc="\\xac\\xb1\\xd7\\xf7",Ic="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lc="\\u2000-\\u206f",Nc=" \\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",Xs="A-Z\\xc0-\\xd6\\xd8-\\xde",Js="\\ufe0e\\ufe0f",Vs=Oc+Ic+Lc+Nc,fi="['’]",Bc="["+rr+"]",Ys="["+Vs+"]",ir="["+Hs+"]",js="\\d+",Uc="["+$s+"]",Zs="["+zs+"]",Qs="[^"+rr+Vs+js+$s+zs+Xs+"]",li="\\ud83c[\\udffb-\\udfff]",Dc="(?:"+ir+"|"+li+")",to="[^"+rr+"]",pi="(?:\\ud83c[\\udde6-\\uddff]){2}",di="[\\ud800-\\udbff][\\udc00-\\udfff]",vn="["+Xs+"]",eo="\\u200d",no="(?:"+Zs+"|"+Qs+")",Pc="(?:"+vn+"|"+Qs+")",ro="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",io="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",so=Dc+"?",oo="["+Js+"]?",Fc="(?:"+eo+"(?:"+[to,pi,di].join("|")+")"+oo+so+")*",Mc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ao=oo+so+Fc,Wc="(?:"+[Uc,pi,di].join("|")+")"+ao,Kc="(?:"+[to+ir+"?",ir,pi,di,Bc].join("|")+")",Gc=RegExp(fi,"g"),Hc=RegExp(ir,"g"),gi=RegExp(li+"(?="+li+")|"+Kc+ao,"g"),$c=RegExp([vn+"?"+Zs+"+"+ro+"(?="+[Ys,vn,"$"].join("|")+")",Pc+"+"+io+"(?="+[Ys,vn+no,"$"].join("|")+")",vn+"?"+no+"+"+ro,vn+"+"+io,qc,Mc,js,Wc].join("|"),"g"),zc=RegExp("["+eo+rr+Hs+Js+"]"),Xc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jc=["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"],Vc=-1,xt={};xt[ti]=xt[ei]=xt[ni]=xt[ri]=xt[ii]=xt[si]=xt[oi]=xt[ai]=xt[ui]=!0,xt[F]=xt[et]=xt[Xe]=xt[Z]=xt[gn]=xt[tt]=xt[at]=xt[bt]=xt[Ot]=xt[Se]=xt[oe]=xt[Vt]=xt[Yt]=xt[Re]=xt[De]=!1;var Tt={};Tt[F]=Tt[et]=Tt[Xe]=Tt[gn]=Tt[Z]=Tt[tt]=Tt[ti]=Tt[ei]=Tt[ni]=Tt[ri]=Tt[ii]=Tt[Ot]=Tt[Se]=Tt[oe]=Tt[Vt]=Tt[Yt]=Tt[Re]=Tt[Oe]=Tt[si]=Tt[oi]=Tt[ai]=Tt[ui]=!0,Tt[at]=Tt[bt]=Tt[De]=!1;var Yc={À:"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"},jc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zc={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Qc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},th=parseFloat,eh=parseInt,uo=typeof jn=="object"&&jn&&jn.Object===Object&&jn,nh=typeof self=="object"&&self&&self.Object===Object&&self,Wt=uo||nh||Function("return this")(),vi=i&&!i.nodeType&&i,rn=vi&&!0&&s&&!s.nodeType&&s,co=rn&&rn.exports===vi,yi=co&&uo.process,pe=function(){try{var E=rn&&rn.require&&rn.require("util").types;return E||yi&&yi.binding&&yi.binding("util")}catch{}}(),ho=pe&&pe.isArrayBuffer,fo=pe&&pe.isDate,lo=pe&&pe.isMap,po=pe&&pe.isRegExp,go=pe&&pe.isSet,vo=pe&&pe.isTypedArray;function ae(E,R,T){switch(T.length){case 0:return E.call(R);case 1:return E.call(R,T[0]);case 2:return E.call(R,T[0],T[1]);case 3:return E.call(R,T[0],T[1],T[2])}return E.apply(R,T)}function rh(E,R,T,$){for(var ct=-1,_t=E==null?0:E.length;++ct<_t;){var Pt=E[ct];R($,Pt,T(Pt),E)}return $}function de(E,R){for(var T=-1,$=E==null?0:E.length;++T<$&&R(E[T],T,E)!==!1;);return E}function ih(E,R){for(var T=E==null?0:E.length;T--&&R(E[T],T,E)!==!1;);return E}function yo(E,R){for(var T=-1,$=E==null?0:E.length;++T<$;)if(!R(E[T],T,E))return!1;return!0}function Je(E,R){for(var T=-1,$=E==null?0:E.length,ct=0,_t=[];++T<$;){var Pt=E[T];R(Pt,T,E)&&(_t[ct++]=Pt)}return _t}function sr(E,R){var T=E==null?0:E.length;return!!T&&yn(E,R,0)>-1}function mi(E,R,T){for(var $=-1,ct=E==null?0:E.length;++$<ct;)if(T(R,E[$]))return!0;return!1}function It(E,R){for(var T=-1,$=E==null?0:E.length,ct=Array($);++T<$;)ct[T]=R(E[T],T,E);return ct}function Ve(E,R){for(var T=-1,$=R.length,ct=E.length;++T<$;)E[ct+T]=R[T];return E}function _i(E,R,T,$){var ct=-1,_t=E==null?0:E.length;for($&&_t&&(T=E[++ct]);++ct<_t;)T=R(T,E[ct],ct,E);return T}function sh(E,R,T,$){var ct=E==null?0:E.length;for($&&ct&&(T=E[--ct]);ct--;)T=R(T,E[ct],ct,E);return T}function wi(E,R){for(var T=-1,$=E==null?0:E.length;++T<$;)if(R(E[T],T,E))return!0;return!1}var oh=bi("length");function ah(E){return E.split("")}function uh(E){return E.match(vc)||[]}function mo(E,R,T){var $;return T(E,function(ct,_t,Pt){if(R(ct,_t,Pt))return $=_t,!1}),$}function or(E,R,T,$){for(var ct=E.length,_t=T+($?1:-1);$?_t--:++_t<ct;)if(R(E[_t],_t,E))return _t;return-1}function yn(E,R,T){return R===R?wh(E,R,T):or(E,_o,T)}function ch(E,R,T,$){for(var ct=T-1,_t=E.length;++ct<_t;)if($(E[ct],R))return ct;return-1}function _o(E){return E!==E}function wo(E,R){var T=E==null?0:E.length;return T?Ci(E,R)/T:xe}function bi(E){return function(R){return R==null?n:R[E]}}function Si(E){return function(R){return E==null?n:E[R]}}function bo(E,R,T,$,ct){return ct(E,function(_t,Pt,kt){T=$?($=!1,_t):R(T,_t,Pt,kt)}),T}function hh(E,R){var T=E.length;for(E.sort(R);T--;)E[T]=E[T].value;return E}function Ci(E,R){for(var T,$=-1,ct=E.length;++$<ct;){var _t=R(E[$]);_t!==n&&(T=T===n?_t:T+_t)}return T}function Ei(E,R){for(var T=-1,$=Array(E);++T<E;)$[T]=R(T);return $}function fh(E,R){return It(R,function(T){return[T,E[T]]})}function So(E){return E&&E.slice(0,ko(E)+1).replace(hi,"")}function ue(E){return function(R){return E(R)}}function Ai(E,R){return It(R,function(T){return E[T]})}function Dn(E,R){return E.has(R)}function Co(E,R){for(var T=-1,$=E.length;++T<$&&yn(R,E[T],0)>-1;);return T}function Eo(E,R){for(var T=E.length;T--&&yn(R,E[T],0)>-1;);return T}function lh(E,R){for(var T=E.length,$=0;T--;)E[T]===R&&++$;return $}var ph=Si(Yc),dh=Si(jc);function gh(E){return"\\"+Qc[E]}function vh(E,R){return E==null?n:E[R]}function mn(E){return zc.test(E)}function yh(E){return Xc.test(E)}function mh(E){for(var R,T=[];!(R=E.next()).done;)T.push(R.value);return T}function ki(E){var R=-1,T=Array(E.size);return E.forEach(function($,ct){T[++R]=[ct,$]}),T}function Ao(E,R){return function(T){return E(R(T))}}function Ye(E,R){for(var T=-1,$=E.length,ct=0,_t=[];++T<$;){var Pt=E[T];(Pt===R||Pt===_)&&(E[T]=_,_t[ct++]=T)}return _t}function ar(E){var R=-1,T=Array(E.size);return E.forEach(function($){T[++R]=$}),T}function _h(E){var R=-1,T=Array(E.size);return E.forEach(function($){T[++R]=[$,$]}),T}function wh(E,R,T){for(var $=T-1,ct=E.length;++$<ct;)if(E[$]===R)return $;return-1}function bh(E,R,T){for(var $=T+1;$--;)if(E[$]===R)return $;return $}function _n(E){return mn(E)?Ch(E):oh(E)}function Ce(E){return mn(E)?Eh(E):ah(E)}function ko(E){for(var R=E.length;R--&&lc.test(E.charAt(R)););return R}var Sh=Si(Zc);function Ch(E){for(var R=gi.lastIndex=0;gi.test(E);)++R;return R}function Eh(E){return E.match(gi)||[]}function Ah(E){return E.match($c)||[]}var kh=function E(R){R=R==null?Wt:wn.defaults(Wt.Object(),R,wn.pick(Wt,Jc));var T=R.Array,$=R.Date,ct=R.Error,_t=R.Function,Pt=R.Math,kt=R.Object,Ti=R.RegExp,Th=R.String,ge=R.TypeError,ur=T.prototype,xh=_t.prototype,bn=kt.prototype,cr=R["__core-js_shared__"],hr=xh.toString,Ct=bn.hasOwnProperty,Rh=0,To=function(){var t=/[^.]+$/.exec(cr&&cr.keys&&cr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),fr=bn.toString,Oh=hr.call(kt),Ih=Wt._,Lh=Ti("^"+hr.call(Ct).replace(ci,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lr=co?R.Buffer:n,je=R.Symbol,pr=R.Uint8Array,xo=lr?lr.allocUnsafe:n,dr=Ao(kt.getPrototypeOf,kt),Ro=kt.create,Oo=bn.propertyIsEnumerable,gr=ur.splice,Io=je?je.isConcatSpreadable:n,Pn=je?je.iterator:n,sn=je?je.toStringTag:n,vr=function(){try{var t=hn(kt,"defineProperty");return t({},"",{}),t}catch{}}(),Nh=R.clearTimeout!==Wt.clearTimeout&&R.clearTimeout,Bh=$&&$.now!==Wt.Date.now&&$.now,Uh=R.setTimeout!==Wt.setTimeout&&R.setTimeout,yr=Pt.ceil,mr=Pt.floor,xi=kt.getOwnPropertySymbols,Dh=lr?lr.isBuffer:n,Lo=R.isFinite,Ph=ur.join,Fh=Ao(kt.keys,kt),Ft=Pt.max,zt=Pt.min,Mh=$.now,qh=R.parseInt,No=Pt.random,Wh=ur.reverse,Ri=hn(R,"DataView"),Fn=hn(R,"Map"),Oi=hn(R,"Promise"),Sn=hn(R,"Set"),Mn=hn(R,"WeakMap"),qn=hn(kt,"create"),_r=Mn&&new Mn,Cn={},Kh=fn(Ri),Gh=fn(Fn),Hh=fn(Oi),$h=fn(Sn),zh=fn(Mn),wr=je?je.prototype:n,Wn=wr?wr.valueOf:n,Bo=wr?wr.toString:n;function p(t){if(Nt(t)&&!ht(t)&&!(t instanceof vt)){if(t instanceof ve)return t;if(Ct.call(t,"__wrapped__"))return Ua(t)}return new ve(t)}var En=function(){function t(){}return function(e){if(!Lt(e))return{};if(Ro)return Ro(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function br(){}function ve(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}p.templateSettings={escape:oc,evaluate:ac,interpolate:Ks,variable:"",imports:{_:p}},p.prototype=br.prototype,p.prototype.constructor=p,ve.prototype=En(br.prototype),ve.prototype.constructor=ve;function vt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=se,this.__views__=[]}function Xh(){var t=new vt(this.__wrapped__);return t.__actions__=te(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=te(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=te(this.__views__),t}function Jh(){if(this.__filtered__){var t=new vt(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function Vh(){var t=this.__wrapped__.value(),e=this.__dir__,r=ht(t),a=e<0,c=r?t.length:0,d=ul(0,c,this.__views__),w=d.start,C=d.end,A=C-w,O=a?C:w-1,I=this.__iteratees__,N=I.length,K=0,Y=zt(A,this.__takeCount__);if(!r||!a&&c==A&&Y==A)return ia(t,this.__actions__);var rt=[];t:for(;A--&&K<Y;){O+=e;for(var pt=-1,it=t[O];++pt<N;){var gt=I[pt],yt=gt.iteratee,fe=gt.type,Qt=yt(it);if(fe==Et)it=Qt;else if(!Qt){if(fe==B)continue t;break t}}rt[K++]=it}return rt}vt.prototype=En(br.prototype),vt.prototype.constructor=vt;function on(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function Yh(){this.__data__=qn?qn(null):{},this.size=0}function jh(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Zh(t){var e=this.__data__;if(qn){var r=e[t];return r===S?n:r}return Ct.call(e,t)?e[t]:n}function Qh(t){var e=this.__data__;return qn?e[t]!==n:Ct.call(e,t)}function tf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=qn&&e===n?S:e,this}on.prototype.clear=Yh,on.prototype.delete=jh,on.prototype.get=Zh,on.prototype.has=Qh,on.prototype.set=tf;function Pe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function ef(){this.__data__=[],this.size=0}function nf(t){var e=this.__data__,r=Sr(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():gr.call(e,r,1),--this.size,!0}function rf(t){var e=this.__data__,r=Sr(e,t);return r<0?n:e[r][1]}function sf(t){return Sr(this.__data__,t)>-1}function of(t,e){var r=this.__data__,a=Sr(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}Pe.prototype.clear=ef,Pe.prototype.delete=nf,Pe.prototype.get=rf,Pe.prototype.has=sf,Pe.prototype.set=of;function Fe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function af(){this.size=0,this.__data__={hash:new on,map:new(Fn||Pe),string:new on}}function uf(t){var e=Br(this,t).delete(t);return this.size-=e?1:0,e}function cf(t){return Br(this,t).get(t)}function hf(t){return Br(this,t).has(t)}function ff(t,e){var r=Br(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}Fe.prototype.clear=af,Fe.prototype.delete=uf,Fe.prototype.get=cf,Fe.prototype.has=hf,Fe.prototype.set=ff;function an(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Fe;++e<r;)this.add(t[e])}function lf(t){return this.__data__.set(t,S),this}function pf(t){return this.__data__.has(t)}an.prototype.add=an.prototype.push=lf,an.prototype.has=pf;function Ee(t){var e=this.__data__=new Pe(t);this.size=e.size}function df(){this.__data__=new Pe,this.size=0}function gf(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function vf(t){return this.__data__.get(t)}function yf(t){return this.__data__.has(t)}function mf(t,e){var r=this.__data__;if(r instanceof Pe){var a=r.__data__;if(!Fn||a.length<u-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new Fe(a)}return r.set(t,e),this.size=r.size,this}Ee.prototype.clear=df,Ee.prototype.delete=gf,Ee.prototype.get=vf,Ee.prototype.has=yf,Ee.prototype.set=mf;function Uo(t,e){var r=ht(t),a=!r&&ln(t),c=!r&&!a&&nn(t),d=!r&&!a&&!c&&xn(t),w=r||a||c||d,C=w?Ei(t.length,Th):[],A=C.length;for(var O in t)(e||Ct.call(t,O))&&!(w&&(O=="length"||c&&(O=="offset"||O=="parent")||d&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||Ke(O,A)))&&C.push(O);return C}function Do(t){var e=t.length;return e?t[Wi(0,e-1)]:n}function _f(t,e){return Ur(te(t),un(e,0,t.length))}function wf(t){return Ur(te(t))}function Ii(t,e,r){(r!==n&&!Ae(t[e],r)||r===n&&!(e in t))&&Me(t,e,r)}function Kn(t,e,r){var a=t[e];(!(Ct.call(t,e)&&Ae(a,r))||r===n&&!(e in t))&&Me(t,e,r)}function Sr(t,e){for(var r=t.length;r--;)if(Ae(t[r][0],e))return r;return-1}function bf(t,e,r,a){return Ze(t,function(c,d,w){e(a,c,r(c),w)}),a}function Po(t,e){return t&&Le(e,Mt(e),t)}function Sf(t,e){return t&&Le(e,ne(e),t)}function Me(t,e,r){e=="__proto__"&&vr?vr(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Li(t,e){for(var r=-1,a=e.length,c=T(a),d=t==null;++r<a;)c[r]=d?n:ls(t,e[r]);return c}function un(t,e,r){return t===t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function ye(t,e,r,a,c,d){var w,C=e&y,A=e&l,O=e&f;if(r&&(w=c?r(t,a,c,d):r(t)),w!==n)return w;if(!Lt(t))return t;var I=ht(t);if(I){if(w=hl(t),!C)return te(t,w)}else{var N=Xt(t),K=N==bt||N==$t;if(nn(t))return aa(t,C);if(N==oe||N==F||K&&!c){if(w=A||K?{}:ka(t),!C)return A?Qf(t,Sf(w,t)):Zf(t,Po(w,t))}else{if(!Tt[N])return c?t:{};w=fl(t,N,C)}}d||(d=new Ee);var Y=d.get(t);if(Y)return Y;d.set(t,w),eu(t)?t.forEach(function(it){w.add(ye(it,e,r,it,t,d))}):Qa(t)&&t.forEach(function(it,gt){w.set(gt,ye(it,e,r,gt,t,d))});var rt=O?A?Zi:ji:A?ne:Mt,pt=I?n:rt(t);return de(pt||t,function(it,gt){pt&&(gt=it,it=t[gt]),Kn(w,gt,ye(it,e,r,gt,t,d))}),w}function Cf(t){var e=Mt(t);return function(r){return Fo(r,t,e)}}function Fo(t,e,r){var a=r.length;if(t==null)return!a;for(t=kt(t);a--;){var c=r[a],d=e[c],w=t[c];if(w===n&&!(c in t)||!d(w))return!1}return!0}function Mo(t,e,r){if(typeof t!="function")throw new ge(m);return Vn(function(){t.apply(n,r)},e)}function Gn(t,e,r,a){var c=-1,d=sr,w=!0,C=t.length,A=[],O=e.length;if(!C)return A;r&&(e=It(e,ue(r))),a?(d=mi,w=!1):e.length>=u&&(d=Dn,w=!1,e=new an(e));t:for(;++c<C;){var I=t[c],N=r==null?I:r(I);if(I=a||I!==0?I:0,w&&N===N){for(var K=O;K--;)if(e[K]===N)continue t;A.push(I)}else d(e,N,a)||A.push(I)}return A}var Ze=la(Ie),qo=la(Bi,!0);function Ef(t,e){var r=!0;return Ze(t,function(a,c,d){return r=!!e(a,c,d),r}),r}function Cr(t,e,r){for(var a=-1,c=t.length;++a<c;){var d=t[a],w=e(d);if(w!=null&&(C===n?w===w&&!he(w):r(w,C)))var C=w,A=d}return A}function Af(t,e,r,a){var c=t.length;for(r=lt(r),r<0&&(r=-r>c?0:c+r),a=a===n||a>c?c:lt(a),a<0&&(a+=c),a=r>a?0:ru(a);r<a;)t[r++]=e;return t}function Wo(t,e){var r=[];return Ze(t,function(a,c,d){e(a,c,d)&&r.push(a)}),r}function Kt(t,e,r,a,c){var d=-1,w=t.length;for(r||(r=pl),c||(c=[]);++d<w;){var C=t[d];e>0&&r(C)?e>1?Kt(C,e-1,r,a,c):Ve(c,C):a||(c[c.length]=C)}return c}var Ni=pa(),Ko=pa(!0);function Ie(t,e){return t&&Ni(t,e,Mt)}function Bi(t,e){return t&&Ko(t,e,Mt)}function Er(t,e){return Je(e,function(r){return Ge(t[r])})}function cn(t,e){e=tn(e,t);for(var r=0,a=e.length;t!=null&&r<a;)t=t[Ne(e[r++])];return r&&r==a?t:n}function Go(t,e,r){var a=e(t);return ht(t)?a:Ve(a,r(t))}function jt(t){return t==null?t===n?Bn:Ln:sn&&sn in kt(t)?al(t):wl(t)}function Ui(t,e){return t>e}function kf(t,e){return t!=null&&Ct.call(t,e)}function Tf(t,e){return t!=null&&e in kt(t)}function xf(t,e,r){return t>=zt(e,r)&&t<Ft(e,r)}function Di(t,e,r){for(var a=r?mi:sr,c=t[0].length,d=t.length,w=d,C=T(d),A=1/0,O=[];w--;){var I=t[w];w&&e&&(I=It(I,ue(e))),A=zt(I.length,A),C[w]=!r&&(e||c>=120&&I.length>=120)?new an(w&&I):n}I=t[0];var N=-1,K=C[0];t:for(;++N<c&&O.length<A;){var Y=I[N],rt=e?e(Y):Y;if(Y=r||Y!==0?Y:0,!(K?Dn(K,rt):a(O,rt,r))){for(w=d;--w;){var pt=C[w];if(!(pt?Dn(pt,rt):a(t[w],rt,r)))continue t}K&&K.push(rt),O.push(Y)}}return O}function Rf(t,e,r,a){return Ie(t,function(c,d,w){e(a,r(c),d,w)}),a}function Hn(t,e,r){e=tn(e,t),t=Oa(t,e);var a=t==null?t:t[Ne(_e(e))];return a==null?n:ae(a,t,r)}function Ho(t){return Nt(t)&&jt(t)==F}function Of(t){return Nt(t)&&jt(t)==Xe}function If(t){return Nt(t)&&jt(t)==tt}function $n(t,e,r,a,c){return t===e?!0:t==null||e==null||!Nt(t)&&!Nt(e)?t!==t&&e!==e:Lf(t,e,r,a,$n,c)}function Lf(t,e,r,a,c,d){var w=ht(t),C=ht(e),A=w?et:Xt(t),O=C?et:Xt(e);A=A==F?oe:A,O=O==F?oe:O;var I=A==oe,N=O==oe,K=A==O;if(K&&nn(t)){if(!nn(e))return!1;w=!0,I=!1}if(K&&!I)return d||(d=new Ee),w||xn(t)?Ca(t,e,r,a,c,d):sl(t,e,A,r,a,c,d);if(!(r&b)){var Y=I&&Ct.call(t,"__wrapped__"),rt=N&&Ct.call(e,"__wrapped__");if(Y||rt){var pt=Y?t.value():t,it=rt?e.value():e;return d||(d=new Ee),c(pt,it,r,a,d)}}return K?(d||(d=new Ee),ol(t,e,r,a,c,d)):!1}function Nf(t){return Nt(t)&&Xt(t)==Ot}function Pi(t,e,r,a){var c=r.length,d=c,w=!a;if(t==null)return!d;for(t=kt(t);c--;){var C=r[c];if(w&&C[2]?C[1]!==t[C[0]]:!(C[0]in t))return!1}for(;++c<d;){C=r[c];var A=C[0],O=t[A],I=C[1];if(w&&C[2]){if(O===n&&!(A in t))return!1}else{var N=new Ee;if(a)var K=a(O,I,A,t,e,N);if(!(K===n?$n(I,O,b|k,a,N):K))return!1}}return!0}function $o(t){if(!Lt(t)||gl(t))return!1;var e=Ge(t)?Lh:Sc;return e.test(fn(t))}function Bf(t){return Nt(t)&&jt(t)==Vt}function Uf(t){return Nt(t)&&Xt(t)==Yt}function Df(t){return Nt(t)&&Wr(t.length)&&!!xt[jt(t)]}function zo(t){return typeof t=="function"?t:t==null?re:typeof t=="object"?ht(t)?Vo(t[0],t[1]):Jo(t):du(t)}function Fi(t){if(!Jn(t))return Fh(t);var e=[];for(var r in kt(t))Ct.call(t,r)&&r!="constructor"&&e.push(r);return e}function Pf(t){if(!Lt(t))return _l(t);var e=Jn(t),r=[];for(var a in t)a=="constructor"&&(e||!Ct.call(t,a))||r.push(a);return r}function Mi(t,e){return t<e}function Xo(t,e){var r=-1,a=ee(t)?T(t.length):[];return Ze(t,function(c,d,w){a[++r]=e(c,d,w)}),a}function Jo(t){var e=ts(t);return e.length==1&&e[0][2]?xa(e[0][0],e[0][1]):function(r){return r===t||Pi(r,t,e)}}function Vo(t,e){return ns(t)&&Ta(e)?xa(Ne(t),e):function(r){var a=ls(r,t);return a===n&&a===e?ps(r,t):$n(e,a,b|k)}}function Ar(t,e,r,a,c){t!==e&&Ni(e,function(d,w){if(c||(c=new Ee),Lt(d))Ff(t,e,w,r,Ar,a,c);else{var C=a?a(is(t,w),d,w+"",t,e,c):n;C===n&&(C=d),Ii(t,w,C)}},ne)}function Ff(t,e,r,a,c,d,w){var C=is(t,r),A=is(e,r),O=w.get(A);if(O){Ii(t,r,O);return}var I=d?d(C,A,r+"",t,e,w):n,N=I===n;if(N){var K=ht(A),Y=!K&&nn(A),rt=!K&&!Y&&xn(A);I=A,K||Y||rt?ht(C)?I=C:Bt(C)?I=te(C):Y?(N=!1,I=aa(A,!0)):rt?(N=!1,I=ua(A,!0)):I=[]:Yn(A)||ln(A)?(I=C,ln(C)?I=iu(C):(!Lt(C)||Ge(C))&&(I=ka(A))):N=!1}N&&(w.set(A,I),c(I,A,a,d,w),w.delete(A)),Ii(t,r,I)}function Yo(t,e){var r=t.length;if(r)return e+=e<0?r:0,Ke(e,r)?t[e]:n}function jo(t,e,r){e.length?e=It(e,function(d){return ht(d)?function(w){return cn(w,d.length===1?d[0]:d)}:d}):e=[re];var a=-1;e=It(e,ue(nt()));var c=Xo(t,function(d,w,C){var A=It(e,function(O){return O(d)});return{criteria:A,index:++a,value:d}});return hh(c,function(d,w){return jf(d,w,r)})}function Mf(t,e){return Zo(t,e,function(r,a){return ps(t,a)})}function Zo(t,e,r){for(var a=-1,c=e.length,d={};++a<c;){var w=e[a],C=cn(t,w);r(C,w)&&zn(d,tn(w,t),C)}return d}function qf(t){return function(e){return cn(e,t)}}function qi(t,e,r,a){var c=a?ch:yn,d=-1,w=e.length,C=t;for(t===e&&(e=te(e)),r&&(C=It(t,ue(r)));++d<w;)for(var A=0,O=e[d],I=r?r(O):O;(A=c(C,I,A,a))>-1;)C!==t&&gr.call(C,A,1),gr.call(t,A,1);return t}function Qo(t,e){for(var r=t?e.length:0,a=r-1;r--;){var c=e[r];if(r==a||c!==d){var d=c;Ke(c)?gr.call(t,c,1):Hi(t,c)}}return t}function Wi(t,e){return t+mr(No()*(e-t+1))}function Wf(t,e,r,a){for(var c=-1,d=Ft(yr((e-t)/(r||1)),0),w=T(d);d--;)w[a?d:++c]=t,t+=r;return w}function Ki(t,e){var r="";if(!t||e<1||e>ut)return r;do e%2&&(r+=t),e=mr(e/2),e&&(t+=t);while(e);return r}function dt(t,e){return ss(Ra(t,e,re),t+"")}function Kf(t){return Do(Rn(t))}function Gf(t,e){var r=Rn(t);return Ur(r,un(e,0,r.length))}function zn(t,e,r,a){if(!Lt(t))return t;e=tn(e,t);for(var c=-1,d=e.length,w=d-1,C=t;C!=null&&++c<d;){var A=Ne(e[c]),O=r;if(A==="__proto__"||A==="constructor"||A==="prototype")return t;if(c!=w){var I=C[A];O=a?a(I,A,C):n,O===n&&(O=Lt(I)?I:Ke(e[c+1])?[]:{})}Kn(C,A,O),C=C[A]}return t}var ta=_r?function(t,e){return _r.set(t,e),t}:re,Hf=vr?function(t,e){return vr(t,"toString",{configurable:!0,enumerable:!1,value:gs(e),writable:!0})}:re;function $f(t){return Ur(Rn(t))}function me(t,e,r){var a=-1,c=t.length;e<0&&(e=-e>c?0:c+e),r=r>c?c:r,r<0&&(r+=c),c=e>r?0:r-e>>>0,e>>>=0;for(var d=T(c);++a<c;)d[a]=t[a+e];return d}function zf(t,e){var r;return Ze(t,function(a,c,d){return r=e(a,c,d),!r}),!!r}function kr(t,e,r){var a=0,c=t==null?a:t.length;if(typeof e=="number"&&e===e&&c<=q){for(;a<c;){var d=a+c>>>1,w=t[d];w!==null&&!he(w)&&(r?w<=e:w<e)?a=d+1:c=d}return c}return Gi(t,e,re,r)}function Gi(t,e,r,a){var c=0,d=t==null?0:t.length;if(d===0)return 0;e=r(e);for(var w=e!==e,C=e===null,A=he(e),O=e===n;c<d;){var I=mr((c+d)/2),N=r(t[I]),K=N!==n,Y=N===null,rt=N===N,pt=he(N);if(w)var it=a||rt;else O?it=rt&&(a||K):C?it=rt&&K&&(a||!Y):A?it=rt&&K&&!Y&&(a||!pt):Y||pt?it=!1:it=a?N<=e:N<e;it?c=I+1:d=I}return zt(d,er)}function ea(t,e){for(var r=-1,a=t.length,c=0,d=[];++r<a;){var w=t[r],C=e?e(w):w;if(!r||!Ae(C,A)){var A=C;d[c++]=w===0?0:w}}return d}function na(t){return typeof t=="number"?t:he(t)?xe:+t}function ce(t){if(typeof t=="string")return t;if(ht(t))return It(t,ce)+"";if(he(t))return Bo?Bo.call(t):"";var e=t+"";return e=="0"&&1/t==-Rt?"-0":e}function Qe(t,e,r){var a=-1,c=sr,d=t.length,w=!0,C=[],A=C;if(r)w=!1,c=mi;else if(d>=u){var O=e?null:rl(t);if(O)return ar(O);w=!1,c=Dn,A=new an}else A=e?[]:C;t:for(;++a<d;){var I=t[a],N=e?e(I):I;if(I=r||I!==0?I:0,w&&N===N){for(var K=A.length;K--;)if(A[K]===N)continue t;e&&A.push(N),C.push(I)}else c(A,N,r)||(A!==C&&A.push(N),C.push(I))}return C}function Hi(t,e){return e=tn(e,t),t=Oa(t,e),t==null||delete t[Ne(_e(e))]}function ra(t,e,r,a){return zn(t,e,r(cn(t,e)),a)}function Tr(t,e,r,a){for(var c=t.length,d=a?c:-1;(a?d--:++d<c)&&e(t[d],d,t););return r?me(t,a?0:d,a?d+1:c):me(t,a?d+1:0,a?c:d)}function ia(t,e){var r=t;return r instanceof vt&&(r=r.value()),_i(e,function(a,c){return c.func.apply(c.thisArg,Ve([a],c.args))},r)}function $i(t,e,r){var a=t.length;if(a<2)return a?Qe(t[0]):[];for(var c=-1,d=T(a);++c<a;)for(var w=t[c],C=-1;++C<a;)C!=c&&(d[c]=Gn(d[c]||w,t[C],e,r));return Qe(Kt(d,1),e,r)}function sa(t,e,r){for(var a=-1,c=t.length,d=e.length,w={};++a<c;){var C=a<d?e[a]:n;r(w,t[a],C)}return w}function zi(t){return Bt(t)?t:[]}function Xi(t){return typeof t=="function"?t:re}function tn(t,e){return ht(t)?t:ns(t,e)?[t]:Ba(St(t))}var Xf=dt;function en(t,e,r){var a=t.length;return r=r===n?a:r,!e&&r>=a?t:me(t,e,r)}var oa=Nh||function(t){return Wt.clearTimeout(t)};function aa(t,e){if(e)return t.slice();var r=t.length,a=xo?xo(r):new t.constructor(r);return t.copy(a),a}function Ji(t){var e=new t.constructor(t.byteLength);return new pr(e).set(new pr(t)),e}function Jf(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function Vf(t){var e=new t.constructor(t.source,Gs.exec(t));return e.lastIndex=t.lastIndex,e}function Yf(t){return Wn?kt(Wn.call(t)):{}}function ua(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ca(t,e){if(t!==e){var r=t!==n,a=t===null,c=t===t,d=he(t),w=e!==n,C=e===null,A=e===e,O=he(e);if(!C&&!O&&!d&&t>e||d&&w&&A&&!C&&!O||a&&w&&A||!r&&A||!c)return 1;if(!a&&!d&&!O&&t<e||O&&r&&c&&!a&&!d||C&&r&&c||!w&&c||!A)return-1}return 0}function jf(t,e,r){for(var a=-1,c=t.criteria,d=e.criteria,w=c.length,C=r.length;++a<w;){var A=ca(c[a],d[a]);if(A){if(a>=C)return A;var O=r[a];return A*(O=="desc"?-1:1)}}return t.index-e.index}function ha(t,e,r,a){for(var c=-1,d=t.length,w=r.length,C=-1,A=e.length,O=Ft(d-w,0),I=T(A+O),N=!a;++C<A;)I[C]=e[C];for(;++c<w;)(N||c<d)&&(I[r[c]]=t[c]);for(;O--;)I[C++]=t[c++];return I}function fa(t,e,r,a){for(var c=-1,d=t.length,w=-1,C=r.length,A=-1,O=e.length,I=Ft(d-C,0),N=T(I+O),K=!a;++c<I;)N[c]=t[c];for(var Y=c;++A<O;)N[Y+A]=e[A];for(;++w<C;)(K||c<d)&&(N[Y+r[w]]=t[c++]);return N}function te(t,e){var r=-1,a=t.length;for(e||(e=T(a));++r<a;)e[r]=t[r];return e}function Le(t,e,r,a){var c=!r;r||(r={});for(var d=-1,w=e.length;++d<w;){var C=e[d],A=a?a(r[C],t[C],C,r,t):n;A===n&&(A=t[C]),c?Me(r,C,A):Kn(r,C,A)}return r}function Zf(t,e){return Le(t,es(t),e)}function Qf(t,e){return Le(t,Ea(t),e)}function xr(t,e){return function(r,a){var c=ht(r)?rh:bf,d=e?e():{};return c(r,t,nt(a,2),d)}}function An(t){return dt(function(e,r){var a=-1,c=r.length,d=c>1?r[c-1]:n,w=c>2?r[2]:n;for(d=t.length>3&&typeof d=="function"?(c--,d):n,w&&Zt(r[0],r[1],w)&&(d=c<3?n:d,c=1),e=kt(e);++a<c;){var C=r[a];C&&t(e,C,a,d)}return e})}function la(t,e){return function(r,a){if(r==null)return r;if(!ee(r))return t(r,a);for(var c=r.length,d=e?c:-1,w=kt(r);(e?d--:++d<c)&&a(w[d],d,w)!==!1;);return r}}function pa(t){return function(e,r,a){for(var c=-1,d=kt(e),w=a(e),C=w.length;C--;){var A=w[t?C:++c];if(r(d[A],A,d)===!1)break}return e}}function tl(t,e,r){var a=e&x,c=Xn(t);function d(){var w=this&&this!==Wt&&this instanceof d?c:t;return w.apply(a?r:this,arguments)}return d}function da(t){return function(e){e=St(e);var r=mn(e)?Ce(e):n,a=r?r[0]:e.charAt(0),c=r?en(r,1).join(""):e.slice(1);return a[t]()+c}}function kn(t){return function(e){return _i(lu(fu(e).replace(Gc,"")),t,"")}}function Xn(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 r=En(t.prototype),a=t.apply(r,e);return Lt(a)?a:r}}function el(t,e,r){var a=Xn(t);function c(){for(var d=arguments.length,w=T(d),C=d,A=Tn(c);C--;)w[C]=arguments[C];var O=d<3&&w[0]!==A&&w[d-1]!==A?[]:Ye(w,A);if(d-=O.length,d<r)return _a(t,e,Rr,c.placeholder,n,w,O,n,n,r-d);var I=this&&this!==Wt&&this instanceof c?a:t;return ae(I,this,w)}return c}function ga(t){return function(e,r,a){var c=kt(e);if(!ee(e)){var d=nt(r,3);e=Mt(e),r=function(C){return d(c[C],C,c)}}var w=t(e,r,a);return w>-1?c[d?e[w]:w]:n}}function va(t){return We(function(e){var r=e.length,a=r,c=ve.prototype.thru;for(t&&e.reverse();a--;){var d=e[a];if(typeof d!="function")throw new ge(m);if(c&&!w&&Nr(d)=="wrapper")var w=new ve([],!0)}for(a=w?a:r;++a<r;){d=e[a];var C=Nr(d),A=C=="wrapper"?Qi(d):n;A&&rs(A[0])&&A[1]==(M|V|H|G)&&!A[4].length&&A[9]==1?w=w[Nr(A[0])].apply(w,A[3]):w=d.length==1&&rs(d)?w[C]():w.thru(d)}return function(){var O=arguments,I=O[0];if(w&&O.length==1&&ht(I))return w.plant(I).value();for(var N=0,K=r?e[N].apply(this,O):I;++N<r;)K=e[N].call(this,K);return K}})}function Rr(t,e,r,a,c,d,w,C,A,O){var I=e&M,N=e&x,K=e&W,Y=e&(V|ot),rt=e&L,pt=K?n:Xn(t);function it(){for(var gt=arguments.length,yt=T(gt),fe=gt;fe--;)yt[fe]=arguments[fe];if(Y)var Qt=Tn(it),le=lh(yt,Qt);if(a&&(yt=ha(yt,a,c,Y)),d&&(yt=fa(yt,d,w,Y)),gt-=le,Y&&gt<O){var Ut=Ye(yt,Qt);return _a(t,e,Rr,it.placeholder,r,yt,Ut,C,A,O-gt)}var ke=N?r:this,$e=K?ke[t]:t;return gt=yt.length,C?yt=bl(yt,C):rt&&gt>1&&yt.reverse(),I&&A<gt&&(yt.length=A),this&&this!==Wt&&this instanceof it&&($e=pt||Xn($e)),$e.apply(ke,yt)}return it}function ya(t,e){return function(r,a){return Rf(r,t,e(a),{})}}function Or(t,e){return function(r,a){var c;if(r===n&&a===n)return e;if(r!==n&&(c=r),a!==n){if(c===n)return a;typeof r=="string"||typeof a=="string"?(r=ce(r),a=ce(a)):(r=na(r),a=na(a)),c=t(r,a)}return c}}function Vi(t){return We(function(e){return e=It(e,ue(nt())),dt(function(r){var a=this;return t(e,function(c){return ae(c,a,r)})})})}function Ir(t,e){e=e===n?" ":ce(e);var r=e.length;if(r<2)return r?Ki(e,t):e;var a=Ki(e,yr(t/_n(e)));return mn(e)?en(Ce(a),0,t).join(""):a.slice(0,t)}function nl(t,e,r,a){var c=e&x,d=Xn(t);function w(){for(var C=-1,A=arguments.length,O=-1,I=a.length,N=T(I+A),K=this&&this!==Wt&&this instanceof w?d:t;++O<I;)N[O]=a[O];for(;A--;)N[O++]=arguments[++C];return ae(K,c?r:this,N)}return w}function ma(t){return function(e,r,a){return a&&typeof a!="number"&&Zt(e,r,a)&&(r=a=n),e=He(e),r===n?(r=e,e=0):r=He(r),a=a===n?e<r?1:-1:He(a),Wf(e,r,a,t)}}function Lr(t){return function(e,r){return typeof e=="string"&&typeof r=="string"||(e=we(e),r=we(r)),t(e,r)}}function _a(t,e,r,a,c,d,w,C,A,O){var I=e&V,N=I?w:n,K=I?n:w,Y=I?d:n,rt=I?n:d;e|=I?H:D,e&=~(I?D:H),e&st||(e&=~(x|W));var pt=[t,e,c,Y,N,rt,K,C,A,O],it=r.apply(n,pt);return rs(t)&&Ia(it,pt),it.placeholder=a,La(it,t,e)}function Yi(t){var e=Pt[t];return function(r,a){if(r=we(r),a=a==null?0:zt(lt(a),292),a&&Lo(r)){var c=(St(r)+"e").split("e"),d=e(c[0]+"e"+(+c[1]+a));return c=(St(d)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return e(r)}}var rl=Sn&&1/ar(new Sn([,-0]))[1]==Rt?function(t){return new Sn(t)}:ms;function wa(t){return function(e){var r=Xt(e);return r==Ot?ki(e):r==Yt?_h(e):fh(e,t(e))}}function qe(t,e,r,a,c,d,w,C){var A=e&W;if(!A&&typeof t!="function")throw new ge(m);var O=a?a.length:0;if(O||(e&=~(H|D),a=c=n),w=w===n?w:Ft(lt(w),0),C=C===n?C:lt(C),O-=c?c.length:0,e&D){var I=a,N=c;a=c=n}var K=A?n:Qi(t),Y=[t,e,r,a,c,I,N,d,w,C];if(K&&ml(Y,K),t=Y[0],e=Y[1],r=Y[2],a=Y[3],c=Y[4],C=Y[9]=Y[9]===n?A?0:t.length:Ft(Y[9]-O,0),!C&&e&(V|ot)&&(e&=~(V|ot)),!e||e==x)var rt=tl(t,e,r);else e==V||e==ot?rt=el(t,e,C):(e==H||e==(x|H))&&!c.length?rt=nl(t,e,r,a):rt=Rr.apply(n,Y);var pt=K?ta:Ia;return La(pt(rt,Y),t,e)}function ba(t,e,r,a){return t===n||Ae(t,bn[r])&&!Ct.call(a,r)?e:t}function Sa(t,e,r,a,c,d){return Lt(t)&&Lt(e)&&(d.set(e,t),Ar(t,e,n,Sa,d),d.delete(e)),t}function il(t){return Yn(t)?n:t}function Ca(t,e,r,a,c,d){var w=r&b,C=t.length,A=e.length;if(C!=A&&!(w&&A>C))return!1;var O=d.get(t),I=d.get(e);if(O&&I)return O==e&&I==t;var N=-1,K=!0,Y=r&k?new an:n;for(d.set(t,e),d.set(e,t);++N<C;){var rt=t[N],pt=e[N];if(a)var it=w?a(pt,rt,N,e,t,d):a(rt,pt,N,t,e,d);if(it!==n){if(it)continue;K=!1;break}if(Y){if(!wi(e,function(gt,yt){if(!Dn(Y,yt)&&(rt===gt||c(rt,gt,r,a,d)))return Y.push(yt)})){K=!1;break}}else if(!(rt===pt||c(rt,pt,r,a,d))){K=!1;break}}return d.delete(t),d.delete(e),K}function sl(t,e,r,a,c,d,w){switch(r){case gn:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xe:return!(t.byteLength!=e.byteLength||!d(new pr(t),new pr(e)));case Z:case tt:case Se:return Ae(+t,+e);case at:return t.name==e.name&&t.message==e.message;case Vt:case Re:return t==e+"";case Ot:var C=ki;case Yt:var A=a&b;if(C||(C=ar),t.size!=e.size&&!A)return!1;var O=w.get(t);if(O)return O==e;a|=k,w.set(t,e);var I=Ca(C(t),C(e),a,c,d,w);return w.delete(t),I;case Oe:if(Wn)return Wn.call(t)==Wn.call(e)}return!1}function ol(t,e,r,a,c,d){var w=r&b,C=ji(t),A=C.length,O=ji(e),I=O.length;if(A!=I&&!w)return!1;for(var N=A;N--;){var K=C[N];if(!(w?K in e:Ct.call(e,K)))return!1}var Y=d.get(t),rt=d.get(e);if(Y&&rt)return Y==e&&rt==t;var pt=!0;d.set(t,e),d.set(e,t);for(var it=w;++N<A;){K=C[N];var gt=t[K],yt=e[K];if(a)var fe=w?a(yt,gt,K,e,t,d):a(gt,yt,K,t,e,d);if(!(fe===n?gt===yt||c(gt,yt,r,a,d):fe)){pt=!1;break}it||(it=K=="constructor")}if(pt&&!it){var Qt=t.constructor,le=e.constructor;Qt!=le&&"constructor"in t&&"constructor"in e&&!(typeof Qt=="function"&&Qt instanceof Qt&&typeof le=="function"&&le instanceof le)&&(pt=!1)}return d.delete(t),d.delete(e),pt}function We(t){return ss(Ra(t,n,Fa),t+"")}function ji(t){return Go(t,Mt,es)}function Zi(t){return Go(t,ne,Ea)}var Qi=_r?function(t){return _r.get(t)}:ms;function Nr(t){for(var e=t.name+"",r=Cn[e],a=Ct.call(Cn,e)?r.length:0;a--;){var c=r[a],d=c.func;if(d==null||d==t)return c.name}return e}function Tn(t){var e=Ct.call(p,"placeholder")?p:t;return e.placeholder}function nt(){var t=p.iteratee||vs;return t=t===vs?zo:t,arguments.length?t(arguments[0],arguments[1]):t}function Br(t,e){var r=t.__data__;return dl(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ts(t){for(var e=Mt(t),r=e.length;r--;){var a=e[r],c=t[a];e[r]=[a,c,Ta(c)]}return e}function hn(t,e){var r=vh(t,e);return $o(r)?r:n}function al(t){var e=Ct.call(t,sn),r=t[sn];try{t[sn]=n;var a=!0}catch{}var c=fr.call(t);return a&&(e?t[sn]=r:delete t[sn]),c}var es=xi?function(t){return t==null?[]:(t=kt(t),Je(xi(t),function(e){return Oo.call(t,e)}))}:_s,Ea=xi?function(t){for(var e=[];t;)Ve(e,es(t)),t=dr(t);return e}:_s,Xt=jt;(Ri&&Xt(new Ri(new ArrayBuffer(1)))!=gn||Fn&&Xt(new Fn)!=Ot||Oi&&Xt(Oi.resolve())!=dn||Sn&&Xt(new Sn)!=Yt||Mn&&Xt(new Mn)!=De)&&(Xt=function(t){var e=jt(t),r=e==oe?t.constructor:n,a=r?fn(r):"";if(a)switch(a){case Kh:return gn;case Gh:return Ot;case Hh:return dn;case $h:return Yt;case zh:return De}return e});function ul(t,e,r){for(var a=-1,c=r.length;++a<c;){var d=r[a],w=d.size;switch(d.type){case"drop":t+=w;break;case"dropRight":e-=w;break;case"take":e=zt(e,t+w);break;case"takeRight":t=Ft(t,e-w);break}}return{start:t,end:e}}function cl(t){var e=t.match(dc);return e?e[1].split(gc):[]}function Aa(t,e,r){e=tn(e,t);for(var a=-1,c=e.length,d=!1;++a<c;){var w=Ne(e[a]);if(!(d=t!=null&&r(t,w)))break;t=t[w]}return d||++a!=c?d:(c=t==null?0:t.length,!!c&&Wr(c)&&Ke(w,c)&&(ht(t)||ln(t)))}function hl(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Ct.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function ka(t){return typeof t.constructor=="function"&&!Jn(t)?En(dr(t)):{}}function fl(t,e,r){var a=t.constructor;switch(e){case Xe:return Ji(t);case Z:case tt:return new a(+t);case gn:return Jf(t,r);case ti:case ei:case ni:case ri:case ii:case si:case oi:case ai:case ui:return ua(t,r);case Ot:return new a;case Se:case Re:return new a(t);case Vt:return Vf(t);case Yt:return new a;case Oe:return Yf(t)}}function ll(t,e){var r=e.length;if(!r)return t;var a=r-1;return e[a]=(r>1?"& ":"")+e[a],e=e.join(r>2?", ":" "),t.replace(pc,`{
14
14
  /* [wrapped with `+e+`] */
15
- `)}function pl(t){return ht(t)||ln(t)||!!(Io&&t&&t[Io])}function Ke(t,e){var r=typeof t;return e=e??ut,!!e&&(r=="number"||r!="symbol"&&Ac.test(t))&&t>-1&&t%1==0&&t<e}function Zt(t,e,r){if(!Lt(r))return!1;var a=typeof e;return(a=="number"?ee(r)&&Ke(e,r.length):a=="string"&&e in r)?ke(r[e],t):!1}function ns(t,e){if(ht(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||he(t)?!0:cc.test(t)||!uc.test(t)||e!=null&&t in Et(e)}function dl(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function rs(t){var e=Nr(t),r=p[e];if(typeof r!="function"||!(e in vt.prototype))return!1;if(t===r)return!0;var a=Qi(r);return!!a&&t===a[0]}function gl(t){return!!To&&To in t}var vl=cr?Ge:ws;function Jn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bn;return t===r}function Ta(t){return t===t&&!Lt(t)}function xa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==n||t in Et(r))}}function yl(t){var e=Mr(t,function(a){return r.size===v&&r.clear(),a}),r=e.cache;return e}function ml(t,e){var r=t[1],a=e[1],c=r|a,g=c<(x|W|M),w=a==M&&r==V||a==M&&r==G&&t[7].length<=e[8]||a==(M|G)&&e[7].length<=e[8]&&r==V;if(!(g||w))return t;a&x&&(t[2]=e[2],c|=r&x?0:st);var C=e[3];if(C){var k=t[3];t[3]=k?ha(k,C,e[4]):C,t[4]=k?Ye(t[3],_):e[4]}return C=e[5],C&&(k=t[5],t[5]=k?fa(k,C,e[6]):C,t[6]=k?Ye(t[5],_):e[6]),C=e[7],C&&(t[7]=C),a&M&&(t[8]=t[8]==null?e[8]:zt(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=c,t}function _l(t){var e=[];if(t!=null)for(var r in Et(t))e.push(r);return e}function wl(t){return fr.call(t)}function Ra(t,e,r){return e=Ft(e===n?t.length-1:e,0),function(){for(var a=arguments,c=-1,g=Ft(a.length-e,0),w=T(g);++c<g;)w[c]=a[e+c];c=-1;for(var C=T(e+1);++c<e;)C[c]=a[c];return C[e]=r(w),ae(t,this,C)}}function Oa(t,e){return e.length<2?t:cn(t,me(e,0,-1))}function bl(t,e){for(var r=t.length,a=zt(e.length,r),c=te(t);a--;){var g=e[a];t[a]=Ke(g,r)?c[g]:n}return t}function is(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Ia=Na(ta),Vn=Uh||function(t,e){return Wt.setTimeout(t,e)},ss=Na(Hf);function La(t,e,r){var a=e+"";return ss(t,ll(a,Sl(cl(a),r)))}function Na(t){var e=0,r=0;return function(){var a=Mh(),c=j-(a-r);if(r=a,c>0){if(++e>=Q)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Ur(t,e){var r=-1,a=t.length,c=a-1;for(e=e===n?a:e;++r<e;){var g=Wi(r,c),w=t[g];t[g]=t[r],t[r]=w}return t.length=e,t}var Ba=yl(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(hc,function(r,a,c,g){e.push(c?g.replace(mc,"$1"):a||r)}),e});function Ne(t){if(typeof t=="string"||he(t))return t;var e=t+"";return e=="0"&&1/t==-Rt?"-0":e}function fn(t){if(t!=null){try{return hr.call(t)}catch{}try{return t+""}catch{}}return""}function Sl(t,e){return de(J,function(r){var a="_."+r[0];e&r[1]&&!sr(t,a)&&t.push(a)}),t.sort()}function Ua(t){if(t instanceof vt)return t.clone();var e=new ve(t.__wrapped__,t.__chain__);return e.__actions__=te(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function Cl(t,e,r){(r?Zt(t,e,r):e===n)?e=1:e=Ft(lt(e),0);var a=t==null?0:t.length;if(!a||e<1)return[];for(var c=0,g=0,w=T(yr(a/e));c<a;)w[g++]=me(t,c,c+=e);return w}function Al(t){for(var e=-1,r=t==null?0:t.length,a=0,c=[];++e<r;){var g=t[e];g&&(c[a++]=g)}return c}function kl(){var t=arguments.length;if(!t)return[];for(var e=T(t-1),r=arguments[0],a=t;a--;)e[a-1]=arguments[a];return Ve(ht(r)?te(r):[r],Kt(e,1))}var El=dt(function(t,e){return Bt(t)?Gn(t,Kt(e,1,Bt,!0)):[]}),Tl=dt(function(t,e){var r=_e(e);return Bt(r)&&(r=n),Bt(t)?Gn(t,Kt(e,1,Bt,!0),nt(r,2)):[]}),xl=dt(function(t,e){var r=_e(e);return Bt(r)&&(r=n),Bt(t)?Gn(t,Kt(e,1,Bt,!0),n,r):[]});function Rl(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),me(t,e<0?0:e,a)):[]}function Ol(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),e=a-e,me(t,0,e<0?0:e)):[]}function Il(t,e){return t&&t.length?Tr(t,nt(e,3),!0,!0):[]}function Ll(t,e){return t&&t.length?Tr(t,nt(e,3),!0):[]}function Nl(t,e,r,a){var c=t==null?0:t.length;return c?(r&&typeof r!="number"&&Zt(t,e,r)&&(r=0,a=c),kf(t,e,r,a)):[]}function Da(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=r==null?0:lt(r);return c<0&&(c=Ft(a+c,0)),or(t,nt(e,3),c)}function Pa(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=a-1;return r!==n&&(c=lt(r),c=r<0?Ft(a+c,0):zt(c,a-1)),or(t,nt(e,3),c,!0)}function Fa(t){var e=t==null?0:t.length;return e?Kt(t,1):[]}function Bl(t){var e=t==null?0:t.length;return e?Kt(t,Rt):[]}function Ul(t,e){var r=t==null?0:t.length;return r?(e=e===n?1:lt(e),Kt(t,e)):[]}function Dl(t){for(var e=-1,r=t==null?0:t.length,a={};++e<r;){var c=t[e];a[c[0]]=c[1]}return a}function Ma(t){return t&&t.length?t[0]:n}function Pl(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=r==null?0:lt(r);return c<0&&(c=Ft(a+c,0)),yn(t,e,c)}function Fl(t){var e=t==null?0:t.length;return e?me(t,0,-1):[]}var Ml=dt(function(t){var e=It(t,zi);return e.length&&e[0]===t[0]?Di(e):[]}),ql=dt(function(t){var e=_e(t),r=It(t,zi);return e===_e(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Di(r,nt(e,2)):[]}),Wl=dt(function(t){var e=_e(t),r=It(t,zi);return e=typeof e=="function"?e:n,e&&r.pop(),r.length&&r[0]===t[0]?Di(r,n,e):[]});function Kl(t,e){return t==null?"":Ph.call(t,e)}function _e(t){var e=t==null?0:t.length;return e?t[e-1]:n}function Gl(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=a;return r!==n&&(c=lt(r),c=c<0?Ft(a+c,0):zt(c,a-1)),e===e?bh(t,e,c):or(t,_o,c,!0)}function Hl(t,e){return t&&t.length?Yo(t,lt(e)):n}var $l=dt(qa);function qa(t,e){return t&&t.length&&e&&e.length?qi(t,e):t}function zl(t,e,r){return t&&t.length&&e&&e.length?qi(t,e,nt(r,2)):t}function Xl(t,e,r){return t&&t.length&&e&&e.length?qi(t,e,n,r):t}var Jl=We(function(t,e){var r=t==null?0:t.length,a=Li(t,e);return Qo(t,It(e,function(c){return Ke(c,r)?+c:c}).sort(ca)),a});function Vl(t,e){var r=[];if(!(t&&t.length))return r;var a=-1,c=[],g=t.length;for(e=nt(e,3);++a<g;){var w=t[a];e(w,a,t)&&(r.push(w),c.push(a))}return Qo(t,c),r}function os(t){return t==null?t:Wh.call(t)}function Yl(t,e,r){var a=t==null?0:t.length;return a?(r&&typeof r!="number"&&Zt(t,e,r)?(e=0,r=a):(e=e==null?0:lt(e),r=r===n?a:lt(r)),me(t,e,r)):[]}function jl(t,e){return Er(t,e)}function Zl(t,e,r){return Gi(t,e,nt(r,2))}function Ql(t,e){var r=t==null?0:t.length;if(r){var a=Er(t,e);if(a<r&&ke(t[a],e))return a}return-1}function tp(t,e){return Er(t,e,!0)}function ep(t,e,r){return Gi(t,e,nt(r,2),!0)}function np(t,e){var r=t==null?0:t.length;if(r){var a=Er(t,e,!0)-1;if(ke(t[a],e))return a}return-1}function rp(t){return t&&t.length?ea(t):[]}function ip(t,e){return t&&t.length?ea(t,nt(e,2)):[]}function sp(t){var e=t==null?0:t.length;return e?me(t,1,e):[]}function op(t,e,r){return t&&t.length?(e=r||e===n?1:lt(e),me(t,0,e<0?0:e)):[]}function ap(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),e=a-e,me(t,e<0?0:e,a)):[]}function up(t,e){return t&&t.length?Tr(t,nt(e,3),!1,!0):[]}function cp(t,e){return t&&t.length?Tr(t,nt(e,3)):[]}var hp=dt(function(t){return Qe(Kt(t,1,Bt,!0))}),fp=dt(function(t){var e=_e(t);return Bt(e)&&(e=n),Qe(Kt(t,1,Bt,!0),nt(e,2))}),lp=dt(function(t){var e=_e(t);return e=typeof e=="function"?e:n,Qe(Kt(t,1,Bt,!0),n,e)});function pp(t){return t&&t.length?Qe(t):[]}function dp(t,e){return t&&t.length?Qe(t,nt(e,2)):[]}function gp(t,e){return e=typeof e=="function"?e:n,t&&t.length?Qe(t,n,e):[]}function as(t){if(!(t&&t.length))return[];var e=0;return t=Je(t,function(r){if(Bt(r))return e=Ft(r.length,e),!0}),Ai(e,function(r){return It(t,bi(r))})}function Wa(t,e){if(!(t&&t.length))return[];var r=as(t);return e==null?r:It(r,function(a){return ae(e,n,a)})}var vp=dt(function(t,e){return Bt(t)?Gn(t,e):[]}),yp=dt(function(t){return $i(Je(t,Bt))}),mp=dt(function(t){var e=_e(t);return Bt(e)&&(e=n),$i(Je(t,Bt),nt(e,2))}),_p=dt(function(t){var e=_e(t);return e=typeof e=="function"?e:n,$i(Je(t,Bt),n,e)}),wp=dt(as);function bp(t,e){return sa(t||[],e||[],Kn)}function Sp(t,e){return sa(t||[],e||[],zn)}var Cp=dt(function(t){var e=t.length,r=e>1?t[e-1]:n;return r=typeof r=="function"?(t.pop(),r):n,Wa(t,r)});function Ka(t){var e=p(t);return e.__chain__=!0,e}function Ap(t,e){return e(t),t}function Dr(t,e){return e(t)}var kp=We(function(t){var e=t.length,r=e?t[0]:0,a=this.__wrapped__,c=function(g){return Li(g,t)};return e>1||this.__actions__.length||!(a instanceof vt)||!Ke(r)?this.thru(c):(a=a.slice(r,+r+(e?1:0)),a.__actions__.push({func:Dr,args:[c],thisArg:n}),new ve(a,this.__chain__).thru(function(g){return e&&!g.length&&g.push(n),g}))});function Ep(){return Ka(this)}function Tp(){return new ve(this.value(),this.__chain__)}function xp(){this.__values__===n&&(this.__values__=nu(this.value()));var t=this.__index__>=this.__values__.length,e=t?n:this.__values__[this.__index__++];return{done:t,value:e}}function Rp(){return this}function Op(t){for(var e,r=this;r instanceof br;){var a=Ua(r);a.__index__=0,a.__values__=n,e?c.__wrapped__=a:e=a;var c=a;r=r.__wrapped__}return c.__wrapped__=t,e}function Ip(){var t=this.__wrapped__;if(t instanceof vt){var e=t;return this.__actions__.length&&(e=new vt(this)),e=e.reverse(),e.__actions__.push({func:Dr,args:[os],thisArg:n}),new ve(e,this.__chain__)}return this.thru(os)}function Lp(){return ia(this.__wrapped__,this.__actions__)}var Np=xr(function(t,e,r){Ct.call(t,r)?++t[r]:Me(t,r,1)});function Bp(t,e,r){var a=ht(t)?yo:Af;return r&&Zt(t,e,r)&&(e=n),a(t,nt(e,3))}function Up(t,e){var r=ht(t)?Je:Wo;return r(t,nt(e,3))}var Dp=ga(Da),Pp=ga(Pa);function Fp(t,e){return Kt(Pr(t,e),1)}function Mp(t,e){return Kt(Pr(t,e),Rt)}function qp(t,e,r){return r=r===n?1:lt(r),Kt(Pr(t,e),r)}function Ga(t,e){var r=ht(t)?de:Ze;return r(t,nt(e,3))}function Ha(t,e){var r=ht(t)?ih:qo;return r(t,nt(e,3))}var Wp=xr(function(t,e,r){Ct.call(t,r)?t[r].push(e):Me(t,r,[e])});function Kp(t,e,r,a){t=ee(t)?t:Rn(t),r=r&&!a?lt(r):0;var c=t.length;return r<0&&(r=Ft(c+r,0)),Kr(t)?r<=c&&t.indexOf(e,r)>-1:!!c&&yn(t,e,r)>-1}var Gp=dt(function(t,e,r){var a=-1,c=typeof e=="function",g=ee(t)?T(t.length):[];return Ze(t,function(w){g[++a]=c?ae(e,w,r):Hn(w,e,r)}),g}),Hp=xr(function(t,e,r){Me(t,r,e)});function Pr(t,e){var r=ht(t)?It:Xo;return r(t,nt(e,3))}function $p(t,e,r,a){return t==null?[]:(ht(e)||(e=e==null?[]:[e]),r=a?n:r,ht(r)||(r=r==null?[]:[r]),jo(t,e,r))}var zp=xr(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});function Xp(t,e,r){var a=ht(t)?_i:bo,c=arguments.length<3;return a(t,nt(e,4),r,c,Ze)}function Jp(t,e,r){var a=ht(t)?sh:bo,c=arguments.length<3;return a(t,nt(e,4),r,c,qo)}function Vp(t,e){var r=ht(t)?Je:Wo;return r(t,qr(nt(e,3)))}function Yp(t){var e=ht(t)?Do:Kf;return e(t)}function jp(t,e,r){(r?Zt(t,e,r):e===n)?e=1:e=lt(e);var a=ht(t)?_f:Gf;return a(t,e)}function Zp(t){var e=ht(t)?wf:$f;return e(t)}function Qp(t){if(t==null)return 0;if(ee(t))return Kr(t)?_n(t):t.length;var e=Xt(t);return e==Ot||e==Yt?t.size:Fi(t).length}function td(t,e,r){var a=ht(t)?wi:zf;return r&&Zt(t,e,r)&&(e=n),a(t,nt(e,3))}var ed=dt(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Zt(t,e[0],e[1])?e=[]:r>2&&Zt(e[0],e[1],e[2])&&(e=[e[0]]),jo(t,Kt(e,1),[])}),Fr=Bh||function(){return Wt.Date.now()};function nd(t,e){if(typeof e!="function")throw new ge(m);return t=lt(t),function(){if(--t<1)return e.apply(this,arguments)}}function $a(t,e,r){return e=r?n:e,e=t&&e==null?t.length:e,qe(t,M,n,n,n,n,e)}function za(t,e){var r;if(typeof e!="function")throw new ge(m);return t=lt(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var us=dt(function(t,e,r){var a=x;if(r.length){var c=Ye(r,Tn(us));a|=H}return qe(t,a,e,r,c)}),Xa=dt(function(t,e,r){var a=x|W;if(r.length){var c=Ye(r,Tn(Xa));a|=H}return qe(e,a,t,r,c)});function Ja(t,e,r){e=r?n:e;var a=qe(t,V,n,n,n,n,n,e);return a.placeholder=Ja.placeholder,a}function Va(t,e,r){e=r?n:e;var a=qe(t,ot,n,n,n,n,n,e);return a.placeholder=Va.placeholder,a}function Ya(t,e,r){var a,c,g,w,C,k,O=0,I=!1,N=!1,K=!0;if(typeof t!="function")throw new ge(m);e=we(e)||0,Lt(r)&&(I=!!r.leading,N="maxWait"in r,g=N?Ft(we(r.maxWait)||0,e):g,K="trailing"in r?!!r.trailing:K);function Y(Ut){var Ee=a,$e=c;return a=c=n,O=Ut,w=t.apply($e,Ee),w}function rt(Ut){return O=Ut,C=Vn(gt,e),I?Y(Ut):w}function pt(Ut){var Ee=Ut-k,$e=Ut-O,gu=e-Ee;return N?zt(gu,g-$e):gu}function it(Ut){var Ee=Ut-k,$e=Ut-O;return k===n||Ee>=e||Ee<0||N&&$e>=g}function gt(){var Ut=Fr();if(it(Ut))return yt(Ut);C=Vn(gt,pt(Ut))}function yt(Ut){return C=n,K&&a?Y(Ut):(a=c=n,w)}function fe(){C!==n&&oa(C),O=0,a=k=c=C=n}function Qt(){return C===n?w:yt(Fr())}function le(){var Ut=Fr(),Ee=it(Ut);if(a=arguments,c=this,k=Ut,Ee){if(C===n)return rt(k);if(N)return oa(C),C=Vn(gt,e),Y(k)}return C===n&&(C=Vn(gt,e)),w}return le.cancel=fe,le.flush=Qt,le}var rd=dt(function(t,e){return Mo(t,1,e)}),id=dt(function(t,e,r){return Mo(t,we(e)||0,r)});function sd(t){return qe(t,L)}function Mr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new ge(m);var r=function(){var a=arguments,c=e?e.apply(this,a):a[0],g=r.cache;if(g.has(c))return g.get(c);var w=t.apply(this,a);return r.cache=g.set(c,w)||g,w};return r.cache=new(Mr.Cache||Fe),r}Mr.Cache=Fe;function qr(t){if(typeof t!="function")throw new ge(m);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 od(t){return za(2,t)}var ad=Xf(function(t,e){e=e.length==1&&ht(e[0])?It(e[0],ue(nt())):It(Kt(e,1),ue(nt()));var r=e.length;return dt(function(a){for(var c=-1,g=zt(a.length,r);++c<g;)a[c]=e[c].call(this,a[c]);return ae(t,this,a)})}),cs=dt(function(t,e){var r=Ye(e,Tn(cs));return qe(t,H,n,e,r)}),ja=dt(function(t,e){var r=Ye(e,Tn(ja));return qe(t,D,n,e,r)}),ud=We(function(t,e){return qe(t,G,n,n,n,e)});function cd(t,e){if(typeof t!="function")throw new ge(m);return e=e===n?e:lt(e),dt(t,e)}function hd(t,e){if(typeof t!="function")throw new ge(m);return e=e==null?0:Ft(lt(e),0),dt(function(r){var a=r[e],c=en(r,0,e);return a&&Ve(c,a),ae(t,this,c)})}function fd(t,e,r){var a=!0,c=!0;if(typeof t!="function")throw new ge(m);return Lt(r)&&(a="leading"in r?!!r.leading:a,c="trailing"in r?!!r.trailing:c),Ya(t,e,{leading:a,maxWait:e,trailing:c})}function ld(t){return $a(t,1)}function pd(t,e){return cs(Xi(e),t)}function dd(){if(!arguments.length)return[];var t=arguments[0];return ht(t)?t:[t]}function gd(t){return ye(t,f)}function vd(t,e){return e=typeof e=="function"?e:n,ye(t,f,e)}function yd(t){return ye(t,y|f)}function md(t,e){return e=typeof e=="function"?e:n,ye(t,y|f,e)}function _d(t,e){return e==null||Fo(t,e,Mt(e))}function ke(t,e){return t===e||t!==t&&e!==e}var wd=Lr(Ui),bd=Lr(function(t,e){return t>=e}),ln=Ho(function(){return arguments}())?Ho:function(t){return Nt(t)&&Ct.call(t,"callee")&&!Oo.call(t,"callee")},ht=T.isArray,Sd=ho?ue(ho):Of;function ee(t){return t!=null&&Wr(t.length)&&!Ge(t)}function Bt(t){return Nt(t)&&ee(t)}function Cd(t){return t===!0||t===!1||Nt(t)&&jt(t)==Z}var nn=Dh||ws,Ad=fo?ue(fo):If;function kd(t){return Nt(t)&&t.nodeType===1&&!Yn(t)}function Ed(t){if(t==null)return!0;if(ee(t)&&(ht(t)||typeof t=="string"||typeof t.splice=="function"||nn(t)||xn(t)||ln(t)))return!t.length;var e=Xt(t);if(e==Ot||e==Yt)return!t.size;if(Jn(t))return!Fi(t).length;for(var r in t)if(Ct.call(t,r))return!1;return!0}function Td(t,e){return $n(t,e)}function xd(t,e,r){r=typeof r=="function"?r:n;var a=r?r(t,e):n;return a===n?$n(t,e,n,r):!!a}function hs(t){if(!Nt(t))return!1;var e=jt(t);return e==at||e==z||typeof t.message=="string"&&typeof t.name=="string"&&!Yn(t)}function Rd(t){return typeof t=="number"&&Lo(t)}function Ge(t){if(!Lt(t))return!1;var e=jt(t);return e==bt||e==$t||e==P||e==Nn}function Za(t){return typeof t=="number"&&t==lt(t)}function Wr(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 Nt(t){return t!=null&&typeof t=="object"}var Qa=lo?ue(lo):Nf;function Od(t,e){return t===e||Pi(t,e,ts(e))}function Id(t,e,r){return r=typeof r=="function"?r:n,Pi(t,e,ts(e),r)}function Ld(t){return tu(t)&&t!=+t}function Nd(t){if(vl(t))throw new ct(h);return $o(t)}function Bd(t){return t===null}function Ud(t){return t==null}function tu(t){return typeof t=="number"||Nt(t)&&jt(t)==Se}function Yn(t){if(!Nt(t)||jt(t)!=oe)return!1;var e=dr(t);if(e===null)return!0;var r=Ct.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&hr.call(r)==Oh}var fs=po?ue(po):Bf;function Dd(t){return Za(t)&&t>=-ut&&t<=ut}var eu=go?ue(go):Uf;function Kr(t){return typeof t=="string"||!ht(t)&&Nt(t)&&jt(t)==Re}function he(t){return typeof t=="symbol"||Nt(t)&&jt(t)==Oe}var xn=vo?ue(vo):Df;function Pd(t){return t===n}function Fd(t){return Nt(t)&&Xt(t)==De}function Md(t){return Nt(t)&&jt(t)==Un}var qd=Lr(Mi),Wd=Lr(function(t,e){return t<=e});function nu(t){if(!t)return[];if(ee(t))return Kr(t)?Ce(t):te(t);if(Pn&&t[Pn])return mh(t[Pn]());var e=Xt(t),r=e==Ot?Ei:e==Yt?ar:Rn;return r(t)}function He(t){if(!t)return t===0?t:0;if(t=we(t),t===Rt||t===-Rt){var e=t<0?-1:1;return e*Ht}return t===t?t:0}function lt(t){var e=He(t),r=e%1;return e===e?r?e-r:e:0}function ru(t){return t?un(lt(t),0,se):0}function we(t){if(typeof t=="number")return t;if(he(t))return xe;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=So(t);var r=bc.test(t);return r||Cc.test(t)?eh(t.slice(2),r?2:8):wc.test(t)?xe:+t}function iu(t){return Le(t,ne(t))}function Kd(t){return t?un(lt(t),-ut,ut):t===0?t:0}function St(t){return t==null?"":ce(t)}var Gd=kn(function(t,e){if(Jn(e)||ee(e)){Le(e,Mt(e),t);return}for(var r in e)Ct.call(e,r)&&Kn(t,r,e[r])}),su=kn(function(t,e){Le(e,ne(e),t)}),Gr=kn(function(t,e,r,a){Le(e,ne(e),t,a)}),Hd=kn(function(t,e,r,a){Le(e,Mt(e),t,a)}),$d=We(Li);function zd(t,e){var r=An(t);return e==null?r:Po(r,e)}var Xd=dt(function(t,e){t=Et(t);var r=-1,a=e.length,c=a>2?e[2]:n;for(c&&Zt(e[0],e[1],c)&&(a=1);++r<a;)for(var g=e[r],w=ne(g),C=-1,k=w.length;++C<k;){var O=w[C],I=t[O];(I===n||ke(I,bn[O])&&!Ct.call(t,O))&&(t[O]=g[O])}return t}),Jd=dt(function(t){return t.push(n,Sa),ae(ou,n,t)});function Vd(t,e){return mo(t,nt(e,3),Ie)}function Yd(t,e){return mo(t,nt(e,3),Bi)}function jd(t,e){return t==null?t:Ni(t,nt(e,3),ne)}function Zd(t,e){return t==null?t:Ko(t,nt(e,3),ne)}function Qd(t,e){return t&&Ie(t,nt(e,3))}function tg(t,e){return t&&Bi(t,nt(e,3))}function eg(t){return t==null?[]:Ar(t,Mt(t))}function ng(t){return t==null?[]:Ar(t,ne(t))}function ls(t,e,r){var a=t==null?n:cn(t,e);return a===n?r:a}function rg(t,e){return t!=null&&ka(t,e,Ef)}function ps(t,e){return t!=null&&ka(t,e,Tf)}var ig=ya(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=fr.call(e)),t[e]=r},gs(re)),sg=ya(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=fr.call(e)),Ct.call(t,e)?t[e].push(r):t[e]=[r]},nt),og=dt(Hn);function Mt(t){return ee(t)?Uo(t):Fi(t)}function ne(t){return ee(t)?Uo(t,!0):Pf(t)}function ag(t,e){var r={};return e=nt(e,3),Ie(t,function(a,c,g){Me(r,e(a,c,g),a)}),r}function ug(t,e){var r={};return e=nt(e,3),Ie(t,function(a,c,g){Me(r,c,e(a,c,g))}),r}var cg=kn(function(t,e,r){kr(t,e,r)}),ou=kn(function(t,e,r,a){kr(t,e,r,a)}),hg=We(function(t,e){var r={};if(t==null)return r;var a=!1;e=It(e,function(g){return g=tn(g,t),a||(a=g.length>1),g}),Le(t,Zi(t),r),a&&(r=ye(r,y|l|f,il));for(var c=e.length;c--;)Hi(r,e[c]);return r});function fg(t,e){return au(t,qr(nt(e)))}var lg=We(function(t,e){return t==null?{}:Mf(t,e)});function au(t,e){if(t==null)return{};var r=It(Zi(t),function(a){return[a]});return e=nt(e),Zo(t,r,function(a,c){return e(a,c[0])})}function pg(t,e,r){e=tn(e,t);var a=-1,c=e.length;for(c||(c=1,t=n);++a<c;){var g=t==null?n:t[Ne(e[a])];g===n&&(a=c,g=r),t=Ge(g)?g.call(t):g}return t}function dg(t,e,r){return t==null?t:zn(t,e,r)}function gg(t,e,r,a){return a=typeof a=="function"?a:n,t==null?t:zn(t,e,r,a)}var uu=wa(Mt),cu=wa(ne);function vg(t,e,r){var a=ht(t),c=a||nn(t)||xn(t);if(e=nt(e,4),r==null){var g=t&&t.constructor;c?r=a?new g:[]:Lt(t)?r=Ge(g)?An(dr(t)):{}:r={}}return(c?de:Ie)(t,function(w,C,k){return e(r,w,C,k)}),r}function yg(t,e){return t==null?!0:Hi(t,e)}function mg(t,e,r){return t==null?t:ra(t,e,Xi(r))}function _g(t,e,r,a){return a=typeof a=="function"?a:n,t==null?t:ra(t,e,Xi(r),a)}function Rn(t){return t==null?[]:ki(t,Mt(t))}function wg(t){return t==null?[]:ki(t,ne(t))}function bg(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=we(r),r=r===r?r:0),e!==n&&(e=we(e),e=e===e?e:0),un(we(t),e,r)}function Sg(t,e,r){return e=He(e),r===n?(r=e,e=0):r=He(r),t=we(t),xf(t,e,r)}function Cg(t,e,r){if(r&&typeof r!="boolean"&&Zt(t,e,r)&&(e=r=n),r===n&&(typeof e=="boolean"?(r=e,e=n):typeof t=="boolean"&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=He(t),e===n?(e=t,t=0):e=He(e)),t>e){var a=t;t=e,e=a}if(r||t%1||e%1){var c=No();return zt(t+c*(e-t+th("1e-"+((c+"").length-1))),e)}return Wi(t,e)}var Ag=En(function(t,e,r){return e=e.toLowerCase(),t+(r?hu(e):e)});function hu(t){return ds(St(t).toLowerCase())}function fu(t){return t=St(t),t&&t.replace(kc,ph).replace(Hc,"")}function kg(t,e,r){t=St(t),e=ce(e);var a=t.length;r=r===n?a:un(lt(r),0,a);var c=r;return r-=e.length,r>=0&&t.slice(r,c)==e}function Eg(t){return t=St(t),t&&sc.test(t)?t.replace(Ws,dh):t}function Tg(t){return t=St(t),t&&fc.test(t)?t.replace(ci,"\\$&"):t}var xg=En(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Rg=En(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Og=da("toLowerCase");function Ig(t,e,r){t=St(t),e=lt(e);var a=e?_n(t):0;if(!e||a>=e)return t;var c=(e-a)/2;return Ir(mr(c),r)+t+Ir(yr(c),r)}function Lg(t,e,r){t=St(t),e=lt(e);var a=e?_n(t):0;return e&&a<e?t+Ir(e-a,r):t}function Ng(t,e,r){t=St(t),e=lt(e);var a=e?_n(t):0;return e&&a<e?Ir(e-a,r)+t:t}function Bg(t,e,r){return r||e==null?e=0:e&&(e=+e),qh(St(t).replace(hi,""),e||0)}function Ug(t,e,r){return(r?Zt(t,e,r):e===n)?e=1:e=lt(e),Ki(St(t),e)}function Dg(){var t=arguments,e=St(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var Pg=En(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});function Fg(t,e,r){return r&&typeof r!="number"&&Zt(t,e,r)&&(e=r=n),r=r===n?se:r>>>0,r?(t=St(t),t&&(typeof e=="string"||e!=null&&!fs(e))&&(e=ce(e),!e&&mn(t))?en(Ce(t),0,r):t.split(e,r)):[]}var Mg=En(function(t,e,r){return t+(r?" ":"")+ds(e)});function qg(t,e,r){return t=St(t),r=r==null?0:un(lt(r),0,t.length),e=ce(e),t.slice(r,r+e.length)==e}function Wg(t,e,r){var a=p.templateSettings;r&&Zt(t,e,r)&&(e=n),t=St(t),e=Gr({},e,a,ba);var c=Gr({},e.imports,a.imports,ba),g=Mt(c),w=ki(c,g),C,k,O=0,I=e.interpolate||nr,N="__p += '",K=Ti((e.escape||nr).source+"|"+I.source+"|"+(I===Ks?_c:nr).source+"|"+(e.evaluate||nr).source+"|$","g"),Y="//# sourceURL="+(Ct.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vc+"]")+`
16
- `;t.replace(K,function(it,gt,yt,fe,Qt,le){return yt||(yt=fe),N+=t.slice(O,le).replace(Ec,gh),gt&&(C=!0,N+=`' +
15
+ `)}function pl(t){return ht(t)||ln(t)||!!(Io&&t&&t[Io])}function Ke(t,e){var r=typeof t;return e=e??ut,!!e&&(r=="number"||r!="symbol"&&Ec.test(t))&&t>-1&&t%1==0&&t<e}function Zt(t,e,r){if(!Lt(r))return!1;var a=typeof e;return(a=="number"?ee(r)&&Ke(e,r.length):a=="string"&&e in r)?Ae(r[e],t):!1}function ns(t,e){if(ht(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||he(t)?!0:cc.test(t)||!uc.test(t)||e!=null&&t in kt(e)}function dl(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function rs(t){var e=Nr(t),r=p[e];if(typeof r!="function"||!(e in vt.prototype))return!1;if(t===r)return!0;var a=Qi(r);return!!a&&t===a[0]}function gl(t){return!!To&&To in t}var vl=cr?Ge:ws;function Jn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bn;return t===r}function Ta(t){return t===t&&!Lt(t)}function xa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==n||t in kt(r))}}function yl(t){var e=Mr(t,function(a){return r.size===v&&r.clear(),a}),r=e.cache;return e}function ml(t,e){var r=t[1],a=e[1],c=r|a,d=c<(x|W|M),w=a==M&&r==V||a==M&&r==G&&t[7].length<=e[8]||a==(M|G)&&e[7].length<=e[8]&&r==V;if(!(d||w))return t;a&x&&(t[2]=e[2],c|=r&x?0:st);var C=e[3];if(C){var A=t[3];t[3]=A?ha(A,C,e[4]):C,t[4]=A?Ye(t[3],_):e[4]}return C=e[5],C&&(A=t[5],t[5]=A?fa(A,C,e[6]):C,t[6]=A?Ye(t[5],_):e[6]),C=e[7],C&&(t[7]=C),a&M&&(t[8]=t[8]==null?e[8]:zt(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=c,t}function _l(t){var e=[];if(t!=null)for(var r in kt(t))e.push(r);return e}function wl(t){return fr.call(t)}function Ra(t,e,r){return e=Ft(e===n?t.length-1:e,0),function(){for(var a=arguments,c=-1,d=Ft(a.length-e,0),w=T(d);++c<d;)w[c]=a[e+c];c=-1;for(var C=T(e+1);++c<e;)C[c]=a[c];return C[e]=r(w),ae(t,this,C)}}function Oa(t,e){return e.length<2?t:cn(t,me(e,0,-1))}function bl(t,e){for(var r=t.length,a=zt(e.length,r),c=te(t);a--;){var d=e[a];t[a]=Ke(d,r)?c[d]:n}return t}function is(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Ia=Na(ta),Vn=Uh||function(t,e){return Wt.setTimeout(t,e)},ss=Na(Hf);function La(t,e,r){var a=e+"";return ss(t,ll(a,Sl(cl(a),r)))}function Na(t){var e=0,r=0;return function(){var a=Mh(),c=j-(a-r);if(r=a,c>0){if(++e>=Q)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Ur(t,e){var r=-1,a=t.length,c=a-1;for(e=e===n?a:e;++r<e;){var d=Wi(r,c),w=t[d];t[d]=t[r],t[r]=w}return t.length=e,t}var Ba=yl(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(hc,function(r,a,c,d){e.push(c?d.replace(mc,"$1"):a||r)}),e});function Ne(t){if(typeof t=="string"||he(t))return t;var e=t+"";return e=="0"&&1/t==-Rt?"-0":e}function fn(t){if(t!=null){try{return hr.call(t)}catch{}try{return t+""}catch{}}return""}function Sl(t,e){return de(J,function(r){var a="_."+r[0];e&r[1]&&!sr(t,a)&&t.push(a)}),t.sort()}function Ua(t){if(t instanceof vt)return t.clone();var e=new ve(t.__wrapped__,t.__chain__);return e.__actions__=te(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function Cl(t,e,r){(r?Zt(t,e,r):e===n)?e=1:e=Ft(lt(e),0);var a=t==null?0:t.length;if(!a||e<1)return[];for(var c=0,d=0,w=T(yr(a/e));c<a;)w[d++]=me(t,c,c+=e);return w}function El(t){for(var e=-1,r=t==null?0:t.length,a=0,c=[];++e<r;){var d=t[e];d&&(c[a++]=d)}return c}function Al(){var t=arguments.length;if(!t)return[];for(var e=T(t-1),r=arguments[0],a=t;a--;)e[a-1]=arguments[a];return Ve(ht(r)?te(r):[r],Kt(e,1))}var kl=dt(function(t,e){return Bt(t)?Gn(t,Kt(e,1,Bt,!0)):[]}),Tl=dt(function(t,e){var r=_e(e);return Bt(r)&&(r=n),Bt(t)?Gn(t,Kt(e,1,Bt,!0),nt(r,2)):[]}),xl=dt(function(t,e){var r=_e(e);return Bt(r)&&(r=n),Bt(t)?Gn(t,Kt(e,1,Bt,!0),n,r):[]});function Rl(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),me(t,e<0?0:e,a)):[]}function Ol(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),e=a-e,me(t,0,e<0?0:e)):[]}function Il(t,e){return t&&t.length?Tr(t,nt(e,3),!0,!0):[]}function Ll(t,e){return t&&t.length?Tr(t,nt(e,3),!0):[]}function Nl(t,e,r,a){var c=t==null?0:t.length;return c?(r&&typeof r!="number"&&Zt(t,e,r)&&(r=0,a=c),Af(t,e,r,a)):[]}function Da(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=r==null?0:lt(r);return c<0&&(c=Ft(a+c,0)),or(t,nt(e,3),c)}function Pa(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=a-1;return r!==n&&(c=lt(r),c=r<0?Ft(a+c,0):zt(c,a-1)),or(t,nt(e,3),c,!0)}function Fa(t){var e=t==null?0:t.length;return e?Kt(t,1):[]}function Bl(t){var e=t==null?0:t.length;return e?Kt(t,Rt):[]}function Ul(t,e){var r=t==null?0:t.length;return r?(e=e===n?1:lt(e),Kt(t,e)):[]}function Dl(t){for(var e=-1,r=t==null?0:t.length,a={};++e<r;){var c=t[e];a[c[0]]=c[1]}return a}function Ma(t){return t&&t.length?t[0]:n}function Pl(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=r==null?0:lt(r);return c<0&&(c=Ft(a+c,0)),yn(t,e,c)}function Fl(t){var e=t==null?0:t.length;return e?me(t,0,-1):[]}var Ml=dt(function(t){var e=It(t,zi);return e.length&&e[0]===t[0]?Di(e):[]}),ql=dt(function(t){var e=_e(t),r=It(t,zi);return e===_e(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Di(r,nt(e,2)):[]}),Wl=dt(function(t){var e=_e(t),r=It(t,zi);return e=typeof e=="function"?e:n,e&&r.pop(),r.length&&r[0]===t[0]?Di(r,n,e):[]});function Kl(t,e){return t==null?"":Ph.call(t,e)}function _e(t){var e=t==null?0:t.length;return e?t[e-1]:n}function Gl(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=a;return r!==n&&(c=lt(r),c=c<0?Ft(a+c,0):zt(c,a-1)),e===e?bh(t,e,c):or(t,_o,c,!0)}function Hl(t,e){return t&&t.length?Yo(t,lt(e)):n}var $l=dt(qa);function qa(t,e){return t&&t.length&&e&&e.length?qi(t,e):t}function zl(t,e,r){return t&&t.length&&e&&e.length?qi(t,e,nt(r,2)):t}function Xl(t,e,r){return t&&t.length&&e&&e.length?qi(t,e,n,r):t}var Jl=We(function(t,e){var r=t==null?0:t.length,a=Li(t,e);return Qo(t,It(e,function(c){return Ke(c,r)?+c:c}).sort(ca)),a});function Vl(t,e){var r=[];if(!(t&&t.length))return r;var a=-1,c=[],d=t.length;for(e=nt(e,3);++a<d;){var w=t[a];e(w,a,t)&&(r.push(w),c.push(a))}return Qo(t,c),r}function os(t){return t==null?t:Wh.call(t)}function Yl(t,e,r){var a=t==null?0:t.length;return a?(r&&typeof r!="number"&&Zt(t,e,r)?(e=0,r=a):(e=e==null?0:lt(e),r=r===n?a:lt(r)),me(t,e,r)):[]}function jl(t,e){return kr(t,e)}function Zl(t,e,r){return Gi(t,e,nt(r,2))}function Ql(t,e){var r=t==null?0:t.length;if(r){var a=kr(t,e);if(a<r&&Ae(t[a],e))return a}return-1}function tp(t,e){return kr(t,e,!0)}function ep(t,e,r){return Gi(t,e,nt(r,2),!0)}function np(t,e){var r=t==null?0:t.length;if(r){var a=kr(t,e,!0)-1;if(Ae(t[a],e))return a}return-1}function rp(t){return t&&t.length?ea(t):[]}function ip(t,e){return t&&t.length?ea(t,nt(e,2)):[]}function sp(t){var e=t==null?0:t.length;return e?me(t,1,e):[]}function op(t,e,r){return t&&t.length?(e=r||e===n?1:lt(e),me(t,0,e<0?0:e)):[]}function ap(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),e=a-e,me(t,e<0?0:e,a)):[]}function up(t,e){return t&&t.length?Tr(t,nt(e,3),!1,!0):[]}function cp(t,e){return t&&t.length?Tr(t,nt(e,3)):[]}var hp=dt(function(t){return Qe(Kt(t,1,Bt,!0))}),fp=dt(function(t){var e=_e(t);return Bt(e)&&(e=n),Qe(Kt(t,1,Bt,!0),nt(e,2))}),lp=dt(function(t){var e=_e(t);return e=typeof e=="function"?e:n,Qe(Kt(t,1,Bt,!0),n,e)});function pp(t){return t&&t.length?Qe(t):[]}function dp(t,e){return t&&t.length?Qe(t,nt(e,2)):[]}function gp(t,e){return e=typeof e=="function"?e:n,t&&t.length?Qe(t,n,e):[]}function as(t){if(!(t&&t.length))return[];var e=0;return t=Je(t,function(r){if(Bt(r))return e=Ft(r.length,e),!0}),Ei(e,function(r){return It(t,bi(r))})}function Wa(t,e){if(!(t&&t.length))return[];var r=as(t);return e==null?r:It(r,function(a){return ae(e,n,a)})}var vp=dt(function(t,e){return Bt(t)?Gn(t,e):[]}),yp=dt(function(t){return $i(Je(t,Bt))}),mp=dt(function(t){var e=_e(t);return Bt(e)&&(e=n),$i(Je(t,Bt),nt(e,2))}),_p=dt(function(t){var e=_e(t);return e=typeof e=="function"?e:n,$i(Je(t,Bt),n,e)}),wp=dt(as);function bp(t,e){return sa(t||[],e||[],Kn)}function Sp(t,e){return sa(t||[],e||[],zn)}var Cp=dt(function(t){var e=t.length,r=e>1?t[e-1]:n;return r=typeof r=="function"?(t.pop(),r):n,Wa(t,r)});function Ka(t){var e=p(t);return e.__chain__=!0,e}function Ep(t,e){return e(t),t}function Dr(t,e){return e(t)}var Ap=We(function(t){var e=t.length,r=e?t[0]:0,a=this.__wrapped__,c=function(d){return Li(d,t)};return e>1||this.__actions__.length||!(a instanceof vt)||!Ke(r)?this.thru(c):(a=a.slice(r,+r+(e?1:0)),a.__actions__.push({func:Dr,args:[c],thisArg:n}),new ve(a,this.__chain__).thru(function(d){return e&&!d.length&&d.push(n),d}))});function kp(){return Ka(this)}function Tp(){return new ve(this.value(),this.__chain__)}function xp(){this.__values__===n&&(this.__values__=nu(this.value()));var t=this.__index__>=this.__values__.length,e=t?n:this.__values__[this.__index__++];return{done:t,value:e}}function Rp(){return this}function Op(t){for(var e,r=this;r instanceof br;){var a=Ua(r);a.__index__=0,a.__values__=n,e?c.__wrapped__=a:e=a;var c=a;r=r.__wrapped__}return c.__wrapped__=t,e}function Ip(){var t=this.__wrapped__;if(t instanceof vt){var e=t;return this.__actions__.length&&(e=new vt(this)),e=e.reverse(),e.__actions__.push({func:Dr,args:[os],thisArg:n}),new ve(e,this.__chain__)}return this.thru(os)}function Lp(){return ia(this.__wrapped__,this.__actions__)}var Np=xr(function(t,e,r){Ct.call(t,r)?++t[r]:Me(t,r,1)});function Bp(t,e,r){var a=ht(t)?yo:Ef;return r&&Zt(t,e,r)&&(e=n),a(t,nt(e,3))}function Up(t,e){var r=ht(t)?Je:Wo;return r(t,nt(e,3))}var Dp=ga(Da),Pp=ga(Pa);function Fp(t,e){return Kt(Pr(t,e),1)}function Mp(t,e){return Kt(Pr(t,e),Rt)}function qp(t,e,r){return r=r===n?1:lt(r),Kt(Pr(t,e),r)}function Ga(t,e){var r=ht(t)?de:Ze;return r(t,nt(e,3))}function Ha(t,e){var r=ht(t)?ih:qo;return r(t,nt(e,3))}var Wp=xr(function(t,e,r){Ct.call(t,r)?t[r].push(e):Me(t,r,[e])});function Kp(t,e,r,a){t=ee(t)?t:Rn(t),r=r&&!a?lt(r):0;var c=t.length;return r<0&&(r=Ft(c+r,0)),Kr(t)?r<=c&&t.indexOf(e,r)>-1:!!c&&yn(t,e,r)>-1}var Gp=dt(function(t,e,r){var a=-1,c=typeof e=="function",d=ee(t)?T(t.length):[];return Ze(t,function(w){d[++a]=c?ae(e,w,r):Hn(w,e,r)}),d}),Hp=xr(function(t,e,r){Me(t,r,e)});function Pr(t,e){var r=ht(t)?It:Xo;return r(t,nt(e,3))}function $p(t,e,r,a){return t==null?[]:(ht(e)||(e=e==null?[]:[e]),r=a?n:r,ht(r)||(r=r==null?[]:[r]),jo(t,e,r))}var zp=xr(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});function Xp(t,e,r){var a=ht(t)?_i:bo,c=arguments.length<3;return a(t,nt(e,4),r,c,Ze)}function Jp(t,e,r){var a=ht(t)?sh:bo,c=arguments.length<3;return a(t,nt(e,4),r,c,qo)}function Vp(t,e){var r=ht(t)?Je:Wo;return r(t,qr(nt(e,3)))}function Yp(t){var e=ht(t)?Do:Kf;return e(t)}function jp(t,e,r){(r?Zt(t,e,r):e===n)?e=1:e=lt(e);var a=ht(t)?_f:Gf;return a(t,e)}function Zp(t){var e=ht(t)?wf:$f;return e(t)}function Qp(t){if(t==null)return 0;if(ee(t))return Kr(t)?_n(t):t.length;var e=Xt(t);return e==Ot||e==Yt?t.size:Fi(t).length}function td(t,e,r){var a=ht(t)?wi:zf;return r&&Zt(t,e,r)&&(e=n),a(t,nt(e,3))}var ed=dt(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Zt(t,e[0],e[1])?e=[]:r>2&&Zt(e[0],e[1],e[2])&&(e=[e[0]]),jo(t,Kt(e,1),[])}),Fr=Bh||function(){return Wt.Date.now()};function nd(t,e){if(typeof e!="function")throw new ge(m);return t=lt(t),function(){if(--t<1)return e.apply(this,arguments)}}function $a(t,e,r){return e=r?n:e,e=t&&e==null?t.length:e,qe(t,M,n,n,n,n,e)}function za(t,e){var r;if(typeof e!="function")throw new ge(m);return t=lt(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var us=dt(function(t,e,r){var a=x;if(r.length){var c=Ye(r,Tn(us));a|=H}return qe(t,a,e,r,c)}),Xa=dt(function(t,e,r){var a=x|W;if(r.length){var c=Ye(r,Tn(Xa));a|=H}return qe(e,a,t,r,c)});function Ja(t,e,r){e=r?n:e;var a=qe(t,V,n,n,n,n,n,e);return a.placeholder=Ja.placeholder,a}function Va(t,e,r){e=r?n:e;var a=qe(t,ot,n,n,n,n,n,e);return a.placeholder=Va.placeholder,a}function Ya(t,e,r){var a,c,d,w,C,A,O=0,I=!1,N=!1,K=!0;if(typeof t!="function")throw new ge(m);e=we(e)||0,Lt(r)&&(I=!!r.leading,N="maxWait"in r,d=N?Ft(we(r.maxWait)||0,e):d,K="trailing"in r?!!r.trailing:K);function Y(Ut){var ke=a,$e=c;return a=c=n,O=Ut,w=t.apply($e,ke),w}function rt(Ut){return O=Ut,C=Vn(gt,e),I?Y(Ut):w}function pt(Ut){var ke=Ut-A,$e=Ut-O,gu=e-ke;return N?zt(gu,d-$e):gu}function it(Ut){var ke=Ut-A,$e=Ut-O;return A===n||ke>=e||ke<0||N&&$e>=d}function gt(){var Ut=Fr();if(it(Ut))return yt(Ut);C=Vn(gt,pt(Ut))}function yt(Ut){return C=n,K&&a?Y(Ut):(a=c=n,w)}function fe(){C!==n&&oa(C),O=0,a=A=c=C=n}function Qt(){return C===n?w:yt(Fr())}function le(){var Ut=Fr(),ke=it(Ut);if(a=arguments,c=this,A=Ut,ke){if(C===n)return rt(A);if(N)return oa(C),C=Vn(gt,e),Y(A)}return C===n&&(C=Vn(gt,e)),w}return le.cancel=fe,le.flush=Qt,le}var rd=dt(function(t,e){return Mo(t,1,e)}),id=dt(function(t,e,r){return Mo(t,we(e)||0,r)});function sd(t){return qe(t,L)}function Mr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new ge(m);var r=function(){var a=arguments,c=e?e.apply(this,a):a[0],d=r.cache;if(d.has(c))return d.get(c);var w=t.apply(this,a);return r.cache=d.set(c,w)||d,w};return r.cache=new(Mr.Cache||Fe),r}Mr.Cache=Fe;function qr(t){if(typeof t!="function")throw new ge(m);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 od(t){return za(2,t)}var ad=Xf(function(t,e){e=e.length==1&&ht(e[0])?It(e[0],ue(nt())):It(Kt(e,1),ue(nt()));var r=e.length;return dt(function(a){for(var c=-1,d=zt(a.length,r);++c<d;)a[c]=e[c].call(this,a[c]);return ae(t,this,a)})}),cs=dt(function(t,e){var r=Ye(e,Tn(cs));return qe(t,H,n,e,r)}),ja=dt(function(t,e){var r=Ye(e,Tn(ja));return qe(t,D,n,e,r)}),ud=We(function(t,e){return qe(t,G,n,n,n,e)});function cd(t,e){if(typeof t!="function")throw new ge(m);return e=e===n?e:lt(e),dt(t,e)}function hd(t,e){if(typeof t!="function")throw new ge(m);return e=e==null?0:Ft(lt(e),0),dt(function(r){var a=r[e],c=en(r,0,e);return a&&Ve(c,a),ae(t,this,c)})}function fd(t,e,r){var a=!0,c=!0;if(typeof t!="function")throw new ge(m);return Lt(r)&&(a="leading"in r?!!r.leading:a,c="trailing"in r?!!r.trailing:c),Ya(t,e,{leading:a,maxWait:e,trailing:c})}function ld(t){return $a(t,1)}function pd(t,e){return cs(Xi(e),t)}function dd(){if(!arguments.length)return[];var t=arguments[0];return ht(t)?t:[t]}function gd(t){return ye(t,f)}function vd(t,e){return e=typeof e=="function"?e:n,ye(t,f,e)}function yd(t){return ye(t,y|f)}function md(t,e){return e=typeof e=="function"?e:n,ye(t,y|f,e)}function _d(t,e){return e==null||Fo(t,e,Mt(e))}function Ae(t,e){return t===e||t!==t&&e!==e}var wd=Lr(Ui),bd=Lr(function(t,e){return t>=e}),ln=Ho(function(){return arguments}())?Ho:function(t){return Nt(t)&&Ct.call(t,"callee")&&!Oo.call(t,"callee")},ht=T.isArray,Sd=ho?ue(ho):Of;function ee(t){return t!=null&&Wr(t.length)&&!Ge(t)}function Bt(t){return Nt(t)&&ee(t)}function Cd(t){return t===!0||t===!1||Nt(t)&&jt(t)==Z}var nn=Dh||ws,Ed=fo?ue(fo):If;function Ad(t){return Nt(t)&&t.nodeType===1&&!Yn(t)}function kd(t){if(t==null)return!0;if(ee(t)&&(ht(t)||typeof t=="string"||typeof t.splice=="function"||nn(t)||xn(t)||ln(t)))return!t.length;var e=Xt(t);if(e==Ot||e==Yt)return!t.size;if(Jn(t))return!Fi(t).length;for(var r in t)if(Ct.call(t,r))return!1;return!0}function Td(t,e){return $n(t,e)}function xd(t,e,r){r=typeof r=="function"?r:n;var a=r?r(t,e):n;return a===n?$n(t,e,n,r):!!a}function hs(t){if(!Nt(t))return!1;var e=jt(t);return e==at||e==z||typeof t.message=="string"&&typeof t.name=="string"&&!Yn(t)}function Rd(t){return typeof t=="number"&&Lo(t)}function Ge(t){if(!Lt(t))return!1;var e=jt(t);return e==bt||e==$t||e==P||e==Nn}function Za(t){return typeof t=="number"&&t==lt(t)}function Wr(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 Nt(t){return t!=null&&typeof t=="object"}var Qa=lo?ue(lo):Nf;function Od(t,e){return t===e||Pi(t,e,ts(e))}function Id(t,e,r){return r=typeof r=="function"?r:n,Pi(t,e,ts(e),r)}function Ld(t){return tu(t)&&t!=+t}function Nd(t){if(vl(t))throw new ct(h);return $o(t)}function Bd(t){return t===null}function Ud(t){return t==null}function tu(t){return typeof t=="number"||Nt(t)&&jt(t)==Se}function Yn(t){if(!Nt(t)||jt(t)!=oe)return!1;var e=dr(t);if(e===null)return!0;var r=Ct.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&hr.call(r)==Oh}var fs=po?ue(po):Bf;function Dd(t){return Za(t)&&t>=-ut&&t<=ut}var eu=go?ue(go):Uf;function Kr(t){return typeof t=="string"||!ht(t)&&Nt(t)&&jt(t)==Re}function he(t){return typeof t=="symbol"||Nt(t)&&jt(t)==Oe}var xn=vo?ue(vo):Df;function Pd(t){return t===n}function Fd(t){return Nt(t)&&Xt(t)==De}function Md(t){return Nt(t)&&jt(t)==Un}var qd=Lr(Mi),Wd=Lr(function(t,e){return t<=e});function nu(t){if(!t)return[];if(ee(t))return Kr(t)?Ce(t):te(t);if(Pn&&t[Pn])return mh(t[Pn]());var e=Xt(t),r=e==Ot?ki:e==Yt?ar:Rn;return r(t)}function He(t){if(!t)return t===0?t:0;if(t=we(t),t===Rt||t===-Rt){var e=t<0?-1:1;return e*Ht}return t===t?t:0}function lt(t){var e=He(t),r=e%1;return e===e?r?e-r:e:0}function ru(t){return t?un(lt(t),0,se):0}function we(t){if(typeof t=="number")return t;if(he(t))return xe;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=So(t);var r=bc.test(t);return r||Cc.test(t)?eh(t.slice(2),r?2:8):wc.test(t)?xe:+t}function iu(t){return Le(t,ne(t))}function Kd(t){return t?un(lt(t),-ut,ut):t===0?t:0}function St(t){return t==null?"":ce(t)}var Gd=An(function(t,e){if(Jn(e)||ee(e)){Le(e,Mt(e),t);return}for(var r in e)Ct.call(e,r)&&Kn(t,r,e[r])}),su=An(function(t,e){Le(e,ne(e),t)}),Gr=An(function(t,e,r,a){Le(e,ne(e),t,a)}),Hd=An(function(t,e,r,a){Le(e,Mt(e),t,a)}),$d=We(Li);function zd(t,e){var r=En(t);return e==null?r:Po(r,e)}var Xd=dt(function(t,e){t=kt(t);var r=-1,a=e.length,c=a>2?e[2]:n;for(c&&Zt(e[0],e[1],c)&&(a=1);++r<a;)for(var d=e[r],w=ne(d),C=-1,A=w.length;++C<A;){var O=w[C],I=t[O];(I===n||Ae(I,bn[O])&&!Ct.call(t,O))&&(t[O]=d[O])}return t}),Jd=dt(function(t){return t.push(n,Sa),ae(ou,n,t)});function Vd(t,e){return mo(t,nt(e,3),Ie)}function Yd(t,e){return mo(t,nt(e,3),Bi)}function jd(t,e){return t==null?t:Ni(t,nt(e,3),ne)}function Zd(t,e){return t==null?t:Ko(t,nt(e,3),ne)}function Qd(t,e){return t&&Ie(t,nt(e,3))}function tg(t,e){return t&&Bi(t,nt(e,3))}function eg(t){return t==null?[]:Er(t,Mt(t))}function ng(t){return t==null?[]:Er(t,ne(t))}function ls(t,e,r){var a=t==null?n:cn(t,e);return a===n?r:a}function rg(t,e){return t!=null&&Aa(t,e,kf)}function ps(t,e){return t!=null&&Aa(t,e,Tf)}var ig=ya(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=fr.call(e)),t[e]=r},gs(re)),sg=ya(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=fr.call(e)),Ct.call(t,e)?t[e].push(r):t[e]=[r]},nt),og=dt(Hn);function Mt(t){return ee(t)?Uo(t):Fi(t)}function ne(t){return ee(t)?Uo(t,!0):Pf(t)}function ag(t,e){var r={};return e=nt(e,3),Ie(t,function(a,c,d){Me(r,e(a,c,d),a)}),r}function ug(t,e){var r={};return e=nt(e,3),Ie(t,function(a,c,d){Me(r,c,e(a,c,d))}),r}var cg=An(function(t,e,r){Ar(t,e,r)}),ou=An(function(t,e,r,a){Ar(t,e,r,a)}),hg=We(function(t,e){var r={};if(t==null)return r;var a=!1;e=It(e,function(d){return d=tn(d,t),a||(a=d.length>1),d}),Le(t,Zi(t),r),a&&(r=ye(r,y|l|f,il));for(var c=e.length;c--;)Hi(r,e[c]);return r});function fg(t,e){return au(t,qr(nt(e)))}var lg=We(function(t,e){return t==null?{}:Mf(t,e)});function au(t,e){if(t==null)return{};var r=It(Zi(t),function(a){return[a]});return e=nt(e),Zo(t,r,function(a,c){return e(a,c[0])})}function pg(t,e,r){e=tn(e,t);var a=-1,c=e.length;for(c||(c=1,t=n);++a<c;){var d=t==null?n:t[Ne(e[a])];d===n&&(a=c,d=r),t=Ge(d)?d.call(t):d}return t}function dg(t,e,r){return t==null?t:zn(t,e,r)}function gg(t,e,r,a){return a=typeof a=="function"?a:n,t==null?t:zn(t,e,r,a)}var uu=wa(Mt),cu=wa(ne);function vg(t,e,r){var a=ht(t),c=a||nn(t)||xn(t);if(e=nt(e,4),r==null){var d=t&&t.constructor;c?r=a?new d:[]:Lt(t)?r=Ge(d)?En(dr(t)):{}:r={}}return(c?de:Ie)(t,function(w,C,A){return e(r,w,C,A)}),r}function yg(t,e){return t==null?!0:Hi(t,e)}function mg(t,e,r){return t==null?t:ra(t,e,Xi(r))}function _g(t,e,r,a){return a=typeof a=="function"?a:n,t==null?t:ra(t,e,Xi(r),a)}function Rn(t){return t==null?[]:Ai(t,Mt(t))}function wg(t){return t==null?[]:Ai(t,ne(t))}function bg(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=we(r),r=r===r?r:0),e!==n&&(e=we(e),e=e===e?e:0),un(we(t),e,r)}function Sg(t,e,r){return e=He(e),r===n?(r=e,e=0):r=He(r),t=we(t),xf(t,e,r)}function Cg(t,e,r){if(r&&typeof r!="boolean"&&Zt(t,e,r)&&(e=r=n),r===n&&(typeof e=="boolean"?(r=e,e=n):typeof t=="boolean"&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=He(t),e===n?(e=t,t=0):e=He(e)),t>e){var a=t;t=e,e=a}if(r||t%1||e%1){var c=No();return zt(t+c*(e-t+th("1e-"+((c+"").length-1))),e)}return Wi(t,e)}var Eg=kn(function(t,e,r){return e=e.toLowerCase(),t+(r?hu(e):e)});function hu(t){return ds(St(t).toLowerCase())}function fu(t){return t=St(t),t&&t.replace(Ac,ph).replace(Hc,"")}function Ag(t,e,r){t=St(t),e=ce(e);var a=t.length;r=r===n?a:un(lt(r),0,a);var c=r;return r-=e.length,r>=0&&t.slice(r,c)==e}function kg(t){return t=St(t),t&&sc.test(t)?t.replace(Ws,dh):t}function Tg(t){return t=St(t),t&&fc.test(t)?t.replace(ci,"\\$&"):t}var xg=kn(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Rg=kn(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Og=da("toLowerCase");function Ig(t,e,r){t=St(t),e=lt(e);var a=e?_n(t):0;if(!e||a>=e)return t;var c=(e-a)/2;return Ir(mr(c),r)+t+Ir(yr(c),r)}function Lg(t,e,r){t=St(t),e=lt(e);var a=e?_n(t):0;return e&&a<e?t+Ir(e-a,r):t}function Ng(t,e,r){t=St(t),e=lt(e);var a=e?_n(t):0;return e&&a<e?Ir(e-a,r)+t:t}function Bg(t,e,r){return r||e==null?e=0:e&&(e=+e),qh(St(t).replace(hi,""),e||0)}function Ug(t,e,r){return(r?Zt(t,e,r):e===n)?e=1:e=lt(e),Ki(St(t),e)}function Dg(){var t=arguments,e=St(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var Pg=kn(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});function Fg(t,e,r){return r&&typeof r!="number"&&Zt(t,e,r)&&(e=r=n),r=r===n?se:r>>>0,r?(t=St(t),t&&(typeof e=="string"||e!=null&&!fs(e))&&(e=ce(e),!e&&mn(t))?en(Ce(t),0,r):t.split(e,r)):[]}var Mg=kn(function(t,e,r){return t+(r?" ":"")+ds(e)});function qg(t,e,r){return t=St(t),r=r==null?0:un(lt(r),0,t.length),e=ce(e),t.slice(r,r+e.length)==e}function Wg(t,e,r){var a=p.templateSettings;r&&Zt(t,e,r)&&(e=n),t=St(t),e=Gr({},e,a,ba);var c=Gr({},e.imports,a.imports,ba),d=Mt(c),w=Ai(c,d),C,A,O=0,I=e.interpolate||nr,N="__p += '",K=Ti((e.escape||nr).source+"|"+I.source+"|"+(I===Ks?_c:nr).source+"|"+(e.evaluate||nr).source+"|$","g"),Y="//# sourceURL="+(Ct.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vc+"]")+`
16
+ `;t.replace(K,function(it,gt,yt,fe,Qt,le){return yt||(yt=fe),N+=t.slice(O,le).replace(kc,gh),gt&&(C=!0,N+=`' +
17
17
  __e(`+gt+`) +
18
- '`),Qt&&(k=!0,N+=`';
18
+ '`),Qt&&(A=!0,N+=`';
19
19
  `+Qt+`;
20
20
  __p += '`),yt&&(N+=`' +
21
21
  ((__t = (`+yt+`)) == null ? '' : __t) +
@@ -23,23 +23,23 @@ __p += '`),yt&&(N+=`' +
23
23
  `;var rt=Ct.call(e,"variable")&&e.variable;if(!rt)N=`with (obj) {
24
24
  `+N+`
25
25
  }
26
- `;else if(yc.test(rt))throw new ct(d);N=(k?N.replace(ec,""):N).replace(nc,"$1").replace(rc,"$1;"),N="function("+(rt||"obj")+`) {
26
+ `;else if(yc.test(rt))throw new ct(g);N=(A?N.replace(ec,""):N).replace(nc,"$1").replace(rc,"$1;"),N="function("+(rt||"obj")+`) {
27
27
  `+(rt?"":`obj || (obj = {});
28
- `)+"var __t, __p = ''"+(C?", __e = _.escape":"")+(k?`, __j = Array.prototype.join;
28
+ `)+"var __t, __p = ''"+(C?", __e = _.escape":"")+(A?`, __j = Array.prototype.join;
29
29
  function print() { __p += __j.call(arguments, '') }
30
30
  `:`;
31
31
  `)+N+`return __p
32
- }`;var pt=pu(function(){return _t(g,Y+"return "+N).apply(n,w)});if(pt.source=N,hs(pt))throw pt;return pt}function Kg(t){return St(t).toLowerCase()}function Gg(t){return St(t).toUpperCase()}function Hg(t,e,r){if(t=St(t),t&&(r||e===n))return So(t);if(!t||!(e=ce(e)))return t;var a=Ce(t),c=Ce(e),g=Co(a,c),w=Ao(a,c)+1;return en(a,g,w).join("")}function $g(t,e,r){if(t=St(t),t&&(r||e===n))return t.slice(0,Eo(t)+1);if(!t||!(e=ce(e)))return t;var a=Ce(t),c=Ao(a,Ce(e))+1;return en(a,0,c).join("")}function zg(t,e,r){if(t=St(t),t&&(r||e===n))return t.replace(hi,"");if(!t||!(e=ce(e)))return t;var a=Ce(t),c=Co(a,Ce(e));return en(a,c).join("")}function Xg(t,e){var r=U,a=X;if(Lt(e)){var c="separator"in e?e.separator:c;r="length"in e?lt(e.length):r,a="omission"in e?ce(e.omission):a}t=St(t);var g=t.length;if(mn(t)){var w=Ce(t);g=w.length}if(r>=g)return t;var C=r-_n(a);if(C<1)return a;var k=w?en(w,0,C).join(""):t.slice(0,C);if(c===n)return k+a;if(w&&(C+=k.length-C),fs(c)){if(t.slice(C).search(c)){var O,I=k;for(c.global||(c=Ti(c.source,St(Gs.exec(c))+"g")),c.lastIndex=0;O=c.exec(I);)var N=O.index;k=k.slice(0,N===n?C:N)}}else if(t.indexOf(ce(c),C)!=C){var K=k.lastIndexOf(c);K>-1&&(k=k.slice(0,K))}return k+a}function Jg(t){return t=St(t),t&&ic.test(t)?t.replace(qs,Sh):t}var Vg=En(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),ds=da("toUpperCase");function lu(t,e,r){return t=St(t),e=r?n:e,e===n?yh(t)?kh(t):uh(t):t.match(e)||[]}var pu=dt(function(t,e){try{return ae(t,n,e)}catch(r){return hs(r)?r:new ct(r)}}),Yg=We(function(t,e){return de(e,function(r){r=Ne(r),Me(t,r,us(t[r],t))}),t});function jg(t){var e=t==null?0:t.length,r=nt();return t=e?It(t,function(a){if(typeof a[1]!="function")throw new ge(m);return[r(a[0]),a[1]]}):[],dt(function(a){for(var c=-1;++c<e;){var g=t[c];if(ae(g[0],this,a))return ae(g[1],this,a)}})}function Zg(t){return Cf(ye(t,y))}function gs(t){return function(){return t}}function Qg(t,e){return t==null||t!==t?e:t}var tv=va(),ev=va(!0);function re(t){return t}function vs(t){return zo(typeof t=="function"?t:ye(t,y))}function nv(t){return Jo(ye(t,y))}function rv(t,e){return Vo(t,ye(e,y))}var iv=dt(function(t,e){return function(r){return Hn(r,t,e)}}),sv=dt(function(t,e){return function(r){return Hn(t,r,e)}});function ys(t,e,r){var a=Mt(e),c=Ar(e,a);r==null&&!(Lt(e)&&(c.length||!a.length))&&(r=e,e=t,t=this,c=Ar(e,Mt(e)));var g=!(Lt(r)&&"chain"in r)||!!r.chain,w=Ge(t);return de(c,function(C){var k=e[C];t[C]=k,w&&(t.prototype[C]=function(){var O=this.__chain__;if(g||O){var I=t(this.__wrapped__),N=I.__actions__=te(this.__actions__);return N.push({func:k,args:arguments,thisArg:t}),I.__chain__=O,I}return k.apply(t,Ve([this.value()],arguments))})}),t}function ov(){return Wt._===this&&(Wt._=Ih),this}function ms(){}function av(t){return t=lt(t),dt(function(e){return Yo(e,t)})}var uv=Vi(It),cv=Vi(yo),hv=Vi(wi);function du(t){return ns(t)?bi(Ne(t)):qf(t)}function fv(t){return function(e){return t==null?n:cn(t,e)}}var lv=ma(),pv=ma(!0);function _s(){return[]}function ws(){return!1}function dv(){return{}}function gv(){return""}function vv(){return!0}function yv(t,e){if(t=lt(t),t<1||t>ut)return[];var r=se,a=zt(t,se);e=nt(e),t-=se;for(var c=Ai(a,e);++r<t;)e(r);return c}function mv(t){return ht(t)?It(t,Ne):he(t)?[t]:te(Ba(St(t)))}function _v(t){var e=++Rh;return St(t)+e}var wv=Or(function(t,e){return t+e},0),bv=Yi("ceil"),Sv=Or(function(t,e){return t/e},1),Cv=Yi("floor");function Av(t){return t&&t.length?Cr(t,re,Ui):n}function kv(t,e){return t&&t.length?Cr(t,nt(e,2),Ui):n}function Ev(t){return wo(t,re)}function Tv(t,e){return wo(t,nt(e,2))}function xv(t){return t&&t.length?Cr(t,re,Mi):n}function Rv(t,e){return t&&t.length?Cr(t,nt(e,2),Mi):n}var Ov=Or(function(t,e){return t*e},1),Iv=Yi("round"),Lv=Or(function(t,e){return t-e},0);function Nv(t){return t&&t.length?Ci(t,re):0}function Bv(t,e){return t&&t.length?Ci(t,nt(e,2)):0}return p.after=nd,p.ary=$a,p.assign=Gd,p.assignIn=su,p.assignInWith=Gr,p.assignWith=Hd,p.at=$d,p.before=za,p.bind=us,p.bindAll=Yg,p.bindKey=Xa,p.castArray=dd,p.chain=Ka,p.chunk=Cl,p.compact=Al,p.concat=kl,p.cond=jg,p.conforms=Zg,p.constant=gs,p.countBy=Np,p.create=zd,p.curry=Ja,p.curryRight=Va,p.debounce=Ya,p.defaults=Xd,p.defaultsDeep=Jd,p.defer=rd,p.delay=id,p.difference=El,p.differenceBy=Tl,p.differenceWith=xl,p.drop=Rl,p.dropRight=Ol,p.dropRightWhile=Il,p.dropWhile=Ll,p.fill=Nl,p.filter=Up,p.flatMap=Fp,p.flatMapDeep=Mp,p.flatMapDepth=qp,p.flatten=Fa,p.flattenDeep=Bl,p.flattenDepth=Ul,p.flip=sd,p.flow=tv,p.flowRight=ev,p.fromPairs=Dl,p.functions=eg,p.functionsIn=ng,p.groupBy=Wp,p.initial=Fl,p.intersection=Ml,p.intersectionBy=ql,p.intersectionWith=Wl,p.invert=ig,p.invertBy=sg,p.invokeMap=Gp,p.iteratee=vs,p.keyBy=Hp,p.keys=Mt,p.keysIn=ne,p.map=Pr,p.mapKeys=ag,p.mapValues=ug,p.matches=nv,p.matchesProperty=rv,p.memoize=Mr,p.merge=cg,p.mergeWith=ou,p.method=iv,p.methodOf=sv,p.mixin=ys,p.negate=qr,p.nthArg=av,p.omit=hg,p.omitBy=fg,p.once=od,p.orderBy=$p,p.over=uv,p.overArgs=ad,p.overEvery=cv,p.overSome=hv,p.partial=cs,p.partialRight=ja,p.partition=zp,p.pick=lg,p.pickBy=au,p.property=du,p.propertyOf=fv,p.pull=$l,p.pullAll=qa,p.pullAllBy=zl,p.pullAllWith=Xl,p.pullAt=Jl,p.range=lv,p.rangeRight=pv,p.rearg=ud,p.reject=Vp,p.remove=Vl,p.rest=cd,p.reverse=os,p.sampleSize=jp,p.set=dg,p.setWith=gg,p.shuffle=Zp,p.slice=Yl,p.sortBy=ed,p.sortedUniq=rp,p.sortedUniqBy=ip,p.split=Fg,p.spread=hd,p.tail=sp,p.take=op,p.takeRight=ap,p.takeRightWhile=up,p.takeWhile=cp,p.tap=Ap,p.throttle=fd,p.thru=Dr,p.toArray=nu,p.toPairs=uu,p.toPairsIn=cu,p.toPath=mv,p.toPlainObject=iu,p.transform=vg,p.unary=ld,p.union=hp,p.unionBy=fp,p.unionWith=lp,p.uniq=pp,p.uniqBy=dp,p.uniqWith=gp,p.unset=yg,p.unzip=as,p.unzipWith=Wa,p.update=mg,p.updateWith=_g,p.values=Rn,p.valuesIn=wg,p.without=vp,p.words=lu,p.wrap=pd,p.xor=yp,p.xorBy=mp,p.xorWith=_p,p.zip=wp,p.zipObject=bp,p.zipObjectDeep=Sp,p.zipWith=Cp,p.entries=uu,p.entriesIn=cu,p.extend=su,p.extendWith=Gr,ys(p,p),p.add=wv,p.attempt=pu,p.camelCase=Ag,p.capitalize=hu,p.ceil=bv,p.clamp=bg,p.clone=gd,p.cloneDeep=yd,p.cloneDeepWith=md,p.cloneWith=vd,p.conformsTo=_d,p.deburr=fu,p.defaultTo=Qg,p.divide=Sv,p.endsWith=kg,p.eq=ke,p.escape=Eg,p.escapeRegExp=Tg,p.every=Bp,p.find=Dp,p.findIndex=Da,p.findKey=Vd,p.findLast=Pp,p.findLastIndex=Pa,p.findLastKey=Yd,p.floor=Cv,p.forEach=Ga,p.forEachRight=Ha,p.forIn=jd,p.forInRight=Zd,p.forOwn=Qd,p.forOwnRight=tg,p.get=ls,p.gt=wd,p.gte=bd,p.has=rg,p.hasIn=ps,p.head=Ma,p.identity=re,p.includes=Kp,p.indexOf=Pl,p.inRange=Sg,p.invoke=og,p.isArguments=ln,p.isArray=ht,p.isArrayBuffer=Sd,p.isArrayLike=ee,p.isArrayLikeObject=Bt,p.isBoolean=Cd,p.isBuffer=nn,p.isDate=Ad,p.isElement=kd,p.isEmpty=Ed,p.isEqual=Td,p.isEqualWith=xd,p.isError=hs,p.isFinite=Rd,p.isFunction=Ge,p.isInteger=Za,p.isLength=Wr,p.isMap=Qa,p.isMatch=Od,p.isMatchWith=Id,p.isNaN=Ld,p.isNative=Nd,p.isNil=Ud,p.isNull=Bd,p.isNumber=tu,p.isObject=Lt,p.isObjectLike=Nt,p.isPlainObject=Yn,p.isRegExp=fs,p.isSafeInteger=Dd,p.isSet=eu,p.isString=Kr,p.isSymbol=he,p.isTypedArray=xn,p.isUndefined=Pd,p.isWeakMap=Fd,p.isWeakSet=Md,p.join=Kl,p.kebabCase=xg,p.last=_e,p.lastIndexOf=Gl,p.lowerCase=Rg,p.lowerFirst=Og,p.lt=qd,p.lte=Wd,p.max=Av,p.maxBy=kv,p.mean=Ev,p.meanBy=Tv,p.min=xv,p.minBy=Rv,p.stubArray=_s,p.stubFalse=ws,p.stubObject=dv,p.stubString=gv,p.stubTrue=vv,p.multiply=Ov,p.nth=Hl,p.noConflict=ov,p.noop=ms,p.now=Fr,p.pad=Ig,p.padEnd=Lg,p.padStart=Ng,p.parseInt=Bg,p.random=Cg,p.reduce=Xp,p.reduceRight=Jp,p.repeat=Ug,p.replace=Dg,p.result=pg,p.round=Iv,p.runInContext=A,p.sample=Yp,p.size=Qp,p.snakeCase=Pg,p.some=td,p.sortedIndex=jl,p.sortedIndexBy=Zl,p.sortedIndexOf=Ql,p.sortedLastIndex=tp,p.sortedLastIndexBy=ep,p.sortedLastIndexOf=np,p.startCase=Mg,p.startsWith=qg,p.subtract=Lv,p.sum=Nv,p.sumBy=Bv,p.template=Wg,p.times=yv,p.toFinite=He,p.toInteger=lt,p.toLength=ru,p.toLower=Kg,p.toNumber=we,p.toSafeInteger=Kd,p.toString=St,p.toUpper=Gg,p.trim=Hg,p.trimEnd=$g,p.trimStart=zg,p.truncate=Xg,p.unescape=Jg,p.uniqueId=_v,p.upperCase=Vg,p.upperFirst=ds,p.each=Ga,p.eachRight=Ha,p.first=Ma,ys(p,function(){var t={};return Ie(p,function(e,r){Ct.call(p.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),p.VERSION=o,de(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){p[t].placeholder=p}),de(["drop","take"],function(t,e){vt.prototype[t]=function(r){r=r===n?1:Ft(lt(r),0);var a=this.__filtered__&&!e?new vt(this):this.clone();return a.__filtered__?a.__takeCount__=zt(r,a.__takeCount__):a.__views__.push({size:zt(r,se),type:t+(a.__dir__<0?"Right":"")}),a},vt.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),de(["filter","map","takeWhile"],function(t,e){var r=e+1,a=r==B||r==kt;vt.prototype[t]=function(c){var g=this.clone();return g.__iteratees__.push({iteratee:nt(c,3),type:r}),g.__filtered__=g.__filtered__||a,g}}),de(["head","last"],function(t,e){var r="take"+(e?"Right":"");vt.prototype[t]=function(){return this[r](1).value()[0]}}),de(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");vt.prototype[t]=function(){return this.__filtered__?new vt(this):this[r](1)}}),vt.prototype.compact=function(){return this.filter(re)},vt.prototype.find=function(t){return this.filter(t).head()},vt.prototype.findLast=function(t){return this.reverse().find(t)},vt.prototype.invokeMap=dt(function(t,e){return typeof t=="function"?new vt(this):this.map(function(r){return Hn(r,t,e)})}),vt.prototype.reject=function(t){return this.filter(qr(nt(t)))},vt.prototype.slice=function(t,e){t=lt(t);var r=this;return r.__filtered__&&(t>0||e<0)?new vt(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(e=lt(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},vt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vt.prototype.toArray=function(){return this.take(se)},Ie(vt.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),a=/^(?:head|last)$/.test(e),c=p[a?"take"+(e=="last"?"Right":""):e],g=a||/^find/.test(e);c&&(p.prototype[e]=function(){var w=this.__wrapped__,C=a?[1]:arguments,k=w instanceof vt,O=C[0],I=k||ht(w),N=function(gt){var yt=c.apply(p,Ve([gt],C));return a&&K?yt[0]:yt};I&&r&&typeof O=="function"&&O.length!=1&&(k=I=!1);var K=this.__chain__,Y=!!this.__actions__.length,rt=g&&!K,pt=k&&!Y;if(!g&&I){w=pt?w:new vt(this);var it=t.apply(w,C);return it.__actions__.push({func:Dr,args:[N],thisArg:n}),new ve(it,K)}return rt&&pt?t.apply(this,C):(it=this.thru(N),rt?a?it.value()[0]:it.value():it)})}),de(["pop","push","shift","sort","splice","unshift"],function(t){var e=ur[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",a=/^(?:pop|shift)$/.test(t);p.prototype[t]=function(){var c=arguments;if(a&&!this.__chain__){var g=this.value();return e.apply(ht(g)?g:[],c)}return this[r](function(w){return e.apply(ht(w)?w:[],c)})}}),Ie(vt.prototype,function(t,e){var r=p[e];if(r){var a=r.name+"";Ct.call(Cn,a)||(Cn[a]=[]),Cn[a].push({name:e,func:r})}}),Cn[Rr(n,W).name]=[{name:"wrapper",func:n}],vt.prototype.clone=Xh,vt.prototype.reverse=Jh,vt.prototype.value=Vh,p.prototype.at=kp,p.prototype.chain=Ep,p.prototype.commit=Tp,p.prototype.next=xp,p.prototype.plant=Op,p.prototype.reverse=Ip,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Lp,p.prototype.first=p.prototype.head,Pn&&(p.prototype[Pn]=Rp),p},wn=Eh();rn?((rn.exports=wn)._=wn,vi._=wn):Wt._=wn}).call(jn)})(Zr,Zr.exports);var Hv=Zr.exports;const $v={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,namespace:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function zv(){return function s(i,n,o){function u(d,S){if(!n[d]){if(!i[d]){var v=typeof require=="function"&&require;if(!S&&v)return v(d,!0);if(h)return h(d,!0);throw new Error("Cannot find module '"+d+"'")}var _=n[d]={exports:{}};i[d][0].call(_.exports,function(y){var l=i[d][1][y];return u(l||y)},_,_.exports,s,i,n,o)}return n[d].exports}for(var h=typeof require=="function"&&require,m=0;m<o.length;m++)u(o[m]);return u}({1:[function(s,i){i.exports=s("./lib/")},{"./lib/":2}],2:[function(s,i,n){function o(v,_){typeof v=="object"&&(_=v,v=void 0),_=_||{};var y,l=u(v),f=l.source,b=l.id;return _.forceNew||_["force new connection"]||_.multiplex===!1?(d("ignoring socket cache for %s",f),y=m(f,_)):(S[b]||(d("new io instance for %s",f),S[b]=m(f,_)),y=S[b]),y.socket(l.path)}var u=s("./url"),h=s("socket.io-parser"),m=s("./manager"),d=s("debug")("socket.io-client");i.exports=n=o;var S=n.managers={};n.protocol=h.protocol,n.connect=o,n.Manager=s("./manager"),n.Socket=s("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(s,i){function n(l,f){return this instanceof n?(l&&typeof l=="object"&&(f=l,l=void 0),f=f||{},f.path=f.path||"/socket.io",this.nsps={},this.subs=[],this.opts=f,this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor(f.randomizationFactor||.5),this.backoff=new y({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this.readyState="closed",this.uri=l,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new m.Encoder,this.decoder=new m.Decoder,this.autoConnect=f.autoConnect!==!1,void(this.autoConnect&&this.open())):new n(l,f)}var o=(s("./url"),s("engine.io-client")),u=s("./socket"),h=s("component-emitter"),m=s("socket.io-parser"),d=s("./on"),S=s("component-bind"),v=(s("object-component"),s("debug")("socket.io-client:manager")),_=s("indexof"),y=s("backo2");i.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},h(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(v("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;v("opening %s",this.uri),this.engine=o(this.uri,this.opts);var f=this.engine,b=this;this.readyState="opening",this.skipReconnect=!1;var E=d(f,"open",function(){b.onopen(),l&&l()}),x=d(f,"error",function(V){if(v("connect_error"),b.cleanup(),b.readyState="closed",b.emitAll("connect_error",V),l){var ot=new Error("Connection error");ot.data=V,l(ot)}else b.maybeReconnectOnOpen()});if(this._timeout!==!1){var W=this._timeout;v("connect attempt will timeout after %d",W);var st=setTimeout(function(){v("connect attempt timed out after %d",W),E.destroy(),f.close(),f.emit("error","timeout"),b.emitAll("connect_timeout",W)},W);this.subs.push({destroy:function(){clearTimeout(st)}})}return this.subs.push(E),this.subs.push(x),this},n.prototype.onopen=function(){v("open"),this.cleanup(),this.readyState="open",this.emit("open");var l=this.engine;this.subs.push(d(l,"data",S(this,"ondata"))),this.subs.push(d(this.decoder,"decoded",S(this,"ondecoded"))),this.subs.push(d(l,"error",S(this,"onerror"))),this.subs.push(d(l,"close",S(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){v("error",l),this.emitAll("error",l)},n.prototype.socket=function(l){var f=this.nsps[l];if(!f){f=new u(this,l),this.nsps[l]=f;var b=this;f.on("connect",function(){f.id=b.engine.id,~_(b.connected,f)||b.connected.push(f)})}return f},n.prototype.destroy=function(l){var f=_(this.connected,l);~f&&this.connected.splice(f,1),this.connected.length||this.close()},n.prototype.packet=function(l){v("writing packet %j",l);var f=this;f.encoding?f.packetBuffer.push(l):(f.encoding=!0,this.encoder.encode(l,function(b){for(var E=0;E<b.length;E++)f.engine.write(b[E]);f.encoding=!1,f.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){v("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)v("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var f=this.backoff.duration();v("will wait %dms before reconnect attempt",f),this.reconnecting=!0;var b=setTimeout(function(){l.skipReconnect||(v("attempting reconnect"),l.emitAll("reconnect_attempt",l.backoff.attempts),l.emitAll("reconnecting",l.backoff.attempts),l.skipReconnect||l.open(function(E){E?(v("reconnect attempt error"),l.reconnecting=!1,l.reconnect(),l.emitAll("reconnect_error",E.data)):(v("reconnect success"),l.onreconnect())}))},f);this.subs.push({destroy:function(){clearTimeout(b)}})}},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(s,i){function n(o,u,h){return o.on(u,h),{destroy:function(){o.removeListener(u,h)}}}i.exports=n},{}],5:[function(s,i,n){function o(f,b){this.io=f,this.nsp=b,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var u=s("socket.io-parser"),h=s("component-emitter"),m=s("to-array"),d=s("./on"),S=s("component-bind"),v=s("debug")("socket.io-client:socket"),_=s("has-binary");i.exports=o;var y={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=h.prototype.emit;h(o.prototype),o.prototype.subEvents=function(){if(!this.subs){var f=this.io;this.subs=[d(f,"open",S(this,"onopen")),d(f,"packet",S(this,"onpacket")),d(f,"close",S(this,"onclose"))]}},o.prototype.open=o.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},o.prototype.send=function(){var f=m(arguments);return f.unshift("message"),this.emit.apply(this,f),this},o.prototype.emit=function(f){if(y.hasOwnProperty(f))return l.apply(this,arguments),this;var b=m(arguments),E=u.EVENT;_(b)&&(E=u.BINARY_EVENT);var x={type:E,data:b};return typeof b[b.length-1]=="function"&&(v("emitting packet with ack id %d",this.ids),this.acks[this.ids]=b.pop(),x.id=this.ids++),this.connected?this.packet(x):this.sendBuffer.push(x),this},o.prototype.packet=function(f){f.nsp=this.nsp,this.io.packet(f)},o.prototype.onopen=function(){v("transport is open - connecting"),this.nsp!="/"&&this.packet({type:u.CONNECT})},o.prototype.onclose=function(f){v("close (%s)",f),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",f)},o.prototype.onpacket=function(f){if(f.nsp==this.nsp)switch(f.type){case u.CONNECT:this.onconnect();break;case u.EVENT:this.onevent(f);break;case u.BINARY_EVENT:this.onevent(f);break;case u.ACK:this.onack(f);break;case u.BINARY_ACK:this.onack(f);break;case u.DISCONNECT:this.ondisconnect();break;case u.ERROR:this.emit("error",f.data)}},o.prototype.onevent=function(f){var b=f.data||[];v("emitting event %j",b),f.id!=null&&(v("attaching ack callback to event"),b.push(this.ack(f.id))),this.connected?l.apply(this,b):this.receiveBuffer.push(b)},o.prototype.ack=function(f){var b=this,E=!1;return function(){if(!E){E=!0;var x=m(arguments);v("sending ack %j",x);var W=_(x)?u.BINARY_ACK:u.ACK;b.packet({type:W,id:f,data:x})}}},o.prototype.onack=function(f){v("calling ack %s with %j",f.id,f.data);var b=this.acks[f.id];b.apply(this,f.data),delete this.acks[f.id]},o.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},o.prototype.emitBuffered=function(){var f;for(f=0;f<this.receiveBuffer.length;f++)l.apply(this,this.receiveBuffer[f]);for(this.receiveBuffer=[],f=0;f<this.sendBuffer.length;f++)this.packet(this.sendBuffer[f]);this.sendBuffer=[]},o.prototype.ondisconnect=function(){v("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},o.prototype.destroy=function(){if(this.subs){for(var f=0;f<this.subs.length;f++)this.subs[f].destroy();this.subs=null}this.io.destroy(this)},o.prototype.close=o.prototype.disconnect=function(){return this.connected&&(v("performing disconnect (%s)",this.nsp),this.packet({type:u.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(s,i){(function(n){function o(m,v){var S=m,v=v||n.location;return m==null&&(m=v.protocol+"//"+v.host),typeof m=="string"&&(m.charAt(0)=="/"&&(m=m.charAt(1)=="/"?v.protocol+m:v.hostname+m),/^(https?|wss?):\/\//.test(m)||(h("protocol-less url %s",m),m=typeof v<"u"?v.protocol+"//"+m:"https://"+m),h("parse %s",m),S=u(m)),S.port||(/^(http|ws)$/.test(S.protocol)?S.port="80":/^(http|ws)s$/.test(S.protocol)&&(S.port="443")),S.path=S.path||"/",S.id=S.protocol+"://"+S.host+":"+S.port,S.href=S.protocol+"://"+S.host+(v&&v.port==S.port?"":":"+S.port),S}var u=s("parseuri"),h=s("debug")("socket.io-client:url");i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(s,i){function n(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}i.exports=n,n.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var u=Math.random(),h=Math.floor(u*this.jitter*o);o=1&Math.floor(10*u)?o+h:o-h}return 0|Math.min(o,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(o){this.ms=o},n.prototype.setMax=function(o){this.max=o},n.prototype.setJitter=function(o){this.jitter=o}},{}],8:[function(s,i){var n=[].slice;i.exports=function(o,u){if(typeof u=="string"&&(u=o[u]),typeof u!="function")throw new Error("bind() requires a function");var h=n.call(arguments,2);return function(){return u.apply(o,h.concat(n.call(arguments)))}}},{}],9:[function(s,i){function n(u){return u?o(u):void 0}function o(u){for(var h in n.prototype)u[h]=n.prototype[h];return u}i.exports=n,n.prototype.on=n.prototype.addEventListener=function(u,h){return this._callbacks=this._callbacks||{},(this._callbacks[u]=this._callbacks[u]||[]).push(h),this},n.prototype.once=function(u,h){function m(){d.off(u,m),h.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},m.fn=h,this.on(u,m),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(u,h){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var m=this._callbacks[u];if(!m)return this;if(arguments.length==1)return delete this._callbacks[u],this;for(var d,S=0;S<m.length;S++)if(d=m[S],d===h||d.fn===h){m.splice(S,1);break}return this},n.prototype.emit=function(u){this._callbacks=this._callbacks||{};var h=[].slice.call(arguments,1),m=this._callbacks[u];if(m){m=m.slice(0);for(var d=0,S=m.length;S>d;++d)m[d].apply(this,h)}return this},n.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks[u]||[]},n.prototype.hasListeners=function(u){return!!this.listeners(u).length}},{}],10:[function(s,i){function n(u){return n.enabled(u)?function(h){h=o(h);var m=new Date,d=m-(n[u]||m);n[u]=m,h=u+" "+h+" +"+n.humanize(d),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function o(u){return u instanceof Error?u.stack||u.message:u}i.exports=n,n.names=[],n.skips=[],n.enable=function(u){try{localStorage.debug=u}catch{}for(var h=(u||"").split(/[\s,]+/),m=h.length,d=0;m>d;d++)u=h[d].replace("*",".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.substr(1)+"$")):n.names.push(new RegExp("^"+u+"$"))},n.disable=function(){n.enable("")},n.humanize=function(u){var h=1e3,m=6e4,d=60*m;return u>=d?(u/d).toFixed(1)+"h":u>=m?(u/m).toFixed(1)+"m":u>=h?(u/h|0)+"s":u+"ms"},n.enabled=function(u){for(var h=0,m=n.skips.length;m>h;h++)if(n.skips[h].test(u))return!1;for(var h=0,m=n.names.length;m>h;h++)if(n.names[h].test(u))return!0;return!1};try{window.localStorage&&n.enable(localStorage.debug)}catch{}},{}],11:[function(s,i){i.exports=s("./lib/")},{"./lib/":12}],12:[function(s,i){i.exports=s("./socket"),i.exports.parser=s("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(s,i){(function(n){function o(f,b){if(!(this instanceof o))return new o(f,b);if(b=b||{},f&&typeof f=="object"&&(b=f,f=null),f&&(f=_(f),b.host=f.host,b.secure=f.protocol=="https"||f.protocol=="wss",b.port=f.port,f.query&&(b.query=f.query)),this.secure=b.secure!=null?b.secure:n.location&&location.protocol=="https:",b.host){var E=b.host.split(":");b.hostname=E.shift(),E.length?b.port=E.pop():b.port||(b.port=this.secure?"443":"80")}this.agent=b.agent||!1,this.hostname=b.hostname||(n.location?location.hostname:"localhost"),this.port=b.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=b.query||{},typeof this.query=="string"&&(this.query=l.decode(this.query)),this.upgrade=b.upgrade!==!1,this.path=(b.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!b.forceJSONP,this.jsonp=b.jsonp!==!1,this.forceBase64=!!b.forceBase64,this.enablesXDR=!!b.enablesXDR,this.timestampParam=b.timestampParam||"t",this.timestampRequests=b.timestampRequests,this.transports=b.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=b.policyPort||843,this.rememberUpgrade=b.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=b.onlyBinaryUpgrades,this.pfx=b.pfx||null,this.key=b.key||null,this.passphrase=b.passphrase||null,this.cert=b.cert||null,this.ca=b.ca||null,this.ciphers=b.ciphers||null,this.rejectUnauthorized=b.rejectUnauthorized||null,this.open()}function u(f){var b={};for(var E in f)f.hasOwnProperty(E)&&(b[E]=f[E]);return b}var h=s("./transports"),m=s("component-emitter"),d=s("debug")("engine.io-client:socket"),S=s("indexof"),v=s("engine.io-parser"),_=s("parseuri"),y=s("parsejson"),l=s("parseqs");i.exports=o,o.priorWebsocketSuccess=!1,m(o.prototype),o.protocol=v.protocol,o.Socket=o,o.Transport=s("./transport"),o.transports=s("./transports"),o.parser=s("engine.io-parser"),o.prototype.createTransport=function(f){d('creating transport "%s"',f);var b=u(this.query);b.EIO=v.protocol,b.transport=f,this.id&&(b.sid=this.id);var E=new h[f]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:b,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 E},o.prototype.open=function(){var b;if(this.rememberUpgrade&&o.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)b="websocket";else{if(this.transports.length==0){var f=this;return void setTimeout(function(){f.emit("error","No transports available")},0)}b=this.transports[0]}this.readyState="opening";var b;try{b=this.createTransport(b)}catch{return this.transports.shift(),void this.open()}b.open(),this.setTransport(b)},o.prototype.setTransport=function(f){d("setting transport %s",f.name);var b=this;this.transport&&(d("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=f,f.on("drain",function(){b.onDrain()}).on("packet",function(E){b.onPacket(E)}).on("error",function(E){b.onError(E)}).on("close",function(){b.onClose("transport close")})},o.prototype.probe=function(f){function b(){if(M.onlyBinaryUpgrades){var G=!this.supportsBinary&&M.transport.supportsBinary;D=D||G}D||(d('probe transport "%s" opened',f),H.send([{type:"ping",data:"probe"}]),H.once("packet",function(L){if(!D)if(L.type=="pong"&&L.data=="probe"){if(d('probe transport "%s" pong',f),M.upgrading=!0,M.emit("upgrading",H),!H)return;o.priorWebsocketSuccess=H.name=="websocket",d('pausing current transport "%s"',M.transport.name),M.transport.pause(function(){D||M.readyState!="closed"&&(d("changing transport and sending upgrade packet"),ot(),M.setTransport(H),H.send([{type:"upgrade"}]),M.emit("upgrade",H),H=null,M.upgrading=!1,M.flush())})}else{d('probe transport "%s" failed',f);var U=new Error("probe error");U.transport=H.name,M.emit("upgradeError",U)}}))}function E(){D||(D=!0,ot(),H.close(),H=null)}function x(G){var L=new Error("probe error: "+G);L.transport=H.name,E(),d('probe transport "%s" failed because of error: %s',f,G),M.emit("upgradeError",L)}function W(){x("transport closed")}function st(){x("socket closed")}function V(G){H&&G.name!=H.name&&(d('"%s" works - aborting "%s"',G.name,H.name),E())}function ot(){H.removeListener("open",b),H.removeListener("error",x),H.removeListener("close",W),M.removeListener("close",st),M.removeListener("upgrading",V)}d('probing transport "%s"',f);var H=this.createTransport(f,{probe:1}),D=!1,M=this;o.priorWebsocketSuccess=!1,H.once("open",b),H.once("error",x),H.once("close",W),this.once("close",st),this.once("upgrading",V),H.open()},o.prototype.onOpen=function(){if(d("socket open"),this.readyState="open",o.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){d("starting upgrade probes");for(var f=0,b=this.upgrades.length;b>f;f++)this.probe(this.upgrades[f])}},o.prototype.onPacket=function(f){if(this.readyState=="opening"||this.readyState=="open")switch(d('socket receive: type "%s", data "%s"',f.type,f.data),this.emit("packet",f),this.emit("heartbeat"),f.type){case"open":this.onHandshake(y(f.data));break;case"pong":this.setPing();break;case"error":var b=new Error("server error");b.code=f.data,this.emit("error",b);break;case"message":this.emit("data",f.data),this.emit("message",f.data)}else d('packet received with socket readyState "%s"',this.readyState)},o.prototype.onHandshake=function(f){this.emit("handshake",f),this.id=f.sid,this.transport.query.sid=f.sid,this.upgrades=this.filterUpgrades(f.upgrades),this.pingInterval=f.pingInterval,this.pingTimeout=f.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},o.prototype.onHeartbeat=function(f){clearTimeout(this.pingTimeoutTimer);var b=this;b.pingTimeoutTimer=setTimeout(function(){b.readyState!="closed"&&b.onClose("ping timeout")},f||b.pingInterval+b.pingTimeout)},o.prototype.setPing=function(){var f=this;clearTimeout(f.pingIntervalTimer),f.pingIntervalTimer=setTimeout(function(){d("writing ping packet - expecting pong within %sms",f.pingTimeout),f.ping(),f.onHeartbeat(f.pingTimeout)},f.pingInterval)},o.prototype.ping=function(){this.sendPacket("ping")},o.prototype.onDrain=function(){for(var f=0;f<this.prevBufferLen;f++)this.callbackBuffer[f]&&this.callbackBuffer[f]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},o.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"))},o.prototype.write=o.prototype.send=function(f,b){return this.sendPacket("message",f,b),this},o.prototype.sendPacket=function(f,b,E){if(this.readyState!="closing"&&this.readyState!="closed"){var x={type:f,data:b};this.emit("packetCreate",x),this.writeBuffer.push(x),this.callbackBuffer.push(E),this.flush()}},o.prototype.close=function(){function f(){x.onClose("forced close"),d("socket closing - telling transport to close"),x.transport.close()}function b(){x.removeListener("upgrade",b),x.removeListener("upgradeError",b),f()}function E(){x.once("upgrade",b),x.once("upgradeError",b)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var x=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?E():f()}):this.upgrading?E():f()}return this},o.prototype.onError=function(f){d("socket error %j",f),o.priorWebsocketSuccess=!1,this.emit("error",f),this.onClose("transport error",f)},o.prototype.onClose=function(f,b){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){d('socket close with reason: "%s"',f);var E=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){E.writeBuffer=[],E.callbackBuffer=[],E.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",f,b)}},o.prototype.filterUpgrades=function(f){for(var b=[],E=0,x=f.length;x>E;E++)~S(this.transports,f[E])&&b.push(f[E]);return b}}).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(s,i){function n(h){this.path=h.path,this.hostname=h.hostname,this.port=h.port,this.secure=h.secure,this.query=h.query,this.timestampParam=h.timestampParam,this.timestampRequests=h.timestampRequests,this.readyState="",this.agent=h.agent||!1,this.socket=h.socket,this.enablesXDR=h.enablesXDR,this.pfx=h.pfx,this.key=h.key,this.passphrase=h.passphrase,this.cert=h.cert,this.ca=h.ca,this.ciphers=h.ciphers,this.rejectUnauthorized=h.rejectUnauthorized}var o=s("engine.io-parser"),u=s("component-emitter");i.exports=n,u(n.prototype),n.timestamps=0,n.prototype.onError=function(h,m){var d=new Error(h);return d.type="TransportError",d.description=m,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(h){if(this.readyState!="open")throw new Error("Transport not open");this.write(h)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(h){var m=o.decodePacket(h,this.socket.binaryType);this.onPacket(m)},n.prototype.onPacket=function(h){this.emit("packet",h)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(s,i,n){(function(o){function u(v){var _,y=!1,l=!1,f=v.jsonp!==!1;if(o.location){var b=location.protocol=="https:",E=location.port;E||(E=b?443:80),y=v.hostname!=location.hostname||E!=v.port,l=v.secure!=b}if(v.xdomain=y,v.xscheme=l,_=new h(v),"open"in _&&!v.forceJSONP)return new m(v);if(!f)throw new Error("JSONP disabled");return new d(v)}var h=s("xmlhttprequest"),m=s("./polling-xhr"),d=s("./polling-jsonp"),S=s("./websocket");n.polling=u,n.websocket=S}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(s,i){(function(n){function o(){}function u(_){h.call(this,_),this.query=this.query||{},d||(n.___eio||(n.___eio=[]),d=n.___eio),this.index=d.length;var y=this;d.push(function(l){y.onData(l)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){y.script&&(y.script.onerror=o)},!1)}var h=s("./polling"),m=s("component-inherit");i.exports=u;var d,S=/\n/g,v=/\\n/g;m(u,h),u.prototype.supportsBinary=!1,u.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),h.prototype.doClose.call(this)},u.prototype.doPoll=function(){var _=this,y=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),y.async=!0,y.src=this.uri(),y.onerror=function(b){_.onError("jsonp poll error",b)};var l=document.getElementsByTagName("script")[0];l.parentNode.insertBefore(y,l),this.script=y;var f=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);f&&setTimeout(function(){var b=document.createElement("iframe");document.body.appendChild(b),document.body.removeChild(b)},100)},u.prototype.doWrite=function(_,y){function l(){f(),y()}function f(){if(b.iframe)try{b.form.removeChild(b.iframe)}catch(ot){b.onError("jsonp polling iframe removal error",ot)}try{var V='<iframe src="javascript:0" name="'+b.iframeId+'">';E=document.createElement(V)}catch{E=document.createElement("iframe"),E.name=b.iframeId,E.src="javascript:0"}E.id=b.iframeId,b.form.appendChild(E),b.iframe=E}var b=this;if(!this.form){var E,x=document.createElement("form"),W=document.createElement("textarea"),st=this.iframeId="eio_iframe_"+this.index;x.className="socketio",x.style.position="absolute",x.style.top="-1000px",x.style.left="-1000px",x.target=st,x.method="POST",x.setAttribute("accept-charset","utf-8"),W.name="d",x.appendChild(W),document.body.appendChild(x),this.form=x,this.area=W}this.form.action=this.uri(),f(),_=_.replace(v,`\\
33
- `),this.area.value=_.replace(S,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){b.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(s,i){(function(n){function o(){}function u(l){if(S.call(this,l),n.location){var f=location.protocol=="https:",b=location.port;b||(b=f?443:80),this.xd=l.hostname!=n.location.hostname||b!=l.port,this.xs=l.secure!=f}}function h(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 m(){for(var l in h.requests)h.requests.hasOwnProperty(l)&&h.requests[l].abort()}var d=s("xmlhttprequest"),S=s("./polling"),v=s("component-emitter"),_=s("component-inherit"),y=s("debug")("engine.io-client:polling-xhr");i.exports=u,i.exports.Request=h,_(u,S),u.prototype.supportsBinary=!0,u.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 h(l)},u.prototype.doWrite=function(l,f){var b=typeof l!="string"&&l!==void 0,E=this.request({method:"POST",data:l,isBinary:b}),x=this;E.on("success",f),E.on("error",function(W){x.onError("xhr post error",W)}),this.sendXhr=E},u.prototype.doPoll=function(){y("xhr poll");var l=this.request(),f=this;l.on("data",function(b){f.onData(b)}),l.on("error",function(b){f.onError("xhr poll error",b)}),this.pollXhr=l},v(h.prototype),h.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 f=this.xhr=new d(l),b=this;try{if(y("xhr open %s: %s",this.method,this.uri),f.open(this.method,this.uri,this.async),this.supportsBinary&&(f.responseType="arraybuffer"),this.method=="POST")try{this.isBinary?f.setRequestHeader("Content-type","application/octet-stream"):f.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}"withCredentials"in f&&(f.withCredentials=!0),this.hasXDR()?(f.onload=function(){b.onLoad()},f.onerror=function(){b.onError(f.responseText)}):f.onreadystatechange=function(){f.readyState==4&&(f.status==200||f.status==1223?b.onLoad():setTimeout(function(){b.onError(f.status)},0))},y("xhr data %s",this.data),f.send(this.data)}catch(E){return void setTimeout(function(){b.onError(E)},0)}n.document&&(this.index=h.requestsCount++,h.requests[this.index]=this)},h.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h.prototype.onData=function(l){this.emit("data",l),this.onSuccess()},h.prototype.onError=function(l){this.emit("error",l),this.cleanup(!0)},h.prototype.cleanup=function(l){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=o:this.xhr.onreadystatechange=o,l)try{this.xhr.abort()}catch{}n.document&&delete h.requests[this.index],this.xhr=null}},h.prototype.onLoad=function(){var l;try{var f;try{f=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch{}l=f==="application/octet-stream"?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(b){this.onError(b)}l!=null&&this.onData(l)},h.prototype.hasXDR=function(){return typeof n.XDomainRequest<"u"&&!this.xs&&this.enablesXDR},h.prototype.abort=function(){this.cleanup()},n.document&&(h.requestsCount=0,h.requests={},n.attachEvent?n.attachEvent("onunload",m):n.addEventListener&&n.addEventListener("beforeunload",m,!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(s,i){function n(v){var _=v&&v.forceBase64;(!S||_)&&(this.supportsBinary=!1),o.call(this,v)}var o=s("../transport"),u=s("parseqs"),h=s("engine.io-parser"),m=s("component-inherit"),d=s("debug")("engine.io-client:polling");i.exports=n;var S=function(){var v=s("xmlhttprequest"),_=new v({xdomain:!1});return _.responseType!=null}();m(n,o),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(v){function _(){d("paused"),y.readyState="paused",v()}var y=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(v){var _=this;d("polling got data %s",v);var y=function(l){return _.readyState=="opening"&&_.onOpen(),l.type=="close"?(_.onClose(),!1):void _.onPacket(l)};h.decodePayload(v,this.socket.binaryType,y),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 v(){d("writing close packet"),_.write([{type:"close"}])}var _=this;this.readyState=="open"?(d("transport open - closing"),v()):(d("transport not open - deferring close"),this.once("open",v))},n.prototype.write=function(v){var y=this;this.writable=!1;var _=function(){y.writable=!0,y.emit("drain")},y=this;h.encodePayload(v,this.supportsBinary,function(l){y.doWrite(l,_)})},n.prototype.uri=function(){var v=this.query||{},_=this.secure?"https":"http",y="";return this.timestampRequests!==!1&&(v[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||v.sid||(v.b64=1),v=u.encode(v),this.port&&(_=="https"&&this.port!=443||_=="http"&&this.port!=80)&&(y=":"+this.port),v.length&&(v="?"+v),_+"://"+this.hostname+y+this.path+v}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(s,i){function n(v){var _=v&&v.forceBase64;_&&(this.supportsBinary=!1),o.call(this,v)}var o=s("../transport"),u=s("engine.io-parser"),h=s("parseqs"),m=s("component-inherit"),d=s("debug")("engine.io-client:websocket"),S=s("ws");i.exports=n,m(n,o),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var v=this.uri(),_=void 0,y={agent:this.agent};y.pfx=this.pfx,y.key=this.key,y.passphrase=this.passphrase,y.cert=this.cert,y.ca=this.ca,y.ciphers=this.ciphers,y.rejectUnauthorized=this.rejectUnauthorized,this.ws=new S(v,_,y),this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var v=this;this.ws.onopen=function(){v.onOpen()},this.ws.onclose=function(){v.onClose()},this.ws.onmessage=function(_){v.onData(_.data)},this.ws.onerror=function(_){v.onError("websocket error",_)}},typeof navigator<"u"&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(v){var _=this;setTimeout(function(){o.prototype.onData.call(_,v)},0)}),n.prototype.write=function(v){function _(){y.writable=!0,y.emit("drain")}var y=this;this.writable=!1;for(var l=0,f=v.length;f>l;l++)u.encodePacket(v[l],this.supportsBinary,function(b){try{y.ws.send(b)}catch{d("websocket closed before onclose event")}});setTimeout(_,0)},n.prototype.onClose=function(){o.prototype.onClose.call(this)},n.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},n.prototype.uri=function(){var v=this.query||{},_=this.secure?"wss":"ws",y="";return this.port&&(_=="wss"&&this.port!=443||_=="ws"&&this.port!=80)&&(y=":"+this.port),this.timestampRequests&&(v[this.timestampParam]=+new Date),this.supportsBinary||(v.b64=1),v=h.encode(v),v.length&&(v="?"+v),_+"://"+this.hostname+y+this.path+v},n.prototype.check=function(){return!(!S||"__initialize"in S&&this.name===n.prototype.name)}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,ws:35}],20:[function(s,i){var n=s("has-cors");i.exports=function(o){var u=o.xdomain,h=o.xscheme,m=o.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!u||n))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!h&&m)return new XDomainRequest}catch{}if(!u)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}}},{"has-cors":38}],21:[function(s,i){i.exports=function(n,o){var u=function(){};u.prototype=o.prototype,n.prototype=new u,n.prototype.constructor=n}},{}],22:[function(s,i,n){function o(){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 u(){var S=arguments,v=this.useColors;if(S[0]=(v?"%c":"")+this.namespace+(v?" %c":" ")+S[0]+(v?"%c ":" ")+"+"+n.humanize(this.diff),!v)return S;var _="color: "+this.color;S=[S[0],_,"color: inherit"].concat(Array.prototype.slice.call(S,1));var y=0,l=0;return S[0].replace(/%[a-z%]/g,function(f){f!=="%%"&&(y++,f==="%c"&&(l=y))}),S.splice(l,0,_),S}function h(){return typeof console=="object"&&typeof console.log=="function"&&Function.prototype.apply.call(console.log,console,arguments)}function m(S){try{S==null?localStorage.removeItem("debug"):localStorage.debug=S}catch{}}function d(){var S;try{S=localStorage.debug}catch{}return S}n=i.exports=s("./debug"),n.log=h,n.formatArgs=u,n.save=m,n.load=d,n.useColors=o,n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(S){return JSON.stringify(S)},n.enable(d())},{"./debug":23}],23:[function(s,i,n){function o(){return n.colors[_++%n.colors.length]}function u(y){function l(){}function f(){var E=f,x=+new Date,W=x-(v||x);E.diff=W,E.prev=v,E.curr=x,v=x,E.useColors==null&&(E.useColors=n.useColors()),E.color==null&&E.useColors&&(E.color=o());var st=Array.prototype.slice.call(arguments);st[0]=n.coerce(st[0]),typeof st[0]!="string"&&(st=["%o"].concat(st));var V=0;st[0]=st[0].replace(/%([a-z%])/g,function(H,D){if(H==="%%")return H;V++;var M=n.formatters[D];if(typeof M=="function"){var G=st[V];H=M.call(E,G),st.splice(V,1),V--}return H}),typeof n.formatArgs=="function"&&(st=n.formatArgs.apply(E,st));var ot=f.log||n.log||console.log.bind(console);ot.apply(E,st)}l.enabled=!1,f.enabled=!0;var b=n.enabled(y)?f:l;return b.namespace=y,b}function h(y){n.save(y);for(var l=(y||"").split(/[\s,]+/),f=l.length,b=0;f>b;b++)l[b]&&(y=l[b].replace(/\*/g,".*?"),y[0]==="-"?n.skips.push(new RegExp("^"+y.substr(1)+"$")):n.names.push(new RegExp("^"+y+"$")))}function m(){n.enable("")}function d(y){var l,f;for(l=0,f=n.skips.length;f>l;l++)if(n.skips[l].test(y))return!1;for(l=0,f=n.names.length;f>l;l++)if(n.names[l].test(y))return!0;return!1}function S(y){return y instanceof Error?y.stack||y.message:y}n=i.exports=u,n.coerce=S,n.disable=m,n.enable=h,n.enabled=d,n.humanize=s("ms"),n.names=[],n.skips=[],n.formatters={};var v,_=0},{ms:24}],24:[function(s,i){function n(y){var l=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(y);if(l){var f=parseFloat(l[1]),b=(l[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"y":return f*_;case"days":case"day":case"d":return f*v;case"hours":case"hour":case"h":return f*S;case"minutes":case"minute":case"m":return f*d;case"seconds":case"second":case"s":return f*m;case"ms":return f}}}function o(y){return y>=v?Math.round(y/v)+"d":y>=S?Math.round(y/S)+"h":y>=d?Math.round(y/d)+"m":y>=m?Math.round(y/m)+"s":y+"ms"}function u(y){return h(y,v,"day")||h(y,S,"hour")||h(y,d,"minute")||h(y,m,"second")||y+" ms"}function h(y,l,f){return l>y?void 0:1.5*l>y?Math.floor(y/l)+" "+f:Math.ceil(y/l)+" "+f+"s"}var m=1e3,d=60*m,S=60*d,v=24*S,_=365.25*v;i.exports=function(y,l){return l=l||{},typeof y=="string"?n(y):l.long?u(y):o(y)}},{}],25:[function(s,i,n){(function(o){function u(D,M){var G="b"+n.packets[D.type]+D.data.data;return M(G)}function h(D,M,G){if(!M)return n.encodeBase64Packet(D,G);var L=D.data,U=new Uint8Array(L),X=new Uint8Array(1+L.byteLength);X[0]=st[D.type];for(var Q=0;Q<U.length;Q++)X[Q+1]=U[Q];return G(X.buffer)}function m(D,M,G){if(!M)return n.encodeBase64Packet(D,G);var L=new FileReader;return L.onload=function(){D.data=L.result,n.encodePacket(D,M,!0,G)},L.readAsArrayBuffer(D.data)}function d(D,M,G){if(!M)return n.encodeBase64Packet(D,G);if(W)return m(D,M,G);var L=new Uint8Array(1);L[0]=st[D.type];var U=new H([L.buffer,D.data]);return G(U)}function S(D,M,G){for(var L=new Array(D.length),U=f(D.length,G),X=function(j,B,At){M(B,function(kt,Rt){L[j]=Rt,At(kt,L)})},Q=0;Q<D.length;Q++)X(Q,D[Q],U)}var v=s("./keys"),_=s("has-binary"),y=s("arraybuffer.slice"),l=s("base64-arraybuffer"),f=s("after"),b=s("utf8"),E=navigator.userAgent.match(/Android/i),x=/PhantomJS/i.test(navigator.userAgent),W=E||x;n.protocol=3;var st=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},V=v(st),ot={type:"error",data:"parser error"},H=s("blob");n.encodePacket=function(D,M,G,L){typeof M=="function"&&(L=M,M=!1),typeof G=="function"&&(L=G,G=null);var U=D.data===void 0?void 0:D.data.buffer||D.data;if(o.ArrayBuffer&&U instanceof ArrayBuffer)return h(D,M,L);if(H&&U instanceof o.Blob)return d(D,M,L);if(U&&U.base64)return u(D,L);var X=st[D.type];return D.data!==void 0&&(X+=G?b.encode(String(D.data)):String(D.data)),L(""+X)},n.encodeBase64Packet=function(D,M){var G="b"+n.packets[D.type];if(H&&D.data instanceof H){var L=new FileReader;return L.onload=function(){var B=L.result.split(",")[1];M(G+B)},L.readAsDataURL(D.data)}var U;try{U=String.fromCharCode.apply(null,new Uint8Array(D.data))}catch{for(var X=new Uint8Array(D.data),Q=new Array(X.length),j=0;j<X.length;j++)Q[j]=X[j];U=String.fromCharCode.apply(null,Q)}return G+=o.btoa(U),M(G)},n.decodePacket=function(D,M,G){if(typeof D=="string"||D===void 0){if(D.charAt(0)=="b")return n.decodeBase64Packet(D.substr(1),M);if(G)try{D=b.decode(D)}catch{return ot}var U=D.charAt(0);return Number(U)==U&&V[U]?D.length>1?{type:V[U],data:D.substring(1)}:{type:V[U]}:ot}var L=new Uint8Array(D),U=L[0],X=y(D,1);return H&&M==="blob"&&(X=new H([X])),{type:V[U],data:X}},n.decodeBase64Packet=function(D,M){var G=V[D.charAt(0)];if(!o.ArrayBuffer)return{type:G,data:{base64:!0,data:D.substr(1)}};var L=l.decode(D.substr(1));return M==="blob"&&H&&(L=new H([L])),{type:G,data:L}},n.encodePayload=function(D,M,G){function L(Q){return Q.length+":"+Q}function U(Q,j){n.encodePacket(Q,X?M:!1,!0,function(B){j(null,L(B))})}typeof M=="function"&&(G=M,M=null);var X=_(D);return M&&X?H&&!W?n.encodePayloadAsBlob(D,G):n.encodePayloadAsArrayBuffer(D,G):D.length?void S(D,U,function(Q,j){return G(j.join(""))}):G("0:")},n.decodePayload=function(D,M,G){if(typeof D!="string")return n.decodePayloadAsBinary(D,M,G);typeof M=="function"&&(G=M,M=null);var L;if(D=="")return G(ot,0,1);for(var U,X,Q="",j=0,B=D.length;B>j;j++){var At=D.charAt(j);if(At!=":")Q+=At;else{if(Q==""||Q!=(U=Number(Q))||(X=D.substr(j+1,U),Q!=X.length))return G(ot,0,1);if(X.length){if(L=n.decodePacket(X,M,!0),ot.type==L.type&&ot.data==L.data)return G(ot,0,1);var kt=G(L,j+U,B);if(kt===!1)return}j+=U,Q=""}}return Q!=""?G(ot,0,1):void 0},n.encodePayloadAsArrayBuffer=function(D,M){function G(L,U){n.encodePacket(L,!0,!0,function(X){return U(null,X)})}return D.length?void S(D,G,function(L,U){var X=U.reduce(function(B,At){var kt;return kt=typeof At=="string"?At.length:At.byteLength,B+kt.toString().length+kt+2},0),Q=new Uint8Array(X),j=0;return U.forEach(function(B){var At=typeof B=="string",kt=B;if(At){for(var Rt=new Uint8Array(B.length),ut=0;ut<B.length;ut++)Rt[ut]=B.charCodeAt(ut);kt=Rt.buffer}Q[j++]=At?0:1;for(var Ht=kt.byteLength.toString(),ut=0;ut<Ht.length;ut++)Q[j++]=parseInt(Ht[ut]);Q[j++]=255;for(var Rt=new Uint8Array(kt),ut=0;ut<Rt.length;ut++)Q[j++]=Rt[ut]}),M(Q.buffer)}):M(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(D,M){function G(L,U){n.encodePacket(L,!0,!0,function(X){var Q=new Uint8Array(1);if(Q[0]=1,typeof X=="string"){for(var j=new Uint8Array(X.length),B=0;B<X.length;B++)j[B]=X.charCodeAt(B);X=j.buffer,Q[0]=0}for(var At=X instanceof ArrayBuffer?X.byteLength:X.size,kt=At.toString(),Rt=new Uint8Array(kt.length+1),B=0;B<kt.length;B++)Rt[B]=parseInt(kt[B]);if(Rt[kt.length]=255,H){var ut=new H([Q.buffer,Rt.buffer,X]);U(null,ut)}})}S(D,G,function(L,U){return M(new H(U))})},n.decodePayloadAsBinary=function(D,M,G){typeof M=="function"&&(G=M,M=null);for(var L=D,U=[],X=!1;L.byteLength>0;){for(var Q=new Uint8Array(L),j=Q[0]===0,B="",At=1;Q[At]!=255;At++){if(B.length>310){X=!0;break}B+=Q[At]}if(X)return G(ot,0,1);L=y(L,2+B.length),B=parseInt(B);var kt=y(L,0,B);if(j)try{kt=String.fromCharCode.apply(null,new Uint8Array(kt))}catch{var Rt=new Uint8Array(kt);kt="";for(var At=0;At<Rt.length;At++)kt+=String.fromCharCode(Rt[At])}U.push(kt),L=y(L,B)}var ut=U.length;U.forEach(function(Ht,xe){G(n.decodePacket(Ht,M,!0),xe,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(s,i){i.exports=Object.keys||function(n){var o=[],u=Object.prototype.hasOwnProperty;for(var h in n)u.call(n,h)&&o.push(h);return o}},{}],27:[function(s,i){function n(u,h,m){function d(v,_){if(d.count<=0)throw new Error("after called too many times");--d.count,v?(S=!0,h(v),h=m):d.count!==0||S||h(null,_)}var S=!1;return m=m||o,d.count=u,u===0?h():d}function o(){}i.exports=n},{}],28:[function(s,i){i.exports=function(n,o,u){var h=n.byteLength;if(o=o||0,u=u||h,n.slice)return n.slice(o,u);if(0>o&&(o+=h),0>u&&(u+=h),u>h&&(u=h),o>=h||o>=u||h===0)return new ArrayBuffer(0);for(var m=new Uint8Array(n),d=new Uint8Array(u-o),S=o,v=0;u>S;S++,v++)d[v]=m[S];return d.buffer}},{}],29:[function(s,i,n){(function(o){n.encode=function(u){var h,m=new Uint8Array(u),d=m.length,S="";for(h=0;d>h;h+=3)S+=o[m[h]>>2],S+=o[(3&m[h])<<4|m[h+1]>>4],S+=o[(15&m[h+1])<<2|m[h+2]>>6],S+=o[63&m[h+2]];return d%3===2?S=S.substring(0,S.length-1)+"=":d%3===1&&(S=S.substring(0,S.length-2)+"=="),S},n.decode=function(u){var h,m,d,S,v,_=.75*u.length,y=u.length,l=0;u[u.length-1]==="="&&(_--,u[u.length-2]==="="&&_--);var f=new ArrayBuffer(_),b=new Uint8Array(f);for(h=0;y>h;h+=4)m=o.indexOf(u[h]),d=o.indexOf(u[h+1]),S=o.indexOf(u[h+2]),v=o.indexOf(u[h+3]),b[l++]=m<<2|d>>4,b[l++]=(15&d)<<4|S>>2,b[l++]=(3&S)<<6|63&v;return f}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(s,i){(function(n){function o(_){for(var y=0;y<_.length;y++){var l=_[y];if(l.buffer instanceof ArrayBuffer){var f=l.buffer;if(l.byteLength!==f.byteLength){var b=new Uint8Array(l.byteLength);b.set(new Uint8Array(f,l.byteOffset,l.byteLength)),f=b.buffer}_[y]=f}}}function u(_,y){y=y||{};var l=new m;o(_);for(var f=0;f<_.length;f++)l.append(_[f]);return y.type?l.getBlob(y.type):l.getBlob()}function h(_,y){return o(_),new Blob(_,y||{})}var m=n.BlobBuilder||n.WebKitBlobBuilder||n.MSBlobBuilder||n.MozBlobBuilder,d=function(){try{var _=new Blob(["hi"]);return _.size===2}catch{return!1}}(),S=d&&function(){try{var _=new Blob([new Uint8Array([1,2])]);return _.size===2}catch{return!1}}(),v=m&&m.prototype.append&&m.prototype.getBlob;i.exports=function(){return d?S?n.Blob:h:v?u:void 0}()}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],31:[function(s,i,n){(function(o){(function(u){function h(L){for(var U,X,Q=[],j=0,B=L.length;B>j;)U=L.charCodeAt(j++),U>=55296&&56319>=U&&B>j?(X=L.charCodeAt(j++),(64512&X)==56320?Q.push(((1023&U)<<10)+(1023&X)+65536):(Q.push(U),j--)):Q.push(U);return Q}function m(L){for(var U,X=L.length,Q=-1,j="";++Q<X;)U=L[Q],U>65535&&(U-=65536,j+=ot(U>>>10&1023|55296),U=56320|1023&U),j+=ot(U);return j}function d(L){if(L>=55296&&57343>=L)throw Error("Lone surrogate U+"+L.toString(16).toUpperCase()+" is not a scalar value")}function S(L,U){return ot(L>>U&63|128)}function v(L){if(!(4294967168&L))return ot(L);var U="";return 4294965248&L?4294901760&L?!(4292870144&L)&&(U=ot(L>>18&7|240),U+=S(L,12),U+=S(L,6)):(d(L),U=ot(L>>12&15|224),U+=S(L,6)):U=ot(L>>6&31|192),U+=ot(63&L|128)}function _(L){for(var U,X=h(L),Q=X.length,j=-1,B="";++j<Q;)U=X[j],B+=v(U);return B}function y(){if(V>=st)throw Error("Invalid byte index");var L=255&W[V];if(V++,(192&L)==128)return 63&L;throw Error("Invalid continuation byte")}function l(){var L,U,X,Q,j;if(V>st)throw Error("Invalid byte index");if(V==st)return!1;if(L=255&W[V],V++,(128&L)==0)return L;if((224&L)==192){var U=y();if(j=(31&L)<<6|U,j>=128)return j;throw Error("Invalid continuation byte")}if((240&L)==224){if(U=y(),X=y(),j=(15&L)<<12|U<<6|X,j>=2048)return d(j),j;throw Error("Invalid continuation byte")}if((248&L)==240&&(U=y(),X=y(),Q=y(),j=(15&L)<<18|U<<12|X<<6|Q,j>=65536&&1114111>=j))return j;throw Error("Invalid UTF-8 detected")}function f(L){W=h(L),st=W.length,V=0;for(var U,X=[];(U=l())!==!1;)X.push(U);return m(X)}var b=typeof n=="object"&&n,E=typeof i=="object"&&i&&i.exports==b&&i,x=typeof o=="object"&&o;(x.global===x||x.window===x)&&(u=x);var W,st,V,ot=String.fromCharCode,H={version:"2.0.0",encode:_,decode:f};if(b&&!b.nodeType)if(E)E.exports=H;else{var D={},M=D.hasOwnProperty;for(var G in H)M.call(H,G)&&(b[G]=H[G])}else u.utf8=H})(this)}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],32:[function(s,i){(function(n){var o=/^[\],:{}\s]*$/,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,h=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,d=/^\s+/,S=/\s+$/;i.exports=function(v){return typeof v=="string"&&v?(v=v.replace(d,"").replace(S,""),n.JSON&&JSON.parse?JSON.parse(v):o.test(v.replace(u,"@").replace(h,"]").replace(m,""))?new Function("return "+v)():void 0):null}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],33:[function(s,i,n){n.encode=function(o){var u="";for(var h in o)o.hasOwnProperty(h)&&(u.length&&(u+="&"),u+=encodeURIComponent(h)+"="+encodeURIComponent(o[h]));return u},n.decode=function(o){for(var u={},h=o.split("&"),m=0,d=h.length;d>m;m++){var S=h[m].split("=");u[decodeURIComponent(S[0])]=decodeURIComponent(S[1])}return u}},{}],34:[function(s,i){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];i.exports=function(u){var h=u,m=u.indexOf("["),d=u.indexOf("]");m!=-1&&d!=-1&&(u=u.substring(0,m)+u.substring(m,d).replace(/:/g,";")+u.substring(d,u.length));for(var S=n.exec(u||""),v={},_=14;_--;)v[o[_]]=S[_]||"";return m!=-1&&d!=-1&&(v.source=h,v.host=v.host.substring(1,v.host.length-1).replace(/;/g,":"),v.authority=v.authority.replace("[","").replace("]","").replace(/;/g,":"),v.ipv6uri=!0),v}},{}],35:[function(s,i){function n(h,m){return m?new u(h,m):new u(h)}var o=function(){return self}(),u=o.WebSocket||o.MozWebSocket;i.exports=u?n:null,u&&(n.prototype=u.prototype)},{}],36:[function(s,i){(function(n){function o(h){function m(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(u(d)){for(var S=0;S<d.length;S++)if(m(d[S]))return!0}else if(d&&typeof d=="object"){d.toJSON&&(d=d.toJSON());for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)&&m(d[v]))return!0}return!1}return m(h)}var u=s("isarray");i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{isarray:37}],37:[function(s,i){i.exports=Array.isArray||function(n){return Object.prototype.toString.call(n)=="[object Array]"}},{}],38:[function(s,i){var n=s("global");try{i.exports="XMLHttpRequest"in n&&"withCredentials"in new n.XMLHttpRequest}catch{i.exports=!1}},{global:39}],39:[function(s,i){i.exports=function(){return this}()},{}],40:[function(s,i){var n=[].indexOf;i.exports=function(o,u){if(n)return o.indexOf(u);for(var h=0;h<o.length;++h)if(o[h]===u)return h;return-1}},{}],41:[function(s,i,n){var o=Object.prototype.hasOwnProperty;n.keys=Object.keys||function(u){var h=[];for(var m in u)o.call(u,m)&&h.push(m);return h},n.values=function(u){var h=[];for(var m in u)o.call(u,m)&&h.push(u[m]);return h},n.merge=function(u,h){for(var m in h)o.call(h,m)&&(u[m]=h[m]);return u},n.length=function(u){return n.keys(u).length},n.isEmpty=function(u){return n.length(u)==0}},{}],42:[function(s,i){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];i.exports=function(u){for(var h=n.exec(u||""),m={},d=14;d--;)m[o[d]]=h[d]||"";return m}},{}],43:[function(s,i,n){(function(o){var u=s("isarray"),h=s("./is-buffer");n.deconstructPacket=function(m){function d(y){if(!y)return y;if(h(y)){var l={_placeholder:!0,num:S.length};return S.push(y),l}if(u(y)){for(var f=new Array(y.length),b=0;b<y.length;b++)f[b]=d(y[b]);return f}if(typeof y=="object"&&!(y instanceof Date)){var f={};for(var E in y)f[E]=d(y[E]);return f}return y}var S=[],v=m.data,_=m;return _.data=d(v),_.attachments=S.length,{packet:_,buffers:S}},n.reconstructPacket=function(m,d){function S(v){if(v&&v._placeholder){var _=d[v.num];return _}if(u(v)){for(var y=0;y<v.length;y++)v[y]=S(v[y]);return v}if(v&&typeof v=="object"){for(var l in v)v[l]=S(v[l]);return v}return v}return m.data=S(m.data),m.attachments=void 0,m},n.removeBlobs=function(m,d){function S(y,l,f){if(!y)return y;if(o.Blob&&y instanceof Blob||o.File&&y instanceof File){v++;var b=new FileReader;b.onload=function(){f?f[l]=this.result:_=this.result,--v||d(_)},b.readAsArrayBuffer(y)}else if(u(y))for(var E=0;E<y.length;E++)S(y[E],E,y);else if(y&&typeof y=="object"&&!h(y))for(var x in y)S(y[x],x,y)}var v=0,_=m;S(_),v||d(_)}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./is-buffer":45,isarray:46}],44:[function(s,i,n){function o(){}function u(E){var x="",W=!1;return x+=E.type,(n.BINARY_EVENT==E.type||n.BINARY_ACK==E.type)&&(x+=E.attachments,x+="-"),E.nsp&&E.nsp!="/"&&(W=!0,x+=E.nsp),E.id!=null&&(W&&(x+=",",W=!1),x+=E.id),E.data!=null&&(W&&(x+=","),x+=y.stringify(E.data)),_("encoded %j as %s",E,x),x}function h(E,x){function W(st){var V=f.deconstructPacket(st),ot=u(V.packet),H=V.buffers;H.unshift(ot),x(H)}f.removeBlobs(E,W)}function m(){this.reconstructor=null}function d(E){var x={},W=0;if(x.type=Number(E.charAt(0)),n.types[x.type]==null)return v();if(n.BINARY_EVENT==x.type||n.BINARY_ACK==x.type){for(var st="";E.charAt(++W)!="-"&&(st+=E.charAt(W),W!=E.length););if(st!=Number(st)||E.charAt(W)!="-")throw new Error("Illegal attachments");x.attachments=Number(st)}if(E.charAt(W+1)=="/")for(x.nsp="";++W;){var V=E.charAt(W);if(V==","||(x.nsp+=V,W==E.length))break}else x.nsp="/";var ot=E.charAt(W+1);if(ot!==""&&Number(ot)==ot){for(x.id="";++W;){var V=E.charAt(W);if(V==null||Number(V)!=V){--W;break}if(x.id+=E.charAt(W),W==E.length)break}x.id=Number(x.id)}if(E.charAt(++W))try{x.data=y.parse(E.substr(W))}catch{return v()}return _("decoded %s as %j",E,x),x}function S(E){this.reconPack=E,this.buffers=[]}function v(){return{type:n.ERROR,data:"parser error"}}var _=s("debug")("socket.io-parser"),y=s("json3"),l=(s("isarray"),s("component-emitter")),f=s("./binary"),b=s("./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=o,n.Decoder=m,o.prototype.encode=function(E,x){if(_("encoding packet %j",E),n.BINARY_EVENT==E.type||n.BINARY_ACK==E.type)h(E,x);else{var W=u(E);x([W])}},l(m.prototype),m.prototype.add=function(E){var x;if(typeof E=="string")x=d(E),n.BINARY_EVENT==x.type||n.BINARY_ACK==x.type?(this.reconstructor=new S(x),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",x)):this.emit("decoded",x);else{if(!b(E)&&!E.base64)throw new Error("Unknown type: "+E);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");x=this.reconstructor.takeBinaryData(E),x&&(this.reconstructor=null,this.emit("decoded",x))}},m.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},S.prototype.takeBinaryData=function(E){if(this.buffers.push(E),this.buffers.length==this.reconPack.attachments){var x=f.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),x}return null},S.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(s,i){(function(n){function o(u){return n.Buffer&&n.Buffer.isBuffer(u)||n.ArrayBuffer&&u instanceof ArrayBuffer}i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],46:[function(s,i){i.exports=s(37)},{}],47:[function(s,i,n){(function(o){function u(q){if(u[q]!==d)return u[q];var J;if(q=="bug-string-char-index")J=!1;else if(q=="json")J=u("json-stringify")&&u("json-parse");else{var F,et='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(q=="json-stringify"){var P=_.stringify,Z=typeof P=="function"&&y;if(Z){(F=function(){return 1}).toJSON=F;try{Z=P(0)==="0"&&P(new Number)==="0"&&P(new String)=='""'&&P(S)===d&&P(d)===d&&P()===d&&P(F)==="1"&&P([F])=="[1]"&&P([d])=="[null]"&&P(null)=="null"&&P([d,S,null])=="[null,null,null]"&&P({a:[F,!0,!1,null,`\0\b
32
+ }`;var pt=pu(function(){return _t(d,Y+"return "+N).apply(n,w)});if(pt.source=N,hs(pt))throw pt;return pt}function Kg(t){return St(t).toLowerCase()}function Gg(t){return St(t).toUpperCase()}function Hg(t,e,r){if(t=St(t),t&&(r||e===n))return So(t);if(!t||!(e=ce(e)))return t;var a=Ce(t),c=Ce(e),d=Co(a,c),w=Eo(a,c)+1;return en(a,d,w).join("")}function $g(t,e,r){if(t=St(t),t&&(r||e===n))return t.slice(0,ko(t)+1);if(!t||!(e=ce(e)))return t;var a=Ce(t),c=Eo(a,Ce(e))+1;return en(a,0,c).join("")}function zg(t,e,r){if(t=St(t),t&&(r||e===n))return t.replace(hi,"");if(!t||!(e=ce(e)))return t;var a=Ce(t),c=Co(a,Ce(e));return en(a,c).join("")}function Xg(t,e){var r=U,a=X;if(Lt(e)){var c="separator"in e?e.separator:c;r="length"in e?lt(e.length):r,a="omission"in e?ce(e.omission):a}t=St(t);var d=t.length;if(mn(t)){var w=Ce(t);d=w.length}if(r>=d)return t;var C=r-_n(a);if(C<1)return a;var A=w?en(w,0,C).join(""):t.slice(0,C);if(c===n)return A+a;if(w&&(C+=A.length-C),fs(c)){if(t.slice(C).search(c)){var O,I=A;for(c.global||(c=Ti(c.source,St(Gs.exec(c))+"g")),c.lastIndex=0;O=c.exec(I);)var N=O.index;A=A.slice(0,N===n?C:N)}}else if(t.indexOf(ce(c),C)!=C){var K=A.lastIndexOf(c);K>-1&&(A=A.slice(0,K))}return A+a}function Jg(t){return t=St(t),t&&ic.test(t)?t.replace(qs,Sh):t}var Vg=kn(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),ds=da("toUpperCase");function lu(t,e,r){return t=St(t),e=r?n:e,e===n?yh(t)?Ah(t):uh(t):t.match(e)||[]}var pu=dt(function(t,e){try{return ae(t,n,e)}catch(r){return hs(r)?r:new ct(r)}}),Yg=We(function(t,e){return de(e,function(r){r=Ne(r),Me(t,r,us(t[r],t))}),t});function jg(t){var e=t==null?0:t.length,r=nt();return t=e?It(t,function(a){if(typeof a[1]!="function")throw new ge(m);return[r(a[0]),a[1]]}):[],dt(function(a){for(var c=-1;++c<e;){var d=t[c];if(ae(d[0],this,a))return ae(d[1],this,a)}})}function Zg(t){return Cf(ye(t,y))}function gs(t){return function(){return t}}function Qg(t,e){return t==null||t!==t?e:t}var tv=va(),ev=va(!0);function re(t){return t}function vs(t){return zo(typeof t=="function"?t:ye(t,y))}function nv(t){return Jo(ye(t,y))}function rv(t,e){return Vo(t,ye(e,y))}var iv=dt(function(t,e){return function(r){return Hn(r,t,e)}}),sv=dt(function(t,e){return function(r){return Hn(t,r,e)}});function ys(t,e,r){var a=Mt(e),c=Er(e,a);r==null&&!(Lt(e)&&(c.length||!a.length))&&(r=e,e=t,t=this,c=Er(e,Mt(e)));var d=!(Lt(r)&&"chain"in r)||!!r.chain,w=Ge(t);return de(c,function(C){var A=e[C];t[C]=A,w&&(t.prototype[C]=function(){var O=this.__chain__;if(d||O){var I=t(this.__wrapped__),N=I.__actions__=te(this.__actions__);return N.push({func:A,args:arguments,thisArg:t}),I.__chain__=O,I}return A.apply(t,Ve([this.value()],arguments))})}),t}function ov(){return Wt._===this&&(Wt._=Ih),this}function ms(){}function av(t){return t=lt(t),dt(function(e){return Yo(e,t)})}var uv=Vi(It),cv=Vi(yo),hv=Vi(wi);function du(t){return ns(t)?bi(Ne(t)):qf(t)}function fv(t){return function(e){return t==null?n:cn(t,e)}}var lv=ma(),pv=ma(!0);function _s(){return[]}function ws(){return!1}function dv(){return{}}function gv(){return""}function vv(){return!0}function yv(t,e){if(t=lt(t),t<1||t>ut)return[];var r=se,a=zt(t,se);e=nt(e),t-=se;for(var c=Ei(a,e);++r<t;)e(r);return c}function mv(t){return ht(t)?It(t,Ne):he(t)?[t]:te(Ba(St(t)))}function _v(t){var e=++Rh;return St(t)+e}var wv=Or(function(t,e){return t+e},0),bv=Yi("ceil"),Sv=Or(function(t,e){return t/e},1),Cv=Yi("floor");function Ev(t){return t&&t.length?Cr(t,re,Ui):n}function Av(t,e){return t&&t.length?Cr(t,nt(e,2),Ui):n}function kv(t){return wo(t,re)}function Tv(t,e){return wo(t,nt(e,2))}function xv(t){return t&&t.length?Cr(t,re,Mi):n}function Rv(t,e){return t&&t.length?Cr(t,nt(e,2),Mi):n}var Ov=Or(function(t,e){return t*e},1),Iv=Yi("round"),Lv=Or(function(t,e){return t-e},0);function Nv(t){return t&&t.length?Ci(t,re):0}function Bv(t,e){return t&&t.length?Ci(t,nt(e,2)):0}return p.after=nd,p.ary=$a,p.assign=Gd,p.assignIn=su,p.assignInWith=Gr,p.assignWith=Hd,p.at=$d,p.before=za,p.bind=us,p.bindAll=Yg,p.bindKey=Xa,p.castArray=dd,p.chain=Ka,p.chunk=Cl,p.compact=El,p.concat=Al,p.cond=jg,p.conforms=Zg,p.constant=gs,p.countBy=Np,p.create=zd,p.curry=Ja,p.curryRight=Va,p.debounce=Ya,p.defaults=Xd,p.defaultsDeep=Jd,p.defer=rd,p.delay=id,p.difference=kl,p.differenceBy=Tl,p.differenceWith=xl,p.drop=Rl,p.dropRight=Ol,p.dropRightWhile=Il,p.dropWhile=Ll,p.fill=Nl,p.filter=Up,p.flatMap=Fp,p.flatMapDeep=Mp,p.flatMapDepth=qp,p.flatten=Fa,p.flattenDeep=Bl,p.flattenDepth=Ul,p.flip=sd,p.flow=tv,p.flowRight=ev,p.fromPairs=Dl,p.functions=eg,p.functionsIn=ng,p.groupBy=Wp,p.initial=Fl,p.intersection=Ml,p.intersectionBy=ql,p.intersectionWith=Wl,p.invert=ig,p.invertBy=sg,p.invokeMap=Gp,p.iteratee=vs,p.keyBy=Hp,p.keys=Mt,p.keysIn=ne,p.map=Pr,p.mapKeys=ag,p.mapValues=ug,p.matches=nv,p.matchesProperty=rv,p.memoize=Mr,p.merge=cg,p.mergeWith=ou,p.method=iv,p.methodOf=sv,p.mixin=ys,p.negate=qr,p.nthArg=av,p.omit=hg,p.omitBy=fg,p.once=od,p.orderBy=$p,p.over=uv,p.overArgs=ad,p.overEvery=cv,p.overSome=hv,p.partial=cs,p.partialRight=ja,p.partition=zp,p.pick=lg,p.pickBy=au,p.property=du,p.propertyOf=fv,p.pull=$l,p.pullAll=qa,p.pullAllBy=zl,p.pullAllWith=Xl,p.pullAt=Jl,p.range=lv,p.rangeRight=pv,p.rearg=ud,p.reject=Vp,p.remove=Vl,p.rest=cd,p.reverse=os,p.sampleSize=jp,p.set=dg,p.setWith=gg,p.shuffle=Zp,p.slice=Yl,p.sortBy=ed,p.sortedUniq=rp,p.sortedUniqBy=ip,p.split=Fg,p.spread=hd,p.tail=sp,p.take=op,p.takeRight=ap,p.takeRightWhile=up,p.takeWhile=cp,p.tap=Ep,p.throttle=fd,p.thru=Dr,p.toArray=nu,p.toPairs=uu,p.toPairsIn=cu,p.toPath=mv,p.toPlainObject=iu,p.transform=vg,p.unary=ld,p.union=hp,p.unionBy=fp,p.unionWith=lp,p.uniq=pp,p.uniqBy=dp,p.uniqWith=gp,p.unset=yg,p.unzip=as,p.unzipWith=Wa,p.update=mg,p.updateWith=_g,p.values=Rn,p.valuesIn=wg,p.without=vp,p.words=lu,p.wrap=pd,p.xor=yp,p.xorBy=mp,p.xorWith=_p,p.zip=wp,p.zipObject=bp,p.zipObjectDeep=Sp,p.zipWith=Cp,p.entries=uu,p.entriesIn=cu,p.extend=su,p.extendWith=Gr,ys(p,p),p.add=wv,p.attempt=pu,p.camelCase=Eg,p.capitalize=hu,p.ceil=bv,p.clamp=bg,p.clone=gd,p.cloneDeep=yd,p.cloneDeepWith=md,p.cloneWith=vd,p.conformsTo=_d,p.deburr=fu,p.defaultTo=Qg,p.divide=Sv,p.endsWith=Ag,p.eq=Ae,p.escape=kg,p.escapeRegExp=Tg,p.every=Bp,p.find=Dp,p.findIndex=Da,p.findKey=Vd,p.findLast=Pp,p.findLastIndex=Pa,p.findLastKey=Yd,p.floor=Cv,p.forEach=Ga,p.forEachRight=Ha,p.forIn=jd,p.forInRight=Zd,p.forOwn=Qd,p.forOwnRight=tg,p.get=ls,p.gt=wd,p.gte=bd,p.has=rg,p.hasIn=ps,p.head=Ma,p.identity=re,p.includes=Kp,p.indexOf=Pl,p.inRange=Sg,p.invoke=og,p.isArguments=ln,p.isArray=ht,p.isArrayBuffer=Sd,p.isArrayLike=ee,p.isArrayLikeObject=Bt,p.isBoolean=Cd,p.isBuffer=nn,p.isDate=Ed,p.isElement=Ad,p.isEmpty=kd,p.isEqual=Td,p.isEqualWith=xd,p.isError=hs,p.isFinite=Rd,p.isFunction=Ge,p.isInteger=Za,p.isLength=Wr,p.isMap=Qa,p.isMatch=Od,p.isMatchWith=Id,p.isNaN=Ld,p.isNative=Nd,p.isNil=Ud,p.isNull=Bd,p.isNumber=tu,p.isObject=Lt,p.isObjectLike=Nt,p.isPlainObject=Yn,p.isRegExp=fs,p.isSafeInteger=Dd,p.isSet=eu,p.isString=Kr,p.isSymbol=he,p.isTypedArray=xn,p.isUndefined=Pd,p.isWeakMap=Fd,p.isWeakSet=Md,p.join=Kl,p.kebabCase=xg,p.last=_e,p.lastIndexOf=Gl,p.lowerCase=Rg,p.lowerFirst=Og,p.lt=qd,p.lte=Wd,p.max=Ev,p.maxBy=Av,p.mean=kv,p.meanBy=Tv,p.min=xv,p.minBy=Rv,p.stubArray=_s,p.stubFalse=ws,p.stubObject=dv,p.stubString=gv,p.stubTrue=vv,p.multiply=Ov,p.nth=Hl,p.noConflict=ov,p.noop=ms,p.now=Fr,p.pad=Ig,p.padEnd=Lg,p.padStart=Ng,p.parseInt=Bg,p.random=Cg,p.reduce=Xp,p.reduceRight=Jp,p.repeat=Ug,p.replace=Dg,p.result=pg,p.round=Iv,p.runInContext=E,p.sample=Yp,p.size=Qp,p.snakeCase=Pg,p.some=td,p.sortedIndex=jl,p.sortedIndexBy=Zl,p.sortedIndexOf=Ql,p.sortedLastIndex=tp,p.sortedLastIndexBy=ep,p.sortedLastIndexOf=np,p.startCase=Mg,p.startsWith=qg,p.subtract=Lv,p.sum=Nv,p.sumBy=Bv,p.template=Wg,p.times=yv,p.toFinite=He,p.toInteger=lt,p.toLength=ru,p.toLower=Kg,p.toNumber=we,p.toSafeInteger=Kd,p.toString=St,p.toUpper=Gg,p.trim=Hg,p.trimEnd=$g,p.trimStart=zg,p.truncate=Xg,p.unescape=Jg,p.uniqueId=_v,p.upperCase=Vg,p.upperFirst=ds,p.each=Ga,p.eachRight=Ha,p.first=Ma,ys(p,function(){var t={};return Ie(p,function(e,r){Ct.call(p.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),p.VERSION=o,de(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){p[t].placeholder=p}),de(["drop","take"],function(t,e){vt.prototype[t]=function(r){r=r===n?1:Ft(lt(r),0);var a=this.__filtered__&&!e?new vt(this):this.clone();return a.__filtered__?a.__takeCount__=zt(r,a.__takeCount__):a.__views__.push({size:zt(r,se),type:t+(a.__dir__<0?"Right":"")}),a},vt.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),de(["filter","map","takeWhile"],function(t,e){var r=e+1,a=r==B||r==At;vt.prototype[t]=function(c){var d=this.clone();return d.__iteratees__.push({iteratee:nt(c,3),type:r}),d.__filtered__=d.__filtered__||a,d}}),de(["head","last"],function(t,e){var r="take"+(e?"Right":"");vt.prototype[t]=function(){return this[r](1).value()[0]}}),de(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");vt.prototype[t]=function(){return this.__filtered__?new vt(this):this[r](1)}}),vt.prototype.compact=function(){return this.filter(re)},vt.prototype.find=function(t){return this.filter(t).head()},vt.prototype.findLast=function(t){return this.reverse().find(t)},vt.prototype.invokeMap=dt(function(t,e){return typeof t=="function"?new vt(this):this.map(function(r){return Hn(r,t,e)})}),vt.prototype.reject=function(t){return this.filter(qr(nt(t)))},vt.prototype.slice=function(t,e){t=lt(t);var r=this;return r.__filtered__&&(t>0||e<0)?new vt(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(e=lt(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},vt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vt.prototype.toArray=function(){return this.take(se)},Ie(vt.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),a=/^(?:head|last)$/.test(e),c=p[a?"take"+(e=="last"?"Right":""):e],d=a||/^find/.test(e);c&&(p.prototype[e]=function(){var w=this.__wrapped__,C=a?[1]:arguments,A=w instanceof vt,O=C[0],I=A||ht(w),N=function(gt){var yt=c.apply(p,Ve([gt],C));return a&&K?yt[0]:yt};I&&r&&typeof O=="function"&&O.length!=1&&(A=I=!1);var K=this.__chain__,Y=!!this.__actions__.length,rt=d&&!K,pt=A&&!Y;if(!d&&I){w=pt?w:new vt(this);var it=t.apply(w,C);return it.__actions__.push({func:Dr,args:[N],thisArg:n}),new ve(it,K)}return rt&&pt?t.apply(this,C):(it=this.thru(N),rt?a?it.value()[0]:it.value():it)})}),de(["pop","push","shift","sort","splice","unshift"],function(t){var e=ur[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",a=/^(?:pop|shift)$/.test(t);p.prototype[t]=function(){var c=arguments;if(a&&!this.__chain__){var d=this.value();return e.apply(ht(d)?d:[],c)}return this[r](function(w){return e.apply(ht(w)?w:[],c)})}}),Ie(vt.prototype,function(t,e){var r=p[e];if(r){var a=r.name+"";Ct.call(Cn,a)||(Cn[a]=[]),Cn[a].push({name:e,func:r})}}),Cn[Rr(n,W).name]=[{name:"wrapper",func:n}],vt.prototype.clone=Xh,vt.prototype.reverse=Jh,vt.prototype.value=Vh,p.prototype.at=Ap,p.prototype.chain=kp,p.prototype.commit=Tp,p.prototype.next=xp,p.prototype.plant=Op,p.prototype.reverse=Ip,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Lp,p.prototype.first=p.prototype.head,Pn&&(p.prototype[Pn]=Rp),p},wn=kh();rn?((rn.exports=wn)._=wn,vi._=wn):Wt._=wn}).call(jn)})(Zr,Zr.exports);var Hv=Zr.exports;const $v={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,namespace:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function zv(){return function s(i,n,o){function u(g,S){if(!n[g]){if(!i[g]){var v=typeof require=="function"&&require;if(!S&&v)return v(g,!0);if(h)return h(g,!0);throw new Error("Cannot find module '"+g+"'")}var _=n[g]={exports:{}};i[g][0].call(_.exports,function(y){var l=i[g][1][y];return u(l||y)},_,_.exports,s,i,n,o)}return n[g].exports}for(var h=typeof require=="function"&&require,m=0;m<o.length;m++)u(o[m]);return u}({1:[function(s,i){i.exports=s("./lib/")},{"./lib/":2}],2:[function(s,i,n){function o(v,_){typeof v=="object"&&(_=v,v=void 0),_=_||{};var y,l=u(v),f=l.source,b=l.id;return _.forceNew||_["force new connection"]||_.multiplex===!1?(g("ignoring socket cache for %s",f),y=m(f,_)):(S[b]||(g("new io instance for %s",f),S[b]=m(f,_)),y=S[b]),y.socket(l.path)}var u=s("./url"),h=s("socket.io-parser"),m=s("./manager"),g=s("debug")("socket.io-client");i.exports=n=o;var S=n.managers={};n.protocol=h.protocol,n.connect=o,n.Manager=s("./manager"),n.Socket=s("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(s,i){function n(l,f){return this instanceof n?(l&&typeof l=="object"&&(f=l,l=void 0),f=f||{},f.path=f.path||"/socket.io",this.nsps={},this.subs=[],this.opts=f,this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor(f.randomizationFactor||.5),this.backoff=new y({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this.readyState="closed",this.uri=l,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new m.Encoder,this.decoder=new m.Decoder,this.autoConnect=f.autoConnect!==!1,void(this.autoConnect&&this.open())):new n(l,f)}var o=(s("./url"),s("engine.io-client")),u=s("./socket"),h=s("component-emitter"),m=s("socket.io-parser"),g=s("./on"),S=s("component-bind"),v=(s("object-component"),s("debug")("socket.io-client:manager")),_=s("indexof"),y=s("backo2");i.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},h(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(v("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;v("opening %s",this.uri),this.engine=o(this.uri,this.opts);var f=this.engine,b=this;this.readyState="opening",this.skipReconnect=!1;var k=g(f,"open",function(){b.onopen(),l&&l()}),x=g(f,"error",function(V){if(v("connect_error"),b.cleanup(),b.readyState="closed",b.emitAll("connect_error",V),l){var ot=new Error("Connection error");ot.data=V,l(ot)}else b.maybeReconnectOnOpen()});if(this._timeout!==!1){var W=this._timeout;v("connect attempt will timeout after %d",W);var st=setTimeout(function(){v("connect attempt timed out after %d",W),k.destroy(),f.close(),f.emit("error","timeout"),b.emitAll("connect_timeout",W)},W);this.subs.push({destroy:function(){clearTimeout(st)}})}return this.subs.push(k),this.subs.push(x),this},n.prototype.onopen=function(){v("open"),this.cleanup(),this.readyState="open",this.emit("open");var l=this.engine;this.subs.push(g(l,"data",S(this,"ondata"))),this.subs.push(g(this.decoder,"decoded",S(this,"ondecoded"))),this.subs.push(g(l,"error",S(this,"onerror"))),this.subs.push(g(l,"close",S(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){v("error",l),this.emitAll("error",l)},n.prototype.socket=function(l){var f=this.nsps[l];if(!f){f=new u(this,l),this.nsps[l]=f;var b=this;f.on("connect",function(){f.id=b.engine.id,~_(b.connected,f)||b.connected.push(f)})}return f},n.prototype.destroy=function(l){var f=_(this.connected,l);~f&&this.connected.splice(f,1),this.connected.length||this.close()},n.prototype.packet=function(l){v("writing packet %j",l);var f=this;f.encoding?f.packetBuffer.push(l):(f.encoding=!0,this.encoder.encode(l,function(b){for(var k=0;k<b.length;k++)f.engine.write(b[k]);f.encoding=!1,f.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){v("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)v("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var f=this.backoff.duration();v("will wait %dms before reconnect attempt",f),this.reconnecting=!0;var b=setTimeout(function(){l.skipReconnect||(v("attempting reconnect"),l.emitAll("reconnect_attempt",l.backoff.attempts),l.emitAll("reconnecting",l.backoff.attempts),l.skipReconnect||l.open(function(k){k?(v("reconnect attempt error"),l.reconnecting=!1,l.reconnect(),l.emitAll("reconnect_error",k.data)):(v("reconnect success"),l.onreconnect())}))},f);this.subs.push({destroy:function(){clearTimeout(b)}})}},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(s,i){function n(o,u,h){return o.on(u,h),{destroy:function(){o.removeListener(u,h)}}}i.exports=n},{}],5:[function(s,i,n){function o(f,b){this.io=f,this.nsp=b,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var u=s("socket.io-parser"),h=s("component-emitter"),m=s("to-array"),g=s("./on"),S=s("component-bind"),v=s("debug")("socket.io-client:socket"),_=s("has-binary");i.exports=o;var y={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=h.prototype.emit;h(o.prototype),o.prototype.subEvents=function(){if(!this.subs){var f=this.io;this.subs=[g(f,"open",S(this,"onopen")),g(f,"packet",S(this,"onpacket")),g(f,"close",S(this,"onclose"))]}},o.prototype.open=o.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},o.prototype.send=function(){var f=m(arguments);return f.unshift("message"),this.emit.apply(this,f),this},o.prototype.emit=function(f){if(y.hasOwnProperty(f))return l.apply(this,arguments),this;var b=m(arguments),k=u.EVENT;_(b)&&(k=u.BINARY_EVENT);var x={type:k,data:b};return typeof b[b.length-1]=="function"&&(v("emitting packet with ack id %d",this.ids),this.acks[this.ids]=b.pop(),x.id=this.ids++),this.connected?this.packet(x):this.sendBuffer.push(x),this},o.prototype.packet=function(f){f.nsp=this.nsp,this.io.packet(f)},o.prototype.onopen=function(){v("transport is open - connecting"),this.nsp!="/"&&this.packet({type:u.CONNECT})},o.prototype.onclose=function(f){v("close (%s)",f),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",f)},o.prototype.onpacket=function(f){if(f.nsp==this.nsp)switch(f.type){case u.CONNECT:this.onconnect();break;case u.EVENT:this.onevent(f);break;case u.BINARY_EVENT:this.onevent(f);break;case u.ACK:this.onack(f);break;case u.BINARY_ACK:this.onack(f);break;case u.DISCONNECT:this.ondisconnect();break;case u.ERROR:this.emit("error",f.data)}},o.prototype.onevent=function(f){var b=f.data||[];v("emitting event %j",b),f.id!=null&&(v("attaching ack callback to event"),b.push(this.ack(f.id))),this.connected?l.apply(this,b):this.receiveBuffer.push(b)},o.prototype.ack=function(f){var b=this,k=!1;return function(){if(!k){k=!0;var x=m(arguments);v("sending ack %j",x);var W=_(x)?u.BINARY_ACK:u.ACK;b.packet({type:W,id:f,data:x})}}},o.prototype.onack=function(f){v("calling ack %s with %j",f.id,f.data);var b=this.acks[f.id];b.apply(this,f.data),delete this.acks[f.id]},o.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},o.prototype.emitBuffered=function(){var f;for(f=0;f<this.receiveBuffer.length;f++)l.apply(this,this.receiveBuffer[f]);for(this.receiveBuffer=[],f=0;f<this.sendBuffer.length;f++)this.packet(this.sendBuffer[f]);this.sendBuffer=[]},o.prototype.ondisconnect=function(){v("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},o.prototype.destroy=function(){if(this.subs){for(var f=0;f<this.subs.length;f++)this.subs[f].destroy();this.subs=null}this.io.destroy(this)},o.prototype.close=o.prototype.disconnect=function(){return this.connected&&(v("performing disconnect (%s)",this.nsp),this.packet({type:u.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(s,i){(function(n){function o(m,v){var S=m,v=v||n.location;return m==null&&(m=v.protocol+"//"+v.host),typeof m=="string"&&(m.charAt(0)=="/"&&(m=m.charAt(1)=="/"?v.protocol+m:v.hostname+m),/^(https?|wss?):\/\//.test(m)||(h("protocol-less url %s",m),m=typeof v<"u"?v.protocol+"//"+m:"https://"+m),h("parse %s",m),S=u(m)),S.port||(/^(http|ws)$/.test(S.protocol)?S.port="80":/^(http|ws)s$/.test(S.protocol)&&(S.port="443")),S.path=S.path||"/",S.id=S.protocol+"://"+S.host+":"+S.port,S.href=S.protocol+"://"+S.host+(v&&v.port==S.port?"":":"+S.port),S}var u=s("parseuri"),h=s("debug")("socket.io-client:url");i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(s,i){function n(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}i.exports=n,n.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var u=Math.random(),h=Math.floor(u*this.jitter*o);o=1&Math.floor(10*u)?o+h:o-h}return 0|Math.min(o,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(o){this.ms=o},n.prototype.setMax=function(o){this.max=o},n.prototype.setJitter=function(o){this.jitter=o}},{}],8:[function(s,i){var n=[].slice;i.exports=function(o,u){if(typeof u=="string"&&(u=o[u]),typeof u!="function")throw new Error("bind() requires a function");var h=n.call(arguments,2);return function(){return u.apply(o,h.concat(n.call(arguments)))}}},{}],9:[function(s,i){function n(u){return u?o(u):void 0}function o(u){for(var h in n.prototype)u[h]=n.prototype[h];return u}i.exports=n,n.prototype.on=n.prototype.addEventListener=function(u,h){return this._callbacks=this._callbacks||{},(this._callbacks[u]=this._callbacks[u]||[]).push(h),this},n.prototype.once=function(u,h){function m(){g.off(u,m),h.apply(this,arguments)}var g=this;return this._callbacks=this._callbacks||{},m.fn=h,this.on(u,m),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(u,h){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var m=this._callbacks[u];if(!m)return this;if(arguments.length==1)return delete this._callbacks[u],this;for(var g,S=0;S<m.length;S++)if(g=m[S],g===h||g.fn===h){m.splice(S,1);break}return this},n.prototype.emit=function(u){this._callbacks=this._callbacks||{};var h=[].slice.call(arguments,1),m=this._callbacks[u];if(m){m=m.slice(0);for(var g=0,S=m.length;S>g;++g)m[g].apply(this,h)}return this},n.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks[u]||[]},n.prototype.hasListeners=function(u){return!!this.listeners(u).length}},{}],10:[function(s,i){function n(u){return n.enabled(u)?function(h){h=o(h);var m=new Date,g=m-(n[u]||m);n[u]=m,h=u+" "+h+" +"+n.humanize(g),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function o(u){return u instanceof Error?u.stack||u.message:u}i.exports=n,n.names=[],n.skips=[],n.enable=function(u){try{localStorage.debug=u}catch{}for(var h=(u||"").split(/[\s,]+/),m=h.length,g=0;m>g;g++)u=h[g].replace("*",".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.substr(1)+"$")):n.names.push(new RegExp("^"+u+"$"))},n.disable=function(){n.enable("")},n.humanize=function(u){var h=1e3,m=6e4,g=60*m;return u>=g?(u/g).toFixed(1)+"h":u>=m?(u/m).toFixed(1)+"m":u>=h?(u/h|0)+"s":u+"ms"},n.enabled=function(u){for(var h=0,m=n.skips.length;m>h;h++)if(n.skips[h].test(u))return!1;for(var h=0,m=n.names.length;m>h;h++)if(n.names[h].test(u))return!0;return!1};try{window.localStorage&&n.enable(localStorage.debug)}catch{}},{}],11:[function(s,i){i.exports=s("./lib/")},{"./lib/":12}],12:[function(s,i){i.exports=s("./socket"),i.exports.parser=s("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(s,i){(function(n){function o(f,b){if(!(this instanceof o))return new o(f,b);if(b=b||{},f&&typeof f=="object"&&(b=f,f=null),f&&(f=_(f),b.host=f.host,b.secure=f.protocol=="https"||f.protocol=="wss",b.port=f.port,f.query&&(b.query=f.query)),this.secure=b.secure!=null?b.secure:n.location&&location.protocol=="https:",b.host){var k=b.host.split(":");b.hostname=k.shift(),k.length?b.port=k.pop():b.port||(b.port=this.secure?"443":"80")}this.agent=b.agent||!1,this.hostname=b.hostname||(n.location?location.hostname:"localhost"),this.port=b.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=b.query||{},typeof this.query=="string"&&(this.query=l.decode(this.query)),this.upgrade=b.upgrade!==!1,this.path=(b.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!b.forceJSONP,this.jsonp=b.jsonp!==!1,this.forceBase64=!!b.forceBase64,this.enablesXDR=!!b.enablesXDR,this.timestampParam=b.timestampParam||"t",this.timestampRequests=b.timestampRequests,this.transports=b.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=b.policyPort||843,this.rememberUpgrade=b.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=b.onlyBinaryUpgrades,this.pfx=b.pfx||null,this.key=b.key||null,this.passphrase=b.passphrase||null,this.cert=b.cert||null,this.ca=b.ca||null,this.ciphers=b.ciphers||null,this.rejectUnauthorized=b.rejectUnauthorized||null,this.open()}function u(f){var b={};for(var k in f)f.hasOwnProperty(k)&&(b[k]=f[k]);return b}var h=s("./transports"),m=s("component-emitter"),g=s("debug")("engine.io-client:socket"),S=s("indexof"),v=s("engine.io-parser"),_=s("parseuri"),y=s("parsejson"),l=s("parseqs");i.exports=o,o.priorWebsocketSuccess=!1,m(o.prototype),o.protocol=v.protocol,o.Socket=o,o.Transport=s("./transport"),o.transports=s("./transports"),o.parser=s("engine.io-parser"),o.prototype.createTransport=function(f){g('creating transport "%s"',f);var b=u(this.query);b.EIO=v.protocol,b.transport=f,this.id&&(b.sid=this.id);var k=new h[f]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:b,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 k},o.prototype.open=function(){var b;if(this.rememberUpgrade&&o.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)b="websocket";else{if(this.transports.length==0){var f=this;return void setTimeout(function(){f.emit("error","No transports available")},0)}b=this.transports[0]}this.readyState="opening";var b;try{b=this.createTransport(b)}catch{return this.transports.shift(),void this.open()}b.open(),this.setTransport(b)},o.prototype.setTransport=function(f){g("setting transport %s",f.name);var b=this;this.transport&&(g("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=f,f.on("drain",function(){b.onDrain()}).on("packet",function(k){b.onPacket(k)}).on("error",function(k){b.onError(k)}).on("close",function(){b.onClose("transport close")})},o.prototype.probe=function(f){function b(){if(M.onlyBinaryUpgrades){var G=!this.supportsBinary&&M.transport.supportsBinary;D=D||G}D||(g('probe transport "%s" opened',f),H.send([{type:"ping",data:"probe"}]),H.once("packet",function(L){if(!D)if(L.type=="pong"&&L.data=="probe"){if(g('probe transport "%s" pong',f),M.upgrading=!0,M.emit("upgrading",H),!H)return;o.priorWebsocketSuccess=H.name=="websocket",g('pausing current transport "%s"',M.transport.name),M.transport.pause(function(){D||M.readyState!="closed"&&(g("changing transport and sending upgrade packet"),ot(),M.setTransport(H),H.send([{type:"upgrade"}]),M.emit("upgrade",H),H=null,M.upgrading=!1,M.flush())})}else{g('probe transport "%s" failed',f);var U=new Error("probe error");U.transport=H.name,M.emit("upgradeError",U)}}))}function k(){D||(D=!0,ot(),H.close(),H=null)}function x(G){var L=new Error("probe error: "+G);L.transport=H.name,k(),g('probe transport "%s" failed because of error: %s',f,G),M.emit("upgradeError",L)}function W(){x("transport closed")}function st(){x("socket closed")}function V(G){H&&G.name!=H.name&&(g('"%s" works - aborting "%s"',G.name,H.name),k())}function ot(){H.removeListener("open",b),H.removeListener("error",x),H.removeListener("close",W),M.removeListener("close",st),M.removeListener("upgrading",V)}g('probing transport "%s"',f);var H=this.createTransport(f,{probe:1}),D=!1,M=this;o.priorWebsocketSuccess=!1,H.once("open",b),H.once("error",x),H.once("close",W),this.once("close",st),this.once("upgrading",V),H.open()},o.prototype.onOpen=function(){if(g("socket open"),this.readyState="open",o.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){g("starting upgrade probes");for(var f=0,b=this.upgrades.length;b>f;f++)this.probe(this.upgrades[f])}},o.prototype.onPacket=function(f){if(this.readyState=="opening"||this.readyState=="open")switch(g('socket receive: type "%s", data "%s"',f.type,f.data),this.emit("packet",f),this.emit("heartbeat"),f.type){case"open":this.onHandshake(y(f.data));break;case"pong":this.setPing();break;case"error":var b=new Error("server error");b.code=f.data,this.emit("error",b);break;case"message":this.emit("data",f.data),this.emit("message",f.data)}else g('packet received with socket readyState "%s"',this.readyState)},o.prototype.onHandshake=function(f){this.emit("handshake",f),this.id=f.sid,this.transport.query.sid=f.sid,this.upgrades=this.filterUpgrades(f.upgrades),this.pingInterval=f.pingInterval,this.pingTimeout=f.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},o.prototype.onHeartbeat=function(f){clearTimeout(this.pingTimeoutTimer);var b=this;b.pingTimeoutTimer=setTimeout(function(){b.readyState!="closed"&&b.onClose("ping timeout")},f||b.pingInterval+b.pingTimeout)},o.prototype.setPing=function(){var f=this;clearTimeout(f.pingIntervalTimer),f.pingIntervalTimer=setTimeout(function(){g("writing ping packet - expecting pong within %sms",f.pingTimeout),f.ping(),f.onHeartbeat(f.pingTimeout)},f.pingInterval)},o.prototype.ping=function(){this.sendPacket("ping")},o.prototype.onDrain=function(){for(var f=0;f<this.prevBufferLen;f++)this.callbackBuffer[f]&&this.callbackBuffer[f]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},o.prototype.flush=function(){this.readyState!="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(g("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},o.prototype.write=o.prototype.send=function(f,b){return this.sendPacket("message",f,b),this},o.prototype.sendPacket=function(f,b,k){if(this.readyState!="closing"&&this.readyState!="closed"){var x={type:f,data:b};this.emit("packetCreate",x),this.writeBuffer.push(x),this.callbackBuffer.push(k),this.flush()}},o.prototype.close=function(){function f(){x.onClose("forced close"),g("socket closing - telling transport to close"),x.transport.close()}function b(){x.removeListener("upgrade",b),x.removeListener("upgradeError",b),f()}function k(){x.once("upgrade",b),x.once("upgradeError",b)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var x=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?k():f()}):this.upgrading?k():f()}return this},o.prototype.onError=function(f){g("socket error %j",f),o.priorWebsocketSuccess=!1,this.emit("error",f),this.onClose("transport error",f)},o.prototype.onClose=function(f,b){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){g('socket close with reason: "%s"',f);var k=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){k.writeBuffer=[],k.callbackBuffer=[],k.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",f,b)}},o.prototype.filterUpgrades=function(f){for(var b=[],k=0,x=f.length;x>k;k++)~S(this.transports,f[k])&&b.push(f[k]);return b}}).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(s,i){function n(h){this.path=h.path,this.hostname=h.hostname,this.port=h.port,this.secure=h.secure,this.query=h.query,this.timestampParam=h.timestampParam,this.timestampRequests=h.timestampRequests,this.readyState="",this.agent=h.agent||!1,this.socket=h.socket,this.enablesXDR=h.enablesXDR,this.pfx=h.pfx,this.key=h.key,this.passphrase=h.passphrase,this.cert=h.cert,this.ca=h.ca,this.ciphers=h.ciphers,this.rejectUnauthorized=h.rejectUnauthorized}var o=s("engine.io-parser"),u=s("component-emitter");i.exports=n,u(n.prototype),n.timestamps=0,n.prototype.onError=function(h,m){var g=new Error(h);return g.type="TransportError",g.description=m,this.emit("error",g),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(h){if(this.readyState!="open")throw new Error("Transport not open");this.write(h)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(h){var m=o.decodePacket(h,this.socket.binaryType);this.onPacket(m)},n.prototype.onPacket=function(h){this.emit("packet",h)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(s,i,n){(function(o){function u(v){var _,y=!1,l=!1,f=v.jsonp!==!1;if(o.location){var b=location.protocol=="https:",k=location.port;k||(k=b?443:80),y=v.hostname!=location.hostname||k!=v.port,l=v.secure!=b}if(v.xdomain=y,v.xscheme=l,_=new h(v),"open"in _&&!v.forceJSONP)return new m(v);if(!f)throw new Error("JSONP disabled");return new g(v)}var h=s("xmlhttprequest"),m=s("./polling-xhr"),g=s("./polling-jsonp"),S=s("./websocket");n.polling=u,n.websocket=S}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(s,i){(function(n){function o(){}function u(_){h.call(this,_),this.query=this.query||{},g||(n.___eio||(n.___eio=[]),g=n.___eio),this.index=g.length;var y=this;g.push(function(l){y.onData(l)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){y.script&&(y.script.onerror=o)},!1)}var h=s("./polling"),m=s("component-inherit");i.exports=u;var g,S=/\n/g,v=/\\n/g;m(u,h),u.prototype.supportsBinary=!1,u.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),h.prototype.doClose.call(this)},u.prototype.doPoll=function(){var _=this,y=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),y.async=!0,y.src=this.uri(),y.onerror=function(b){_.onError("jsonp poll error",b)};var l=document.getElementsByTagName("script")[0];l.parentNode.insertBefore(y,l),this.script=y;var f=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);f&&setTimeout(function(){var b=document.createElement("iframe");document.body.appendChild(b),document.body.removeChild(b)},100)},u.prototype.doWrite=function(_,y){function l(){f(),y()}function f(){if(b.iframe)try{b.form.removeChild(b.iframe)}catch(ot){b.onError("jsonp polling iframe removal error",ot)}try{var V='<iframe src="javascript:0" name="'+b.iframeId+'">';k=document.createElement(V)}catch{k=document.createElement("iframe"),k.name=b.iframeId,k.src="javascript:0"}k.id=b.iframeId,b.form.appendChild(k),b.iframe=k}var b=this;if(!this.form){var k,x=document.createElement("form"),W=document.createElement("textarea"),st=this.iframeId="eio_iframe_"+this.index;x.className="socketio",x.style.position="absolute",x.style.top="-1000px",x.style.left="-1000px",x.target=st,x.method="POST",x.setAttribute("accept-charset","utf-8"),W.name="d",x.appendChild(W),document.body.appendChild(x),this.form=x,this.area=W}this.form.action=this.uri(),f(),_=_.replace(v,`\\
33
+ `),this.area.value=_.replace(S,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){b.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(s,i){(function(n){function o(){}function u(l){if(S.call(this,l),n.location){var f=location.protocol=="https:",b=location.port;b||(b=f?443:80),this.xd=l.hostname!=n.location.hostname||b!=l.port,this.xs=l.secure!=f}}function h(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 m(){for(var l in h.requests)h.requests.hasOwnProperty(l)&&h.requests[l].abort()}var g=s("xmlhttprequest"),S=s("./polling"),v=s("component-emitter"),_=s("component-inherit"),y=s("debug")("engine.io-client:polling-xhr");i.exports=u,i.exports.Request=h,_(u,S),u.prototype.supportsBinary=!0,u.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 h(l)},u.prototype.doWrite=function(l,f){var b=typeof l!="string"&&l!==void 0,k=this.request({method:"POST",data:l,isBinary:b}),x=this;k.on("success",f),k.on("error",function(W){x.onError("xhr post error",W)}),this.sendXhr=k},u.prototype.doPoll=function(){y("xhr poll");var l=this.request(),f=this;l.on("data",function(b){f.onData(b)}),l.on("error",function(b){f.onError("xhr poll error",b)}),this.pollXhr=l},v(h.prototype),h.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 f=this.xhr=new g(l),b=this;try{if(y("xhr open %s: %s",this.method,this.uri),f.open(this.method,this.uri,this.async),this.supportsBinary&&(f.responseType="arraybuffer"),this.method=="POST")try{this.isBinary?f.setRequestHeader("Content-type","application/octet-stream"):f.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}"withCredentials"in f&&(f.withCredentials=!0),this.hasXDR()?(f.onload=function(){b.onLoad()},f.onerror=function(){b.onError(f.responseText)}):f.onreadystatechange=function(){f.readyState==4&&(f.status==200||f.status==1223?b.onLoad():setTimeout(function(){b.onError(f.status)},0))},y("xhr data %s",this.data),f.send(this.data)}catch(k){return void setTimeout(function(){b.onError(k)},0)}n.document&&(this.index=h.requestsCount++,h.requests[this.index]=this)},h.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h.prototype.onData=function(l){this.emit("data",l),this.onSuccess()},h.prototype.onError=function(l){this.emit("error",l),this.cleanup(!0)},h.prototype.cleanup=function(l){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=o:this.xhr.onreadystatechange=o,l)try{this.xhr.abort()}catch{}n.document&&delete h.requests[this.index],this.xhr=null}},h.prototype.onLoad=function(){var l;try{var f;try{f=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch{}l=f==="application/octet-stream"?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(b){this.onError(b)}l!=null&&this.onData(l)},h.prototype.hasXDR=function(){return typeof n.XDomainRequest<"u"&&!this.xs&&this.enablesXDR},h.prototype.abort=function(){this.cleanup()},n.document&&(h.requestsCount=0,h.requests={},n.attachEvent?n.attachEvent("onunload",m):n.addEventListener&&n.addEventListener("beforeunload",m,!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(s,i){function n(v){var _=v&&v.forceBase64;(!S||_)&&(this.supportsBinary=!1),o.call(this,v)}var o=s("../transport"),u=s("parseqs"),h=s("engine.io-parser"),m=s("component-inherit"),g=s("debug")("engine.io-client:polling");i.exports=n;var S=function(){var v=s("xmlhttprequest"),_=new v({xdomain:!1});return _.responseType!=null}();m(n,o),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(v){function _(){g("paused"),y.readyState="paused",v()}var y=this;if(this.readyState="pausing",this.polling||!this.writable){var l=0;this.polling&&(g("we are currently polling - waiting to pause"),l++,this.once("pollComplete",function(){g("pre-pause polling complete"),--l||_()})),this.writable||(g("we are currently writing - waiting to pause"),l++,this.once("drain",function(){g("pre-pause writing complete"),--l||_()}))}else _()},n.prototype.poll=function(){g("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(v){var _=this;g("polling got data %s",v);var y=function(l){return _.readyState=="opening"&&_.onOpen(),l.type=="close"?(_.onClose(),!1):void _.onPacket(l)};h.decodePayload(v,this.socket.binaryType,y),this.readyState!="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState=="open"?this.poll():g('ignoring poll - transport state "%s"',this.readyState))},n.prototype.doClose=function(){function v(){g("writing close packet"),_.write([{type:"close"}])}var _=this;this.readyState=="open"?(g("transport open - closing"),v()):(g("transport not open - deferring close"),this.once("open",v))},n.prototype.write=function(v){var y=this;this.writable=!1;var _=function(){y.writable=!0,y.emit("drain")},y=this;h.encodePayload(v,this.supportsBinary,function(l){y.doWrite(l,_)})},n.prototype.uri=function(){var v=this.query||{},_=this.secure?"https":"http",y="";return this.timestampRequests!==!1&&(v[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||v.sid||(v.b64=1),v=u.encode(v),this.port&&(_=="https"&&this.port!=443||_=="http"&&this.port!=80)&&(y=":"+this.port),v.length&&(v="?"+v),_+"://"+this.hostname+y+this.path+v}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(s,i){function n(v){var _=v&&v.forceBase64;_&&(this.supportsBinary=!1),o.call(this,v)}var o=s("../transport"),u=s("engine.io-parser"),h=s("parseqs"),m=s("component-inherit"),g=s("debug")("engine.io-client:websocket"),S=s("ws");i.exports=n,m(n,o),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var v=this.uri(),_=void 0,y={agent:this.agent};y.pfx=this.pfx,y.key=this.key,y.passphrase=this.passphrase,y.cert=this.cert,y.ca=this.ca,y.ciphers=this.ciphers,y.rejectUnauthorized=this.rejectUnauthorized,this.ws=new S(v,_,y),this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var v=this;this.ws.onopen=function(){v.onOpen()},this.ws.onclose=function(){v.onClose()},this.ws.onmessage=function(_){v.onData(_.data)},this.ws.onerror=function(_){v.onError("websocket error",_)}},typeof navigator<"u"&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(v){var _=this;setTimeout(function(){o.prototype.onData.call(_,v)},0)}),n.prototype.write=function(v){function _(){y.writable=!0,y.emit("drain")}var y=this;this.writable=!1;for(var l=0,f=v.length;f>l;l++)u.encodePacket(v[l],this.supportsBinary,function(b){try{y.ws.send(b)}catch{g("websocket closed before onclose event")}});setTimeout(_,0)},n.prototype.onClose=function(){o.prototype.onClose.call(this)},n.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},n.prototype.uri=function(){var v=this.query||{},_=this.secure?"wss":"ws",y="";return this.port&&(_=="wss"&&this.port!=443||_=="ws"&&this.port!=80)&&(y=":"+this.port),this.timestampRequests&&(v[this.timestampParam]=+new Date),this.supportsBinary||(v.b64=1),v=h.encode(v),v.length&&(v="?"+v),_+"://"+this.hostname+y+this.path+v},n.prototype.check=function(){return!(!S||"__initialize"in S&&this.name===n.prototype.name)}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,ws:35}],20:[function(s,i){var n=s("has-cors");i.exports=function(o){var u=o.xdomain,h=o.xscheme,m=o.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!u||n))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!h&&m)return new XDomainRequest}catch{}if(!u)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}}},{"has-cors":38}],21:[function(s,i){i.exports=function(n,o){var u=function(){};u.prototype=o.prototype,n.prototype=new u,n.prototype.constructor=n}},{}],22:[function(s,i,n){function o(){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 u(){var S=arguments,v=this.useColors;if(S[0]=(v?"%c":"")+this.namespace+(v?" %c":" ")+S[0]+(v?"%c ":" ")+"+"+n.humanize(this.diff),!v)return S;var _="color: "+this.color;S=[S[0],_,"color: inherit"].concat(Array.prototype.slice.call(S,1));var y=0,l=0;return S[0].replace(/%[a-z%]/g,function(f){f!=="%%"&&(y++,f==="%c"&&(l=y))}),S.splice(l,0,_),S}function h(){return typeof console=="object"&&typeof console.log=="function"&&Function.prototype.apply.call(console.log,console,arguments)}function m(S){try{S==null?localStorage.removeItem("debug"):localStorage.debug=S}catch{}}function g(){var S;try{S=localStorage.debug}catch{}return S}n=i.exports=s("./debug"),n.log=h,n.formatArgs=u,n.save=m,n.load=g,n.useColors=o,n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(S){return JSON.stringify(S)},n.enable(g())},{"./debug":23}],23:[function(s,i,n){function o(){return n.colors[_++%n.colors.length]}function u(y){function l(){}function f(){var k=f,x=+new Date,W=x-(v||x);k.diff=W,k.prev=v,k.curr=x,v=x,k.useColors==null&&(k.useColors=n.useColors()),k.color==null&&k.useColors&&(k.color=o());var st=Array.prototype.slice.call(arguments);st[0]=n.coerce(st[0]),typeof st[0]!="string"&&(st=["%o"].concat(st));var V=0;st[0]=st[0].replace(/%([a-z%])/g,function(H,D){if(H==="%%")return H;V++;var M=n.formatters[D];if(typeof M=="function"){var G=st[V];H=M.call(k,G),st.splice(V,1),V--}return H}),typeof n.formatArgs=="function"&&(st=n.formatArgs.apply(k,st));var ot=f.log||n.log||console.log.bind(console);ot.apply(k,st)}l.enabled=!1,f.enabled=!0;var b=n.enabled(y)?f:l;return b.namespace=y,b}function h(y){n.save(y);for(var l=(y||"").split(/[\s,]+/),f=l.length,b=0;f>b;b++)l[b]&&(y=l[b].replace(/\*/g,".*?"),y[0]==="-"?n.skips.push(new RegExp("^"+y.substr(1)+"$")):n.names.push(new RegExp("^"+y+"$")))}function m(){n.enable("")}function g(y){var l,f;for(l=0,f=n.skips.length;f>l;l++)if(n.skips[l].test(y))return!1;for(l=0,f=n.names.length;f>l;l++)if(n.names[l].test(y))return!0;return!1}function S(y){return y instanceof Error?y.stack||y.message:y}n=i.exports=u,n.coerce=S,n.disable=m,n.enable=h,n.enabled=g,n.humanize=s("ms"),n.names=[],n.skips=[],n.formatters={};var v,_=0},{ms:24}],24:[function(s,i){function n(y){var l=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(y);if(l){var f=parseFloat(l[1]),b=(l[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"y":return f*_;case"days":case"day":case"d":return f*v;case"hours":case"hour":case"h":return f*S;case"minutes":case"minute":case"m":return f*g;case"seconds":case"second":case"s":return f*m;case"ms":return f}}}function o(y){return y>=v?Math.round(y/v)+"d":y>=S?Math.round(y/S)+"h":y>=g?Math.round(y/g)+"m":y>=m?Math.round(y/m)+"s":y+"ms"}function u(y){return h(y,v,"day")||h(y,S,"hour")||h(y,g,"minute")||h(y,m,"second")||y+" ms"}function h(y,l,f){return l>y?void 0:1.5*l>y?Math.floor(y/l)+" "+f:Math.ceil(y/l)+" "+f+"s"}var m=1e3,g=60*m,S=60*g,v=24*S,_=365.25*v;i.exports=function(y,l){return l=l||{},typeof y=="string"?n(y):l.long?u(y):o(y)}},{}],25:[function(s,i,n){(function(o){function u(D,M){var G="b"+n.packets[D.type]+D.data.data;return M(G)}function h(D,M,G){if(!M)return n.encodeBase64Packet(D,G);var L=D.data,U=new Uint8Array(L),X=new Uint8Array(1+L.byteLength);X[0]=st[D.type];for(var Q=0;Q<U.length;Q++)X[Q+1]=U[Q];return G(X.buffer)}function m(D,M,G){if(!M)return n.encodeBase64Packet(D,G);var L=new FileReader;return L.onload=function(){D.data=L.result,n.encodePacket(D,M,!0,G)},L.readAsArrayBuffer(D.data)}function g(D,M,G){if(!M)return n.encodeBase64Packet(D,G);if(W)return m(D,M,G);var L=new Uint8Array(1);L[0]=st[D.type];var U=new H([L.buffer,D.data]);return G(U)}function S(D,M,G){for(var L=new Array(D.length),U=f(D.length,G),X=function(j,B,Et){M(B,function(At,Rt){L[j]=Rt,Et(At,L)})},Q=0;Q<D.length;Q++)X(Q,D[Q],U)}var v=s("./keys"),_=s("has-binary"),y=s("arraybuffer.slice"),l=s("base64-arraybuffer"),f=s("after"),b=s("utf8"),k=navigator.userAgent.match(/Android/i),x=/PhantomJS/i.test(navigator.userAgent),W=k||x;n.protocol=3;var st=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},V=v(st),ot={type:"error",data:"parser error"},H=s("blob");n.encodePacket=function(D,M,G,L){typeof M=="function"&&(L=M,M=!1),typeof G=="function"&&(L=G,G=null);var U=D.data===void 0?void 0:D.data.buffer||D.data;if(o.ArrayBuffer&&U instanceof ArrayBuffer)return h(D,M,L);if(H&&U instanceof o.Blob)return g(D,M,L);if(U&&U.base64)return u(D,L);var X=st[D.type];return D.data!==void 0&&(X+=G?b.encode(String(D.data)):String(D.data)),L(""+X)},n.encodeBase64Packet=function(D,M){var G="b"+n.packets[D.type];if(H&&D.data instanceof H){var L=new FileReader;return L.onload=function(){var B=L.result.split(",")[1];M(G+B)},L.readAsDataURL(D.data)}var U;try{U=String.fromCharCode.apply(null,new Uint8Array(D.data))}catch{for(var X=new Uint8Array(D.data),Q=new Array(X.length),j=0;j<X.length;j++)Q[j]=X[j];U=String.fromCharCode.apply(null,Q)}return G+=o.btoa(U),M(G)},n.decodePacket=function(D,M,G){if(typeof D=="string"||D===void 0){if(D.charAt(0)=="b")return n.decodeBase64Packet(D.substr(1),M);if(G)try{D=b.decode(D)}catch{return ot}var U=D.charAt(0);return Number(U)==U&&V[U]?D.length>1?{type:V[U],data:D.substring(1)}:{type:V[U]}:ot}var L=new Uint8Array(D),U=L[0],X=y(D,1);return H&&M==="blob"&&(X=new H([X])),{type:V[U],data:X}},n.decodeBase64Packet=function(D,M){var G=V[D.charAt(0)];if(!o.ArrayBuffer)return{type:G,data:{base64:!0,data:D.substr(1)}};var L=l.decode(D.substr(1));return M==="blob"&&H&&(L=new H([L])),{type:G,data:L}},n.encodePayload=function(D,M,G){function L(Q){return Q.length+":"+Q}function U(Q,j){n.encodePacket(Q,X?M:!1,!0,function(B){j(null,L(B))})}typeof M=="function"&&(G=M,M=null);var X=_(D);return M&&X?H&&!W?n.encodePayloadAsBlob(D,G):n.encodePayloadAsArrayBuffer(D,G):D.length?void S(D,U,function(Q,j){return G(j.join(""))}):G("0:")},n.decodePayload=function(D,M,G){if(typeof D!="string")return n.decodePayloadAsBinary(D,M,G);typeof M=="function"&&(G=M,M=null);var L;if(D=="")return G(ot,0,1);for(var U,X,Q="",j=0,B=D.length;B>j;j++){var Et=D.charAt(j);if(Et!=":")Q+=Et;else{if(Q==""||Q!=(U=Number(Q))||(X=D.substr(j+1,U),Q!=X.length))return G(ot,0,1);if(X.length){if(L=n.decodePacket(X,M,!0),ot.type==L.type&&ot.data==L.data)return G(ot,0,1);var At=G(L,j+U,B);if(At===!1)return}j+=U,Q=""}}return Q!=""?G(ot,0,1):void 0},n.encodePayloadAsArrayBuffer=function(D,M){function G(L,U){n.encodePacket(L,!0,!0,function(X){return U(null,X)})}return D.length?void S(D,G,function(L,U){var X=U.reduce(function(B,Et){var At;return At=typeof Et=="string"?Et.length:Et.byteLength,B+At.toString().length+At+2},0),Q=new Uint8Array(X),j=0;return U.forEach(function(B){var Et=typeof B=="string",At=B;if(Et){for(var Rt=new Uint8Array(B.length),ut=0;ut<B.length;ut++)Rt[ut]=B.charCodeAt(ut);At=Rt.buffer}Q[j++]=Et?0:1;for(var Ht=At.byteLength.toString(),ut=0;ut<Ht.length;ut++)Q[j++]=parseInt(Ht[ut]);Q[j++]=255;for(var Rt=new Uint8Array(At),ut=0;ut<Rt.length;ut++)Q[j++]=Rt[ut]}),M(Q.buffer)}):M(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(D,M){function G(L,U){n.encodePacket(L,!0,!0,function(X){var Q=new Uint8Array(1);if(Q[0]=1,typeof X=="string"){for(var j=new Uint8Array(X.length),B=0;B<X.length;B++)j[B]=X.charCodeAt(B);X=j.buffer,Q[0]=0}for(var Et=X instanceof ArrayBuffer?X.byteLength:X.size,At=Et.toString(),Rt=new Uint8Array(At.length+1),B=0;B<At.length;B++)Rt[B]=parseInt(At[B]);if(Rt[At.length]=255,H){var ut=new H([Q.buffer,Rt.buffer,X]);U(null,ut)}})}S(D,G,function(L,U){return M(new H(U))})},n.decodePayloadAsBinary=function(D,M,G){typeof M=="function"&&(G=M,M=null);for(var L=D,U=[],X=!1;L.byteLength>0;){for(var Q=new Uint8Array(L),j=Q[0]===0,B="",Et=1;Q[Et]!=255;Et++){if(B.length>310){X=!0;break}B+=Q[Et]}if(X)return G(ot,0,1);L=y(L,2+B.length),B=parseInt(B);var At=y(L,0,B);if(j)try{At=String.fromCharCode.apply(null,new Uint8Array(At))}catch{var Rt=new Uint8Array(At);At="";for(var Et=0;Et<Rt.length;Et++)At+=String.fromCharCode(Rt[Et])}U.push(At),L=y(L,B)}var ut=U.length;U.forEach(function(Ht,xe){G(n.decodePacket(Ht,M,!0),xe,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(s,i){i.exports=Object.keys||function(n){var o=[],u=Object.prototype.hasOwnProperty;for(var h in n)u.call(n,h)&&o.push(h);return o}},{}],27:[function(s,i){function n(u,h,m){function g(v,_){if(g.count<=0)throw new Error("after called too many times");--g.count,v?(S=!0,h(v),h=m):g.count!==0||S||h(null,_)}var S=!1;return m=m||o,g.count=u,u===0?h():g}function o(){}i.exports=n},{}],28:[function(s,i){i.exports=function(n,o,u){var h=n.byteLength;if(o=o||0,u=u||h,n.slice)return n.slice(o,u);if(0>o&&(o+=h),0>u&&(u+=h),u>h&&(u=h),o>=h||o>=u||h===0)return new ArrayBuffer(0);for(var m=new Uint8Array(n),g=new Uint8Array(u-o),S=o,v=0;u>S;S++,v++)g[v]=m[S];return g.buffer}},{}],29:[function(s,i,n){(function(o){n.encode=function(u){var h,m=new Uint8Array(u),g=m.length,S="";for(h=0;g>h;h+=3)S+=o[m[h]>>2],S+=o[(3&m[h])<<4|m[h+1]>>4],S+=o[(15&m[h+1])<<2|m[h+2]>>6],S+=o[63&m[h+2]];return g%3===2?S=S.substring(0,S.length-1)+"=":g%3===1&&(S=S.substring(0,S.length-2)+"=="),S},n.decode=function(u){var h,m,g,S,v,_=.75*u.length,y=u.length,l=0;u[u.length-1]==="="&&(_--,u[u.length-2]==="="&&_--);var f=new ArrayBuffer(_),b=new Uint8Array(f);for(h=0;y>h;h+=4)m=o.indexOf(u[h]),g=o.indexOf(u[h+1]),S=o.indexOf(u[h+2]),v=o.indexOf(u[h+3]),b[l++]=m<<2|g>>4,b[l++]=(15&g)<<4|S>>2,b[l++]=(3&S)<<6|63&v;return f}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(s,i){(function(n){function o(_){for(var y=0;y<_.length;y++){var l=_[y];if(l.buffer instanceof ArrayBuffer){var f=l.buffer;if(l.byteLength!==f.byteLength){var b=new Uint8Array(l.byteLength);b.set(new Uint8Array(f,l.byteOffset,l.byteLength)),f=b.buffer}_[y]=f}}}function u(_,y){y=y||{};var l=new m;o(_);for(var f=0;f<_.length;f++)l.append(_[f]);return y.type?l.getBlob(y.type):l.getBlob()}function h(_,y){return o(_),new Blob(_,y||{})}var m=n.BlobBuilder||n.WebKitBlobBuilder||n.MSBlobBuilder||n.MozBlobBuilder,g=function(){try{var _=new Blob(["hi"]);return _.size===2}catch{return!1}}(),S=g&&function(){try{var _=new Blob([new Uint8Array([1,2])]);return _.size===2}catch{return!1}}(),v=m&&m.prototype.append&&m.prototype.getBlob;i.exports=function(){return g?S?n.Blob:h:v?u:void 0}()}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],31:[function(s,i,n){(function(o){(function(u){function h(L){for(var U,X,Q=[],j=0,B=L.length;B>j;)U=L.charCodeAt(j++),U>=55296&&56319>=U&&B>j?(X=L.charCodeAt(j++),(64512&X)==56320?Q.push(((1023&U)<<10)+(1023&X)+65536):(Q.push(U),j--)):Q.push(U);return Q}function m(L){for(var U,X=L.length,Q=-1,j="";++Q<X;)U=L[Q],U>65535&&(U-=65536,j+=ot(U>>>10&1023|55296),U=56320|1023&U),j+=ot(U);return j}function g(L){if(L>=55296&&57343>=L)throw Error("Lone surrogate U+"+L.toString(16).toUpperCase()+" is not a scalar value")}function S(L,U){return ot(L>>U&63|128)}function v(L){if(!(4294967168&L))return ot(L);var U="";return 4294965248&L?4294901760&L?!(4292870144&L)&&(U=ot(L>>18&7|240),U+=S(L,12),U+=S(L,6)):(g(L),U=ot(L>>12&15|224),U+=S(L,6)):U=ot(L>>6&31|192),U+=ot(63&L|128)}function _(L){for(var U,X=h(L),Q=X.length,j=-1,B="";++j<Q;)U=X[j],B+=v(U);return B}function y(){if(V>=st)throw Error("Invalid byte index");var L=255&W[V];if(V++,(192&L)==128)return 63&L;throw Error("Invalid continuation byte")}function l(){var L,U,X,Q,j;if(V>st)throw Error("Invalid byte index");if(V==st)return!1;if(L=255&W[V],V++,(128&L)==0)return L;if((224&L)==192){var U=y();if(j=(31&L)<<6|U,j>=128)return j;throw Error("Invalid continuation byte")}if((240&L)==224){if(U=y(),X=y(),j=(15&L)<<12|U<<6|X,j>=2048)return g(j),j;throw Error("Invalid continuation byte")}if((248&L)==240&&(U=y(),X=y(),Q=y(),j=(15&L)<<18|U<<12|X<<6|Q,j>=65536&&1114111>=j))return j;throw Error("Invalid UTF-8 detected")}function f(L){W=h(L),st=W.length,V=0;for(var U,X=[];(U=l())!==!1;)X.push(U);return m(X)}var b=typeof n=="object"&&n,k=typeof i=="object"&&i&&i.exports==b&&i,x=typeof o=="object"&&o;(x.global===x||x.window===x)&&(u=x);var W,st,V,ot=String.fromCharCode,H={version:"2.0.0",encode:_,decode:f};if(b&&!b.nodeType)if(k)k.exports=H;else{var D={},M=D.hasOwnProperty;for(var G in H)M.call(H,G)&&(b[G]=H[G])}else u.utf8=H})(this)}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],32:[function(s,i){(function(n){var o=/^[\],:{}\s]*$/,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,h=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/^\s+/,S=/\s+$/;i.exports=function(v){return typeof v=="string"&&v?(v=v.replace(g,"").replace(S,""),n.JSON&&JSON.parse?JSON.parse(v):o.test(v.replace(u,"@").replace(h,"]").replace(m,""))?new Function("return "+v)():void 0):null}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],33:[function(s,i,n){n.encode=function(o){var u="";for(var h in o)o.hasOwnProperty(h)&&(u.length&&(u+="&"),u+=encodeURIComponent(h)+"="+encodeURIComponent(o[h]));return u},n.decode=function(o){for(var u={},h=o.split("&"),m=0,g=h.length;g>m;m++){var S=h[m].split("=");u[decodeURIComponent(S[0])]=decodeURIComponent(S[1])}return u}},{}],34:[function(s,i){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];i.exports=function(u){var h=u,m=u.indexOf("["),g=u.indexOf("]");m!=-1&&g!=-1&&(u=u.substring(0,m)+u.substring(m,g).replace(/:/g,";")+u.substring(g,u.length));for(var S=n.exec(u||""),v={},_=14;_--;)v[o[_]]=S[_]||"";return m!=-1&&g!=-1&&(v.source=h,v.host=v.host.substring(1,v.host.length-1).replace(/;/g,":"),v.authority=v.authority.replace("[","").replace("]","").replace(/;/g,":"),v.ipv6uri=!0),v}},{}],35:[function(s,i){function n(h,m){return m?new u(h,m):new u(h)}var o=function(){return self}(),u=o.WebSocket||o.MozWebSocket;i.exports=u?n:null,u&&(n.prototype=u.prototype)},{}],36:[function(s,i){(function(n){function o(h){function m(g){if(!g)return!1;if(n.Buffer&&n.Buffer.isBuffer(g)||n.ArrayBuffer&&g instanceof ArrayBuffer||n.Blob&&g instanceof Blob||n.File&&g instanceof File)return!0;if(u(g)){for(var S=0;S<g.length;S++)if(m(g[S]))return!0}else if(g&&typeof g=="object"){g.toJSON&&(g=g.toJSON());for(var v in g)if(Object.prototype.hasOwnProperty.call(g,v)&&m(g[v]))return!0}return!1}return m(h)}var u=s("isarray");i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{isarray:37}],37:[function(s,i){i.exports=Array.isArray||function(n){return Object.prototype.toString.call(n)=="[object Array]"}},{}],38:[function(s,i){var n=s("global");try{i.exports="XMLHttpRequest"in n&&"withCredentials"in new n.XMLHttpRequest}catch{i.exports=!1}},{global:39}],39:[function(s,i){i.exports=function(){return this}()},{}],40:[function(s,i){var n=[].indexOf;i.exports=function(o,u){if(n)return o.indexOf(u);for(var h=0;h<o.length;++h)if(o[h]===u)return h;return-1}},{}],41:[function(s,i,n){var o=Object.prototype.hasOwnProperty;n.keys=Object.keys||function(u){var h=[];for(var m in u)o.call(u,m)&&h.push(m);return h},n.values=function(u){var h=[];for(var m in u)o.call(u,m)&&h.push(u[m]);return h},n.merge=function(u,h){for(var m in h)o.call(h,m)&&(u[m]=h[m]);return u},n.length=function(u){return n.keys(u).length},n.isEmpty=function(u){return n.length(u)==0}},{}],42:[function(s,i){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];i.exports=function(u){for(var h=n.exec(u||""),m={},g=14;g--;)m[o[g]]=h[g]||"";return m}},{}],43:[function(s,i,n){(function(o){var u=s("isarray"),h=s("./is-buffer");n.deconstructPacket=function(m){function g(y){if(!y)return y;if(h(y)){var l={_placeholder:!0,num:S.length};return S.push(y),l}if(u(y)){for(var f=new Array(y.length),b=0;b<y.length;b++)f[b]=g(y[b]);return f}if(typeof y=="object"&&!(y instanceof Date)){var f={};for(var k in y)f[k]=g(y[k]);return f}return y}var S=[],v=m.data,_=m;return _.data=g(v),_.attachments=S.length,{packet:_,buffers:S}},n.reconstructPacket=function(m,g){function S(v){if(v&&v._placeholder){var _=g[v.num];return _}if(u(v)){for(var y=0;y<v.length;y++)v[y]=S(v[y]);return v}if(v&&typeof v=="object"){for(var l in v)v[l]=S(v[l]);return v}return v}return m.data=S(m.data),m.attachments=void 0,m},n.removeBlobs=function(m,g){function S(y,l,f){if(!y)return y;if(o.Blob&&y instanceof Blob||o.File&&y instanceof File){v++;var b=new FileReader;b.onload=function(){f?f[l]=this.result:_=this.result,--v||g(_)},b.readAsArrayBuffer(y)}else if(u(y))for(var k=0;k<y.length;k++)S(y[k],k,y);else if(y&&typeof y=="object"&&!h(y))for(var x in y)S(y[x],x,y)}var v=0,_=m;S(_),v||g(_)}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./is-buffer":45,isarray:46}],44:[function(s,i,n){function o(){}function u(k){var x="",W=!1;return x+=k.type,(n.BINARY_EVENT==k.type||n.BINARY_ACK==k.type)&&(x+=k.attachments,x+="-"),k.nsp&&k.nsp!="/"&&(W=!0,x+=k.nsp),k.id!=null&&(W&&(x+=",",W=!1),x+=k.id),k.data!=null&&(W&&(x+=","),x+=y.stringify(k.data)),_("encoded %j as %s",k,x),x}function h(k,x){function W(st){var V=f.deconstructPacket(st),ot=u(V.packet),H=V.buffers;H.unshift(ot),x(H)}f.removeBlobs(k,W)}function m(){this.reconstructor=null}function g(k){var x={},W=0;if(x.type=Number(k.charAt(0)),n.types[x.type]==null)return v();if(n.BINARY_EVENT==x.type||n.BINARY_ACK==x.type){for(var st="";k.charAt(++W)!="-"&&(st+=k.charAt(W),W!=k.length););if(st!=Number(st)||k.charAt(W)!="-")throw new Error("Illegal attachments");x.attachments=Number(st)}if(k.charAt(W+1)=="/")for(x.nsp="";++W;){var V=k.charAt(W);if(V==","||(x.nsp+=V,W==k.length))break}else x.nsp="/";var ot=k.charAt(W+1);if(ot!==""&&Number(ot)==ot){for(x.id="";++W;){var V=k.charAt(W);if(V==null||Number(V)!=V){--W;break}if(x.id+=k.charAt(W),W==k.length)break}x.id=Number(x.id)}if(k.charAt(++W))try{x.data=y.parse(k.substr(W))}catch{return v()}return _("decoded %s as %j",k,x),x}function S(k){this.reconPack=k,this.buffers=[]}function v(){return{type:n.ERROR,data:"parser error"}}var _=s("debug")("socket.io-parser"),y=s("json3"),l=(s("isarray"),s("component-emitter")),f=s("./binary"),b=s("./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=o,n.Decoder=m,o.prototype.encode=function(k,x){if(_("encoding packet %j",k),n.BINARY_EVENT==k.type||n.BINARY_ACK==k.type)h(k,x);else{var W=u(k);x([W])}},l(m.prototype),m.prototype.add=function(k){var x;if(typeof k=="string")x=g(k),n.BINARY_EVENT==x.type||n.BINARY_ACK==x.type?(this.reconstructor=new S(x),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",x)):this.emit("decoded",x);else{if(!b(k)&&!k.base64)throw new Error("Unknown type: "+k);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");x=this.reconstructor.takeBinaryData(k),x&&(this.reconstructor=null,this.emit("decoded",x))}},m.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},S.prototype.takeBinaryData=function(k){if(this.buffers.push(k),this.buffers.length==this.reconPack.attachments){var x=f.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),x}return null},S.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(s,i){(function(n){function o(u){return n.Buffer&&n.Buffer.isBuffer(u)||n.ArrayBuffer&&u instanceof ArrayBuffer}i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],46:[function(s,i){i.exports=s(37)},{}],47:[function(s,i,n){(function(o){function u(q){if(u[q]!==g)return u[q];var J;if(q=="bug-string-char-index")J=!1;else if(q=="json")J=u("json-stringify")&&u("json-parse");else{var F,et='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(q=="json-stringify"){var P=_.stringify,Z=typeof P=="function"&&y;if(Z){(F=function(){return 1}).toJSON=F;try{Z=P(0)==="0"&&P(new Number)==="0"&&P(new String)=='""'&&P(S)===g&&P(g)===g&&P()===g&&P(F)==="1"&&P([F])=="[1]"&&P([g])=="[null]"&&P(null)=="null"&&P([g,S,null])=="[null,null,null]"&&P({a:[F,!0,!1,null,`\0\b
34
34
  \f\r `]})==et&&P(null,F)==="1"&&P([1,2],null,1)==`[
35
35
  1,
36
36
  2
37
- ]`&&P(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&P(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&P(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&P(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch{Z=!1}}J=Z}if(q=="json-parse"){var tt=_.parse;if(typeof tt=="function")try{if(tt("0")===0&&!tt(!1)){F=tt(et);var z=F.a.length==5&&F.a[0]===1;if(z){try{z=!tt('" "')}catch{}if(z)try{z=tt("01")!==1}catch{}if(z)try{z=tt("1.")!==1}catch{}}}}catch{z=!1}J=z}}return u[q]=!!J}var h,m,d,S={}.toString,v=typeof JSON=="object"&&JSON,_=typeof n=="object"&&n&&!n.nodeType&&n;_&&v?(_.stringify=v.stringify,_.parse=v.parse):_=o.JSON=v||{};var y=new Date(-0xc782b5b800cec);try{y=y.getUTCFullYear()==-109252&&y.getUTCMonth()===0&&y.getUTCDate()===1&&y.getUTCHours()==10&&y.getUTCMinutes()==37&&y.getUTCSeconds()==6&&y.getUTCMilliseconds()==708}catch{}if(!u("json")){var l="[object Function]",f="[object Date]",b="[object Number]",E="[object String]",x="[object Array]",W="[object Boolean]",st=u("bug-string-char-index");if(!y)var V=Math.floor,ot=[0,31,59,90,120,151,181,212,243,273,304,334],H=function(q,J){return ot[J]+365*(q-1970)+V((q-1969+(J=+(J>1)))/4)-V((q-1901+J)/100)+V((q-1601+J)/400)};(h={}.hasOwnProperty)||(h=function(q){var J,F={};return(F.__proto__=null,F.__proto__={toString:1},F).toString!=S?h=function(et){var P=this.__proto__,Z=et in(this.__proto__=null,this);return this.__proto__=P,Z}:(J=F.constructor,h=function(et){var P=(this.constructor||J).prototype;return et in this&&!(et in P&&this[et]===P[et])}),F=null,h.call(this,q)});var D={boolean:1,number:1,string:1,undefined:1},M=function(q,J){var F=typeof q[J];return F=="object"?!!q[J]:!D[F]};if(m=function(q,J){var F,et,P,Z=0;(F=function(){this.valueOf=0}).prototype.valueOf=0,et=new F;for(P in et)h.call(et,P)&&Z++;return F=et=null,Z?m=Z==2?function(tt,z){var at,bt={},$t=S.call(tt)==l;for(at in tt)$t&&at=="prototype"||h.call(bt,at)||!(bt[at]=1)||!h.call(tt,at)||z(at)}:function(tt,z){var at,bt,$t=S.call(tt)==l;for(at in tt)$t&&at=="prototype"||!h.call(tt,at)||(bt=at==="constructor")||z(at);(bt||h.call(tt,at="constructor"))&&z(at)}:(et=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(tt,z){var at,bt,$t=S.call(tt)==l,Ot=!$t&&typeof tt.constructor!="function"&&M(tt,"hasOwnProperty")?tt.hasOwnProperty:h;for(at in tt)$t&&at=="prototype"||!Ot.call(tt,at)||z(at);for(bt=et.length;at=et[--bt];Ot.call(tt,at)&&z(at));}),m(q,J)},!u("json-stringify")){var G={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},L="000000",U=function(q,J){return(L+(J||0)).slice(-q)},X="\\u00",Q=function(q){var J,F='"',et=0,P=q.length,Z=P>10&&st;for(Z&&(J=q.split(""));P>et;et++){var tt=q.charCodeAt(et);switch(tt){case 8:case 9:case 10:case 12:case 13:case 34:case 92:F+=G[tt];break;default:if(32>tt){F+=X+U(2,tt.toString(16));break}F+=Z?J[et]:st?q.charAt(et):q[et]}}return F+'"'},j=function(q,J,F,et,P,Z,tt){var z,at,bt,$t,Ot,Se,Ln,oe,dn,Nn,Vt,Yt,Re,Oe,Bn,De;try{z=J[q]}catch{}if(typeof z=="object"&&z)if(at=S.call(z),at!=f||h.call(z,"toJSON"))typeof z.toJSON=="function"&&(at!=b&&at!=E&&at!=x||h.call(z,"toJSON"))&&(z=z.toJSON(q));else if(z>-1/0&&1/0>z){if(H){for(Ot=V(z/864e5),bt=V(Ot/365.2425)+1970-1;H(bt+1,0)<=Ot;bt++);for($t=V((Ot-H(bt,0))/30.42);H(bt,$t+1)<=Ot;$t++);Ot=1+Ot-H(bt,$t),Se=(z%864e5+864e5)%864e5,Ln=V(Se/36e5)%24,oe=V(Se/6e4)%60,dn=V(Se/1e3)%60,Nn=Se%1e3}else bt=z.getUTCFullYear(),$t=z.getUTCMonth(),Ot=z.getUTCDate(),Ln=z.getUTCHours(),oe=z.getUTCMinutes(),dn=z.getUTCSeconds(),Nn=z.getUTCMilliseconds();z=(0>=bt||bt>=1e4?(0>bt?"-":"+")+U(6,0>bt?-bt:bt):U(4,bt))+"-"+U(2,$t+1)+"-"+U(2,Ot)+"T"+U(2,Ln)+":"+U(2,oe)+":"+U(2,dn)+"."+U(3,Nn)+"Z"}else z=null;if(F&&(z=F.call(J,q,z)),z===null)return"null";if(at=S.call(z),at==W)return""+z;if(at==b)return z>-1/0&&1/0>z?""+z:"null";if(at==E)return Q(""+z);if(typeof z=="object"){for(Oe=tt.length;Oe--;)if(tt[Oe]===z)throw TypeError();if(tt.push(z),Vt=[],Bn=Z,Z+=P,at==x){for(Re=0,Oe=z.length;Oe>Re;Re++)Yt=j(Re,z,F,et,P,Z,tt),Vt.push(Yt===d?"null":Yt);De=Vt.length?P?`[
37
+ ]`&&P(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&P(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&P(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&P(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch{Z=!1}}J=Z}if(q=="json-parse"){var tt=_.parse;if(typeof tt=="function")try{if(tt("0")===0&&!tt(!1)){F=tt(et);var z=F.a.length==5&&F.a[0]===1;if(z){try{z=!tt('" "')}catch{}if(z)try{z=tt("01")!==1}catch{}if(z)try{z=tt("1.")!==1}catch{}}}}catch{z=!1}J=z}}return u[q]=!!J}var h,m,g,S={}.toString,v=typeof JSON=="object"&&JSON,_=typeof n=="object"&&n&&!n.nodeType&&n;_&&v?(_.stringify=v.stringify,_.parse=v.parse):_=o.JSON=v||{};var y=new Date(-0xc782b5b800cec);try{y=y.getUTCFullYear()==-109252&&y.getUTCMonth()===0&&y.getUTCDate()===1&&y.getUTCHours()==10&&y.getUTCMinutes()==37&&y.getUTCSeconds()==6&&y.getUTCMilliseconds()==708}catch{}if(!u("json")){var l="[object Function]",f="[object Date]",b="[object Number]",k="[object String]",x="[object Array]",W="[object Boolean]",st=u("bug-string-char-index");if(!y)var V=Math.floor,ot=[0,31,59,90,120,151,181,212,243,273,304,334],H=function(q,J){return ot[J]+365*(q-1970)+V((q-1969+(J=+(J>1)))/4)-V((q-1901+J)/100)+V((q-1601+J)/400)};(h={}.hasOwnProperty)||(h=function(q){var J,F={};return(F.__proto__=null,F.__proto__={toString:1},F).toString!=S?h=function(et){var P=this.__proto__,Z=et in(this.__proto__=null,this);return this.__proto__=P,Z}:(J=F.constructor,h=function(et){var P=(this.constructor||J).prototype;return et in this&&!(et in P&&this[et]===P[et])}),F=null,h.call(this,q)});var D={boolean:1,number:1,string:1,undefined:1},M=function(q,J){var F=typeof q[J];return F=="object"?!!q[J]:!D[F]};if(m=function(q,J){var F,et,P,Z=0;(F=function(){this.valueOf=0}).prototype.valueOf=0,et=new F;for(P in et)h.call(et,P)&&Z++;return F=et=null,Z?m=Z==2?function(tt,z){var at,bt={},$t=S.call(tt)==l;for(at in tt)$t&&at=="prototype"||h.call(bt,at)||!(bt[at]=1)||!h.call(tt,at)||z(at)}:function(tt,z){var at,bt,$t=S.call(tt)==l;for(at in tt)$t&&at=="prototype"||!h.call(tt,at)||(bt=at==="constructor")||z(at);(bt||h.call(tt,at="constructor"))&&z(at)}:(et=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(tt,z){var at,bt,$t=S.call(tt)==l,Ot=!$t&&typeof tt.constructor!="function"&&M(tt,"hasOwnProperty")?tt.hasOwnProperty:h;for(at in tt)$t&&at=="prototype"||!Ot.call(tt,at)||z(at);for(bt=et.length;at=et[--bt];Ot.call(tt,at)&&z(at));}),m(q,J)},!u("json-stringify")){var G={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},L="000000",U=function(q,J){return(L+(J||0)).slice(-q)},X="\\u00",Q=function(q){var J,F='"',et=0,P=q.length,Z=P>10&&st;for(Z&&(J=q.split(""));P>et;et++){var tt=q.charCodeAt(et);switch(tt){case 8:case 9:case 10:case 12:case 13:case 34:case 92:F+=G[tt];break;default:if(32>tt){F+=X+U(2,tt.toString(16));break}F+=Z?J[et]:st?q.charAt(et):q[et]}}return F+'"'},j=function(q,J,F,et,P,Z,tt){var z,at,bt,$t,Ot,Se,Ln,oe,dn,Nn,Vt,Yt,Re,Oe,Bn,De;try{z=J[q]}catch{}if(typeof z=="object"&&z)if(at=S.call(z),at!=f||h.call(z,"toJSON"))typeof z.toJSON=="function"&&(at!=b&&at!=k&&at!=x||h.call(z,"toJSON"))&&(z=z.toJSON(q));else if(z>-1/0&&1/0>z){if(H){for(Ot=V(z/864e5),bt=V(Ot/365.2425)+1970-1;H(bt+1,0)<=Ot;bt++);for($t=V((Ot-H(bt,0))/30.42);H(bt,$t+1)<=Ot;$t++);Ot=1+Ot-H(bt,$t),Se=(z%864e5+864e5)%864e5,Ln=V(Se/36e5)%24,oe=V(Se/6e4)%60,dn=V(Se/1e3)%60,Nn=Se%1e3}else bt=z.getUTCFullYear(),$t=z.getUTCMonth(),Ot=z.getUTCDate(),Ln=z.getUTCHours(),oe=z.getUTCMinutes(),dn=z.getUTCSeconds(),Nn=z.getUTCMilliseconds();z=(0>=bt||bt>=1e4?(0>bt?"-":"+")+U(6,0>bt?-bt:bt):U(4,bt))+"-"+U(2,$t+1)+"-"+U(2,Ot)+"T"+U(2,Ln)+":"+U(2,oe)+":"+U(2,dn)+"."+U(3,Nn)+"Z"}else z=null;if(F&&(z=F.call(J,q,z)),z===null)return"null";if(at=S.call(z),at==W)return""+z;if(at==b)return z>-1/0&&1/0>z?""+z:"null";if(at==k)return Q(""+z);if(typeof z=="object"){for(Oe=tt.length;Oe--;)if(tt[Oe]===z)throw TypeError();if(tt.push(z),Vt=[],Bn=Z,Z+=P,at==x){for(Re=0,Oe=z.length;Oe>Re;Re++)Yt=j(Re,z,F,et,P,Z,tt),Vt.push(Yt===g?"null":Yt);De=Vt.length?P?`[
38
38
  `+Z+Vt.join(`,
39
39
  `+Z)+`
40
- `+Bn+"]":"["+Vt.join(",")+"]":"[]"}else m(et||z,function(Un){var Xe=j(Un,z,F,et,P,Z,tt);Xe!==d&&Vt.push(Q(Un)+":"+(P?" ":"")+Xe)}),De=Vt.length?P?`{
40
+ `+Bn+"]":"["+Vt.join(",")+"]":"[]"}else m(et||z,function(Un){var Xe=j(Un,z,F,et,P,Z,tt);Xe!==g&&Vt.push(Q(Un)+":"+(P?" ":"")+Xe)}),De=Vt.length?P?`{
41
41
  `+Z+Vt.join(`,
42
42
  `+Z)+`
43
- `+Bn+"}":"{"+Vt.join(",")+"}":"{}";return tt.pop(),De}};_.stringify=function(q,J,F){var et,P,Z,tt;if(typeof J=="function"||typeof J=="object"&&J){if((tt=S.call(J))==l)P=J;else if(tt==x){Z={};for(var z,at=0,bt=J.length;bt>at;z=J[at++],tt=S.call(z),(tt==E||tt==b)&&(Z[z]=1));}}if(F)if((tt=S.call(F))==b){if((F-=F%1)>0)for(et="",F>10&&(F=10);et.length<F;et+=" ");}else tt==E&&(et=F.length<=10?F:F.slice(0,10));return j("",(z={},z[""]=q,z),P,Z,et,"",[])}}if(!u("json-parse")){var B,At,kt=String.fromCharCode,Rt={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:`
44
- `,102:"\f",114:"\r"},ut=function(){throw B=At=null,SyntaxError()},Ht=function(){for(var q,J,F,et,P,Z=At,tt=Z.length;tt>B;)switch(P=Z.charCodeAt(B)){case 9:case 10:case 13:case 32:B++;break;case 123:case 125:case 91:case 93:case 58:case 44:return q=st?Z.charAt(B):Z[B],B++,q;case 34:for(q="@",B++;tt>B;)if(P=Z.charCodeAt(B),32>P)ut();else if(P==92)switch(P=Z.charCodeAt(++B)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:q+=Rt[P],B++;break;case 117:for(J=++B,F=B+4;F>B;B++)P=Z.charCodeAt(B),P>=48&&57>=P||P>=97&&102>=P||P>=65&&70>=P||ut();q+=kt("0x"+Z.slice(J,B));break;default:ut()}else{if(P==34)break;for(P=Z.charCodeAt(B),J=B;P>=32&&P!=92&&P!=34;)P=Z.charCodeAt(++B);q+=Z.slice(J,B)}if(Z.charCodeAt(B)==34)return B++,q;ut();default:if(J=B,P==45&&(et=!0,P=Z.charCodeAt(++B)),P>=48&&57>=P){for(P==48&&(P=Z.charCodeAt(B+1),P>=48&&57>=P)&&ut(),et=!1;tt>B&&(P=Z.charCodeAt(B),P>=48&&57>=P);B++);if(Z.charCodeAt(B)==46){for(F=++B;tt>F&&(P=Z.charCodeAt(F),P>=48&&57>=P);F++);F==B&&ut(),B=F}if(P=Z.charCodeAt(B),P==101||P==69){for(P=Z.charCodeAt(++B),(P==43||P==45)&&B++,F=B;tt>F&&(P=Z.charCodeAt(F),P>=48&&57>=P);F++);F==B&&ut(),B=F}return+Z.slice(J,B)}if(et&&ut(),Z.slice(B,B+4)=="true")return B+=4,!0;if(Z.slice(B,B+5)=="false")return B+=5,!1;if(Z.slice(B,B+4)=="null")return B+=4,null;ut()}return"$"},xe=function(q){var J,F;if(q=="$"&&ut(),typeof q=="string"){if((st?q.charAt(0):q[0])=="@")return q.slice(1);if(q=="["){for(J=[];q=Ht(),q!="]";F||(F=!0))F&&(q==","?(q=Ht(),q=="]"&&ut()):ut()),q==","&&ut(),J.push(xe(q));return J}if(q=="{"){for(J={};q=Ht(),q!="}";F||(F=!0))F&&(q==","?(q=Ht(),q=="}"&&ut()):ut()),(q==","||typeof q!="string"||(st?q.charAt(0):q[0])!="@"||Ht()!=":")&&ut(),J[q.slice(1)]=xe(Ht());return J}ut()}return q},se=function(q,J,F){var et=er(q,J,F);et===d?delete q[J]:q[J]=et},er=function(q,J,F){var et,P=q[J];if(typeof P=="object"&&P)if(S.call(P)==x)for(et=P.length;et--;)se(P,et,F);else m(P,function(Z){se(P,Z,F)});return F.call(q,J,P)};_.parse=function(q,J){var F,et;return B=0,At=""+q,F=xe(Ht()),Ht()!="$"&&ut(),B=At=null,J&&S.call(J)==l?er((et={},et[""]=F,et),"",J):F}}}})(this)},{}],48:[function(s,i){function n(o,u){var h=[];u=u||0;for(var m=u||0;m<o.length;m++)h[m-u]=o[m];return h}i.exports=n},{}]},{},[1])(1)}const Xv=Object.freeze(Object.defineProperty({__proto__:null,default:zv},Symbol.toStringTag,{value:"Module"})),Jv=Object.assign({"./v1_3_7.js":Xv}),Vv=/v\d+_\d+_\d+/;function Yv(s){return typeof s=="function"}const ks=Object.entries(Jv).reduce((s,i)=>{var u;const n=i[1].default,o=(u=i[0].match(Vv))==null?void 0:u[0];return Yv(n)&&o&&(s[o]=n()),s},{}),Nu=s=>{if(s in ks)return ks[s];throw new Error(`Socket version ${s} not found`)},jv=(s,...i)=>Nu(s)(...i),Zv={...ks,getSocketVersion:Nu,makeSocketVersion:jv};var Bu=(s=>(s.RINGING="Ringing",s.TALKING="Talking",s.DIALING="Dialing",s.HOLD="Hold",s))(Bu||{}),Uu=(s=>(s.INCOMING="Incoming",s.OUTGOING="Outgoing",s))(Uu||{}),Du=(s=>(s.AUTOMATIC="Automatic",s.IVR="IVR",s))(Du||{}),Pu=(s=>(s.INCOMINC="Incoming",s.OUTGOING="Outgoing",s.SPY="Spy",s.CLICK2CALL="Click2Call",s))(Pu||{}),Fu=(s=>(s.RESPONSE_FROM_API_VALID="RESPONSE_FROM_API_VALID",s.RESPONSE_FROM_API_INVALID="RESPONSE_FROM_API_INVALID",s))(Fu||{}),ft=(s=>(s.ALL_DIALER_STATUS="AllDialersStatus",s.ALL_EXTENSION_STATUS="AllExtensionsStatus",s.ALL_USERS_STATUS="AllUsersStatus",s.CONNECT="connect",s.DISCONNECT="disconnect",s.CONNECT_ERROR_EVENT="connect_error",s.EXTENSION_EVENT="ExtensionEvent",s.KEEP_ALIVE="keepalive",s.KEEP_ALIVE_RESPONSE="keepaliveResponse",s.LOGIN_STATUS="loginStatus",s.LOGIN_SUCCESS="loginSuccess",s.QUEUE_EVENT="QueueEvent",s.ONLINE_STATUS_EVENT="onlineStatusEvent",s.DIALER_EVENT="DialerEvent",s.EXTENSIONS_UPDATED="ExtensionsUpdated",s))(ft||{}),Ls=(s=>(s.NEWCALL="NEWCALL",s.ANSWER="ANSWER",s.HOLD="HOLD",s.UNHOLD="UNHOLD",s.HANGUP="HANGUP",s.USER_STATUS_UPDATE="userStatusUpdate",s))(Ls||{}),Mu=(s=>(s.NORMAL_HANGUP="Normal hangup",s.USER_BUSY="User busy",s.CALL_REJECTED="Call Rejected",s.UNALLOCATED_NUMBER="Unallocated (unassigned) number",s.UNKNOWN="Unknown",s.NO_USER_RESPONDING="No user responding",s.USER_ALERTING="User alerting, no answer",s.ANSWERED_ELSEWHERE="Answered elsewhere",s))(Mu||{}),qu=(s=>(s.ANSWER="ANSWER",s.ABANDONED="ABANDONED",s.EXIT="EXIT",s.JOIN="JOIN",s))(qu||{});class yu{static mapExtensionEvent(i){var h,m;const n=i.reason;let o,u;return i.data.currentCall&&(u=this.mapExtensionCall(i,i.data.currentCall)),n===Ls.HANGUP?o={...i,reason:n,data:{...i.data,currentCall:u?{...u,duration:Date.now()-((u==null?void 0:u.callAnswered_UTC_CLIENT)??0)}:void 0,calls:(h=i.data.calls)==null?void 0:h.map(d=>{const S=this.mapExtensionCall(i,d);return{...S,duration:Date.now()-(S.callAnswered_UTC_CLIENT??0)}})}}:o={...i,data:{...i.data,currentCall:u,calls:(m=i.data.calls)==null?void 0:m.map(d=>this.mapExtensionCall(i,d))},reason:n},o}static mapAllExtensionStatus(i){return{...i,extensions:i.extensions.map(n=>{var o;return{...n,currentCall:n.currentCall?this.mapExtensionCall(i,n.currentCall):void 0,calls:(o=n.calls)==null?void 0:o.map(u=>this.mapExtensionCall(i,u))}})}}static mapExtensionCall(i,n){return this.configureUTCForObject(n,["callAnswered","callStarted"],i.servertime,i.servertimeoffset)}static assignProperty(i,n,o){i[n]=o}static configureUTCForObject(i,n,o,u){const h=(o-u*60)*1e3,m=Date.now()-h,d={};return n.forEach(S=>{const v=i[S];if(console.log("####################"),console.log("property",S),console.log("value",v),console.log("####################"),v===0)this.assignProperty(d,`${S}_UTC`,0),this.assignProperty(d,`${S}_UTC_CLIENT`,0);else{const _=(v-u*60)*1e3;this.assignProperty(d,`${S}_UTC`,_),this.assignProperty(d,`${S}_UTC_CLIENT`,_+m)}}),{...i,...d}}}var Ns=(s=>(s.UPDATE_MONITORED_EXTENSIONS="updateMonitoredExtensions",s.KEEP_ALIVE="keepAlive",s))(Ns||{});class Qv{constructor(i){wt(this,"io");wt(this,"ioFunction");wt(this,"lastEventTimestamp",new Date().getTime());wt(this,"doReconnect",!0);wt(this,"keepAliveInterval");wt(this,"keepReconnectInterval");wt(this,"connected",!1);this.eventsSdkClass=i,this.eventsSdkClass=i}getSocketIoFunction(i){const n=i.split("v="),o="v".concat(n[n.length-1]).replaceAll(".","_");this.ioFunction=Zv.getSocketVersion(o)}initSocketConnection(){const i=this.eventsSdkClass.authClass.token,n=this.eventsSdkClass.options.protocol,o=this.eventsSdkClass.server;try{const u=o?o.Domain:this.eventsSdkClass.URL,h=o?`${n}://${u}`:this.eventsSdkClass.URL;this.eventsSdkClass.loggerClass.log(Jt.INFO,"Connecting to..",h),this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!1,attemptToConnect:h,doReconnect:this.doReconnect});const m={reconnection:!1,upgrade:!1,transports:["websocket"],forceNew:!0,query:{token:i},timeout:this.eventsSdkClass.options.timeout};if(i&&(m.query={token:i}),this.ioFunction&&h)this.io=this.ioFunction(h,m);else throw new Error("Socket server url no defined")}catch(u){this.eventsSdkClass.loggerClass.log(Jt.ERROR,"init socket connection error",u)}}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(Ns.KEEP_ALIVE,this.eventsSdkClass.authClass.token),this.eventsSdkClass.loggerClass.log(Jt.INFO,`EMIT -> ${ft.KEEP_ALIVE}`,this.eventsSdkClass.authClass.token);return}},this.eventsSdkClass.options.keepAliveTimeout)}closeAllConnections(){var i;this.io&&(this.io.close(),(i=this.io)==null||i.disconnect(),this.io=void 0),Qn.clearSessionStorage()}initSocketEvents(){this.io&&this.io.on(ft.LOGIN_SUCCESS,i=>this.onLoginSuccessEvent(i)).on(ft.QUEUE_EVENT,i=>this.onQueueEvent(i)).on(ft.EXTENSION_EVENT,i=>this.onExtensionEvent(i)).on(ft.DIALER_EVENT,i=>this.onDialerEvent(i)).on(ft.LOGIN_STATUS,i=>this.onLoginStatusEvent(i)).on(ft.ALL_EXTENSION_STATUS,i=>this.onAllExtensionStatus(i)).on(ft.ALL_DIALER_STATUS,i=>this.onAllDialerStatus(i)).on(ft.KEEP_ALIVE_RESPONSE,i=>this.onKeepAliveResponse(i)).on(ft.EXTENSIONS_UPDATED,i=>this.onExtensionsUpdatedEvent(i)).on(ft.CONNECT,()=>this.onConnect()).on(ft.DISCONNECT,i=>this.onDisconnect(i)).on(ft.CONNECT_ERROR_EVENT,i=>this.onConnectError(i))}onLoginSuccessEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.LOGIN_SUCCESS,i)}onQueueEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.QUEUE_EVENT,i)}onExtensionEvent(i){const n=yu.mapExtensionEvent(i);n&&this.eventsSdkClass.eventEmitterClass.emit(ft.EXTENSION_EVENT,n)}onDialerEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.DIALER_EVENT,i)}onLoginStatusEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.LOGIN_STATUS,i)}onAllExtensionStatus(i){const n=yu.mapAllExtensionStatus(i);this.eventsSdkClass.eventEmitterClass.emit(ft.ALL_EXTENSION_STATUS,n)}onAllDialerStatus(i){this.eventsSdkClass.eventEmitterClass.emit(ft.ALL_DIALER_STATUS,i)}onKeepAliveResponse(i){if(this.eventsSdkClass.loggerClass.log(Jt.INFO,ft.KEEP_ALIVE_RESPONSE),i.errorCode){this.initSocketConnection();return}this.connected?this.lastEventTimestamp=new Date().getTime():this.initSocketConnection()}onExtensionsUpdatedEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.EXTENSIONS_UPDATED,i)}onConnect(){this.keepReconnectInterval&&clearInterval(this.keepReconnectInterval),this.connected=!0,this.eventsSdkClass.loggerClass.log(Jt.INFO,ft.CONNECT,this.eventsSdkClass.reconnectOptions),this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!0,doReconnect:this.doReconnect})}onDisconnect(i){this.connected=!1,this.eventsSdkClass.loggerClass.log(Jt.INFO,ft.DISCONNECT,i),this.closeAllConnections(),this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.doReconnect&&(console.log("attempt to connect..."),this.eventsSdkClass.connect(pn.NEXT))}onConnectError(i){this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log(Jt.ERROR,ft.CONNECT_ERROR_EVENT,i),setTimeout(()=>{this.eventsSdkClass.connect(pn.NEXT)},this.eventsSdkClass.options.reconnectionDelay)}}var ty=Object.defineProperty,ey=(s,i,n)=>i in s?ty(s,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[i]=n,qt=(s,i,n)=>(ey(s,typeof i!="symbol"?i+"":i,n),n);const Ue=Object.create(null);Ue.open="0";Ue.close="1";Ue.ping="2";Ue.pong="3";Ue.message="4";Ue.upgrade="5";Ue.noop="6";const Vr=Object.create(null);Object.keys(Ue).forEach(s=>{Vr[Ue[s]]=s});const Es={type:"error",data:"parser error"},Wu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ku=typeof ArrayBuffer=="function",Gu=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Bs=({type:s,data:i},n,o)=>Wu&&i instanceof Blob?n?o(i):mu(i,o):Ku&&(i instanceof ArrayBuffer||Gu(i))?n?o(i):mu(new Blob([i]),o):o(Ue[s]+(i||"")),mu=(s,i)=>{const n=new FileReader;return n.onload=function(){const o=n.result.split(",")[1];i("b"+(o||""))},n.readAsDataURL(s)};function _u(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let bs;function ny(s,i){if(Wu&&s.data instanceof Blob)return s.data.arrayBuffer().then(_u).then(i);if(Ku&&(s.data instanceof ArrayBuffer||Gu(s.data)))return i(_u(s.data));Bs(s,!1,n=>{bs||(bs=new TextEncoder),i(bs.encode(n))})}const wu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<wu.length;s++)tr[wu.charCodeAt(s)]=s;const ry=s=>{let i=s.length*.75,n=s.length,o,u=0,h,m,d,S;s[s.length-1]==="="&&(i--,s[s.length-2]==="="&&i--);const v=new ArrayBuffer(i),_=new Uint8Array(v);for(o=0;o<n;o+=4)h=tr[s.charCodeAt(o)],m=tr[s.charCodeAt(o+1)],d=tr[s.charCodeAt(o+2)],S=tr[s.charCodeAt(o+3)],_[u++]=h<<2|m>>4,_[u++]=(m&15)<<4|d>>2,_[u++]=(d&3)<<6|S&63;return v},iy=typeof ArrayBuffer=="function",Us=(s,i)=>{if(typeof s!="string")return{type:"message",data:Hu(s,i)};const n=s.charAt(0);return n==="b"?{type:"message",data:sy(s.substring(1),i)}:Vr[n]?s.length>1?{type:Vr[n],data:s.substring(1)}:{type:Vr[n]}:Es},sy=(s,i)=>{if(iy){const n=ry(s);return Hu(n,i)}else return{base64:!0,data:s}},Hu=(s,i)=>{switch(i){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},$u="",oy=(s,i)=>{const n=s.length,o=new Array(n);let u=0;s.forEach((h,m)=>{Bs(h,!1,d=>{o[m]=d,++u===n&&i(o.join($u))})})},ay=(s,i)=>{const n=s.split($u),o=[];for(let u=0;u<n.length;u++){const h=Us(n[u],i);if(o.push(h),h.type==="error")break}return o};function uy(){return new TransformStream({transform(s,i){ny(s,n=>{const o=n.length;let u;if(o<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,o);else if(o<65536){u=new Uint8Array(3);const h=new DataView(u.buffer);h.setUint8(0,126),h.setUint16(1,o)}else{u=new Uint8Array(9);const h=new DataView(u.buffer);h.setUint8(0,127),h.setBigUint64(1,BigInt(o))}s.data&&typeof s.data!="string"&&(u[0]|=128),i.enqueue(u),i.enqueue(n)})}})}let Ss;function Hr(s){return s.reduce((i,n)=>i+n.length,0)}function $r(s,i){if(s[0].length===i)return s.shift();const n=new Uint8Array(i);let o=0;for(let u=0;u<i;u++)n[u]=s[0][o++],o===s[0].length&&(s.shift(),o=0);return s.length&&o<s[0].length&&(s[0]=s[0].slice(o)),n}function cy(s,i){Ss||(Ss=new TextDecoder);const n=[];let o=0,u=-1,h=!1;return new TransformStream({transform(m,d){for(n.push(m);;){if(o===0){if(Hr(n)<1)break;const S=$r(n,1);h=(S[0]&128)===128,u=S[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(Hr(n)<2)break;const S=$r(n,2);u=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),o=3}else if(o===2){if(Hr(n)<8)break;const S=$r(n,8),v=new DataView(S.buffer,S.byteOffset,S.length),_=v.getUint32(0);if(_>Math.pow(2,21)-1){d.enqueue(Es);break}u=_*Math.pow(2,32)+v.getUint32(4),o=3}else{if(Hr(n)<u)break;const S=$r(n,u);d.enqueue(Us(h?S:Ss.decode(S),i)),o=0}if(u===0||u>s){d.enqueue(Es);break}}}})}const zu=4;function Dt(s){if(s)return hy(s)}function hy(s){for(var i in Dt.prototype)s[i]=Dt.prototype[i];return s}Dt.prototype.on=Dt.prototype.addEventListener=function(s,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(i),this};Dt.prototype.once=function(s,i){function n(){this.off(s,n),i.apply(this,arguments)}return n.fn=i,this.on(s,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(s,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+s];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var o,u=0;u<n.length;u++)if(o=n[u],o===i||o.fn===i){n.splice(u,1);break}return n.length===0&&delete this._callbacks["$"+s],this};Dt.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),n=this._callbacks["$"+s],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(n){n=n.slice(0);for(var o=0,u=n.length;o<u;++o)n[o].apply(this,i)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};Dt.prototype.hasListeners=function(s){return!!this.listeners(s).length};const be=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function Xu(s,...i){return i.reduce((n,o)=>(s.hasOwnProperty(o)&&(n[o]=s[o]),n),{})}const fy=be.setTimeout,ly=be.clearTimeout;function Qr(s,i){i.useNativeTimers?(s.setTimeoutFn=fy.bind(be),s.clearTimeoutFn=ly.bind(be)):(s.setTimeoutFn=be.setTimeout.bind(be),s.clearTimeoutFn=be.clearTimeout.bind(be))}const py=1.33;function dy(s){return typeof s=="string"?gy(s):Math.ceil((s.byteLength||s.size)*py)}function gy(s){let i=0,n=0;for(let o=0,u=s.length;o<u;o++)i=s.charCodeAt(o),i<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(o++,n+=4);return n}function vy(s){let i="";for(let n in s)s.hasOwnProperty(n)&&(i.length&&(i+="&"),i+=encodeURIComponent(n)+"="+encodeURIComponent(s[n]));return i}function yy(s){let i={},n=s.split("&");for(let o=0,u=n.length;o<u;o++){let h=n[o].split("=");i[decodeURIComponent(h[0])]=decodeURIComponent(h[1])}return i}class my extends Error{constructor(i,n,o){super(i),this.description=n,this.context=o,this.type="TransportError"}}class Ds extends Dt{constructor(i){super(),this.writable=!1,Qr(this,i),this.opts=i,this.query=i.query,this.socket=i.socket}onError(i,n,o){return super.emitReserved("error",new my(i,n,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const n=Us(i,this.socket.binaryType);this.onPacket(n)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,n={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const n=vy(i);return n.length?"?"+n:""}}const Ju="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ts=64,_y={};let bu=0,zr=0,Su;function Cu(s){let i="";do i=Ju[s%Ts]+i,s=Math.floor(s/Ts);while(s>0);return i}function Vu(){const s=Cu(+new Date);return s!==Su?(bu=0,Su=s):s+"."+Cu(bu++)}for(;zr<Ts;zr++)_y[Ju[zr]]=zr;let Yu=!1;try{Yu=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const wy=Yu;function ju(s){const i=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||wy))return new XMLHttpRequest}catch{}if(!i)try{return new be[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function by(){}const Sy=function(){return new ju({xdomain:!1}).responseType!=null}();class Cy extends Ds{constructor(i){if(super(i),this.polling=!1,typeof location<"u"){const o=location.protocol==="https:";let u=location.port;u||(u=o?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||u!==i.port}const n=i&&i.forceBase64;this.supportsBinary=Sy&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(i){this.readyState="pausing";const n=()=>{this.readyState="paused",i()};if(this.polling||!this.writable){let o=0;this.polling&&(o++,this.once("pollComplete",function(){--o||n()})),this.writable||(o++,this.once("drain",function(){--o||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const n=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};ay(i,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,oy(i,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Vu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(i,n)}request(i={}){return Object.assign(i,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Be(this.uri(),i)}doWrite(i,n){const o=this.request({method:"POST",data:i});o.on("success",n),o.on("error",(u,h)=>{this.onError("xhr post error",u,h)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(n,o)=>{this.onError("xhr poll error",n,o)}),this.pollXhr=i}}class Be extends Dt{constructor(i,n){super(),Qr(this,n),this.opts=n,this.method=n.method||"GET",this.uri=i,this.data=n.data!==void 0?n.data:null,this.create()}create(){var i;const n=Xu(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const o=this.xhr=new ju(n);try{o.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let u in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(u)&&o.setRequestHeader(u,this.opts.extraHeaders[u])}}catch{}if(this.method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this.opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(o.timeout=this.opts.requestTimeout),o.onreadystatechange=()=>{var u;o.readyState===3&&((u=this.opts.cookieJar)===null||u===void 0||u.parseCookies(o)),o.readyState===4&&(o.status===200||o.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof o.status=="number"?o.status:0)},0))},o.send(this.data)}catch(u){this.setTimeoutFn(()=>{this.onError(u)},0);return}typeof document<"u"&&(this.index=Be.requestsCount++,Be.requests[this.index]=this)}onError(i){this.emitReserved("error",i,this.xhr),this.cleanup(!0)}cleanup(i){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=by,i)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Be.requests[this.index],this.xhr=null}}onLoad(){const i=this.xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Be.requestsCount=0;Be.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Au);else if(typeof addEventListener=="function"){const s="onpagehide"in be?"pagehide":"unload";addEventListener(s,Au,!1)}}function Au(){for(let s in Be.requests)Be.requests.hasOwnProperty(s)&&Be.requests[s].abort()}const Ps=typeof Promise=="function"&&typeof Promise.resolve=="function"?s=>Promise.resolve().then(s):(s,i)=>i(s,0),Xr=be.WebSocket||be.MozWebSocket,ku=!0,Ay="arraybuffer",Eu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ky extends Ds{constructor(i){super(i),this.supportsBinary=!i.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const i=this.uri(),n=this.opts.protocols,o=Eu?{}:Xu(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=ku&&!Eu?n?new Xr(i,n):new Xr(i):new Xr(i,n,o)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let n=0;n<i.length;n++){const o=i[n],u=n===i.length-1;Bs(o,this.supportsBinary,h=>{try{ku&&this.ws.send(h)}catch{}u&&Ps(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Vu()),this.supportsBinary||(n.b64=1),this.createUri(i,n)}check(){return!!Xr}}class Ey extends Ds{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(i=>{const n=cy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(n).getReader(),u=uy();u.readable.pipeTo(i.writable),this.writer=u.writable.getWriter();const h=()=>{o.read().then(({done:d,value:S})=>{d||(this.onPacket(S),h())}).catch(d=>{})};h();const m={type:"open"};this.query.sid&&(m.data=`{"sid":"${this.query.sid}"}`),this.writer.write(m).then(()=>this.onOpen())})}))}write(i){this.writable=!1;for(let n=0;n<i.length;n++){const o=i[n],u=n===i.length-1;this.writer.write(o).then(()=>{u&&Ps(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this.transport)===null||i===void 0||i.close()}}const Ty={websocket:ky,webtransport:Ey,polling:Cy},xy=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ry=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xs(s){if(s.length>2e3)throw"URI too long";const i=s,n=s.indexOf("["),o=s.indexOf("]");n!=-1&&o!=-1&&(s=s.substring(0,n)+s.substring(n,o).replace(/:/g,";")+s.substring(o,s.length));let u=xy.exec(s||""),h={},m=14;for(;m--;)h[Ry[m]]=u[m]||"";return n!=-1&&o!=-1&&(h.source=i,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),h.pathNames=Oy(h,h.path),h.queryKey=Iy(h,h.query),h}function Oy(s,i){const n=/\/{2,9}/g,o=i.replace(n,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Iy(s,i){const n={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,h){u&&(n[u]=h)}),n}let Zu=class On extends Dt{constructor(i,n={}){super(),this.binaryType=Ay,this.writeBuffer=[],i&&typeof i=="object"&&(n=i,i=null),i?(i=xs(i),n.hostname=i.host,n.secure=i.protocol==="https"||i.protocol==="wss",n.port=i.port,i.query&&(n.query=i.query)):n.host&&(n.hostname=xs(n.host).host),Qr(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yy(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(i){const n=Object.assign({},this.opts.query);n.EIO=zu,n.transport=i,this.id&&(n.sid=this.id);const o=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new Ty[i](o)}open(){let i;if(this.opts.rememberUpgrade&&On.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)i="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else i=this.transports[0];this.readyState="opening";try{i=this.createTransport(i)}catch{this.transports.shift(),this.open();return}i.open(),this.setTransport(i)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(i){let n=this.createTransport(i),o=!1;On.priorWebsocketSuccess=!1;const u=()=>{o||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!o)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;On.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(_(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const l=new Error("probe error");l.transport=n.name,this.emitReserved("upgradeError",l)}}))};function h(){o||(o=!0,_(),n.close(),n=null)}const m=y=>{const l=new Error("probe error: "+y);l.transport=n.name,h(),this.emitReserved("upgradeError",l)};function d(){m("transport closed")}function S(){m("socket closed")}function v(y){n&&y.name!==n.name&&h()}const _=()=>{n.removeListener("open",u),n.removeListener("error",m),n.removeListener("close",d),this.off("close",S),this.off("upgrading",v)};n.once("open",u),n.once("error",m),n.once("close",d),this.once("close",S),this.once("upgrading",v),this.upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||n.open()},200):n.open()}onOpen(){if(this.readyState="open",On.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let i=0;const n=this.upgrades.length;for(;i<n;i++)this.probe(this.upgrades[i])}}onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),this.resetPingTimeout(),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=i.data,this.onError(n);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this.upgrades=this.filterUpgrades(i.upgrades),this.pingInterval=i.pingInterval,this.pingTimeout=i.pingTimeout,this.maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this.getWritablePackets();this.transport.send(i),this.prevBufferLen=i.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let n=0;n<this.writeBuffer.length;n++){const o=this.writeBuffer[n].data;if(o&&(i+=dy(o)),n>0&&i>this.maxPayload)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer}write(i,n,o){return this.sendPacket("message",i,n,o),this}send(i,n,o){return this.sendPacket("message",i,n,o),this}sendPacket(i,n,o,u){if(typeof n=="function"&&(u=n,n=void 0),typeof o=="function"&&(u=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const h={type:i,data:n,options:o};this.emitReserved("packetCreate",h),this.writeBuffer.push(h),u&&this.once("flush",u),this.flush()}close(){const i=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),i()},o=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():i()}):this.upgrading?o():i()),this}onError(i){On.priorWebsocketSuccess=!1,this.emitReserved("error",i),this.onClose("transport error",i)}onClose(i,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",i,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(i){const n=[];let o=0;const u=i.length;for(;o<u;o++)~this.transports.indexOf(i[o])&&n.push(i[o]);return n}};Zu.protocol=zu;function Ly(s,i="",n){let o=s;n=n||typeof location<"u"&&location,s==null&&(s=n.protocol+"//"+n.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=n.protocol+s:s=n.host+s),/^(https?|wss?):\/\//.test(s)||(typeof n<"u"?s=n.protocol+"//"+s:s="https://"+s),o=xs(s)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const u=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+u+":"+o.port+i,o.href=o.protocol+"://"+u+(n&&n.port===o.port?"":":"+o.port),o}const Ny=typeof ArrayBuffer=="function",By=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qu=Object.prototype.toString,Uy=typeof Blob=="function"||typeof Blob<"u"&&Qu.call(Blob)==="[object BlobConstructor]",Dy=typeof File=="function"||typeof File<"u"&&Qu.call(File)==="[object FileConstructor]";function Fs(s){return Ny&&(s instanceof ArrayBuffer||By(s))||Uy&&s instanceof Blob||Dy&&s instanceof File}function Yr(s,i){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let n=0,o=s.length;n<o;n++)if(Yr(s[n]))return!0;return!1}if(Fs(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Yr(s.toJSON(),!0);for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)&&Yr(s[n]))return!0;return!1}function Py(s){const i=[],n=s.data,o=s;return o.data=Rs(n,i),o.attachments=i.length,{packet:o,buffers:i}}function Rs(s,i){if(!s)return s;if(Fs(s)){const n={_placeholder:!0,num:i.length};return i.push(s),n}else if(Array.isArray(s)){const n=new Array(s.length);for(let o=0;o<s.length;o++)n[o]=Rs(s[o],i);return n}else if(typeof s=="object"&&!(s instanceof Date)){const n={};for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&(n[o]=Rs(s[o],i));return n}return s}function Fy(s,i){return s.data=Os(s.data,i),delete s.attachments,s}function Os(s,i){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<i.length)return i[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let n=0;n<s.length;n++)s[n]=Os(s[n],i);else if(typeof s=="object")for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(s[n]=Os(s[n],i));return s}const My=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],qy=5;var mt;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(mt||(mt={}));class Wy{constructor(i){this.replacer=i}encode(i){return(i.type===mt.EVENT||i.type===mt.ACK)&&Yr(i)?this.encodeAsBinary({type:i.type===mt.EVENT?mt.BINARY_EVENT:mt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let n=""+i.type;return(i.type===mt.BINARY_EVENT||i.type===mt.BINARY_ACK)&&(n+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(n+=i.nsp+","),i.id!=null&&(n+=i.id),i.data!=null&&(n+=JSON.stringify(i.data,this.replacer)),n}encodeAsBinary(i){const n=Py(i),o=this.encodeAsString(n.packet),u=n.buffers;return u.unshift(o),u}}function Tu(s){return Object.prototype.toString.call(s)==="[object Object]"}class Ms extends Dt{constructor(i){super(),this.reviver=i}add(i){let n;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(i);const o=n.type===mt.BINARY_EVENT;o||n.type===mt.BINARY_ACK?(n.type=o?mt.EVENT:mt.ACK,this.reconstructor=new Ky(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Fs(i)||i.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(i),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let n=0;const o={type:Number(i.charAt(0))};if(mt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===mt.BINARY_EVENT||o.type===mt.BINARY_ACK){const h=n+1;for(;i.charAt(++n)!=="-"&&n!=i.length;);const m=i.substring(h,n);if(m!=Number(m)||i.charAt(n)!=="-")throw new Error("Illegal attachments");o.attachments=Number(m)}if(i.charAt(n+1)==="/"){const h=n+1;for(;++n&&!(i.charAt(n)===","||n===i.length););o.nsp=i.substring(h,n)}else o.nsp="/";const u=i.charAt(n+1);if(u!==""&&Number(u)==u){const h=n+1;for(;++n;){const m=i.charAt(n);if(m==null||Number(m)!=m){--n;break}if(n===i.length)break}o.id=Number(i.substring(h,n+1))}if(i.charAt(++n)){const h=this.tryParse(i.substr(n));if(Ms.isPayloadValid(o.type,h))o.data=h;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,n){switch(i){case mt.CONNECT:return Tu(n);case mt.DISCONNECT:return n===void 0;case mt.CONNECT_ERROR:return typeof n=="string"||Tu(n);case mt.EVENT:case mt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&My.indexOf(n[0])===-1);case mt.ACK:case mt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ky{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const n=Fy(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gy=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ms,Encoder:Wy,get PacketType(){return mt},protocol:qy},Symbol.toStringTag,{value:"Module"}));function Te(s,i,n){return s.on(i,n),function(){s.off(i,n)}}const Hy=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tc extends Dt{constructor(i,n,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=n,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Te(i,"open",this.onopen.bind(this)),Te(i,"packet",this.onpacket.bind(this)),Te(i,"error",this.onerror.bind(this)),Te(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...n){if(Hy.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(n.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:mt.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,m=n.pop();this._registerAckCallback(h,m),o.id=h}const u=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!u||!this.connected)||(this.connected?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(i,n){var o;const u=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(u===void 0){this.acks[i]=n;return}const h=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);n.call(this,new Error("operation has timed out"))},u);this.acks[i]=(...m)=>{this.io.clearTimeoutFn(h),n.apply(this,[null,...m])}}emitWithAck(i,...n){const o=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((u,h)=>{n.push((m,d)=>o?m?h(m):u(d):u(m)),this.emit(i,...n)})}_addToQueue(i){let n;typeof i[i.length-1]=="function"&&(n=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((u,...h)=>o!==this._queue[0]?void 0:(u!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(u)):(this._queue.shift(),n&&n(null,...h)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!i||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:mt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,n)}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case mt.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case mt.EVENT:case mt.BINARY_EVENT:this.onevent(i);break;case mt.ACK:case mt.BINARY_ACK:this.onack(i);break;case mt.DISCONNECT:this.ondisconnect();break;case mt.CONNECT_ERROR:this.destroy();const n=new Error(i.data.message);n.data=i.data.data,this.emitReserved("connect_error",n);break}}onevent(i){const n=i.data||[];i.id!=null&&n.push(this.ack(i.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const o of n)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const n=this;let o=!1;return function(...u){o||(o=!0,n.packet({type:mt.ACK,id:i,data:u}))}}onack(i){const n=this.acks[i.id];typeof n=="function"&&(n.apply(this,i.data),delete this.acks[i.id])}onconnect(i,n){this.id=i,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:mt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const n=this._anyListeners;for(let o=0;o<n.length;o++)if(i===n[o])return n.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const n=this._anyOutgoingListeners;for(let o=0;o<n.length;o++)if(i===n[o])return n.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const o of n)o.apply(this,i.data)}}}function In(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}In.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),n=Math.floor(i*this.jitter*s);s=Math.floor(i*10)&1?s+n:s-n}return Math.min(s,this.max)|0};In.prototype.reset=function(){this.attempts=0};In.prototype.setMin=function(s){this.ms=s};In.prototype.setMax=function(s){this.max=s};In.prototype.setJitter=function(s){this.jitter=s};class Is extends Dt{constructor(i,n){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(n=i,i=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Qr(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((o=n.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new In({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=i;const u=n.parser||Gy;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var n;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(n=this.backoff)===null||n===void 0||n.setMin(i),this)}randomizationFactor(i){var n;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(n=this.backoff)===null||n===void 0||n.setJitter(i),this)}reconnectionDelayMax(i){var n;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(n=this.backoff)===null||n===void 0||n.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Zu(this.uri,this.opts);const n=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const u=Te(n,"open",function(){o.onopen(),i&&i()}),h=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),i?i(d):this.maybeReconnectOnOpen()},m=Te(n,"error",h);if(this._timeout!==!1){const d=this._timeout,S=this.setTimeoutFn(()=>{u(),h(new Error("timeout")),n.close()},d);this.opts.autoUnref&&S.unref(),this.subs.push(()=>{this.clearTimeoutFn(S)})}return this.subs.push(u),this.subs.push(m),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Te(i,"ping",this.onping.bind(this)),Te(i,"data",this.ondata.bind(this)),Te(i,"error",this.onerror.bind(this)),Te(i,"close",this.onclose.bind(this)),Te(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(n){this.onclose("parse error",n)}}ondecoded(i){Ps(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,n){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new tc(this,i,n),this.nsps[i]=o),o}_destroy(i){const n=Object.keys(this.nsps);for(const o of n)if(this.nsps[o].active)return;this._close()}_packet(i){const n=this.encoder.encode(i);for(let o=0;o<n.length;o++)this.engine.write(n[o],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(i,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(u=>{u?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",u)):i.onreconnect()}))},n);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Zn={};function jr(s,i){typeof s=="object"&&(i=s,s=void 0),i=i||{};const n=Ly(s,i.path||"/socket.io"),o=n.source,u=n.id,h=n.path,m=Zn[u]&&h in Zn[u].nsps,d=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let S;return d?S=new Is(o,i):(Zn[u]||(Zn[u]=new Is(o,i)),S=Zn[u]),n.query&&!i.query&&(i.query=n.queryKey),S.socket(n.path,i)}Object.assign(jr,{Manager:Is,Socket:tc,io:jr,connect:jr});let Jr;const $y=new Uint8Array(16);function zy(){if(!Jr&&(Jr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jr($y)}const Gt=[];for(let s=0;s<256;++s)Gt.push((s+256).toString(16).slice(1));function Xy(s,i=0){return Gt[s[i+0]]+Gt[s[i+1]]+Gt[s[i+2]]+Gt[s[i+3]]+"-"+Gt[s[i+4]]+Gt[s[i+5]]+"-"+Gt[s[i+6]]+Gt[s[i+7]]+"-"+Gt[s[i+8]]+Gt[s[i+9]]+"-"+Gt[s[i+10]]+Gt[s[i+11]]+Gt[s[i+12]]+Gt[s[i+13]]+Gt[s[i+14]]+Gt[s[i+15]]}const Jy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xu={randomUUID:Jy};function Vy(s,i,n){if(xu.randomUUID&&!i&&!s)return xu.randomUUID();s=s||{};const o=s.random||(s.rng||zy)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){n=n||0;for(let u=0;u<16;++u)i[n+u]=o[u];return i}return Xy(o)}function Yy(s){return!!s&&(typeof s=="object"||typeof s=="function")&&typeof s.then=="function"}function jy(s,i){const n=i.map(u=>JSON.stringify(u)).join(" "),o=new Date().toISOString();return JSON.stringify({level:s,time:o,message:n})}function Zy(s){const i=String(s[0]),n=s.slice(1);return{level:i,logs:n}}function Qy(s,i){const n=JSON.parse(s);return i.forEach(o=>delete n[o]),n}const t0={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},Cs={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4};let ie=console;class Ru{constructor(i){qt(this,"logToConsole"),qt(this,"overloadGlobalConsole"),qt(this,"namespace"),qt(this,"socketEmitInterval"),qt(this,"storageId"),qt(this,"emitInProgress"),qt(this,"queue"),qt(this,"processing"),qt(this,"interval"),qt(this,"logIndex"),qt(this,"socket"),qt(this,"getItem"),qt(this,"setItem"),qt(this,"parseLog"),qt(this,"_logMethod"),qt(this,"_warnMethod"),qt(this,"_errorMethod"),qt(this,"_debugMethod");const{loggerOptions:n}=i;if(!n.namespace)throw new Error("Config property 'namespace' should be provided!");this.setupStorageFunctions(n.getItem,n.setItem,n.parseLog),this.namespace=n.namespace,this.socketEmitInterval=n.socketEmitInterval||Cs.socketEmitInterval,this.logToConsole=n.logToConsole!==void 0?n.logToConsole:Cs.logToConsole,this.overloadGlobalConsole=n.overloadGlobalConsole!==void 0?n.overloadGlobalConsole:Cs.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.emitInProgress=!1,this.logIndex=0,this.init(i)}setupStorageFunctions(i,n,o){this.getItem=i&&typeof i=="function"?this.promisifyStorageFunction(i):this.defaultGetItemFunction,this.setItem=n&&typeof n=="function"?this.promisifyStorageFunction(n):this.defaultSetItemFunction,this.parseLog=o&&typeof o=="function"?o:jy}promisifyStorageFunction(i){const n=i("");return Yy(n)?async(...o)=>new Promise((u,h)=>{try{const m=i(...o);u(m)}catch(m){h(m)}}):i}init(i){const{socket:n,url:o,socketOptions:u={}}=i;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(o)this.socket=this.createConnection(o,u);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(i,n={}){const o={...t0,...n};return jr(i,o)}async emitLogs(){if(!this.emitInProgress)try{const i=await this.getItem(this.storageId);if(!i)return;const n=[];this.emitInProgress=!0;const o=JSON.parse(i),u=Object.keys(o);if(!u.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const d of u)this.socket.emit("Log",o[d]),n.push(d);const h=await this.getItem(this.storageId);if(!h)return;const m=Qy(h,n);await this.setItem(this.storageId,JSON.stringify(m))}catch(i){this._errorMethod(i)}finally{this.emitInProgress=!1}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){ie=Object.assign(ie,{log:(...i)=>{this.log(...i)},warn:(...i)=>{this.warn(...i)},error:(...i)=>{this.error(...i)},debug:(...i)=>{this.debug(...i)}})}async initStorage(){const i=await this.getItem(this.storageId);(!i||typeof i!="string")&&await this.setItem(this.storageId,JSON.stringify({}))}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const i=Vy();return this.namespace.toString().toUpperCase()+i+Date.now()}async processLog(...i){try{if(i.length<2)return;const n=await this.getItem(this.storageId);if(!n)return;const{level:o,logs:u}=Zy(i),h=JSON.parse(n),m=this.formItemKey(o);h[m]=this.parseLog(o,u),await this.setItem(this.storageId,JSON.stringify(h))}catch(n){this._errorMethod(n)}}async processQueue(){if(this.processing||this.queue.length===0)return;const i=this.queue.shift();i&&(this.processing=!0,await this.processLog(...i).finally(()=>{this.processing=!1,this.processQueue()}))}log(...i){const n=["INFO",...i];this.queue.push(n),this.logToConsole&&this._logMethod.apply(ie,i),this.processQueue()}warn(...i){const n=["WARN",...i];this.queue.push(n),this.logToConsole&&this._warnMethod.apply(ie,i),this.processQueue()}error(...i){const n=["ERROR",...i];this.queue.push(n),this.logToConsole&&this._errorMethod.apply(ie,i),this.processQueue()}debug(...i){const n=["DEBUG",...i];this.queue.push(n),this.logToConsole&&this._debugMethod.apply(ie,i),this.processQueue()}async defaultGetItemFunction(i){return localStorage.getItem(i)}async defaultSetItemFunction(i,n){try{localStorage.setItem(i,n)}catch(o){this._errorMethod(o)}}formItemKey(i){const n=new Date().toISOString();return this.logIndex++,`${i}-${this.namespace}-${n}-${this.logIndex}`}}class e0{constructor(i){wt(this,"io");wt(this,"storageLogger");this.eventsSdkClass=i,this.eventsSdkClass=i}init(){this.eventsSdkClass.options.useLogger&&(this.eventsSdkClass.options.loggerSocketConnection?this.io=this.eventsSdkClass.options.loggerSocketConnection:this.eventsSdkClass.socketIoClass.ioFunction&&(this.io=this.eventsSdkClass.socketIoClass.ioFunction(this.eventsSdkClass.options.loggerServer,this.eventsSdkClass.options.loggerConnectOptions)),this.io?this.storageLogger=new Ru({socket:this.io,loggerOptions:this.eventsSdkClass.options.loggerConfig}):this.storageLogger=new Ru({url:this.eventsSdkClass.options.loggerServer,socketOptions:this.eventsSdkClass.options.loggerConnectOptions,loggerOptions:this.eventsSdkClass.options.loggerConfig}))}log(i,n,...o){const u=[n,...o];this.storageLogger?i===Jt.INFO?this.storageLogger.log(u):i===Jt.ERROR&&this.storageLogger.error(u):i===Jt.INFO?console.log(u):i===Jt.ERROR&&console.error(u)}}class n0{constructor(i){wt(this,"listeners",{[ft.ALL_EXTENSION_STATUS]:[],[ft.ALL_DIALER_STATUS]:[],[ft.ALL_USERS_STATUS]:[],[ft.QUEUE_EVENT]:[],[ft.EXTENSION_EVENT]:[],[ft.DIALER_EVENT]:[],[ft.LOGIN_SUCCESS]:[],[ft.LOGIN_STATUS]:[],[ft.KEEP_ALIVE_RESPONSE]:[],[ft.ONLINE_STATUS_EVENT]:[],[ft.EXTENSIONS_UPDATED]:[]});wt(this,"allListeners",[]);this.eventsSdkClass=i,this.eventsSdkClass=i}on(i,n){i==="*"?this.allListeners.push(n):this.listeners[i].push(n)}off(i,n){if(i==="*")this.allListeners=this.allListeners.filter(o=>o!==n);else{const u=this.listeners[i].filter(h=>h!==n);this.listeners={...this.listeners,[i]:u}}}emit(i,n){this.eventsSdkClass.socketIoClass.lastEventTimestamp=new Date().getTime(),this.listeners[i].forEach(u=>u({name:i,data:n}));const o={name:i,data:n};this.allListeners.forEach(u=>u(o))}}class r0{constructor(i){wt(this,"argumentOptions");wt(this,"options");wt(this,"servers",[]);wt(this,"URLList",[]);wt(this,"server");wt(this,"URL");wt(this,"socket");wt(this,"mainServer");wt(this,"alreadyAttemptedOtherServers",[]);wt(this,"authClass",new Gv(this));wt(this,"socketIoClass",new Qv(this));wt(this,"loggerClass",new e0(this));wt(this,"eventEmitterClass",new n0(this));wt(this,"reconnectOptions");wt(this,"retryConnection");this.options={...$v,...i},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=Hv.debounce(this.connect.bind(this),this.reconnectOptions.reconnectionDelay,{leading:!0,trailing:!1}),this.argumentOptions={...i}}on(i,n){this.eventEmitterClass.on(i,n)}emit(i,...n){this.socketIoClass.io&&this.socketIoClass.io.emit(i,...n)}connect(i){i===pn.MAIN&&this.findMainServer(),i===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((i,n)=>n.Priority>i.Priority?n:i),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 i=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0);i.length||(this.alreadyAttemptedOtherServers=[],i=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0)),i.length&&(this.server=i.reduce((n,o)=>o.Priority>n.Priority?o:n),this.alreadyAttemptedOtherServers.push(this.server.Priority))}else this.server=this.mainServer;else if(this.URLList.length)if(this.URL===this.URLList[0]){let i=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0);i.length||(this.alreadyAttemptedOtherServers=[],i=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0)),i.length&&(this.URL=i[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)}}exports.CallStatusEnum=Bu;exports.CallTypeEnum=Uu;exports.DialerTypeEnum=Du;exports.DirectionEnum=Pu;exports.DoNotCallMeStatusCodeEnum=Fu;exports.EventsEnum=ft;exports.ExtensionEventReasonEnum=Ls;exports.ExtensionHangupCauseEnum=Mu;exports.QueueEventReasonEnum=qu;exports.ServerListenerEventsEnum=Ns;exports.default=r0;
43
+ `+Bn+"}":"{"+Vt.join(",")+"}":"{}";return tt.pop(),De}};_.stringify=function(q,J,F){var et,P,Z,tt;if(typeof J=="function"||typeof J=="object"&&J){if((tt=S.call(J))==l)P=J;else if(tt==x){Z={};for(var z,at=0,bt=J.length;bt>at;z=J[at++],tt=S.call(z),(tt==k||tt==b)&&(Z[z]=1));}}if(F)if((tt=S.call(F))==b){if((F-=F%1)>0)for(et="",F>10&&(F=10);et.length<F;et+=" ");}else tt==k&&(et=F.length<=10?F:F.slice(0,10));return j("",(z={},z[""]=q,z),P,Z,et,"",[])}}if(!u("json-parse")){var B,Et,At=String.fromCharCode,Rt={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:`
44
+ `,102:"\f",114:"\r"},ut=function(){throw B=Et=null,SyntaxError()},Ht=function(){for(var q,J,F,et,P,Z=Et,tt=Z.length;tt>B;)switch(P=Z.charCodeAt(B)){case 9:case 10:case 13:case 32:B++;break;case 123:case 125:case 91:case 93:case 58:case 44:return q=st?Z.charAt(B):Z[B],B++,q;case 34:for(q="@",B++;tt>B;)if(P=Z.charCodeAt(B),32>P)ut();else if(P==92)switch(P=Z.charCodeAt(++B)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:q+=Rt[P],B++;break;case 117:for(J=++B,F=B+4;F>B;B++)P=Z.charCodeAt(B),P>=48&&57>=P||P>=97&&102>=P||P>=65&&70>=P||ut();q+=At("0x"+Z.slice(J,B));break;default:ut()}else{if(P==34)break;for(P=Z.charCodeAt(B),J=B;P>=32&&P!=92&&P!=34;)P=Z.charCodeAt(++B);q+=Z.slice(J,B)}if(Z.charCodeAt(B)==34)return B++,q;ut();default:if(J=B,P==45&&(et=!0,P=Z.charCodeAt(++B)),P>=48&&57>=P){for(P==48&&(P=Z.charCodeAt(B+1),P>=48&&57>=P)&&ut(),et=!1;tt>B&&(P=Z.charCodeAt(B),P>=48&&57>=P);B++);if(Z.charCodeAt(B)==46){for(F=++B;tt>F&&(P=Z.charCodeAt(F),P>=48&&57>=P);F++);F==B&&ut(),B=F}if(P=Z.charCodeAt(B),P==101||P==69){for(P=Z.charCodeAt(++B),(P==43||P==45)&&B++,F=B;tt>F&&(P=Z.charCodeAt(F),P>=48&&57>=P);F++);F==B&&ut(),B=F}return+Z.slice(J,B)}if(et&&ut(),Z.slice(B,B+4)=="true")return B+=4,!0;if(Z.slice(B,B+5)=="false")return B+=5,!1;if(Z.slice(B,B+4)=="null")return B+=4,null;ut()}return"$"},xe=function(q){var J,F;if(q=="$"&&ut(),typeof q=="string"){if((st?q.charAt(0):q[0])=="@")return q.slice(1);if(q=="["){for(J=[];q=Ht(),q!="]";F||(F=!0))F&&(q==","?(q=Ht(),q=="]"&&ut()):ut()),q==","&&ut(),J.push(xe(q));return J}if(q=="{"){for(J={};q=Ht(),q!="}";F||(F=!0))F&&(q==","?(q=Ht(),q=="}"&&ut()):ut()),(q==","||typeof q!="string"||(st?q.charAt(0):q[0])!="@"||Ht()!=":")&&ut(),J[q.slice(1)]=xe(Ht());return J}ut()}return q},se=function(q,J,F){var et=er(q,J,F);et===g?delete q[J]:q[J]=et},er=function(q,J,F){var et,P=q[J];if(typeof P=="object"&&P)if(S.call(P)==x)for(et=P.length;et--;)se(P,et,F);else m(P,function(Z){se(P,Z,F)});return F.call(q,J,P)};_.parse=function(q,J){var F,et;return B=0,Et=""+q,F=xe(Ht()),Ht()!="$"&&ut(),B=Et=null,J&&S.call(J)==l?er((et={},et[""]=F,et),"",J):F}}}})(this)},{}],48:[function(s,i){function n(o,u){var h=[];u=u||0;for(var m=u||0;m<o.length;m++)h[m-u]=o[m];return h}i.exports=n},{}]},{},[1])(1)}const Xv=Object.freeze(Object.defineProperty({__proto__:null,default:zv},Symbol.toStringTag,{value:"Module"})),Jv=Object.assign({"./v1_3_7.js":Xv}),Vv=/v\d+_\d+_\d+/;function Yv(s){return typeof s=="function"}const As=Object.entries(Jv).reduce((s,i)=>{var u;const n=i[1].default,o=(u=i[0].match(Vv))==null?void 0:u[0];return Yv(n)&&o&&(s[o]=n()),s},{}),Nu=s=>{if(s in As)return As[s];throw new Error(`Socket version ${s} not found`)},jv=(s,...i)=>Nu(s)(...i),Zv={...As,getSocketVersion:Nu,makeSocketVersion:jv};var Bu=(s=>(s.RINGING="Ringing",s.TALKING="Talking",s.DIALING="Dialing",s.HOLD="Hold",s))(Bu||{}),Uu=(s=>(s.INCOMING="Incoming",s.OUTGOING="Outgoing",s))(Uu||{}),Du=(s=>(s.AUTOMATIC="Automatic",s.IVR="IVR",s))(Du||{}),Pu=(s=>(s.INCOMINC="Incoming",s.OUTGOING="Outgoing",s.SPY="Spy",s.CLICK2CALL="Click2Call",s))(Pu||{}),Fu=(s=>(s.RESPONSE_FROM_API_VALID="RESPONSE_FROM_API_VALID",s.RESPONSE_FROM_API_INVALID="RESPONSE_FROM_API_INVALID",s))(Fu||{}),ft=(s=>(s.ALL_DIALER_STATUS="AllDialersStatus",s.ALL_EXTENSION_STATUS="AllExtensionsStatus",s.ALL_USERS_STATUS="AllUsersStatus",s.CONNECT="connect",s.DISCONNECT="disconnect",s.CONNECT_ERROR_EVENT="connect_error",s.EXTENSION_EVENT="ExtensionEvent",s.KEEP_ALIVE="keepalive",s.KEEP_ALIVE_RESPONSE="keepaliveResponse",s.LOGIN_STATUS="loginStatus",s.LOGIN_SUCCESS="loginSuccess",s.QUEUE_EVENT="QueueEvent",s.ONLINE_STATUS_EVENT="onlineStatusEvent",s.DIALER_EVENT="DialerEvent",s.EXTENSIONS_UPDATED="ExtensionsUpdated",s))(ft||{}),Ls=(s=>(s.NEWCALL="NEWCALL",s.ANSWER="ANSWER",s.HOLD="HOLD",s.UNHOLD="UNHOLD",s.HANGUP="HANGUP",s.USER_STATUS_UPDATE="userStatusUpdate",s))(Ls||{}),Mu=(s=>(s.NORMAL_HANGUP="Normal hangup",s.USER_BUSY="User busy",s.CALL_REJECTED="Call Rejected",s.UNALLOCATED_NUMBER="Unallocated (unassigned) number",s.UNKNOWN="Unknown",s.NO_USER_RESPONDING="No user responding",s.USER_ALERTING="User alerting, no answer",s.ANSWERED_ELSEWHERE="Answered elsewhere",s))(Mu||{}),qu=(s=>(s.ANSWER="ANSWER",s.ABANDONED="ABANDONED",s.EXIT="EXIT",s.JOIN="JOIN",s))(qu||{});class yu{static mapExtensionEvent(i){var m,g;const n=i.reason;let o,u;i.data.currentCall&&(u=this.mapExtensionCall(i,i.data.currentCall));const h=this.configureUTCForObject(i.data,["lastAnsweredCallEventEpoch","lastCallEventEpoch","lastHangupCallEpoch"],i.servertime,i.servertimeoffset);return n===Ls.HANGUP?o={...i,reason:n,data:{...h,currentCall:u?{...u,duration:Date.now()-((u==null?void 0:u.callAnswered_UTC_CLIENT)??0)}:void 0,calls:(m=i.data.calls)==null?void 0:m.map(S=>{const v=this.mapExtensionCall(i,S);return{...v,duration:Date.now()-(v.callAnswered_UTC_CLIENT??0)}})}}:o={...i,data:{...h,currentCall:u,calls:(g=i.data.calls)==null?void 0:g.map(S=>this.mapExtensionCall(i,S))},reason:n},o}static mapAllExtensionStatus(i){return{...i,extensions:i.extensions.map(n=>{var u;return{...this.configureUTCForObject(n,["lastAnsweredCallEventEpoch","lastCallEventEpoch","lastHangupCallEpoch"],i.servertime,i.servertimeoffset),currentCall:n.currentCall?this.mapExtensionCall(i,n.currentCall):void 0,calls:(u=n.calls)==null?void 0:u.map(h=>this.mapExtensionCall(i,h))}})}}static mapExtensionCall(i,n){return this.configureUTCForObject(n,["callAnswered","callStarted"],i.servertime,i.servertimeoffset)}static assignProperty(i,n,o){i[n]=o}static configureUTCForObject(i,n,o,u){const h=(o-u*60)*1e3,m=Date.now()-h,g={};return n.forEach(S=>{const v=i[S];if(console.log("####################"),console.log("property",S),console.log("value",v),console.log("####################"),v===0)this.assignProperty(g,`${S}_UTC`,0),this.assignProperty(g,`${S}_UTC_CLIENT`,0);else{const _=(v-u*60)*1e3;this.assignProperty(g,`${S}_UTC`,_),this.assignProperty(g,`${S}_UTC_CLIENT`,_+m)}}),{...i,...g}}}var Ns=(s=>(s.UPDATE_MONITORED_EXTENSIONS="updateMonitoredExtensions",s.KEEP_ALIVE="keepAlive",s))(Ns||{});class Qv{constructor(i){wt(this,"io");wt(this,"ioFunction");wt(this,"lastEventTimestamp",new Date().getTime());wt(this,"doReconnect",!0);wt(this,"keepAliveInterval");wt(this,"keepReconnectInterval");wt(this,"connected",!1);this.eventsSdkClass=i,this.eventsSdkClass=i}getSocketIoFunction(i){const n=i.split("v="),o="v".concat(n[n.length-1]).replaceAll(".","_");this.ioFunction=Zv.getSocketVersion(o)}initSocketConnection(){const i=this.eventsSdkClass.authClass.token,n=this.eventsSdkClass.options.protocol,o=this.eventsSdkClass.server;try{const u=o?o.Domain:this.eventsSdkClass.URL,h=o?`${n}://${u}`:this.eventsSdkClass.URL;this.eventsSdkClass.loggerClass.log(Jt.INFO,"Connecting to..",h),this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!1,attemptToConnect:h,doReconnect:this.doReconnect});const m={reconnection:!1,upgrade:!1,transports:["websocket"],forceNew:!0,query:{token:i},timeout:this.eventsSdkClass.options.timeout};if(i&&(m.query={token:i}),this.ioFunction&&h)this.io=this.ioFunction(h,m);else throw new Error("Socket server url no defined")}catch(u){this.eventsSdkClass.loggerClass.log(Jt.ERROR,"init socket connection error",u)}}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(Ns.KEEP_ALIVE,this.eventsSdkClass.authClass.token),this.eventsSdkClass.loggerClass.log(Jt.INFO,`EMIT -> ${ft.KEEP_ALIVE}`,this.eventsSdkClass.authClass.token);return}},this.eventsSdkClass.options.keepAliveTimeout)}closeAllConnections(){var i;this.io&&(this.io.close(),(i=this.io)==null||i.disconnect(),this.io=void 0),Qn.clearSessionStorage()}initSocketEvents(){this.io&&this.io.on(ft.LOGIN_SUCCESS,i=>this.onLoginSuccessEvent(i)).on(ft.QUEUE_EVENT,i=>this.onQueueEvent(i)).on(ft.EXTENSION_EVENT,i=>this.onExtensionEvent(i)).on(ft.DIALER_EVENT,i=>this.onDialerEvent(i)).on(ft.LOGIN_STATUS,i=>this.onLoginStatusEvent(i)).on(ft.ALL_EXTENSION_STATUS,i=>this.onAllExtensionStatus(i)).on(ft.ALL_DIALER_STATUS,i=>this.onAllDialerStatus(i)).on(ft.KEEP_ALIVE_RESPONSE,i=>this.onKeepAliveResponse(i)).on(ft.EXTENSIONS_UPDATED,i=>this.onExtensionsUpdatedEvent(i)).on(ft.CONNECT,()=>this.onConnect()).on(ft.DISCONNECT,i=>this.onDisconnect(i)).on(ft.CONNECT_ERROR_EVENT,i=>this.onConnectError(i))}onLoginSuccessEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.LOGIN_SUCCESS,i)}onQueueEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.QUEUE_EVENT,i)}onExtensionEvent(i){const n=yu.mapExtensionEvent(i);n&&this.eventsSdkClass.eventEmitterClass.emit(ft.EXTENSION_EVENT,n)}onDialerEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.DIALER_EVENT,i)}onLoginStatusEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.LOGIN_STATUS,i)}onAllExtensionStatus(i){const n=yu.mapAllExtensionStatus(i);this.eventsSdkClass.eventEmitterClass.emit(ft.ALL_EXTENSION_STATUS,n)}onAllDialerStatus(i){this.eventsSdkClass.eventEmitterClass.emit(ft.ALL_DIALER_STATUS,i)}onKeepAliveResponse(i){if(this.eventsSdkClass.loggerClass.log(Jt.INFO,ft.KEEP_ALIVE_RESPONSE),i.errorCode){this.initSocketConnection();return}this.connected?this.lastEventTimestamp=new Date().getTime():this.initSocketConnection()}onExtensionsUpdatedEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ft.EXTENSIONS_UPDATED,i)}onConnect(){this.keepReconnectInterval&&clearInterval(this.keepReconnectInterval),this.connected=!0,this.eventsSdkClass.loggerClass.log(Jt.INFO,ft.CONNECT,this.eventsSdkClass.reconnectOptions),this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!0,doReconnect:this.doReconnect})}onDisconnect(i){this.connected=!1,this.eventsSdkClass.loggerClass.log(Jt.INFO,ft.DISCONNECT,i),this.closeAllConnections(),this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.doReconnect&&(console.log("attempt to connect..."),this.eventsSdkClass.connect(pn.NEXT))}onConnectError(i){this.eventsSdkClass.eventEmitterClass.emit(ft.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log(Jt.ERROR,ft.CONNECT_ERROR_EVENT,i),setTimeout(()=>{this.eventsSdkClass.connect(pn.NEXT)},this.eventsSdkClass.options.reconnectionDelay)}}var ty=Object.defineProperty,ey=(s,i,n)=>i in s?ty(s,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[i]=n,qt=(s,i,n)=>(ey(s,typeof i!="symbol"?i+"":i,n),n);const Ue=Object.create(null);Ue.open="0";Ue.close="1";Ue.ping="2";Ue.pong="3";Ue.message="4";Ue.upgrade="5";Ue.noop="6";const Vr=Object.create(null);Object.keys(Ue).forEach(s=>{Vr[Ue[s]]=s});const ks={type:"error",data:"parser error"},Wu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ku=typeof ArrayBuffer=="function",Gu=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Bs=({type:s,data:i},n,o)=>Wu&&i instanceof Blob?n?o(i):mu(i,o):Ku&&(i instanceof ArrayBuffer||Gu(i))?n?o(i):mu(new Blob([i]),o):o(Ue[s]+(i||"")),mu=(s,i)=>{const n=new FileReader;return n.onload=function(){const o=n.result.split(",")[1];i("b"+(o||""))},n.readAsDataURL(s)};function _u(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let bs;function ny(s,i){if(Wu&&s.data instanceof Blob)return s.data.arrayBuffer().then(_u).then(i);if(Ku&&(s.data instanceof ArrayBuffer||Gu(s.data)))return i(_u(s.data));Bs(s,!1,n=>{bs||(bs=new TextEncoder),i(bs.encode(n))})}const wu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<wu.length;s++)tr[wu.charCodeAt(s)]=s;const ry=s=>{let i=s.length*.75,n=s.length,o,u=0,h,m,g,S;s[s.length-1]==="="&&(i--,s[s.length-2]==="="&&i--);const v=new ArrayBuffer(i),_=new Uint8Array(v);for(o=0;o<n;o+=4)h=tr[s.charCodeAt(o)],m=tr[s.charCodeAt(o+1)],g=tr[s.charCodeAt(o+2)],S=tr[s.charCodeAt(o+3)],_[u++]=h<<2|m>>4,_[u++]=(m&15)<<4|g>>2,_[u++]=(g&3)<<6|S&63;return v},iy=typeof ArrayBuffer=="function",Us=(s,i)=>{if(typeof s!="string")return{type:"message",data:Hu(s,i)};const n=s.charAt(0);return n==="b"?{type:"message",data:sy(s.substring(1),i)}:Vr[n]?s.length>1?{type:Vr[n],data:s.substring(1)}:{type:Vr[n]}:ks},sy=(s,i)=>{if(iy){const n=ry(s);return Hu(n,i)}else return{base64:!0,data:s}},Hu=(s,i)=>{switch(i){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},$u="",oy=(s,i)=>{const n=s.length,o=new Array(n);let u=0;s.forEach((h,m)=>{Bs(h,!1,g=>{o[m]=g,++u===n&&i(o.join($u))})})},ay=(s,i)=>{const n=s.split($u),o=[];for(let u=0;u<n.length;u++){const h=Us(n[u],i);if(o.push(h),h.type==="error")break}return o};function uy(){return new TransformStream({transform(s,i){ny(s,n=>{const o=n.length;let u;if(o<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,o);else if(o<65536){u=new Uint8Array(3);const h=new DataView(u.buffer);h.setUint8(0,126),h.setUint16(1,o)}else{u=new Uint8Array(9);const h=new DataView(u.buffer);h.setUint8(0,127),h.setBigUint64(1,BigInt(o))}s.data&&typeof s.data!="string"&&(u[0]|=128),i.enqueue(u),i.enqueue(n)})}})}let Ss;function Hr(s){return s.reduce((i,n)=>i+n.length,0)}function $r(s,i){if(s[0].length===i)return s.shift();const n=new Uint8Array(i);let o=0;for(let u=0;u<i;u++)n[u]=s[0][o++],o===s[0].length&&(s.shift(),o=0);return s.length&&o<s[0].length&&(s[0]=s[0].slice(o)),n}function cy(s,i){Ss||(Ss=new TextDecoder);const n=[];let o=0,u=-1,h=!1;return new TransformStream({transform(m,g){for(n.push(m);;){if(o===0){if(Hr(n)<1)break;const S=$r(n,1);h=(S[0]&128)===128,u=S[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(Hr(n)<2)break;const S=$r(n,2);u=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),o=3}else if(o===2){if(Hr(n)<8)break;const S=$r(n,8),v=new DataView(S.buffer,S.byteOffset,S.length),_=v.getUint32(0);if(_>Math.pow(2,21)-1){g.enqueue(ks);break}u=_*Math.pow(2,32)+v.getUint32(4),o=3}else{if(Hr(n)<u)break;const S=$r(n,u);g.enqueue(Us(h?S:Ss.decode(S),i)),o=0}if(u===0||u>s){g.enqueue(ks);break}}}})}const zu=4;function Dt(s){if(s)return hy(s)}function hy(s){for(var i in Dt.prototype)s[i]=Dt.prototype[i];return s}Dt.prototype.on=Dt.prototype.addEventListener=function(s,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(i),this};Dt.prototype.once=function(s,i){function n(){this.off(s,n),i.apply(this,arguments)}return n.fn=i,this.on(s,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(s,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+s];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var o,u=0;u<n.length;u++)if(o=n[u],o===i||o.fn===i){n.splice(u,1);break}return n.length===0&&delete this._callbacks["$"+s],this};Dt.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),n=this._callbacks["$"+s],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(n){n=n.slice(0);for(var o=0,u=n.length;o<u;++o)n[o].apply(this,i)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};Dt.prototype.hasListeners=function(s){return!!this.listeners(s).length};const be=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function Xu(s,...i){return i.reduce((n,o)=>(s.hasOwnProperty(o)&&(n[o]=s[o]),n),{})}const fy=be.setTimeout,ly=be.clearTimeout;function Qr(s,i){i.useNativeTimers?(s.setTimeoutFn=fy.bind(be),s.clearTimeoutFn=ly.bind(be)):(s.setTimeoutFn=be.setTimeout.bind(be),s.clearTimeoutFn=be.clearTimeout.bind(be))}const py=1.33;function dy(s){return typeof s=="string"?gy(s):Math.ceil((s.byteLength||s.size)*py)}function gy(s){let i=0,n=0;for(let o=0,u=s.length;o<u;o++)i=s.charCodeAt(o),i<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(o++,n+=4);return n}function vy(s){let i="";for(let n in s)s.hasOwnProperty(n)&&(i.length&&(i+="&"),i+=encodeURIComponent(n)+"="+encodeURIComponent(s[n]));return i}function yy(s){let i={},n=s.split("&");for(let o=0,u=n.length;o<u;o++){let h=n[o].split("=");i[decodeURIComponent(h[0])]=decodeURIComponent(h[1])}return i}class my extends Error{constructor(i,n,o){super(i),this.description=n,this.context=o,this.type="TransportError"}}class Ds extends Dt{constructor(i){super(),this.writable=!1,Qr(this,i),this.opts=i,this.query=i.query,this.socket=i.socket}onError(i,n,o){return super.emitReserved("error",new my(i,n,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const n=Us(i,this.socket.binaryType);this.onPacket(n)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,n={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const n=vy(i);return n.length?"?"+n:""}}const Ju="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ts=64,_y={};let bu=0,zr=0,Su;function Cu(s){let i="";do i=Ju[s%Ts]+i,s=Math.floor(s/Ts);while(s>0);return i}function Vu(){const s=Cu(+new Date);return s!==Su?(bu=0,Su=s):s+"."+Cu(bu++)}for(;zr<Ts;zr++)_y[Ju[zr]]=zr;let Yu=!1;try{Yu=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const wy=Yu;function ju(s){const i=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||wy))return new XMLHttpRequest}catch{}if(!i)try{return new be[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function by(){}const Sy=function(){return new ju({xdomain:!1}).responseType!=null}();class Cy extends Ds{constructor(i){if(super(i),this.polling=!1,typeof location<"u"){const o=location.protocol==="https:";let u=location.port;u||(u=o?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||u!==i.port}const n=i&&i.forceBase64;this.supportsBinary=Sy&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(i){this.readyState="pausing";const n=()=>{this.readyState="paused",i()};if(this.polling||!this.writable){let o=0;this.polling&&(o++,this.once("pollComplete",function(){--o||n()})),this.writable||(o++,this.once("drain",function(){--o||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const n=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};ay(i,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,oy(i,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Vu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(i,n)}request(i={}){return Object.assign(i,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Be(this.uri(),i)}doWrite(i,n){const o=this.request({method:"POST",data:i});o.on("success",n),o.on("error",(u,h)=>{this.onError("xhr post error",u,h)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(n,o)=>{this.onError("xhr poll error",n,o)}),this.pollXhr=i}}class Be extends Dt{constructor(i,n){super(),Qr(this,n),this.opts=n,this.method=n.method||"GET",this.uri=i,this.data=n.data!==void 0?n.data:null,this.create()}create(){var i;const n=Xu(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const o=this.xhr=new ju(n);try{o.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let u in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(u)&&o.setRequestHeader(u,this.opts.extraHeaders[u])}}catch{}if(this.method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this.opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(o.timeout=this.opts.requestTimeout),o.onreadystatechange=()=>{var u;o.readyState===3&&((u=this.opts.cookieJar)===null||u===void 0||u.parseCookies(o)),o.readyState===4&&(o.status===200||o.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof o.status=="number"?o.status:0)},0))},o.send(this.data)}catch(u){this.setTimeoutFn(()=>{this.onError(u)},0);return}typeof document<"u"&&(this.index=Be.requestsCount++,Be.requests[this.index]=this)}onError(i){this.emitReserved("error",i,this.xhr),this.cleanup(!0)}cleanup(i){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=by,i)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Be.requests[this.index],this.xhr=null}}onLoad(){const i=this.xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Be.requestsCount=0;Be.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Eu);else if(typeof addEventListener=="function"){const s="onpagehide"in be?"pagehide":"unload";addEventListener(s,Eu,!1)}}function Eu(){for(let s in Be.requests)Be.requests.hasOwnProperty(s)&&Be.requests[s].abort()}const Ps=typeof Promise=="function"&&typeof Promise.resolve=="function"?s=>Promise.resolve().then(s):(s,i)=>i(s,0),Xr=be.WebSocket||be.MozWebSocket,Au=!0,Ey="arraybuffer",ku=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ay extends Ds{constructor(i){super(i),this.supportsBinary=!i.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const i=this.uri(),n=this.opts.protocols,o=ku?{}:Xu(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=Au&&!ku?n?new Xr(i,n):new Xr(i):new Xr(i,n,o)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let n=0;n<i.length;n++){const o=i[n],u=n===i.length-1;Bs(o,this.supportsBinary,h=>{try{Au&&this.ws.send(h)}catch{}u&&Ps(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Vu()),this.supportsBinary||(n.b64=1),this.createUri(i,n)}check(){return!!Xr}}class ky extends Ds{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(i=>{const n=cy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(n).getReader(),u=uy();u.readable.pipeTo(i.writable),this.writer=u.writable.getWriter();const h=()=>{o.read().then(({done:g,value:S})=>{g||(this.onPacket(S),h())}).catch(g=>{})};h();const m={type:"open"};this.query.sid&&(m.data=`{"sid":"${this.query.sid}"}`),this.writer.write(m).then(()=>this.onOpen())})}))}write(i){this.writable=!1;for(let n=0;n<i.length;n++){const o=i[n],u=n===i.length-1;this.writer.write(o).then(()=>{u&&Ps(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this.transport)===null||i===void 0||i.close()}}const Ty={websocket:Ay,webtransport:ky,polling:Cy},xy=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ry=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xs(s){if(s.length>2e3)throw"URI too long";const i=s,n=s.indexOf("["),o=s.indexOf("]");n!=-1&&o!=-1&&(s=s.substring(0,n)+s.substring(n,o).replace(/:/g,";")+s.substring(o,s.length));let u=xy.exec(s||""),h={},m=14;for(;m--;)h[Ry[m]]=u[m]||"";return n!=-1&&o!=-1&&(h.source=i,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),h.pathNames=Oy(h,h.path),h.queryKey=Iy(h,h.query),h}function Oy(s,i){const n=/\/{2,9}/g,o=i.replace(n,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Iy(s,i){const n={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,h){u&&(n[u]=h)}),n}let Zu=class On extends Dt{constructor(i,n={}){super(),this.binaryType=Ey,this.writeBuffer=[],i&&typeof i=="object"&&(n=i,i=null),i?(i=xs(i),n.hostname=i.host,n.secure=i.protocol==="https"||i.protocol==="wss",n.port=i.port,i.query&&(n.query=i.query)):n.host&&(n.hostname=xs(n.host).host),Qr(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yy(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(i){const n=Object.assign({},this.opts.query);n.EIO=zu,n.transport=i,this.id&&(n.sid=this.id);const o=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new Ty[i](o)}open(){let i;if(this.opts.rememberUpgrade&&On.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)i="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else i=this.transports[0];this.readyState="opening";try{i=this.createTransport(i)}catch{this.transports.shift(),this.open();return}i.open(),this.setTransport(i)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(i){let n=this.createTransport(i),o=!1;On.priorWebsocketSuccess=!1;const u=()=>{o||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!o)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;On.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(_(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const l=new Error("probe error");l.transport=n.name,this.emitReserved("upgradeError",l)}}))};function h(){o||(o=!0,_(),n.close(),n=null)}const m=y=>{const l=new Error("probe error: "+y);l.transport=n.name,h(),this.emitReserved("upgradeError",l)};function g(){m("transport closed")}function S(){m("socket closed")}function v(y){n&&y.name!==n.name&&h()}const _=()=>{n.removeListener("open",u),n.removeListener("error",m),n.removeListener("close",g),this.off("close",S),this.off("upgrading",v)};n.once("open",u),n.once("error",m),n.once("close",g),this.once("close",S),this.once("upgrading",v),this.upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||n.open()},200):n.open()}onOpen(){if(this.readyState="open",On.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let i=0;const n=this.upgrades.length;for(;i<n;i++)this.probe(this.upgrades[i])}}onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),this.resetPingTimeout(),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=i.data,this.onError(n);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this.upgrades=this.filterUpgrades(i.upgrades),this.pingInterval=i.pingInterval,this.pingTimeout=i.pingTimeout,this.maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this.getWritablePackets();this.transport.send(i),this.prevBufferLen=i.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let n=0;n<this.writeBuffer.length;n++){const o=this.writeBuffer[n].data;if(o&&(i+=dy(o)),n>0&&i>this.maxPayload)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer}write(i,n,o){return this.sendPacket("message",i,n,o),this}send(i,n,o){return this.sendPacket("message",i,n,o),this}sendPacket(i,n,o,u){if(typeof n=="function"&&(u=n,n=void 0),typeof o=="function"&&(u=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const h={type:i,data:n,options:o};this.emitReserved("packetCreate",h),this.writeBuffer.push(h),u&&this.once("flush",u),this.flush()}close(){const i=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),i()},o=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():i()}):this.upgrading?o():i()),this}onError(i){On.priorWebsocketSuccess=!1,this.emitReserved("error",i),this.onClose("transport error",i)}onClose(i,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",i,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(i){const n=[];let o=0;const u=i.length;for(;o<u;o++)~this.transports.indexOf(i[o])&&n.push(i[o]);return n}};Zu.protocol=zu;function Ly(s,i="",n){let o=s;n=n||typeof location<"u"&&location,s==null&&(s=n.protocol+"//"+n.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=n.protocol+s:s=n.host+s),/^(https?|wss?):\/\//.test(s)||(typeof n<"u"?s=n.protocol+"//"+s:s="https://"+s),o=xs(s)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const u=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+u+":"+o.port+i,o.href=o.protocol+"://"+u+(n&&n.port===o.port?"":":"+o.port),o}const Ny=typeof ArrayBuffer=="function",By=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qu=Object.prototype.toString,Uy=typeof Blob=="function"||typeof Blob<"u"&&Qu.call(Blob)==="[object BlobConstructor]",Dy=typeof File=="function"||typeof File<"u"&&Qu.call(File)==="[object FileConstructor]";function Fs(s){return Ny&&(s instanceof ArrayBuffer||By(s))||Uy&&s instanceof Blob||Dy&&s instanceof File}function Yr(s,i){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let n=0,o=s.length;n<o;n++)if(Yr(s[n]))return!0;return!1}if(Fs(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Yr(s.toJSON(),!0);for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)&&Yr(s[n]))return!0;return!1}function Py(s){const i=[],n=s.data,o=s;return o.data=Rs(n,i),o.attachments=i.length,{packet:o,buffers:i}}function Rs(s,i){if(!s)return s;if(Fs(s)){const n={_placeholder:!0,num:i.length};return i.push(s),n}else if(Array.isArray(s)){const n=new Array(s.length);for(let o=0;o<s.length;o++)n[o]=Rs(s[o],i);return n}else if(typeof s=="object"&&!(s instanceof Date)){const n={};for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&(n[o]=Rs(s[o],i));return n}return s}function Fy(s,i){return s.data=Os(s.data,i),delete s.attachments,s}function Os(s,i){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<i.length)return i[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let n=0;n<s.length;n++)s[n]=Os(s[n],i);else if(typeof s=="object")for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(s[n]=Os(s[n],i));return s}const My=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],qy=5;var mt;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(mt||(mt={}));class Wy{constructor(i){this.replacer=i}encode(i){return(i.type===mt.EVENT||i.type===mt.ACK)&&Yr(i)?this.encodeAsBinary({type:i.type===mt.EVENT?mt.BINARY_EVENT:mt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let n=""+i.type;return(i.type===mt.BINARY_EVENT||i.type===mt.BINARY_ACK)&&(n+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(n+=i.nsp+","),i.id!=null&&(n+=i.id),i.data!=null&&(n+=JSON.stringify(i.data,this.replacer)),n}encodeAsBinary(i){const n=Py(i),o=this.encodeAsString(n.packet),u=n.buffers;return u.unshift(o),u}}function Tu(s){return Object.prototype.toString.call(s)==="[object Object]"}class Ms extends Dt{constructor(i){super(),this.reviver=i}add(i){let n;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(i);const o=n.type===mt.BINARY_EVENT;o||n.type===mt.BINARY_ACK?(n.type=o?mt.EVENT:mt.ACK,this.reconstructor=new Ky(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Fs(i)||i.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(i),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let n=0;const o={type:Number(i.charAt(0))};if(mt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===mt.BINARY_EVENT||o.type===mt.BINARY_ACK){const h=n+1;for(;i.charAt(++n)!=="-"&&n!=i.length;);const m=i.substring(h,n);if(m!=Number(m)||i.charAt(n)!=="-")throw new Error("Illegal attachments");o.attachments=Number(m)}if(i.charAt(n+1)==="/"){const h=n+1;for(;++n&&!(i.charAt(n)===","||n===i.length););o.nsp=i.substring(h,n)}else o.nsp="/";const u=i.charAt(n+1);if(u!==""&&Number(u)==u){const h=n+1;for(;++n;){const m=i.charAt(n);if(m==null||Number(m)!=m){--n;break}if(n===i.length)break}o.id=Number(i.substring(h,n+1))}if(i.charAt(++n)){const h=this.tryParse(i.substr(n));if(Ms.isPayloadValid(o.type,h))o.data=h;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,n){switch(i){case mt.CONNECT:return Tu(n);case mt.DISCONNECT:return n===void 0;case mt.CONNECT_ERROR:return typeof n=="string"||Tu(n);case mt.EVENT:case mt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&My.indexOf(n[0])===-1);case mt.ACK:case mt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ky{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const n=Fy(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gy=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ms,Encoder:Wy,get PacketType(){return mt},protocol:qy},Symbol.toStringTag,{value:"Module"}));function Te(s,i,n){return s.on(i,n),function(){s.off(i,n)}}const Hy=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tc extends Dt{constructor(i,n,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=n,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Te(i,"open",this.onopen.bind(this)),Te(i,"packet",this.onpacket.bind(this)),Te(i,"error",this.onerror.bind(this)),Te(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...n){if(Hy.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(n.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:mt.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,m=n.pop();this._registerAckCallback(h,m),o.id=h}const u=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!u||!this.connected)||(this.connected?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(i,n){var o;const u=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(u===void 0){this.acks[i]=n;return}const h=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);n.call(this,new Error("operation has timed out"))},u);this.acks[i]=(...m)=>{this.io.clearTimeoutFn(h),n.apply(this,[null,...m])}}emitWithAck(i,...n){const o=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((u,h)=>{n.push((m,g)=>o?m?h(m):u(g):u(m)),this.emit(i,...n)})}_addToQueue(i){let n;typeof i[i.length-1]=="function"&&(n=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((u,...h)=>o!==this._queue[0]?void 0:(u!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(u)):(this._queue.shift(),n&&n(null,...h)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!i||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:mt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,n)}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case mt.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case mt.EVENT:case mt.BINARY_EVENT:this.onevent(i);break;case mt.ACK:case mt.BINARY_ACK:this.onack(i);break;case mt.DISCONNECT:this.ondisconnect();break;case mt.CONNECT_ERROR:this.destroy();const n=new Error(i.data.message);n.data=i.data.data,this.emitReserved("connect_error",n);break}}onevent(i){const n=i.data||[];i.id!=null&&n.push(this.ack(i.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const o of n)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const n=this;let o=!1;return function(...u){o||(o=!0,n.packet({type:mt.ACK,id:i,data:u}))}}onack(i){const n=this.acks[i.id];typeof n=="function"&&(n.apply(this,i.data),delete this.acks[i.id])}onconnect(i,n){this.id=i,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:mt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const n=this._anyListeners;for(let o=0;o<n.length;o++)if(i===n[o])return n.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const n=this._anyOutgoingListeners;for(let o=0;o<n.length;o++)if(i===n[o])return n.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const o of n)o.apply(this,i.data)}}}function In(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}In.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),n=Math.floor(i*this.jitter*s);s=Math.floor(i*10)&1?s+n:s-n}return Math.min(s,this.max)|0};In.prototype.reset=function(){this.attempts=0};In.prototype.setMin=function(s){this.ms=s};In.prototype.setMax=function(s){this.max=s};In.prototype.setJitter=function(s){this.jitter=s};class Is extends Dt{constructor(i,n){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(n=i,i=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Qr(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((o=n.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new In({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=i;const u=n.parser||Gy;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var n;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(n=this.backoff)===null||n===void 0||n.setMin(i),this)}randomizationFactor(i){var n;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(n=this.backoff)===null||n===void 0||n.setJitter(i),this)}reconnectionDelayMax(i){var n;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(n=this.backoff)===null||n===void 0||n.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Zu(this.uri,this.opts);const n=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const u=Te(n,"open",function(){o.onopen(),i&&i()}),h=g=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",g),i?i(g):this.maybeReconnectOnOpen()},m=Te(n,"error",h);if(this._timeout!==!1){const g=this._timeout,S=this.setTimeoutFn(()=>{u(),h(new Error("timeout")),n.close()},g);this.opts.autoUnref&&S.unref(),this.subs.push(()=>{this.clearTimeoutFn(S)})}return this.subs.push(u),this.subs.push(m),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Te(i,"ping",this.onping.bind(this)),Te(i,"data",this.ondata.bind(this)),Te(i,"error",this.onerror.bind(this)),Te(i,"close",this.onclose.bind(this)),Te(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(n){this.onclose("parse error",n)}}ondecoded(i){Ps(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,n){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new tc(this,i,n),this.nsps[i]=o),o}_destroy(i){const n=Object.keys(this.nsps);for(const o of n)if(this.nsps[o].active)return;this._close()}_packet(i){const n=this.encoder.encode(i);for(let o=0;o<n.length;o++)this.engine.write(n[o],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(i,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(u=>{u?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",u)):i.onreconnect()}))},n);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Zn={};function jr(s,i){typeof s=="object"&&(i=s,s=void 0),i=i||{};const n=Ly(s,i.path||"/socket.io"),o=n.source,u=n.id,h=n.path,m=Zn[u]&&h in Zn[u].nsps,g=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let S;return g?S=new Is(o,i):(Zn[u]||(Zn[u]=new Is(o,i)),S=Zn[u]),n.query&&!i.query&&(i.query=n.queryKey),S.socket(n.path,i)}Object.assign(jr,{Manager:Is,Socket:tc,io:jr,connect:jr});let Jr;const $y=new Uint8Array(16);function zy(){if(!Jr&&(Jr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jr($y)}const Gt=[];for(let s=0;s<256;++s)Gt.push((s+256).toString(16).slice(1));function Xy(s,i=0){return Gt[s[i+0]]+Gt[s[i+1]]+Gt[s[i+2]]+Gt[s[i+3]]+"-"+Gt[s[i+4]]+Gt[s[i+5]]+"-"+Gt[s[i+6]]+Gt[s[i+7]]+"-"+Gt[s[i+8]]+Gt[s[i+9]]+"-"+Gt[s[i+10]]+Gt[s[i+11]]+Gt[s[i+12]]+Gt[s[i+13]]+Gt[s[i+14]]+Gt[s[i+15]]}const Jy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xu={randomUUID:Jy};function Vy(s,i,n){if(xu.randomUUID&&!i&&!s)return xu.randomUUID();s=s||{};const o=s.random||(s.rng||zy)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){n=n||0;for(let u=0;u<16;++u)i[n+u]=o[u];return i}return Xy(o)}function Yy(s){return!!s&&(typeof s=="object"||typeof s=="function")&&typeof s.then=="function"}function jy(s,i){const n=i.map(u=>JSON.stringify(u)).join(" "),o=new Date().toISOString();return JSON.stringify({level:s,time:o,message:n})}function Zy(s){const i=String(s[0]),n=s.slice(1);return{level:i,logs:n}}function Qy(s,i){const n=JSON.parse(s);return i.forEach(o=>delete n[o]),n}const t0={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},Cs={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4};let ie=console;class Ru{constructor(i){qt(this,"logToConsole"),qt(this,"overloadGlobalConsole"),qt(this,"namespace"),qt(this,"socketEmitInterval"),qt(this,"storageId"),qt(this,"emitInProgress"),qt(this,"queue"),qt(this,"processing"),qt(this,"interval"),qt(this,"logIndex"),qt(this,"socket"),qt(this,"getItem"),qt(this,"setItem"),qt(this,"parseLog"),qt(this,"_logMethod"),qt(this,"_warnMethod"),qt(this,"_errorMethod"),qt(this,"_debugMethod");const{loggerOptions:n}=i;if(!n.namespace)throw new Error("Config property 'namespace' should be provided!");this.setupStorageFunctions(n.getItem,n.setItem,n.parseLog),this.namespace=n.namespace,this.socketEmitInterval=n.socketEmitInterval||Cs.socketEmitInterval,this.logToConsole=n.logToConsole!==void 0?n.logToConsole:Cs.logToConsole,this.overloadGlobalConsole=n.overloadGlobalConsole!==void 0?n.overloadGlobalConsole:Cs.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.emitInProgress=!1,this.logIndex=0,this.init(i)}setupStorageFunctions(i,n,o){this.getItem=i&&typeof i=="function"?this.promisifyStorageFunction(i):this.defaultGetItemFunction,this.setItem=n&&typeof n=="function"?this.promisifyStorageFunction(n):this.defaultSetItemFunction,this.parseLog=o&&typeof o=="function"?o:jy}promisifyStorageFunction(i){const n=i("");return Yy(n)?async(...o)=>new Promise((u,h)=>{try{const m=i(...o);u(m)}catch(m){h(m)}}):i}init(i){const{socket:n,url:o,socketOptions:u={}}=i;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(o)this.socket=this.createConnection(o,u);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(i,n={}){const o={...t0,...n};return jr(i,o)}async emitLogs(){if(!this.emitInProgress)try{const i=await this.getItem(this.storageId);if(!i)return;const n=[];this.emitInProgress=!0;const o=JSON.parse(i),u=Object.keys(o);if(!u.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const g of u)this.socket.emit("Log",o[g]),n.push(g);const h=await this.getItem(this.storageId);if(!h)return;const m=Qy(h,n);await this.setItem(this.storageId,JSON.stringify(m))}catch(i){this._errorMethod(i)}finally{this.emitInProgress=!1}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){ie=Object.assign(ie,{log:(...i)=>{this.log(...i)},warn:(...i)=>{this.warn(...i)},error:(...i)=>{this.error(...i)},debug:(...i)=>{this.debug(...i)}})}async initStorage(){const i=await this.getItem(this.storageId);(!i||typeof i!="string")&&await this.setItem(this.storageId,JSON.stringify({}))}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const i=Vy();return this.namespace.toString().toUpperCase()+i+Date.now()}async processLog(...i){try{if(i.length<2)return;const n=await this.getItem(this.storageId);if(!n)return;const{level:o,logs:u}=Zy(i),h=JSON.parse(n),m=this.formItemKey(o);h[m]=this.parseLog(o,u),await this.setItem(this.storageId,JSON.stringify(h))}catch(n){this._errorMethod(n)}}async processQueue(){if(this.processing||this.queue.length===0)return;const i=this.queue.shift();i&&(this.processing=!0,await this.processLog(...i).finally(()=>{this.processing=!1,this.processQueue()}))}log(...i){const n=["INFO",...i];this.queue.push(n),this.logToConsole&&this._logMethod.apply(ie,i),this.processQueue()}warn(...i){const n=["WARN",...i];this.queue.push(n),this.logToConsole&&this._warnMethod.apply(ie,i),this.processQueue()}error(...i){const n=["ERROR",...i];this.queue.push(n),this.logToConsole&&this._errorMethod.apply(ie,i),this.processQueue()}debug(...i){const n=["DEBUG",...i];this.queue.push(n),this.logToConsole&&this._debugMethod.apply(ie,i),this.processQueue()}async defaultGetItemFunction(i){return localStorage.getItem(i)}async defaultSetItemFunction(i,n){try{localStorage.setItem(i,n)}catch(o){this._errorMethod(o)}}formItemKey(i){const n=new Date().toISOString();return this.logIndex++,`${i}-${this.namespace}-${n}-${this.logIndex}`}}class e0{constructor(i){wt(this,"io");wt(this,"storageLogger");this.eventsSdkClass=i,this.eventsSdkClass=i}init(){this.eventsSdkClass.options.useLogger&&(this.eventsSdkClass.options.loggerSocketConnection?this.io=this.eventsSdkClass.options.loggerSocketConnection:this.eventsSdkClass.socketIoClass.ioFunction&&(this.io=this.eventsSdkClass.socketIoClass.ioFunction(this.eventsSdkClass.options.loggerServer,this.eventsSdkClass.options.loggerConnectOptions)),this.io?this.storageLogger=new Ru({socket:this.io,loggerOptions:this.eventsSdkClass.options.loggerConfig}):this.storageLogger=new Ru({url:this.eventsSdkClass.options.loggerServer,socketOptions:this.eventsSdkClass.options.loggerConnectOptions,loggerOptions:this.eventsSdkClass.options.loggerConfig}))}log(i,n,...o){const u=[n,...o];this.storageLogger?i===Jt.INFO?this.storageLogger.log(u):i===Jt.ERROR&&this.storageLogger.error(u):i===Jt.INFO?console.log(u):i===Jt.ERROR&&console.error(u)}}class n0{constructor(i){wt(this,"listeners",{[ft.ALL_EXTENSION_STATUS]:[],[ft.ALL_DIALER_STATUS]:[],[ft.ALL_USERS_STATUS]:[],[ft.QUEUE_EVENT]:[],[ft.EXTENSION_EVENT]:[],[ft.DIALER_EVENT]:[],[ft.LOGIN_SUCCESS]:[],[ft.LOGIN_STATUS]:[],[ft.KEEP_ALIVE_RESPONSE]:[],[ft.ONLINE_STATUS_EVENT]:[],[ft.EXTENSIONS_UPDATED]:[]});wt(this,"allListeners",[]);this.eventsSdkClass=i,this.eventsSdkClass=i}on(i,n){i==="*"?this.allListeners.push(n):this.listeners[i].push(n)}off(i,n){if(i==="*")this.allListeners=this.allListeners.filter(o=>o!==n);else{const u=this.listeners[i].filter(h=>h!==n);this.listeners={...this.listeners,[i]:u}}}emit(i,n){this.eventsSdkClass.socketIoClass.lastEventTimestamp=new Date().getTime(),this.listeners[i].forEach(u=>u({name:i,data:n}));const o={name:i,data:n};this.allListeners.forEach(u=>u(o))}}class r0{constructor(i){wt(this,"argumentOptions");wt(this,"options");wt(this,"servers",[]);wt(this,"URLList",[]);wt(this,"server");wt(this,"URL");wt(this,"socket");wt(this,"mainServer");wt(this,"alreadyAttemptedOtherServers",[]);wt(this,"authClass",new Gv(this));wt(this,"socketIoClass",new Qv(this));wt(this,"loggerClass",new e0(this));wt(this,"eventEmitterClass",new n0(this));wt(this,"reconnectOptions");wt(this,"retryConnection");this.options={...$v,...i},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=Hv.debounce(this.connect.bind(this),this.reconnectOptions.reconnectionDelay,{leading:!0,trailing:!1}),this.argumentOptions={...i}}on(i,n){this.eventEmitterClass.on(i,n)}emit(i,...n){this.socketIoClass.io&&this.socketIoClass.io.emit(i,...n)}connect(i){i===pn.MAIN&&this.findMainServer(),i===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((i,n)=>n.Priority>i.Priority?n:i),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 i=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0);i.length||(this.alreadyAttemptedOtherServers=[],i=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0)),i.length&&(this.server=i.reduce((n,o)=>o.Priority>n.Priority?o:n),this.alreadyAttemptedOtherServers.push(this.server.Priority))}else this.server=this.mainServer;else if(this.URLList.length)if(this.URL===this.URLList[0]){let i=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0);i.length||(this.alreadyAttemptedOtherServers=[],i=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0)),i.length&&(this.URL=i[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)}}exports.CallStatusEnum=Bu;exports.CallTypeEnum=Uu;exports.DialerTypeEnum=Du;exports.DirectionEnum=Pu;exports.DoNotCallMeStatusCodeEnum=Fu;exports.EventsEnum=ft;exports.ExtensionEventReasonEnum=Ls;exports.ExtensionHangupCauseEnum=Mu;exports.QueueEventReasonEnum=qu;exports.ServerListenerEventsEnum=Ns;exports.default=r0;
45
45
  //# sourceMappingURL=voicenter-events-sdk.cjs.js.map