let t,e;function r(t,e,r,i){Object.defineProperty(t,e,{get:r,set:i,enumerable:!0,configurable:!0})}const i=Object.create(null);i.open="0",i.close="1",i.ping="2",i.pong="3",i.message="4",i.upgrade="5",i.noop="6";const n=Object.create(null);Object.keys(i).forEach(t=>{n[i[t]]=t});const s={type:"error",data:"parser error"},o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),h="function"==typeof ArrayBuffer,a=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,u=({type:t,data:e},r,n)=>o&&e instanceof Blob?r?n(e):c(e,n):h&&(e instanceof ArrayBuffer||a(e))?r?n(e):c(new Blob([e]),n):n(i[t]+(e||"")),c=(t,e)=>{let r=new FileReader;return r.onload=function(){let t=r.result.split(",")[1];e("b"+(t||""))},r.readAsDataURL(t)};function f(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}const l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t{let e=.75*t.length,r=t.length,i,n=0,s,o,h,a;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);let u=new ArrayBuffer(e),c=new Uint8Array(u);for(i=0;i>4,c[n++]=(15&o)<<4|h>>2,c[n++]=(3&h)<<6|63&a;return u},y="function"==typeof ArrayBuffer,g=(t,e)=>{if("string"!=typeof t)return{type:"message",data:b(t,e)};let r=t.charAt(0);if("b"===r)return{type:"message",data:m(t.substring(1),e)};let i=n[r];return i?t.length>1?{type:n[r],data:t.substring(1)}:{type:n[r]}:s},m=(t,e)=>{if(!y)return{base64:!0,data:t};{let r=d(t);return b(r,e)}},b=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,w=(t,e)=>{let r=t.length,i=Array(r),n=0;t.forEach((t,s)=>{u(t,!1,t=>{i[s]=t,++n===r&&e(i.join("\x1e"))})})},v=(t,e)=>{let r=t.split("\x1e"),i=[];for(let t=0;t(t.hasOwnProperty(r)&&(e[r]=t[r]),e),{})}const _=B.setTimeout,k=B.clearTimeout;function R(t,e){e.useNativeTimers?(t.setTimeoutFn=_.bind(B),t.clearTimeoutFn=k.bind(B)):(t.setTimeoutFn=B.setTimeout.bind(B),t.clearTimeoutFn=B.clearTimeout.bind(B))}class O extends Error{constructor(t,e,r){super(t),this.description=e,this.context=r,this.type="TransportError"}}class T extends E{constructor(t){super(),this.writable=!1,R(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,r){return super.emitReserved("error",new O(t,e,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=g(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return -1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){let e=function(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}(t);return e.length?"?"+e:""}}"use strict";const C="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),L={};let I=0,S=0,x;function U(t){let e="";do e=C[t%64]+e,t=Math.floor(t/64);while(t>0)return e}function N(){let t=U(+new Date);return t!==x?(I=0,x=t):t+"."+U(I++)}for(;S<64;S++)L[C[S]]=S;let P=!1;try{P="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const j=P;function q(t){let e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||j))return new XMLHttpRequest}catch(t){}if(!e)try{return new B[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function M(){}const F=function(){let t=new q({xdomain:!1});return null!=t.responseType}();class D extends E{constructor(t,e){super(),R(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;let e=A(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;let r=this.xhr=new q(e);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders)for(let t in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&r.setRequestHeader(t,this.opts.extraHeaders[t])}catch(t){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var t;3===r.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(r)),4===r.readyState&&(200===r.status||1223===r.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof r.status?r.status:0)},0))},r.send(this.data)}catch(t){this.setTimeoutFn(()=>{this.onError(t)},0);return}"undefined"!=typeof document&&(this.index=D.requestsCount++,D.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=M,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete D.requests[this.index],this.xhr=null}}onLoad(){let t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(D.requestsCount=0,D.requests={},"undefined"!=typeof document){if("function"==typeof attachEvent)attachEvent("onunload",$);else if("function"==typeof addEventListener){let t="onpagehide"in B?"pagehide":"unload";addEventListener(t,$,!1)}}function $(){for(let t in D.requests)D.requests.hasOwnProperty(t)&&D.requests[t].abort()}"use strict";"use strict";const V=(()=>{let t="function"==typeof Promise&&"function"==typeof Promise.resolve;return t?t=>Promise.resolve().then(t):(t,e)=>e(t,0)})(),z=B.WebSocket||B.MozWebSocket;Y=function(t){for(var e,r=t.length,i=r%3,n=[],s=0,o=r-i;s>18&63]+J[i>>12&63]+J[i>>6&63]+J[63&i]);return n.join("")}(t,s,s+16383>o?o:s+16383));return 1===i?n.push(J[(e=t[r-1])>>2]+J[e<<4&63]+"=="):2===i&&n.push(J[(e=(t[r-2]<<8)+t[r-1])>>10]+J[e>>4&63]+J[e<<2&63]+"="),n.join("")};for(var Y,H,K,W,J=[],Q=[],G="undefined"!=typeof Uint8Array?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Z=0,tt=X.length;Z>1,c=-7,f=r?n-1:0,l=r?-1:1,p=t[e+f];for(f+=l,s=p&(1<<-c)-1,p>>=-c,c+=h;c>0;s=256*s+t[e+f],f+=l,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=i;c>0;o=256*o+t[e+f],f+=l,c-=8);if(0===s)s=1-u;else{if(s===a)return o?NaN:(p?-1:1)*(1/0);o+=Math.pow(2,i),s-=u}return(p?-1:1)*o*Math.pow(2,s-i)},K=function(t,e,r,i,n,s){var o,h,a,u=8*s-n-1,c=(1<>1,l=23===n?5960464477539062e-23:0,p=i?0:s-1,d=i?1:-1,y=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(h=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+f>=1?e+=l/a:e+=l*Math.pow(2,1-f),e*a>=2&&(o++,a/=2),o+f>=c?(h=0,o=c):o+f>=1?(h=(e*a-1)*Math.pow(2,n),o+=f):(h=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&h,p+=d,h/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*y};const te="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function tr(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,ti.prototype),e}function ti(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return to(t)}return tn(t,e,r)}function tn(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!ti.isEncoding(e))throw TypeError("Unknown encoding: "+e);let r=0|tc(t,e),i=tr(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(tx(t,Uint8Array)){let e=new Uint8Array(t);return ta(e.buffer,e.byteOffset,e.byteLength)}return th(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(tx(t,ArrayBuffer)||t&&tx(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(tx(t,SharedArrayBuffer)||t&&tx(t.buffer,SharedArrayBuffer)))return ta(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return ti.from(i,e,r);let n=function(t){var e;if(ti.isBuffer(t)){let e=0|tu(t.length),r=tr(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?tr(0):th(t):"Buffer"===t.type&&Array.isArray(t.data)?th(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return ti.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function ts(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function to(t){return ts(t),tr(t<0?0:0|tu(t))}function th(t){let e=t.length<0?0:0|tu(t.length),r=tr(e);for(let i=0;i=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function tc(t,e){if(ti.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||tx(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return tL(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tI(t).length;default:if(n)return i?-1:tL(t).length;e=(""+e).toLowerCase(),n=!0}}function tf(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return -1;r=t.length-1}else if(r<0){if(!n)return -1;r=0}if("string"==typeof e&&(e=ti.from(e,i)),ti.isBuffer(e))return 0===e.length?-1:td(t,e,r,i,n);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):td(t,[e],r,i,n);throw TypeError("val must be string, number or Buffer")}function td(t,e,r,i,n){let s,o=1,h=t.length,a=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;o=2,h/=2,a/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(s=r;sh&&(r=h-a),s=r;s>=0;s--){let r=!0;for(let i=0;i239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,h,a;switch(o){case 1:e<128&&(s=e);break;case 2:(192&(r=t[n+1]))==128&&(a=(31&e)<<6|63&r)>127&&(s=a);break;case 3:r=t[n+1],i=t[n+2],(192&r)==128&&(192&i)==128&&(a=(15&e)<<12|(63&r)<<6|63&i)>2047&&(a<55296||a>57343)&&(s=a);break;case 4:r=t[n+1],i=t[n+2],h=t[n+3],(192&r)==128&&(192&i)==128&&(192&h)==128&&(a=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&h)>65535&&a<1114112&&(s=a)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(t){let e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ir)throw RangeError("Trying to access beyond buffer length")}function tm(t,e,r,i,n,s){if(!ti.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw RangeError("Index out of range")}function tb(t,e,r,i,n){tR(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function tw(t,e,r,i,n){tR(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function tv(t,e,r,i,n,s){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function tE(t,e,r,i,n){return e=+e,r>>>=0,n||tv(t,e,r,4,34028234663852886e22,-34028234663852886e22),K(t,e,r,i,23,4),r+4}function tB(t,e,r,i,n){return e=+e,r>>>=0,n||tv(t,e,r,8,17976931348623157e292,-17976931348623157e292),K(t,e,r,i,52,8),r+8}ti.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),ti.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(ti.prototype,"parent",{enumerable:!0,get:function(){if(ti.isBuffer(this))return this.buffer}}),Object.defineProperty(ti.prototype,"offset",{enumerable:!0,get:function(){if(ti.isBuffer(this))return this.byteOffset}}),ti.poolSize=8192,ti.from=function(t,e,r){return tn(t,e,r)},Object.setPrototypeOf(ti.prototype,Uint8Array.prototype),Object.setPrototypeOf(ti,Uint8Array),ti.alloc=function(t,e,r){return(ts(t),t<=0)?tr(t):void 0!==e?"string"==typeof r?tr(t).fill(e,r):tr(t).fill(e):tr(t)},ti.allocUnsafe=function(t){return to(t)},ti.allocUnsafeSlow=function(t){return to(t)},ti.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==ti.prototype},ti.compare=function(t,e){if(tx(t,Uint8Array)&&(t=ti.from(t,t.offset,t.byteLength)),tx(e,Uint8Array)&&(e=ti.from(e,e.offset,e.byteLength)),!ti.isBuffer(t)||!ti.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,s=Math.min(r,i);ni.length?(ti.isBuffer(e)||(e=ti.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else if(ti.isBuffer(e))e.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=e.length}return i},ti.byteLength=tc,ti.prototype._isBuffer=!0,ti.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e50&&(t+=" ... "),""},te&&(ti.prototype[te]=ti.prototype.inspect),ti.prototype.compare=function(t,e,r,i,n){if(tx(t,Uint8Array)&&(t=ti.from(t,t.offset,t.byteLength)),!ti.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;let s=n-i,o=r-e,h=Math.min(s,o),a=this.slice(i,n),u=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let l=this.length-e;if((void 0===r||r>l)&&(r=l),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let p=!1;for(;;)switch(i){case"hex":return function(t,e,r,i){let n;r=Number(r)||0;let s=t.length-r;i?(i=Number(i))>s&&(i=s):i=s;let o=e.length;for(i>o/2&&(i=o/2),n=0;n>8,n.push(r%256),n.push(i);return n}(t,this.length-c),this,c,f);default:if(p)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},ti.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},ti.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||tg(t,e,this.length);let i=this[t],n=1,s=0;for(;++s>>=0,e>>>=0,r||tg(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},ti.prototype.readUint8=ti.prototype.readUInt8=function(t,e){return t>>>=0,e||tg(t,1,this.length),this[t]},ti.prototype.readUint16LE=ti.prototype.readUInt16LE=function(t,e){return t>>>=0,e||tg(t,2,this.length),this[t]|this[t+1]<<8},ti.prototype.readUint16BE=ti.prototype.readUInt16BE=function(t,e){return t>>>=0,e||tg(t,2,this.length),this[t]<<8|this[t+1]},ti.prototype.readUint32LE=ti.prototype.readUInt32LE=function(t,e){return t>>>=0,e||tg(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},ti.prototype.readUint32BE=ti.prototype.readUInt32BE=function(t,e){return t>>>=0,e||tg(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},ti.prototype.readBigUInt64LE=tN(function(t){tO(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&tT(t,this.length-8);let i=e+256*this[++t]+65536*this[++t]+16777216*this[++t],n=this[++t]+256*this[++t]+65536*this[++t]+16777216*r;return BigInt(i)+(BigInt(n)<>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&tT(t,this.length-8);let i=16777216*e+65536*this[++t]+256*this[++t]+this[++t],n=16777216*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<>>=0,e>>>=0,r||tg(t,e,this.length);let i=this[t],n=1,s=0;for(;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},ti.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||tg(t,e,this.length);let i=e,n=1,s=this[t+--i];for(;i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},ti.prototype.readInt8=function(t,e){return(t>>>=0,e||tg(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},ti.prototype.readInt16LE=function(t,e){t>>>=0,e||tg(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},ti.prototype.readInt16BE=function(t,e){t>>>=0,e||tg(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},ti.prototype.readInt32LE=function(t,e){return t>>>=0,e||tg(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},ti.prototype.readInt32BE=function(t,e){return t>>>=0,e||tg(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},ti.prototype.readBigInt64LE=tN(function(t){tO(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&tT(t,this.length-8);let i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&tT(t,this.length-8);let i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<>>=0,e||tg(t,4,this.length),H(this,t,!0,23,4)},ti.prototype.readFloatBE=function(t,e){return t>>>=0,e||tg(t,4,this.length),H(this,t,!1,23,4)},ti.prototype.readDoubleLE=function(t,e){return t>>>=0,e||tg(t,8,this.length),H(this,t,!0,52,8)},ti.prototype.readDoubleBE=function(t,e){return t>>>=0,e||tg(t,8,this.length),H(this,t,!1,52,8)},ti.prototype.writeUintLE=ti.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;tm(this,t,e,r,i,0)}let n=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;tm(this,t,e,r,i,0)}let n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},ti.prototype.writeUint8=ti.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,1,255,0),this[e]=255&t,e+1},ti.prototype.writeUint16LE=ti.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},ti.prototype.writeUint16BE=ti.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},ti.prototype.writeUint32LE=ti.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},ti.prototype.writeUint32BE=ti.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},ti.prototype.writeBigUInt64LE=tN(function(t,e=0){return tb(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),ti.prototype.writeBigUInt64BE=tN(function(t,e=0){return tw(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),ti.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){let i=Math.pow(2,8*r-1);tm(this,t,e,r,i-1,-i)}let n=0,s=1,o=0;for(this[e]=255&t;++n>0)-o&255;return e+r},ti.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){let i=Math.pow(2,8*r-1);tm(this,t,e,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[e+n]=255&t;--n>=0&&(s*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},ti.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},ti.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},ti.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},ti.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},ti.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||tm(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},ti.prototype.writeBigInt64LE=tN(function(t,e=0){return tb(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ti.prototype.writeBigInt64BE=tN(function(t,e=0){return tw(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ti.prototype.writeFloatLE=function(t,e,r){return tE(this,t,e,!0,r)},ti.prototype.writeFloatBE=function(t,e,r){return tE(this,t,e,!1,r)},ti.prototype.writeDoubleLE=function(t,e,r){return tB(this,t,e,!0,r)},ti.prototype.writeDoubleBE=function(t,e,r){return tB(this,t,e,!1,r)},ti.prototype.copy=function(t,e,r,i){if(!ti.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function tR(t,e,r,i,n,s){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${(s+1)*8}${n}`:`>= -(2${n} ** ${(s+1)*8-1}${n}) and < 2 ** ${(s+1)*8-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new tA.ERR_OUT_OF_RANGE("value",i,t)}tO(n,"offset"),(void 0===i[n]||void 0===i[n+s])&&tT(n,i.length-(s+1))}function tO(t,e){if("number"!=typeof t)throw new tA.ERR_INVALID_ARG_TYPE(e,"number",t)}function tT(t,e,r){if(Math.floor(t)!==t)throw tO(t,r),new tA.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new tA.ERR_BUFFER_OUT_OF_BOUNDS;throw new tA.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}t_("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),t_("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),t_("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?n=tk(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=tk(n)),n+="n"),i+=` It must be ${e}. Received ${n}`},RangeError);const tC=/[^+/0-9A-Za-z-_]/g;function tL(t,e){let r;e=e||1/0;let i=t.length,n=null,s=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319||o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function tI(t){return function(t){var e,r,i=function(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}(t),n=i[0],s=i[1],o=new G((n+s)*3/4-s),h=0,a=s>0?n-4:n;for(r=0;r>16&255,o[h++]=e>>8&255,o[h++]=255&e;return 2===s&&(e=Q[t.charCodeAt(r)]<<2|Q[t.charCodeAt(r+1)]>>4,o[h++]=255&e),1===s&&(e=Q[t.charCodeAt(r)]<<10|Q[t.charCodeAt(r+1)]<<4|Q[t.charCodeAt(r+2)]>>2,o[h++]=e>>8&255,o[h++]=255&e),o}(function(t){if((t=(t=t.split("=")[0]).trim().replace(tC,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tS(t,e,r,i){let n;for(n=0;n=e.length)&&!(n>=t.length);++n)e[n+r]=t[n];return n}function tx(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}const tU=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function tN(t){return"undefined"==typeof BigInt?tP:t}function tP(){throw Error("BigInt not supported")}const tj="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),tq={websocket:class extends T{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let t=this.uri(),e=this.opts.protocols,r=tj?{}:A(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=tj?new z(t,e,r):e?new z(t,e):new z(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e{try{this.ws.send(t)}catch(t){}i&&V(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=N()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!z}},webtransport:class extends T{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{let r;let i=t.readable.getReader();this.writer=t.writable.getWriter();let n=()=>{i.read().then(({done:t,value:i})=>{t||(r||1!==i.byteLength||54!==i[0]?(this.onPacket(function(t,r,i){e||(e=new TextDecoder);let n=r||t[0]<48||t[0]>54;return g(n?t:e.decode(t),i)}(i,r,"arraybuffer")),r=!1):r=!0,n())}).catch(t=>{})};n();let s=this.query.sid?`0{"sid":"${this.query.sid}"}`:"0";this.writer.write(new TextEncoder().encode(s)).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let r=0;r{t||(t=new TextEncoder),r(t.encode(e))})}(i,t=>{"message"===i.type&&"string"!=typeof i.data&&t[0]>=48&&t[0]<=54&&this.writer.write(Uint8Array.of(54)),this.writer.write(t).then(()=>{n&&V(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})})}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends T{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){let e="https:"===location.protocol,r=location.port;r||(r=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port}let e=t&&t.forceBase64;this.supportsBinary=F&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){v(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){let t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,w(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=N()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new D(this.uri(),t)}doWrite(t,e){let r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}},tM=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tF=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tD(t){let e=t,r=t.indexOf("["),i=t.indexOf("]");-1!=r&&-1!=i&&(t=t.substring(0,r)+t.substring(r,i).replace(/:/g,";")+t.substring(i,t.length));let n=tM.exec(t||""),s={},o=14;for(;o--;)s[tF[o]]=n[o]||"";return -1!=r&&-1!=i&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(t,e){let r=e.replace(/\/{2,9}/g,"/").split("/");return("/"==e.slice(0,1)||0===e.length)&&r.splice(0,1),"/"==e.slice(-1)&&r.splice(r.length-1,1),r}(0,s.path),s.queryKey=function(t,e){let r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,i){e&&(r[e]=i)}),r}(0,s.query),s}class t$ extends E{constructor(t,e={}){super(),this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=tD(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=tD(e.host).host),R(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","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},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},r=t.split("&");for(let t=0,i=r.length;t{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){let e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new tq[t](r)}open(){let t;if(this.opts.rememberUpgrade&&t$.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else if(0===this.transports.length){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(t){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(t){let e=this.createTransport(t),r=!1;t$.priorWebsocketSuccess=!1;let i=()=>{r||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!r){if("pong"===t.type&&"probe"===t.data)this.upgrading=!0,this.emitReserved("upgrading",e),e&&(t$.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{r||"closed"===this.readyState||(u(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}));else{let t=Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}}))};function n(){r||(r=!0,u(),e.close(),e=null)}let s=t=>{let r=Error("probe error: "+t);r.transport=e.name,n(),this.emitReserved("upgradeError",r)};function o(){s("transport closed")}function h(){s("socket closed")}function a(t){e&&t.name!==e.name&&n()}let u=()=>{e.removeListener("open",i),e.removeListener("error",s),e.removeListener("close",o),this.off("close",h),this.off("upgrading",a)};e.once("open",i),e.once("error",s),e.once("close",o),this.once("close",h),this.once("upgrading",a),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{r||e.open()},200):e.open()}onOpen(){if(this.readyState="open",t$.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0,e=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){let t=this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1;if(!t)return this.writeBuffer;let e=1;for(let t=0;t=57344?r+=3:(i++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),t>0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(t,e,r){return this.sendPacket("message",t,e,r),this}send(t,e,r){return this.sendPacket("message",t,e,r),this}sendPacket(t,e,r,i){if("function"==typeof e&&(i=e,e=void 0),"function"==typeof r&&(i=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let n={type:t,data:e,options:r};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),i&&this.once("flush",i),this.flush()}close(){let t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){t$.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){let e=[],r=0,i=t.length;for(;rtG),r(tV,"PacketType",()=>W),r(tV,"Encoder",()=>tX),r(tV,"Decoder",()=>t0);const tz="function"==typeof ArrayBuffer,tY=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,tH=Object.prototype.toString,tK="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===tH.call(Blob),tW="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===tH.call(File);function tJ(t){return tz&&(t instanceof ArrayBuffer||tY(t))||tK&&t instanceof Blob||tW&&t instanceof File}const tQ=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],tG=5;!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(W||(W={}));class tX{constructor(t){this.replacer=t}encode(t){return(t.type===W.EVENT||t.type===W.ACK)&&function t(e,r){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let r=0,i=e.length;r=0&&e.num{delete this.acks[t];for(let e=0;e{this.io.clearTimeoutFn(n),e.apply(this,[null,...t])}}emitWithAck(t,...e){let r=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise((i,n)=>{e.push((t,e)=>r?t?n(t):i(e):i(t)),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...i)=>{if(r!==this._queue[0])return;let n=null!==t;return n?r.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...i)),r.pending=!1,this._drainQueue()}),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;let e=this._queue[0];(!e.pending||t)&&(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:W.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){let e=t.nsp===this.nsp;if(e)switch(t.type){case W.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",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 W.EVENT:case W.BINARY_EVENT:this.onevent(t);break;case W.ACK:case W.BINARY_ACK:this.onack(t);break;case W.DISCONNECT:this.ondisconnect();break;case W.CONNECT_ERROR:this.destroy();let r=Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r)}}onevent(t){let e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let e=this._anyListeners.slice();for(let r of e)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,r=!1;return function(...i){r||(r=!0,e.packet({type:W.ACK,id:t,data:i}))}}onack(t){let e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:W.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let r=0;r0&&t.jitter<=1?t.jitter:0,this.attempts=0}t5.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(1&Math.floor(10*e))==0?t-r:t+r}return 0|Math.min(t,this.max)},t5.prototype.reset=function(){this.attempts=0},t5.prototype.setMin=function(t){this.ms=t},t5.prototype.setMax=function(t){this.max=t},t5.prototype.setJitter=function(t){this.jitter=t};class t4 extends E{constructor(t,e){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,R(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=e.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new t5({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;let i=e.parser||tV;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new t$(this.uri,this.opts);let e=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let i=t2(e,"open",function(){r.onopen(),t&&t()}),n=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},s=t2(e,"error",n);if(!1!==this._timeout){let t=this._timeout,r=this.setTimeoutFn(()=>{i(),n(Error("timeout")),e.close()},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(t2(t,"ping",this.onping.bind(this)),t2(t,"data",this.ondata.bind(this)),t2(t,"error",this.onerror.bind(this)),t2(t,"close",this.onclose.bind(this)),t2(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){V(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new t8(this,t,e),this.nsps[t]=r),r}_destroy(t){let e=Object.keys(this.nsps);for(let t of e){let e=this.nsps[t];if(e.active)return}this._close()}_packet(t){let e=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{!t.skipReconnect&&(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const t3={};function t7(t,e){let r;"object"==typeof t&&(e=t,t=void 0),e=e||{};let i=function(t,e="",r){let i=t;r=r||"undefined"!=typeof location&&location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),i=tD(t)),!i.port&&(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let n=-1!==i.host.indexOf(":"),s=n?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+s+":"+i.port+e,i.href=i.protocol+"://"+s+(r&&r.port===i.port?"":":"+i.port),i}(t,e.path||"/socket.io"),n=i.source,s=i.id,o=i.path,h=t3[s]&&o in t3[s].nsps,a=e.forceNew||e["force new connection"]||!1===e.multiplex||h;return a?r=new t4(n,e):(t3[s]||(t3[s]=new t4(n,e)),r=t3[s]),i.query&&!e.query&&(e.query=i.queryKey),r.socket(i.path,e)}Object.assign(t7,{Manager:t4,Socket:t8,io:t7,connect:t7});const t9=t7();t9.on("update",t=>{document.querySelector("#raw-info").innerHTML=t}); //# sourceMappingURL=index.5e4f646d.js.map