socket.io
Advanced tools
Comparing version 4.8.0 to 4.8.1
/*! | ||
* Socket.IO v4.8.0 | ||
* Socket.IO v4.8.1 | ||
* (c) 2014-2024 Guillermo Rauch | ||
* Released under the MIT License. | ||
*/ | ||
const t=Object.create(null);t.open="0",t.close="1",t.ping="2",t.pong="3",t.message="4",t.upgrade="5",t.noop="6";const s=Object.create(null);Object.keys(t).forEach((i=>{s[t[i]]=i}));const i={type:"error",data:"parser error"},e="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),n="function"==typeof ArrayBuffer,r=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,o=({type:s,data:i},o,c)=>e&&i instanceof Blob?o?c(i):h(i,c):n&&(i instanceof ArrayBuffer||r(i))?o?c(i):h(new Blob([i]),c):c(t[s]+(i||"")),h=(t,s)=>{const i=new FileReader;return i.onload=function(){const t=i.result.split(",")[1];s("b"+(t||""))},i.readAsDataURL(t)};function c(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let a;const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)f[u.charCodeAt(t)]=t;const l="function"==typeof ArrayBuffer,p=(t,e)=>{if("string"!=typeof t)return{type:"message",data:y(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:d(t.substring(1),e)};return s[n]?t.length>1?{type:s[n],data:t.substring(1)}:{type:s[n]}:i},d=(t,s)=>{if(l){const i=(t=>{let s,i,e,n,r,o=.75*t.length,h=t.length,c=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);const a=new ArrayBuffer(o),u=new Uint8Array(a);for(s=0;s<h;s+=4)i=f[t.charCodeAt(s)],e=f[t.charCodeAt(s+1)],n=f[t.charCodeAt(s+2)],r=f[t.charCodeAt(s+3)],u[c++]=i<<2|e>>4,u[c++]=(15&e)<<4|n>>2,u[c++]=(3&n)<<6|63&r;return a})(t);return y(i,s)}return{base64:!0,data:t}},y=(t,s)=>"blob"===s?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,g=String.fromCharCode(30);function b(){return new TransformStream({transform(t,s){!function(t,s){e&&t.data instanceof Blob?t.data.arrayBuffer().then(c).then(s):n&&(t.data instanceof ArrayBuffer||r(t.data))?s(c(t.data)):o(t,!1,(t=>{a||(a=new TextEncoder),s(a.encode(t))}))}(t,(i=>{const e=i.length;let n;if(e<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,e);else if(e<65536){n=new Uint8Array(3);const t=new DataView(n.buffer);t.setUint8(0,126),t.setUint16(1,e)}else{n=new Uint8Array(9);const t=new DataView(n.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(e))}t.data&&"string"!=typeof t.data&&(n[0]|=128),s.enqueue(n),s.enqueue(i)}))}})}let w;function v(t){return t.reduce(((t,s)=>t+s.length),0)}function m(t,s){if(t[0].length===s)return t.shift();const i=new Uint8Array(s);let e=0;for(let n=0;n<s;n++)i[n]=t[0][e++],e===t[0].length&&(t.shift(),e=0);return t.length&&e<t[0].length&&(t[0]=t[0].slice(e)),i}function k(t){if(t)return function(t){for(var s in k.prototype)t[s]=k.prototype[s];return t}(t)}k.prototype.on=k.prototype.addEventListener=function(t,s){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(s),this},k.prototype.once=function(t,s){function i(){this.off(t,i),s.apply(this,arguments)}return i.fn=s,this.on(t,i),this},k.prototype.off=k.prototype.removeListener=k.prototype.removeAllListeners=k.prototype.removeEventListener=function(t,s){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var i,e=this.t["$"+t];if(!e)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var n=0;n<e.length;n++)if((i=e[n])===s||i.fn===s){e.splice(n,1);break}return 0===e.length&&delete this.t["$"+t],this},k.prototype.emit=function(t){this.t=this.t||{};for(var s=new Array(arguments.length-1),i=this.t["$"+t],e=1;e<arguments.length;e++)s[e-1]=arguments[e];if(i){e=0;for(var n=(i=i.slice(0)).length;e<n;++e)i[e].apply(this,s)}return this},k.prototype.emitReserved=k.prototype.emit,k.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},k.prototype.hasListeners=function(t){return!!this.listeners(t).length};const A="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,s)=>s(t,0),E="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function O(t,...s){return s.reduce(((s,i)=>(t.hasOwnProperty(i)&&(s[i]=t[i]),s)),{})}const _=E.setTimeout,j=E.clearTimeout;function B(t,s){s.useNativeTimers?(t.setTimeoutFn=_.bind(E),t.clearTimeoutFn=j.bind(E)):(t.setTimeoutFn=E.setTimeout.bind(E),t.clearTimeoutFn=E.clearTimeout.bind(E))}function x(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class C extends Error{constructor(t,s,i){super(t),this.description=s,this.context=i,this.type="TransportError"}}class N extends k{constructor(t){super(),this.writable=!1,B(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,s,i){return super.emitReserved("error",new C(t,s,i)),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){const s=p(t,this.socket.binaryType);this.onPacket(s)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,s={}){return t+"://"+this.i()+this.o()+this.opts.path+this.h(s)}i(){const t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"}o(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}h(t){const s=function(t){let s="";for(let i in t)t.hasOwnProperty(i)&&(s.length&&(s+="&"),s+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return s}(t);return s.length?"?"+s:""}}class U extends N{constructor(){super(...arguments),this.u=!1}get name(){return"polling"}doOpen(){this.l()}pause(t){this.readyState="pausing";const s=()=>{this.readyState="paused",t()};if(this.u||!this.writable){let t=0;this.u&&(t++,this.once("pollComplete",(function(){--t||s()}))),this.writable||(t++,this.once("drain",(function(){--t||s()})))}else s()}l(){this.u=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,s)=>{const i=t.split(g),e=[];for(let t=0;t<i.length;t++){const n=p(i[t],s);if(e.push(n),"error"===n.type)break}return e})(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.u=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.l())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,s)=>{const i=t.length,e=new Array(i);let n=0;t.forEach(((t,r)=>{o(t,!1,(t=>{e[r]=t,++n===i&&s(e.join(g))}))}))})(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return!1!==this.opts.timestampRequests&&(s[this.opts.timestampParam]=x()),this.supportsBinary||s.sid||(s.b64=1),this.createUri(t,s)}}let T=!1;try{T="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const P=T;function D(){}class M extends U{constructor(t){if(super(t),"undefined"!=typeof location){const s="https:"===location.protocol;let i=location.port;i||(i=s?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||i!==t.port}}doWrite(t,s){const i=this.request({method:"POST",data:t});i.on("success",s),i.on("error",((t,s)=>{this.onError("xhr post error",t,s)}))}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,s)=>{this.onError("xhr poll error",t,s)})),this.pollXhr=t}}class L extends k{constructor(t,s,i){super(),this.createRequest=t,B(this,i),this.p=i,this.v=i.method||"GET",this.m=s,this.k=void 0!==i.data?i.data:null,this.A()}A(){var t;const s=O(this.p,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this.p.xd;const i=this.O=this.createRequest(s);try{i.open(this.v,this.m,!0);try{if(this.p.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let t in this.p.extraHeaders)this.p.extraHeaders.hasOwnProperty(t)&&i.setRequestHeader(t,this.p.extraHeaders[t])}}catch(t){}if("POST"===this.v)try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{i.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.p.cookieJar)||void 0===t||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this.p.withCredentials),this.p.requestTimeout&&(i.timeout=this.p.requestTimeout),i.onreadystatechange=()=>{var t;3===i.readyState&&(null===(t=this.p.cookieJar)||void 0===t||t.parseCookies(i.getResponseHeader("set-cookie"))),4===i.readyState&&(200===i.status||1223===i.status?this._():this.setTimeoutFn((()=>{this.j("number"==typeof i.status?i.status:0)}),0))},i.send(this.k)}catch(t){return void this.setTimeoutFn((()=>{this.j(t)}),0)}"undefined"!=typeof document&&(this.B=L.requestsCount++,L.requests[this.B]=this)}j(t){this.emitReserved("error",t,this.O),this.C(!0)}C(t){if(void 0!==this.O&&null!==this.O){if(this.O.onreadystatechange=D,t)try{this.O.abort()}catch(t){}"undefined"!=typeof document&&delete L.requests[this.B],this.O=null}}_(){const t=this.O.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.C())}abort(){this.C()}}if(L.requestsCount=0,L.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",R);else if("function"==typeof addEventListener){addEventListener("onpagehide"in E?"pagehide":"unload",R,!1)}function R(){for(let t in L.requests)L.requests.hasOwnProperty(t)&&L.requests[t].abort()}const S=function(){const t=I({xdomain:!1});return t&&null!==t.responseType}();function I(t){const s=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!s||P))return new XMLHttpRequest}catch(t){}if(!s)try{return new(E[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}const $="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class F extends N{get name(){return"websocket"}doOpen(){const t=this.uri(),s=this.opts.protocols,i=$?{}:O(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,s,i)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws.N.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 s=0;s<t.length;s++){const i=t[s],e=s===t.length-1;o(i,this.supportsBinary,(t=>{try{this.doWrite(i,t)}catch(t){}e&&A((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=x()),this.supportsBinary||(s.b64=1),this.createUri(t,s)}}const V=E.WebSocket||E.MozWebSocket;const q={websocket:class extends F{createSocket(t,s,i){return $?new V(t,s,i):s?new V(t,s):new V(t)}doWrite(t,s){this.ws.send(s)}},webtransport:class extends N{get name(){return"webtransport"}doOpen(){try{this.U=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.U.closed.then((()=>{this.onClose()})).catch((t=>{this.onError("webtransport error",t)})),this.U.ready.then((()=>{this.U.createBidirectionalStream().then((t=>{const s=function(t,s){w||(w=new TextDecoder);const e=[];let n=0,r=-1,o=!1;return new TransformStream({transform(h,c){for(e.push(h);;){if(0===n){if(v(e)<1)break;const t=m(e,1);o=!(128&~t[0]),r=127&t[0],n=r<126?3:126===r?1:2}else if(1===n){if(v(e)<2)break;const t=m(e,2);r=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),n=3}else if(2===n){if(v(e)<8)break;const t=m(e,8),s=new DataView(t.buffer,t.byteOffset,t.length),o=s.getUint32(0);if(o>Math.pow(2,21)-1){c.enqueue(i);break}r=o*Math.pow(2,32)+s.getUint32(4),n=3}else{if(v(e)<r)break;const t=m(e,r);c.enqueue(p(o?t:w.decode(t),s)),n=0}if(0===r||r>t){c.enqueue(i);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(s).getReader(),n=b();n.readable.pipeTo(t.writable),this.T=n.writable.getWriter();const r=()=>{e.read().then((({done:t,value:s})=>{t||(this.onPacket(s),r())})).catch((t=>{}))};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.T.write(o).then((()=>this.onOpen()))}))}))}write(t){this.writable=!1;for(let s=0;s<t.length;s++){const i=t[s],e=s===t.length-1;this.T.write(i).then((()=>{e&&A((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var t;null===(t=this.U)||void 0===t||t.close()}},polling:class extends M{constructor(t){super(t);const s=t&&t.forceBase64;this.supportsBinary=S&&!s}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new L(I,this.uri(),t)}}},H=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,X=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function W(t){if(t.length>8e3)throw"URI too long";const s=t,i=t.indexOf("["),e=t.indexOf("]");-1!=i&&-1!=e&&(t=t.substring(0,i)+t.substring(i,e).replace(/:/g,";")+t.substring(e,t.length));let n=H.exec(t||""),r={},o=14;for(;o--;)r[X[o]]=n[o]||"";return-1!=i&&-1!=e&&(r.source=s,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=function(t,s){const i=/\/{2,9}/g,e=s.replace(i,"/").split("/");"/"!=s.slice(0,1)&&0!==s.length||e.splice(0,1);"/"==s.slice(-1)&&e.splice(e.length-1,1);return e}(0,r.path),r.queryKey=function(t,s){const i={};return s.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,s,e){s&&(i[s]=e)})),i}(0,r.query),r}const z="function"==typeof addEventListener&&"function"==typeof removeEventListener,J=[];z&&addEventListener("offline",(()=>{J.forEach((t=>t()))}),!1);class Q extends k{constructor(t,s){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this.P=0,this.D=-1,this.M=-1,this.L=-1,this.R=1/0,t&&"object"==typeof t&&(s=t,t=null),t){const i=W(t);s.hostname=i.host,s.secure="https"===i.protocol||"wss"===i.protocol,s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=W(s.host).host);B(this,s),this.secure=null!=s.secure?s.secure:"undefined"!=typeof location&&"https:"===location.protocol,s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=s.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this.S={},s.transports.forEach((t=>{const s=t.prototype.name;this.transports.push(s),this.S[s]=t})),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},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let s={},i=t.split("&");for(let t=0,e=i.length;t<e;t++){let e=i[t].split("=");s[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return s}(this.opts.query)),z&&(this.opts.closeOnBeforeunload&&(this.I=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.I,!1)),"localhost"!==this.hostname&&(this.$=()=>{this.F("transport close",{description:"network connection lost"})},J.push(this.$))),this.opts.withCredentials&&(this.V=void 0),this.q()}createTransport(t){const s=Object.assign({},this.opts.query);s.EIO=4,s.transport=t,this.id&&(s.sid=this.id);const i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.S[t](i)}q(){if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);const t=this.opts.rememberUpgrade&&Q.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.H.bind(this)).on("packet",this.X.bind(this)).on("error",this.j.bind(this)).on("close",(t=>this.F("transport close",t)))}onOpen(){this.readyState="open",Q.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}X(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.W("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.J();break;case"error":const s=new Error("server error");s.code=t.data,this.j(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.D=t.pingInterval,this.M=t.pingTimeout,this.L=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.J()}J(){this.clearTimeoutFn(this.K);const t=this.D+this.M;this.R=Date.now()+t,this.K=this.setTimeoutFn((()=>{this.F("ping timeout")}),t),this.opts.autoUnref&&this.K.unref()}H(){this.writeBuffer.splice(0,this.P),this.P=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.Y();this.transport.send(t),this.P=t.length,this.emitReserved("flush")}}Y(){if(!(this.L&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i<this.writeBuffer.length;i++){const e=this.writeBuffer[i].data;if(e&&(t+="string"==typeof(s=e)?function(t){let s=0,i=0;for(let e=0,n=t.length;e<n;e++)s=t.charCodeAt(e),s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(e++,i+=4);return i}(s):Math.ceil(1.33*(s.byteLength||s.size))),i>0&&t>this.L)return this.writeBuffer.slice(0,i);t+=2}var s;return this.writeBuffer}G(){if(!this.R)return!0;const t=Date.now()>this.R;return t&&(this.R=0,A((()=>{this.F("ping timeout")}),this.setTimeoutFn)),t}write(t,s,i){return this.W("message",t,s,i),this}send(t,s,i){return this.W("message",t,s,i),this}W(t,s,i,e){if("function"==typeof s&&(e=s,s=void 0),"function"==typeof i&&(e=i,i=null),"closing"===this.readyState||"closed"===this.readyState)return;(i=i||{}).compress=!1!==i.compress;const n={type:t,data:s,options:i};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),e&&this.once("flush",e),this.flush()}close(){const t=()=>{this.F("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?i():t()})):this.upgrading?i():t()),this}j(t){if(Q.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.q();this.emitReserved("error",t),this.F("transport error",t)}F(t,s){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.K),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),z&&(this.I&&removeEventListener("beforeunload",this.I,!1),this.$)){const t=J.indexOf(this.$);-1!==t&&J.splice(t,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this.P=0}}}Q.protocol=4;class K extends Q{constructor(){super(...arguments),this.Z=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let t=0;t<this.Z.length;t++)this.tt(this.Z[t])}tt(t){let s=this.createTransport(t),i=!1;Q.priorWebsocketSuccess=!1;const e=()=>{i||(s.send([{type:"ping",data:"probe"}]),s.once("packet",(t=>{if(!i)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;Q.priorWebsocketSuccess="websocket"===s.name,this.transport.pause((()=>{i||"closed"!==this.readyState&&(a(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())}))}else{const t=new Error("probe error");t.transport=s.name,this.emitReserved("upgradeError",t)}})))};function n(){i||(i=!0,a(),s.close(),s=null)}const r=t=>{const i=new Error("probe error: "+t);i.transport=s.name,n(),this.emitReserved("upgradeError",i)};function o(){r("transport closed")}function h(){r("socket closed")}function c(t){s&&t.name!==s.name&&n()}const a=()=>{s.removeListener("open",e),s.removeListener("error",r),s.removeListener("close",o),this.off("close",h),this.off("upgrading",c)};s.once("open",e),s.once("error",r),s.once("close",o),this.once("close",h),this.once("upgrading",c),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{i||s.open()}),200):s.open()}onHandshake(t){this.Z=this.st(t.upgrades),super.onHandshake(t)}st(t){const s=[];for(let i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&s.push(t[i]);return s}}class Y extends K{constructor(t,s={}){const i="object"==typeof t?t:s;(!i.transports||i.transports&&"string"==typeof i.transports[0])&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map((t=>q[t])).filter((t=>!!t))),super(t,i)}}const G="function"==typeof ArrayBuffer,Z=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,tt=Object.prototype.toString,st="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===tt.call(Blob),it="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===tt.call(File);function et(t){return G&&(t instanceof ArrayBuffer||Z(t))||st&&t instanceof Blob||it&&t instanceof File}function nt(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,i=t.length;s<i;s++)if(nt(t[s]))return!0;return!1}if(et(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return nt(t.toJSON(),!0);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&nt(t[s]))return!0;return!1}function rt(t){const s=[],i=t.data,e=t;return e.data=ot(i,s),e.attachments=s.length,{packet:e,buffers:s}}function ot(t,s){if(!t)return t;if(et(t)){const i={it:!0,num:s.length};return s.push(t),i}if(Array.isArray(t)){const i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=ot(t[e],s);return i}if("object"==typeof t&&!(t instanceof Date)){const i={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=ot(t[e],s));return i}return t}function ht(t,s){return t.data=ct(t.data,s),delete t.attachments,t}function ct(t,s){if(!t)return t;if(t&&!0===t.it){if("number"==typeof t.num&&t.num>=0&&t.num<s.length)return s[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=ct(t[i],s);else if("object"==typeof t)for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=ct(t[i],s));return t}const at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ut=5;var ft;!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"}(ft||(ft={}));class lt extends k{constructor(t){super(),this.reviver=t}add(t){let s;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(t);const i=s.type===ft.BINARY_EVENT;i||s.type===ft.BINARY_ACK?(s.type=i?ft.EVENT:ft.ACK,this.reconstructor=new pt(s),0===s.attachments&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else{if(!et(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");s=this.reconstructor.takeBinaryData(t),s&&(this.reconstructor=null,super.emitReserved("decoded",s))}}decodeString(t){let s=0;const i={type:Number(t.charAt(0))};if(void 0===ft[i.type])throw new Error("unknown packet type "+i.type);if(i.type===ft.BINARY_EVENT||i.type===ft.BINARY_ACK){const e=s+1;for(;"-"!==t.charAt(++s)&&s!=t.length;);const n=t.substring(e,s);if(n!=Number(n)||"-"!==t.charAt(s))throw new Error("Illegal attachments");i.attachments=Number(n)}if("/"===t.charAt(s+1)){const e=s+1;for(;++s;){if(","===t.charAt(s))break;if(s===t.length)break}i.nsp=t.substring(e,s)}else i.nsp="/";const e=t.charAt(s+1);if(""!==e&&Number(e)==e){const e=s+1;for(;++s;){const i=t.charAt(s);if(null==i||Number(i)!=i){--s;break}if(s===t.length)break}i.id=Number(t.substring(e,s+1))}if(t.charAt(++s)){const e=this.tryParse(t.substr(s));if(!lt.isPayloadValid(i.type,e))throw new Error("invalid payload");i.data=e}return i}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,s){switch(t){case ft.CONNECT:return yt(s);case ft.DISCONNECT:return void 0===s;case ft.CONNECT_ERROR:return"string"==typeof s||yt(s);case ft.EVENT:case ft.BINARY_EVENT:return Array.isArray(s)&&("number"==typeof s[0]||"string"==typeof s[0]&&-1===at.indexOf(s[0]));case ft.ACK:case ft.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=ht(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const dt=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function yt(t){return"[object Object]"===Object.prototype.toString.call(t)}var gt=Object.freeze({__proto__:null,protocol:5,get PacketType(){return ft},Encoder:class{constructor(t){this.replacer=t}encode(t){return t.type!==ft.EVENT&&t.type!==ft.ACK||!nt(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===ft.EVENT?ft.BINARY_EVENT:ft.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let s=""+t.type;return t.type!==ft.BINARY_EVENT&&t.type!==ft.BINARY_ACK||(s+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(s+=t.nsp+","),null!=t.id&&(s+=t.id),null!=t.data&&(s+=JSON.stringify(t.data,this.replacer)),s}encodeAsBinary(t){const s=rt(t),i=this.encodeAsString(s.packet),e=s.buffers;return e.unshift(i),e}},Decoder:lt,isPacketValid:function(t){return"string"==typeof t.nsp&&(void 0===(s=t.id)||dt(s))&&function(t,s){switch(t){case ft.CONNECT:return void 0===s||yt(s);case ft.DISCONNECT:return void 0===s;case ft.EVENT:return Array.isArray(s)&&("number"==typeof s[0]||"string"==typeof s[0]&&-1===at.indexOf(s[0]));case ft.ACK:return Array.isArray(s);case ft.CONNECT_ERROR:return"string"==typeof s||yt(s);default:return!1}}(t.type,t.data);var s}});function bt(t,s,i){return t.on(s,i),function(){t.off(s,i)}}const wt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vt extends k{constructor(t,s,i){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this.et=[],this.nt=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=s,i&&i.auth&&(this.auth=i.auth),this.p=Object.assign({},i),this.io.rt&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[bt(t,"open",this.onopen.bind(this)),bt(t,"packet",this.onpacket.bind(this)),bt(t,"error",this.onerror.bind(this)),bt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io.ot||this.io.open(),"open"===this.io.ht&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...s){var i,e,n;if(wt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(s.unshift(t),this.p.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.ct(s),this;const r={type:ft.EVENT,data:s,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof s[s.length-1]){const t=this.ids++,i=s.pop();this.ut(t,i),r.id=t}const o=null===(e=null===(i=this.io.engine)||void 0===i?void 0:i.transport)||void 0===e?void 0:e.writable,h=this.connected&&!(null===(n=this.io.engine)||void 0===n?void 0:n.G());return this.flags.volatile&&!o||(h?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}ut(t,s){var i;const e=null!==(i=this.flags.timeout)&&void 0!==i?i:this.p.ackTimeout;if(void 0===e)return void(this.acks[t]=s);const n=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);s.call(this,new Error("operation has timed out"))}),e),r=(...t)=>{this.io.clearTimeoutFn(n),s.apply(this,t)};r.withError=!0,this.acks[t]=r}emitWithAck(t,...s){return new Promise(((i,e)=>{const n=(t,s)=>t?e(t):i(s);n.withError=!0,s.push(n),this.emit(t,...s)}))}ct(t){let s;"function"==typeof t[t.length-1]&&(s=t.pop());const i={id:this.nt++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...e)=>{if(i!==this.et[0])return;return null!==t?i.tryCount>this.p.retries&&(this.et.shift(),s&&s(t)):(this.et.shift(),s&&s(null,...e)),i.pending=!1,this.ft()})),this.et.push(i),this.ft()}ft(t=!1){if(!this.connected||0===this.et.length)return;const s=this.et[0];s.pending&&!t||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(t){t.nsp=this.nsp,this.io.lt(t)}onopen(){"function"==typeof this.auth?this.auth((t=>{this.dt(t)})):this.dt(this.auth)}dt(t){this.packet({type:ft.CONNECT,data:this.yt?Object.assign({pid:this.yt,offset:this.gt},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,s),this.bt()}bt(){Object.keys(this.acks).forEach((t=>{if(!this.sendBuffer.some((s=>String(s.id)===t))){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}}))}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ft.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 ft.EVENT:case ft.BINARY_EVENT:this.onevent(t);break;case ft.ACK:case ft.BINARY_ACK:this.onack(t);break;case ft.DISCONNECT:this.ondisconnect();break;case ft.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s)}}onevent(t){const s=t.data||[];null!=t.id&&s.push(this.ack(t.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(t){if(this.wt&&this.wt.length){const s=this.wt.slice();for(const i of s)i.apply(this,t)}super.emit.apply(this,t),this.yt&&t.length&&"string"==typeof t[t.length-1]&&(this.gt=t[t.length-1])}ack(t){const s=this;let i=!1;return function(...e){i||(i=!0,s.packet({type:ft.ACK,id:t,data:e}))}}onack(t){const s=this.acks[t.id];"function"==typeof s&&(delete this.acks[t.id],s.withError&&t.data.unshift(null),s.apply(this,t.data))}onconnect(t,s){this.id=t,this.recovered=s&&this.yt===s,this.yt=s,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.ft(!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.vt(this)}disconnect(){return this.connected&&this.packet({type:ft.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.wt=this.wt||[],this.wt.push(t),this}prependAny(t){return this.wt=this.wt||[],this.wt.unshift(t),this}offAny(t){if(!this.wt)return this;if(t){const s=this.wt;for(let i=0;i<s.length;i++)if(t===s[i])return s.splice(i,1),this}else this.wt=[];return this}listenersAny(){return this.wt||[]}onAnyOutgoing(t){return this.kt=this.kt||[],this.kt.push(t),this}prependAnyOutgoing(t){return this.kt=this.kt||[],this.kt.unshift(t),this}offAnyOutgoing(t){if(!this.kt)return this;if(t){const s=this.kt;for(let i=0;i<s.length;i++)if(t===s[i])return s.splice(i,1),this}else this.kt=[];return this}listenersAnyOutgoing(){return this.kt||[]}notifyOutgoingListeners(t){if(this.kt&&this.kt.length){const s=this.kt.slice();for(const i of s)i.apply(this,t.data)}}}function mt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}mt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var s=Math.random(),i=Math.floor(s*this.jitter*t);t=1&Math.floor(10*s)?t+i:t-i}return 0|Math.min(t,this.max)},mt.prototype.reset=function(){this.attempts=0},mt.prototype.setMin=function(t){this.ms=t},mt.prototype.setMax=function(t){this.max=t},mt.prototype.setJitter=function(t){this.jitter=t};class kt extends k{constructor(t,s){var i;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(s=t,t=void 0),(s=s||{}).path=s.path||"/socket.io",this.opts=s,B(this,s),this.reconnection(!1!==s.reconnection),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(i=s.randomizationFactor)&&void 0!==i?i:.5),this.backoff=new mt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==s.timeout?2e4:s.timeout),this.ht="closed",this.uri=t;const e=s.parser||gt;this.encoder=new e.Encoder,this.decoder=new e.Decoder,this.rt=!1!==s.autoConnect,this.rt&&this.open()}reconnection(t){return arguments.length?(this.At=!!t,t||(this.skipReconnect=!0),this):this.At}reconnectionAttempts(t){return void 0===t?this.Et:(this.Et=t,this)}reconnectionDelay(t){var s;return void 0===t?this.Ot:(this.Ot=t,null===(s=this.backoff)||void 0===s||s.setMin(t),this)}randomizationFactor(t){var s;return void 0===t?this._t:(this._t=t,null===(s=this.backoff)||void 0===s||s.setJitter(t),this)}reconnectionDelayMax(t){var s;return void 0===t?this.jt:(this.jt=t,null===(s=this.backoff)||void 0===s||s.setMax(t),this)}timeout(t){return arguments.length?(this.Bt=t,this):this.Bt}maybeReconnectOnOpen(){!this.ot&&this.At&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this.ht.indexOf("open"))return this;this.engine=new Y(this.uri,this.opts);const s=this.engine,i=this;this.ht="opening",this.skipReconnect=!1;const e=bt(s,"open",(function(){i.onopen(),t&&t()})),n=s=>{this.cleanup(),this.ht="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},r=bt(s,"error",n);if(!1!==this.Bt){const t=this.Bt,i=this.setTimeoutFn((()=>{e(),n(new Error("timeout")),s.close()}),t);this.opts.autoUnref&&i.unref(),this.subs.push((()=>{this.clearTimeoutFn(i)}))}return this.subs.push(e),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this.ht="open",this.emitReserved("open");const t=this.engine;this.subs.push(bt(t,"ping",this.onping.bind(this)),bt(t,"data",this.ondata.bind(this)),bt(t,"error",this.onerror.bind(this)),bt(t,"close",this.onclose.bind(this)),bt(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){A((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,s){let i=this.nsps[t];return i?this.rt&&!i.active&&i.connect():(i=new vt(this,t,s),this.nsps[t]=i),i}vt(t){const s=Object.keys(this.nsps);for(const t of s){if(this.nsps[t].active)return}this.xt()}lt(t){const s=this.encoder.encode(t);for(let i=0;i<s.length;i++)this.engine.write(s[i],t.options)}cleanup(){this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}xt(){this.skipReconnect=!0,this.ot=!1,this.onclose("forced close")}disconnect(){return this.xt()}onclose(t,s){var i;this.cleanup(),null===(i=this.engine)||void 0===i||i.close(),this.backoff.reset(),this.ht="closed",this.emitReserved("close",t,s),this.At&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this.ot||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this.Et)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.ot=!1;else{const s=this.backoff.duration();this.ot=!0;const i=this.setTimeoutFn((()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((s=>{s?(t.ot=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()})))}),s);this.opts.autoUnref&&i.unref(),this.subs.push((()=>{this.clearTimeoutFn(i)}))}}onreconnect(){const t=this.backoff.attempts;this.ot=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const At={};function Et(t,s){"object"==typeof t&&(s=t,t=void 0);const i=function(t,s="",i){let e=t;i=i||"undefined"!=typeof location&&location,null==t&&(t=i.protocol+"//"+i.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?i.protocol+t:i.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==i?i.protocol+"//"+t:"https://"+t),e=W(t)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";const n=-1!==e.host.indexOf(":")?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+s,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}(t,(s=s||{}).path||"/socket.io"),e=i.source,n=i.id,r=i.path,o=At[n]&&r in At[n].nsps;let h;return s.forceNew||s["force new connection"]||!1===s.multiplex||o?h=new kt(e,s):(At[n]||(At[n]=new kt(e,s)),h=At[n]),i.query&&!s.query&&(s.query=i.queryKey),h.socket(i.path,s)}Object.assign(Et,{Manager:kt,Socket:vt,io:Et,connect:Et});export{kt as Manager,vt as Socket,Et as connect,Et as default,Et as io,ut as protocol}; | ||
const t=Object.create(null);t.open="0",t.close="1",t.ping="2",t.pong="3",t.message="4",t.upgrade="5",t.noop="6";const s=Object.create(null);Object.keys(t).forEach((i=>{s[t[i]]=i}));const i={type:"error",data:"parser error"},e="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),n="function"==typeof ArrayBuffer,r=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,o=({type:s,data:i},o,c)=>e&&i instanceof Blob?o?c(i):h(i,c):n&&(i instanceof ArrayBuffer||r(i))?o?c(i):h(new Blob([i]),c):c(t[s]+(i||"")),h=(t,s)=>{const i=new FileReader;return i.onload=function(){const t=i.result.split(",")[1];s("b"+(t||""))},i.readAsDataURL(t)};function c(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let a;const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)f[u.charCodeAt(t)]=t;const l="function"==typeof ArrayBuffer,d=(t,e)=>{if("string"!=typeof t)return{type:"message",data:y(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:p(t.substring(1),e)};return s[n]?t.length>1?{type:s[n],data:t.substring(1)}:{type:s[n]}:i},p=(t,s)=>{if(l){const i=(t=>{let s,i,e,n,r,o=.75*t.length,h=t.length,c=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);const a=new ArrayBuffer(o),u=new Uint8Array(a);for(s=0;s<h;s+=4)i=f[t.charCodeAt(s)],e=f[t.charCodeAt(s+1)],n=f[t.charCodeAt(s+2)],r=f[t.charCodeAt(s+3)],u[c++]=i<<2|e>>4,u[c++]=(15&e)<<4|n>>2,u[c++]=(3&n)<<6|63&r;return a})(t);return y(i,s)}return{base64:!0,data:t}},y=(t,s)=>"blob"===s?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,b=String.fromCharCode(30);function g(){return new TransformStream({transform(t,s){!function(t,s){e&&t.data instanceof Blob?t.data.arrayBuffer().then(c).then(s):n&&(t.data instanceof ArrayBuffer||r(t.data))?s(c(t.data)):o(t,!1,(t=>{a||(a=new TextEncoder),s(a.encode(t))}))}(t,(i=>{const e=i.length;let n;if(e<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,e);else if(e<65536){n=new Uint8Array(3);const t=new DataView(n.buffer);t.setUint8(0,126),t.setUint16(1,e)}else{n=new Uint8Array(9);const t=new DataView(n.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(e))}t.data&&"string"!=typeof t.data&&(n[0]|=128),s.enqueue(n),s.enqueue(i)}))}})}let w;function v(t){return t.reduce(((t,s)=>t+s.length),0)}function m(t,s){if(t[0].length===s)return t.shift();const i=new Uint8Array(s);let e=0;for(let n=0;n<s;n++)i[n]=t[0][e++],e===t[0].length&&(t.shift(),e=0);return t.length&&e<t[0].length&&(t[0]=t[0].slice(e)),i}function k(t){if(t)return function(t){for(var s in k.prototype)t[s]=k.prototype[s];return t}(t)}k.prototype.on=k.prototype.addEventListener=function(t,s){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(s),this},k.prototype.once=function(t,s){function i(){this.off(t,i),s.apply(this,arguments)}return i.fn=s,this.on(t,i),this},k.prototype.off=k.prototype.removeListener=k.prototype.removeAllListeners=k.prototype.removeEventListener=function(t,s){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var i,e=this.t["$"+t];if(!e)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var n=0;n<e.length;n++)if((i=e[n])===s||i.fn===s){e.splice(n,1);break}return 0===e.length&&delete this.t["$"+t],this},k.prototype.emit=function(t){this.t=this.t||{};for(var s=new Array(arguments.length-1),i=this.t["$"+t],e=1;e<arguments.length;e++)s[e-1]=arguments[e];if(i){e=0;for(var n=(i=i.slice(0)).length;e<n;++e)i[e].apply(this,s)}return this},k.prototype.emitReserved=k.prototype.emit,k.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},k.prototype.hasListeners=function(t){return!!this.listeners(t).length};const A="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,s)=>s(t,0),E="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function O(t,...s){return s.reduce(((s,i)=>(t.hasOwnProperty(i)&&(s[i]=t[i]),s)),{})}const _=E.setTimeout,j=E.clearTimeout;function x(t,s){s.useNativeTimers?(t.setTimeoutFn=_.bind(E),t.clearTimeoutFn=j.bind(E)):(t.setTimeoutFn=E.setTimeout.bind(E),t.clearTimeoutFn=E.clearTimeout.bind(E))}function B(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class C extends Error{constructor(t,s,i){super(t),this.description=s,this.context=i,this.type="TransportError"}}class T extends k{constructor(t){super(),this.writable=!1,x(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,s,i){return super.emitReserved("error",new C(t,s,i)),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){const s=d(t,this.socket.binaryType);this.onPacket(s)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,s={}){return t+"://"+this.i()+this.o()+this.opts.path+this.h(s)}i(){const t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"}o(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}h(t){const s=function(t){let s="";for(let i in t)t.hasOwnProperty(i)&&(s.length&&(s+="&"),s+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return s}(t);return s.length?"?"+s:""}}class N extends T{constructor(){super(...arguments),this.u=!1}get name(){return"polling"}doOpen(){this.l()}pause(t){this.readyState="pausing";const s=()=>{this.readyState="paused",t()};if(this.u||!this.writable){let t=0;this.u&&(t++,this.once("pollComplete",(function(){--t||s()}))),this.writable||(t++,this.once("drain",(function(){--t||s()})))}else s()}l(){this.u=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,s)=>{const i=t.split(b),e=[];for(let t=0;t<i.length;t++){const n=d(i[t],s);if(e.push(n),"error"===n.type)break}return e})(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.u=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.l())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,s)=>{const i=t.length,e=new Array(i);let n=0;t.forEach(((t,r)=>{o(t,!1,(t=>{e[r]=t,++n===i&&s(e.join(b))}))}))})(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return!1!==this.opts.timestampRequests&&(s[this.opts.timestampParam]=B()),this.supportsBinary||s.sid||(s.b64=1),this.createUri(t,s)}}let U=!1;try{U="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const P=U;function D(){}class M extends N{constructor(t){if(super(t),"undefined"!=typeof location){const s="https:"===location.protocol;let i=location.port;i||(i=s?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||i!==t.port}}doWrite(t,s){const i=this.request({method:"POST",data:t});i.on("success",s),i.on("error",((t,s)=>{this.onError("xhr post error",t,s)}))}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,s)=>{this.onError("xhr poll error",t,s)})),this.pollXhr=t}}class S extends k{constructor(t,s,i){super(),this.createRequest=t,x(this,i),this.p=i,this.v=i.method||"GET",this.m=s,this.k=void 0!==i.data?i.data:null,this.A()}A(){var t;const s=O(this.p,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this.p.xd;const i=this.O=this.createRequest(s);try{i.open(this.v,this.m,!0);try{if(this.p.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let t in this.p.extraHeaders)this.p.extraHeaders.hasOwnProperty(t)&&i.setRequestHeader(t,this.p.extraHeaders[t])}}catch(t){}if("POST"===this.v)try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{i.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.p.cookieJar)||void 0===t||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this.p.withCredentials),this.p.requestTimeout&&(i.timeout=this.p.requestTimeout),i.onreadystatechange=()=>{var t;3===i.readyState&&(null===(t=this.p.cookieJar)||void 0===t||t.parseCookies(i.getResponseHeader("set-cookie"))),4===i.readyState&&(200===i.status||1223===i.status?this._():this.setTimeoutFn((()=>{this.j("number"==typeof i.status?i.status:0)}),0))},i.send(this.k)}catch(t){return void this.setTimeoutFn((()=>{this.j(t)}),0)}"undefined"!=typeof document&&(this.B=S.requestsCount++,S.requests[this.B]=this)}j(t){this.emitReserved("error",t,this.O),this.C(!0)}C(t){if(void 0!==this.O&&null!==this.O){if(this.O.onreadystatechange=D,t)try{this.O.abort()}catch(t){}"undefined"!=typeof document&&delete S.requests[this.B],this.O=null}}_(){const t=this.O.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.C())}abort(){this.C()}}if(S.requestsCount=0,S.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",L);else if("function"==typeof addEventListener){addEventListener("onpagehide"in E?"pagehide":"unload",L,!1)}function L(){for(let t in S.requests)S.requests.hasOwnProperty(t)&&S.requests[t].abort()}const R=function(){const t=F({xdomain:!1});return t&&null!==t.responseType}();class I extends M{constructor(t){super(t);const s=t&&t.forceBase64;this.supportsBinary=R&&!s}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new S(F,this.uri(),t)}}function F(t){const s=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!s||P))return new XMLHttpRequest}catch(t){}if(!s)try{return new(E[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}const $="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class V extends T{get name(){return"websocket"}doOpen(){const t=this.uri(),s=this.opts.protocols,i=$?{}:O(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,s,i)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws.T.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 s=0;s<t.length;s++){const i=t[s],e=s===t.length-1;o(i,this.supportsBinary,(t=>{try{this.doWrite(i,t)}catch(t){}e&&A((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=B()),this.supportsBinary||(s.b64=1),this.createUri(t,s)}}const H=E.WebSocket||E.MozWebSocket;class W extends V{createSocket(t,s,i){return $?new H(t,s,i):s?new H(t,s):new H(t)}doWrite(t,s){this.ws.send(s)}}class q extends T{get name(){return"webtransport"}doOpen(){try{this.N=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.N.closed.then((()=>{this.onClose()})).catch((t=>{this.onError("webtransport error",t)})),this.N.ready.then((()=>{this.N.createBidirectionalStream().then((t=>{const s=function(t,s){w||(w=new TextDecoder);const e=[];let n=0,r=-1,o=!1;return new TransformStream({transform(h,c){for(e.push(h);;){if(0===n){if(v(e)<1)break;const t=m(e,1);o=!(128&~t[0]),r=127&t[0],n=r<126?3:126===r?1:2}else if(1===n){if(v(e)<2)break;const t=m(e,2);r=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),n=3}else if(2===n){if(v(e)<8)break;const t=m(e,8),s=new DataView(t.buffer,t.byteOffset,t.length),o=s.getUint32(0);if(o>Math.pow(2,21)-1){c.enqueue(i);break}r=o*Math.pow(2,32)+s.getUint32(4),n=3}else{if(v(e)<r)break;const t=m(e,r);c.enqueue(d(o?t:w.decode(t),s)),n=0}if(0===r||r>t){c.enqueue(i);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(s).getReader(),n=g();n.readable.pipeTo(t.writable),this.U=n.writable.getWriter();const r=()=>{e.read().then((({done:t,value:s})=>{t||(this.onPacket(s),r())})).catch((t=>{}))};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.U.write(o).then((()=>this.onOpen()))}))}))}write(t){this.writable=!1;for(let s=0;s<t.length;s++){const i=t[s],e=s===t.length-1;this.U.write(i).then((()=>{e&&A((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var t;null===(t=this.N)||void 0===t||t.close()}}const X={websocket:W,webtransport:q,polling:I},z=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,J=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Q(t){if(t.length>8e3)throw"URI too long";const s=t,i=t.indexOf("["),e=t.indexOf("]");-1!=i&&-1!=e&&(t=t.substring(0,i)+t.substring(i,e).replace(/:/g,";")+t.substring(e,t.length));let n=z.exec(t||""),r={},o=14;for(;o--;)r[J[o]]=n[o]||"";return-1!=i&&-1!=e&&(r.source=s,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=function(t,s){const i=/\/{2,9}/g,e=s.replace(i,"/").split("/");"/"!=s.slice(0,1)&&0!==s.length||e.splice(0,1);"/"==s.slice(-1)&&e.splice(e.length-1,1);return e}(0,r.path),r.queryKey=function(t,s){const i={};return s.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,s,e){s&&(i[s]=e)})),i}(0,r.query),r}const G="function"==typeof addEventListener&&"function"==typeof removeEventListener,K=[];G&&addEventListener("offline",(()=>{K.forEach((t=>t()))}),!1);class Y extends k{constructor(t,s){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this.P=0,this.D=-1,this.M=-1,this.S=-1,this.L=1/0,t&&"object"==typeof t&&(s=t,t=null),t){const i=Q(t);s.hostname=i.host,s.secure="https"===i.protocol||"wss"===i.protocol,s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=Q(s.host).host);x(this,s),this.secure=null!=s.secure?s.secure:"undefined"!=typeof location&&"https:"===location.protocol,s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=s.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this.R={},s.transports.forEach((t=>{const s=t.prototype.name;this.transports.push(s),this.R[s]=t})),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},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let s={},i=t.split("&");for(let t=0,e=i.length;t<e;t++){let e=i[t].split("=");s[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return s}(this.opts.query)),G&&(this.opts.closeOnBeforeunload&&(this.I=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.I,!1)),"localhost"!==this.hostname&&(this.F=()=>{this.$("transport close",{description:"network connection lost"})},K.push(this.F))),this.opts.withCredentials&&(this.V=void 0),this.H()}createTransport(t){const s=Object.assign({},this.opts.query);s.EIO=4,s.transport=t,this.id&&(s.sid=this.id);const i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.R[t](i)}H(){if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);const t=this.opts.rememberUpgrade&&Y.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.W.bind(this)).on("packet",this.q.bind(this)).on("error",this.j.bind(this)).on("close",(t=>this.$("transport close",t)))}onOpen(){this.readyState="open",Y.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}q(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.X("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.J();break;case"error":const s=new Error("server error");s.code=t.data,this.j(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.D=t.pingInterval,this.M=t.pingTimeout,this.S=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.J()}J(){this.clearTimeoutFn(this.G);const t=this.D+this.M;this.L=Date.now()+t,this.G=this.setTimeoutFn((()=>{this.$("ping timeout")}),t),this.opts.autoUnref&&this.G.unref()}W(){this.writeBuffer.splice(0,this.P),this.P=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.K();this.transport.send(t),this.P=t.length,this.emitReserved("flush")}}K(){if(!(this.S&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i<this.writeBuffer.length;i++){const e=this.writeBuffer[i].data;if(e&&(t+="string"==typeof(s=e)?function(t){let s=0,i=0;for(let e=0,n=t.length;e<n;e++)s=t.charCodeAt(e),s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(e++,i+=4);return i}(s):Math.ceil(1.33*(s.byteLength||s.size))),i>0&&t>this.S)return this.writeBuffer.slice(0,i);t+=2}var s;return this.writeBuffer}Y(){if(!this.L)return!0;const t=Date.now()>this.L;return t&&(this.L=0,A((()=>{this.$("ping timeout")}),this.setTimeoutFn)),t}write(t,s,i){return this.X("message",t,s,i),this}send(t,s,i){return this.X("message",t,s,i),this}X(t,s,i,e){if("function"==typeof s&&(e=s,s=void 0),"function"==typeof i&&(e=i,i=null),"closing"===this.readyState||"closed"===this.readyState)return;(i=i||{}).compress=!1!==i.compress;const n={type:t,data:s,options:i};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),e&&this.once("flush",e),this.flush()}close(){const t=()=>{this.$("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?i():t()})):this.upgrading?i():t()),this}j(t){if(Y.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.H();this.emitReserved("error",t),this.$("transport error",t)}$(t,s){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.G),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),G&&(this.I&&removeEventListener("beforeunload",this.I,!1),this.F)){const t=K.indexOf(this.F);-1!==t&&K.splice(t,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this.P=0}}}Y.protocol=4;class Z extends Y{constructor(){super(...arguments),this.Z=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let t=0;t<this.Z.length;t++)this.tt(this.Z[t])}tt(t){let s=this.createTransport(t),i=!1;Y.priorWebsocketSuccess=!1;const e=()=>{i||(s.send([{type:"ping",data:"probe"}]),s.once("packet",(t=>{if(!i)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;Y.priorWebsocketSuccess="websocket"===s.name,this.transport.pause((()=>{i||"closed"!==this.readyState&&(a(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())}))}else{const t=new Error("probe error");t.transport=s.name,this.emitReserved("upgradeError",t)}})))};function n(){i||(i=!0,a(),s.close(),s=null)}const r=t=>{const i=new Error("probe error: "+t);i.transport=s.name,n(),this.emitReserved("upgradeError",i)};function o(){r("transport closed")}function h(){r("socket closed")}function c(t){s&&t.name!==s.name&&n()}const a=()=>{s.removeListener("open",e),s.removeListener("error",r),s.removeListener("close",o),this.off("close",h),this.off("upgrading",c)};s.once("open",e),s.once("error",r),s.once("close",o),this.once("close",h),this.once("upgrading",c),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{i||s.open()}),200):s.open()}onHandshake(t){this.Z=this.st(t.upgrades),super.onHandshake(t)}st(t){const s=[];for(let i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&s.push(t[i]);return s}}class tt extends Z{constructor(t,s={}){const i="object"==typeof t?t:s;(!i.transports||i.transports&&"string"==typeof i.transports[0])&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map((t=>X[t])).filter((t=>!!t))),super(t,i)}}class st extends N{doPoll(){this.it().then((t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then((t=>this.onData(t)))})).catch((t=>{this.onError("fetch read error",t)}))}doWrite(t,s){this.it(t).then((t=>{if(!t.ok)return this.onError("fetch write error",t.status,t);s()})).catch((t=>{this.onError("fetch write error",t)}))}it(t){var s;const i=void 0!==t,e=new Headers(this.opts.extraHeaders);return i&&e.set("content-type","text/plain;charset=UTF-8"),null===(s=this.socket.V)||void 0===s||s.appendCookies(e),fetch(this.uri(),{method:i?"POST":"GET",body:i?t:null,headers:e,credentials:this.opts.withCredentials?"include":"omit"}).then((t=>{var s;return null===(s=this.socket.V)||void 0===s||s.parseCookies(t.headers.getSetCookie()),t}))}}const it="function"==typeof ArrayBuffer,et=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,nt=Object.prototype.toString,rt="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===nt.call(Blob),ot="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===nt.call(File);function ht(t){return it&&(t instanceof ArrayBuffer||et(t))||rt&&t instanceof Blob||ot&&t instanceof File}function ct(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,i=t.length;s<i;s++)if(ct(t[s]))return!0;return!1}if(ht(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return ct(t.toJSON(),!0);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&ct(t[s]))return!0;return!1}function at(t){const s=[],i=t.data,e=t;return e.data=ut(i,s),e.attachments=s.length,{packet:e,buffers:s}}function ut(t,s){if(!t)return t;if(ht(t)){const i={et:!0,num:s.length};return s.push(t),i}if(Array.isArray(t)){const i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=ut(t[e],s);return i}if("object"==typeof t&&!(t instanceof Date)){const i={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=ut(t[e],s));return i}return t}function ft(t,s){return t.data=lt(t.data,s),delete t.attachments,t}function lt(t,s){if(!t)return t;if(t&&!0===t.et){if("number"==typeof t.num&&t.num>=0&&t.num<s.length)return s[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=lt(t[i],s);else if("object"==typeof t)for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=lt(t[i],s));return t}const dt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],pt=5;var yt;!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"}(yt||(yt={}));class bt extends k{constructor(t){super(),this.reviver=t}add(t){let s;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(t);const i=s.type===yt.BINARY_EVENT;i||s.type===yt.BINARY_ACK?(s.type=i?yt.EVENT:yt.ACK,this.reconstructor=new gt(s),0===s.attachments&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else{if(!ht(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");s=this.reconstructor.takeBinaryData(t),s&&(this.reconstructor=null,super.emitReserved("decoded",s))}}decodeString(t){let s=0;const i={type:Number(t.charAt(0))};if(void 0===yt[i.type])throw new Error("unknown packet type "+i.type);if(i.type===yt.BINARY_EVENT||i.type===yt.BINARY_ACK){const e=s+1;for(;"-"!==t.charAt(++s)&&s!=t.length;);const n=t.substring(e,s);if(n!=Number(n)||"-"!==t.charAt(s))throw new Error("Illegal attachments");i.attachments=Number(n)}if("/"===t.charAt(s+1)){const e=s+1;for(;++s;){if(","===t.charAt(s))break;if(s===t.length)break}i.nsp=t.substring(e,s)}else i.nsp="/";const e=t.charAt(s+1);if(""!==e&&Number(e)==e){const e=s+1;for(;++s;){const i=t.charAt(s);if(null==i||Number(i)!=i){--s;break}if(s===t.length)break}i.id=Number(t.substring(e,s+1))}if(t.charAt(++s)){const e=this.tryParse(t.substr(s));if(!bt.isPayloadValid(i.type,e))throw new Error("invalid payload");i.data=e}return i}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,s){switch(t){case yt.CONNECT:return vt(s);case yt.DISCONNECT:return void 0===s;case yt.CONNECT_ERROR:return"string"==typeof s||vt(s);case yt.EVENT:case yt.BINARY_EVENT:return Array.isArray(s)&&("number"==typeof s[0]||"string"==typeof s[0]&&-1===dt.indexOf(s[0]));case yt.ACK:case yt.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class gt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=ft(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const wt=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function vt(t){return"[object Object]"===Object.prototype.toString.call(t)}var mt=Object.freeze({__proto__:null,protocol:5,get PacketType(){return yt},Encoder:class{constructor(t){this.replacer=t}encode(t){return t.type!==yt.EVENT&&t.type!==yt.ACK||!ct(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===yt.EVENT?yt.BINARY_EVENT:yt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let s=""+t.type;return t.type!==yt.BINARY_EVENT&&t.type!==yt.BINARY_ACK||(s+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(s+=t.nsp+","),null!=t.id&&(s+=t.id),null!=t.data&&(s+=JSON.stringify(t.data,this.replacer)),s}encodeAsBinary(t){const s=at(t),i=this.encodeAsString(s.packet),e=s.buffers;return e.unshift(i),e}},Decoder:bt,isPacketValid:function(t){return"string"==typeof t.nsp&&(void 0===(s=t.id)||wt(s))&&function(t,s){switch(t){case yt.CONNECT:return void 0===s||vt(s);case yt.DISCONNECT:return void 0===s;case yt.EVENT:return Array.isArray(s)&&("number"==typeof s[0]||"string"==typeof s[0]&&-1===dt.indexOf(s[0]));case yt.ACK:return Array.isArray(s);case yt.CONNECT_ERROR:return"string"==typeof s||vt(s);default:return!1}}(t.type,t.data);var s}});function kt(t,s,i){return t.on(s,i),function(){t.off(s,i)}}const At=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Et extends k{constructor(t,s,i){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this.nt=[],this.rt=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=s,i&&i.auth&&(this.auth=i.auth),this.p=Object.assign({},i),this.io.ot&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[kt(t,"open",this.onopen.bind(this)),kt(t,"packet",this.onpacket.bind(this)),kt(t,"error",this.onerror.bind(this)),kt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io.ht||this.io.open(),"open"===this.io.ct&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...s){var i,e,n;if(At.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(s.unshift(t),this.p.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.ut(s),this;const r={type:yt.EVENT,data:s,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof s[s.length-1]){const t=this.ids++,i=s.pop();this.ft(t,i),r.id=t}const o=null===(e=null===(i=this.io.engine)||void 0===i?void 0:i.transport)||void 0===e?void 0:e.writable,h=this.connected&&!(null===(n=this.io.engine)||void 0===n?void 0:n.Y());return this.flags.volatile&&!o||(h?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}ft(t,s){var i;const e=null!==(i=this.flags.timeout)&&void 0!==i?i:this.p.ackTimeout;if(void 0===e)return void(this.acks[t]=s);const n=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);s.call(this,new Error("operation has timed out"))}),e),r=(...t)=>{this.io.clearTimeoutFn(n),s.apply(this,t)};r.withError=!0,this.acks[t]=r}emitWithAck(t,...s){return new Promise(((i,e)=>{const n=(t,s)=>t?e(t):i(s);n.withError=!0,s.push(n),this.emit(t,...s)}))}ut(t){let s;"function"==typeof t[t.length-1]&&(s=t.pop());const i={id:this.rt++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...e)=>{if(i!==this.nt[0])return;return null!==t?i.tryCount>this.p.retries&&(this.nt.shift(),s&&s(t)):(this.nt.shift(),s&&s(null,...e)),i.pending=!1,this.lt()})),this.nt.push(i),this.lt()}lt(t=!1){if(!this.connected||0===this.nt.length)return;const s=this.nt[0];s.pending&&!t||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(t){t.nsp=this.nsp,this.io.dt(t)}onopen(){"function"==typeof this.auth?this.auth((t=>{this.yt(t)})):this.yt(this.auth)}yt(t){this.packet({type:yt.CONNECT,data:this.bt?Object.assign({pid:this.bt,offset:this.gt},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,s),this.wt()}wt(){Object.keys(this.acks).forEach((t=>{if(!this.sendBuffer.some((s=>String(s.id)===t))){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}}))}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case yt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 yt.EVENT:case yt.BINARY_EVENT:this.onevent(t);break;case yt.ACK:case yt.BINARY_ACK:this.onack(t);break;case yt.DISCONNECT:this.ondisconnect();break;case yt.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s)}}onevent(t){const s=t.data||[];null!=t.id&&s.push(this.ack(t.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(t){if(this.vt&&this.vt.length){const s=this.vt.slice();for(const i of s)i.apply(this,t)}super.emit.apply(this,t),this.bt&&t.length&&"string"==typeof t[t.length-1]&&(this.gt=t[t.length-1])}ack(t){const s=this;let i=!1;return function(...e){i||(i=!0,s.packet({type:yt.ACK,id:t,data:e}))}}onack(t){const s=this.acks[t.id];"function"==typeof s&&(delete this.acks[t.id],s.withError&&t.data.unshift(null),s.apply(this,t.data))}onconnect(t,s){this.id=t,this.recovered=s&&this.bt===s,this.bt=s,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.lt(!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.kt(this)}disconnect(){return this.connected&&this.packet({type:yt.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.vt=this.vt||[],this.vt.push(t),this}prependAny(t){return this.vt=this.vt||[],this.vt.unshift(t),this}offAny(t){if(!this.vt)return this;if(t){const s=this.vt;for(let i=0;i<s.length;i++)if(t===s[i])return s.splice(i,1),this}else this.vt=[];return this}listenersAny(){return this.vt||[]}onAnyOutgoing(t){return this.At=this.At||[],this.At.push(t),this}prependAnyOutgoing(t){return this.At=this.At||[],this.At.unshift(t),this}offAnyOutgoing(t){if(!this.At)return this;if(t){const s=this.At;for(let i=0;i<s.length;i++)if(t===s[i])return s.splice(i,1),this}else this.At=[];return this}listenersAnyOutgoing(){return this.At||[]}notifyOutgoingListeners(t){if(this.At&&this.At.length){const s=this.At.slice();for(const i of s)i.apply(this,t.data)}}}function Ot(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Ot.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var s=Math.random(),i=Math.floor(s*this.jitter*t);t=1&Math.floor(10*s)?t+i:t-i}return 0|Math.min(t,this.max)},Ot.prototype.reset=function(){this.attempts=0},Ot.prototype.setMin=function(t){this.ms=t},Ot.prototype.setMax=function(t){this.max=t},Ot.prototype.setJitter=function(t){this.jitter=t};class _t extends k{constructor(t,s){var i;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(s=t,t=void 0),(s=s||{}).path=s.path||"/socket.io",this.opts=s,x(this,s),this.reconnection(!1!==s.reconnection),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(i=s.randomizationFactor)&&void 0!==i?i:.5),this.backoff=new Ot({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==s.timeout?2e4:s.timeout),this.ct="closed",this.uri=t;const e=s.parser||mt;this.encoder=new e.Encoder,this.decoder=new e.Decoder,this.ot=!1!==s.autoConnect,this.ot&&this.open()}reconnection(t){return arguments.length?(this.Et=!!t,t||(this.skipReconnect=!0),this):this.Et}reconnectionAttempts(t){return void 0===t?this.Ot:(this.Ot=t,this)}reconnectionDelay(t){var s;return void 0===t?this._t:(this._t=t,null===(s=this.backoff)||void 0===s||s.setMin(t),this)}randomizationFactor(t){var s;return void 0===t?this.jt:(this.jt=t,null===(s=this.backoff)||void 0===s||s.setJitter(t),this)}reconnectionDelayMax(t){var s;return void 0===t?this.xt:(this.xt=t,null===(s=this.backoff)||void 0===s||s.setMax(t),this)}timeout(t){return arguments.length?(this.Bt=t,this):this.Bt}maybeReconnectOnOpen(){!this.ht&&this.Et&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this.ct.indexOf("open"))return this;this.engine=new tt(this.uri,this.opts);const s=this.engine,i=this;this.ct="opening",this.skipReconnect=!1;const e=kt(s,"open",(function(){i.onopen(),t&&t()})),n=s=>{this.cleanup(),this.ct="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},r=kt(s,"error",n);if(!1!==this.Bt){const t=this.Bt,i=this.setTimeoutFn((()=>{e(),n(new Error("timeout")),s.close()}),t);this.opts.autoUnref&&i.unref(),this.subs.push((()=>{this.clearTimeoutFn(i)}))}return this.subs.push(e),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this.ct="open",this.emitReserved("open");const t=this.engine;this.subs.push(kt(t,"ping",this.onping.bind(this)),kt(t,"data",this.ondata.bind(this)),kt(t,"error",this.onerror.bind(this)),kt(t,"close",this.onclose.bind(this)),kt(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){A((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,s){let i=this.nsps[t];return i?this.ot&&!i.active&&i.connect():(i=new Et(this,t,s),this.nsps[t]=i),i}kt(t){const s=Object.keys(this.nsps);for(const t of s){if(this.nsps[t].active)return}this.Ct()}dt(t){const s=this.encoder.encode(t);for(let i=0;i<s.length;i++)this.engine.write(s[i],t.options)}cleanup(){this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}Ct(){this.skipReconnect=!0,this.ht=!1,this.onclose("forced close")}disconnect(){return this.Ct()}onclose(t,s){var i;this.cleanup(),null===(i=this.engine)||void 0===i||i.close(),this.backoff.reset(),this.ct="closed",this.emitReserved("close",t,s),this.Et&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this.ht||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this.Ot)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.ht=!1;else{const s=this.backoff.duration();this.ht=!0;const i=this.setTimeoutFn((()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((s=>{s?(t.ht=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()})))}),s);this.opts.autoUnref&&i.unref(),this.subs.push((()=>{this.clearTimeoutFn(i)}))}}onreconnect(){const t=this.backoff.attempts;this.ht=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const jt={};function xt(t,s){"object"==typeof t&&(s=t,t=void 0);const i=function(t,s="",i){let e=t;i=i||"undefined"!=typeof location&&location,null==t&&(t=i.protocol+"//"+i.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?i.protocol+t:i.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==i?i.protocol+"//"+t:"https://"+t),e=Q(t)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";const n=-1!==e.host.indexOf(":")?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+s,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}(t,(s=s||{}).path||"/socket.io"),e=i.source,n=i.id,r=i.path,o=jt[n]&&r in jt[n].nsps;let h;return s.forceNew||s["force new connection"]||!1===s.multiplex||o?h=new _t(e,s):(jt[n]||(jt[n]=new _t(e,s)),h=jt[n]),i.query&&!s.query&&(s.query=i.queryKey),h.socket(i.path,s)}Object.assign(xt,{Manager:_t,Socket:Et,io:xt,connect:xt});export{st as Fetch,_t as Manager,W as NodeWebSocket,I as NodeXHR,Et as Socket,W as WebSocket,q as WebTransport,I as XHR,xt as connect,xt as default,xt as io,pt as protocol}; | ||
//# sourceMappingURL=socket.io.esm.min.js.map |
/*! | ||
* Socket.IO v4.8.0 | ||
* Socket.IO v4.8.1 | ||
* (c) 2014-2024 Guillermo Rauch | ||
* Released under the MIT License. | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).io=n()}(this,(function(){"use strict";function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=Array(n);i<n;i++)r[i]=t[i];return r}function n(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,f(r.key),r)}}function i(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(n,i){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=function(n,i){if(n){if("string"==typeof n)return t(n,i);var r={}.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,i):void 0}}(n))||i&&n&&"number"==typeof n.length){r&&(n=r);var e=0,o=function(){};return{s:o,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,h=!1;return{s:function(){r=r.call(n)},n:function(){var t=r.next();return u=t.done,t},e:function(t){h=!0,s=t},f:function(){try{u||null==r.return||r.return()}finally{if(h)throw s}}}}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},e.apply(null,arguments)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function s(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,h(t,n)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(u=function(){return!!t})()}function h(t,n){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},h(t,n)}function f(t){var n=function(t,n){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:n+""}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function a(t){var n="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,i)}function i(){return function(t,n,i){if(u())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,n);var e=new(t.bind.apply(t,r));return i&&h(e,i.prototype),e}(t,arguments,o(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),h(i,t)},a(t)}var v=Object.create(null);v.open="0",v.close="1",v.ping="2",v.pong="3",v.message="4",v.upgrade="5",v.noop="6";var l=Object.create(null);Object.keys(v).forEach((function(t){l[v[t]]=t}));var p,d={type:"error",data:"parser error"},y="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),b="function"==typeof ArrayBuffer,w=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},g=function(t,n,i){var r=t.type,e=t.data;return y&&e instanceof Blob?n?i(e):m(e,i):b&&(e instanceof ArrayBuffer||w(e))?n?i(e):m(new Blob([e]),i):i(v[r]+(e||""))},m=function(t,n){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];n("b"+(t||""))},i.readAsDataURL(t)};function k(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}for(var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256),E=0;E<64;E++)j[A.charCodeAt(E)]=E;var O,B="function"==typeof ArrayBuffer,S=function(t,n){if("string"!=typeof t)return{type:"message",data:C(t,n)};var i=t.charAt(0);return"b"===i?{type:"message",data:N(t.substring(1),n)}:l[i]?t.length>1?{type:l[i],data:t.substring(1)}:{type:l[i]}:d},N=function(t,n){if(B){var i=function(t){var n,i,r,e,o,s=.75*t.length,u=t.length,h=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var f=new ArrayBuffer(s),c=new Uint8Array(f);for(n=0;n<u;n+=4)i=j[t.charCodeAt(n)],r=j[t.charCodeAt(n+1)],e=j[t.charCodeAt(n+2)],o=j[t.charCodeAt(n+3)],c[h++]=i<<2|r>>4,c[h++]=(15&r)<<4|e>>2,c[h++]=(3&e)<<6|63&o;return f}(t);return C(i,n)}return{base64:!0,data:t}},C=function(t,n){return"blob"===n?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer},T=String.fromCharCode(30);function U(){return new TransformStream({transform:function(t,n){!function(t,n){y&&t.data instanceof Blob?t.data.arrayBuffer().then(k).then(n):b&&(t.data instanceof ArrayBuffer||w(t.data))?n(k(t.data)):g(t,!1,(function(t){p||(p=new TextEncoder),n(p.encode(t))}))}(t,(function(i){var r,e=i.length;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);var o=new DataView(r.buffer);o.setUint8(0,126),o.setUint16(1,e)}else{r=new Uint8Array(9);var s=new DataView(r.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(e))}t.data&&"string"!=typeof t.data&&(r[0]|=128),n.enqueue(r),n.enqueue(i)}))}})}function M(t){return t.reduce((function(t,n){return t+n.length}),0)}function x(t,n){if(t[0].length===n)return t.shift();for(var i=new Uint8Array(n),r=0,e=0;e<n;e++)i[e]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),i}function I(t){if(t)return function(t){for(var n in I.prototype)t[n]=I.prototype[n];return t}(t)}I.prototype.on=I.prototype.addEventListener=function(t,n){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(n),this},I.prototype.once=function(t,n){function i(){this.off(t,i),n.apply(this,arguments)}return i.fn=n,this.on(t,i),this},I.prototype.off=I.prototype.removeListener=I.prototype.removeAllListeners=I.prototype.removeEventListener=function(t,n){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var i,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var e=0;e<r.length;e++)if((i=r[e])===n||i.fn===n){r.splice(e,1);break}return 0===r.length&&delete this.t["$"+t],this},I.prototype.emit=function(t){this.t=this.t||{};for(var n=new Array(arguments.length-1),i=this.t["$"+t],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(i){r=0;for(var e=(i=i.slice(0)).length;r<e;++r)i[r].apply(this,n)}return this},I.prototype.emitReserved=I.prototype.emit,I.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},I.prototype.hasListeners=function(t){return!!this.listeners(t).length};var R="function"==typeof Promise&&"function"==typeof Promise.resolve?function(t){return Promise.resolve().then(t)}:function(t,n){return n(t,0)},L="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function _(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.reduce((function(n,i){return t.hasOwnProperty(i)&&(n[i]=t[i]),n}),{})}var D=L.setTimeout,P=L.clearTimeout;function $(t,n){n.useNativeTimers?(t.setTimeoutFn=D.bind(L),t.clearTimeoutFn=P.bind(L)):(t.setTimeoutFn=L.setTimeout.bind(L),t.clearTimeoutFn=L.clearTimeout.bind(L))}function F(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var V=function(t){function n(n,i,r){var e;return(e=t.call(this,n)||this).description=i,e.context=r,e.type="TransportError",e}return s(n,t),n}(a(Error)),q=function(t){function n(n){var i;return(i=t.call(this)||this).writable=!1,$(i,n),i.opts=n,i.query=n.query,i.socket=n.socket,i.supportsBinary=!n.forceBase64,i}s(n,t);var i=n.prototype;return i.onError=function(n,i,r){return t.prototype.emitReserved.call(this,"error",new V(n,i,r)),this},i.open=function(){return this.readyState="opening",this.doOpen(),this},i.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.send=function(t){"open"===this.readyState&&this.write(t)},i.onOpen=function(){this.readyState="open",this.writable=!0,t.prototype.emitReserved.call(this,"open")},i.onData=function(t){var n=S(t,this.socket.binaryType);this.onPacket(n)},i.onPacket=function(n){t.prototype.emitReserved.call(this,"packet",n)},i.onClose=function(n){this.readyState="closed",t.prototype.emitReserved.call(this,"close",n)},i.pause=function(t){},i.createUri=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t+"://"+this.i()+this.o()+this.opts.path+this.u(n)},i.i=function(){var t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"},i.o=function(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""},i.u=function(t){var n=function(t){var n="";for(var i in t)t.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return n}(t);return n.length?"?"+n:""},n}(I),X=function(t){function n(){var n;return(n=t.apply(this,arguments)||this).h=!1,n}s(n,t);var r=n.prototype;return r.doOpen=function(){this.v()},r.pause=function(t){var n=this;this.readyState="pausing";var i=function(){n.readyState="paused",t()};if(this.h||!this.writable){var r=0;this.h&&(r++,this.once("pollComplete",(function(){--r||i()}))),this.writable||(r++,this.once("drain",(function(){--r||i()})))}else i()},r.v=function(){this.h=!0,this.doPoll(),this.emitReserved("poll")},r.onData=function(t){var n=this;(function(t,n){for(var i=t.split(T),r=[],e=0;e<i.length;e++){var o=S(i[e],n);if(r.push(o),"error"===o.type)break}return r})(t,this.socket.binaryType).forEach((function(t){if("opening"===n.readyState&&"open"===t.type&&n.onOpen(),"close"===t.type)return n.onClose({description:"transport closed by the server"}),!1;n.onPacket(t)})),"closed"!==this.readyState&&(this.h=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.v())},r.doClose=function(){var t=this,n=function(){t.write([{type:"close"}])};"open"===this.readyState?n():this.once("open",n)},r.write=function(t){var n=this;this.writable=!1,function(t,n){var i=t.length,r=new Array(i),e=0;t.forEach((function(t,o){g(t,!1,(function(t){r[o]=t,++e===i&&n(r.join(T))}))}))}(t,(function(t){n.doWrite(t,(function(){n.writable=!0,n.emitReserved("drain")}))}))},r.uri=function(){var t=this.opts.secure?"https":"http",n=this.query||{};return!1!==this.opts.timestampRequests&&(n[this.opts.timestampParam]=F()),this.supportsBinary||n.sid||(n.b64=1),this.createUri(t,n)},i(n,[{key:"name",get:function(){return"polling"}}])}(q),H=!1;try{H="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}var z=H;function J(){}var K=function(t){function n(n){var i;if(i=t.call(this,n)||this,"undefined"!=typeof location){var r="https:"===location.protocol,e=location.port;e||(e=r?"443":"80"),i.xd="undefined"!=typeof location&&n.hostname!==location.hostname||e!==n.port}return i}s(n,t);var i=n.prototype;return i.doWrite=function(t,n){var i=this,r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(function(t,n){i.onError("xhr post error",t,n)}))},i.doPoll=function(){var t=this,n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(function(n,i){t.onError("xhr poll error",n,i)})),this.pollXhr=n},n}(X),Y=function(t){function n(n,i,r){var e;return(e=t.call(this)||this).createRequest=n,$(e,r),e.l=r,e.p=r.method||"GET",e.m=i,e.k=void 0!==r.data?r.data:null,e.A(),e}s(n,t);var i=n.prototype;return i.A=function(){var t,i=this,r=_(this.l,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.l.xd;var e=this.j=this.createRequest(r);try{e.open(this.p,this.m,!0);try{if(this.l.extraHeaders)for(var o in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.l.extraHeaders)this.l.extraHeaders.hasOwnProperty(o)&&e.setRequestHeader(o,this.l.extraHeaders[o])}catch(t){}if("POST"===this.p)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.l.cookieJar)||void 0===t||t.addCookies(e),"withCredentials"in e&&(e.withCredentials=this.l.withCredentials),this.l.requestTimeout&&(e.timeout=this.l.requestTimeout),e.onreadystatechange=function(){var t;3===e.readyState&&(null===(t=i.l.cookieJar)||void 0===t||t.parseCookies(e.getResponseHeader("set-cookie"))),4===e.readyState&&(200===e.status||1223===e.status?i.O():i.setTimeoutFn((function(){i.B("number"==typeof e.status?e.status:0)}),0))},e.send(this.k)}catch(t){return void this.setTimeoutFn((function(){i.B(t)}),0)}"undefined"!=typeof document&&(this.S=n.requestsCount++,n.requests[this.S]=this)},i.B=function(t){this.emitReserved("error",t,this.j),this.N(!0)},i.N=function(t){if(void 0!==this.j&&null!==this.j){if(this.j.onreadystatechange=J,t)try{this.j.abort()}catch(t){}"undefined"!=typeof document&&delete n.requests[this.S],this.j=null}},i.O=function(){var t=this.j.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.N())},i.abort=function(){this.N()},n}(I);if(Y.requestsCount=0,Y.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",G);else if("function"==typeof addEventListener){addEventListener("onpagehide"in L?"pagehide":"unload",G,!1)}function G(){for(var t in Y.requests)Y.requests.hasOwnProperty(t)&&Y.requests[t].abort()}var Q,W=(Q=tt({xdomain:!1}))&&null!==Q.responseType,Z=function(t){function n(n){var i;i=t.call(this,n)||this;var r=n&&n.forceBase64;return i.supportsBinary=W&&!r,i}return s(n,t),n.prototype.request=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e(t,{xd:this.xd},this.opts),new Y(tt,this.uri(),t)},n}(K);function tt(t){var n=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!n||z))return new XMLHttpRequest}catch(t){}if(!n)try{return new(L[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}var nt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),it=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var r=n.prototype;return r.doOpen=function(){var t=this.uri(),n=this.opts.protocols,i=nt?{}:_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,i)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()},r.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws.C.unref(),t.onOpen()},this.ws.onclose=function(n){return t.onClose({description:"websocket connection closed",context:n})},this.ws.onmessage=function(n){return t.onData(n.data)},this.ws.onerror=function(n){return t.onError("websocket error",n)}},r.write=function(t){var n=this;this.writable=!1;for(var i=function(){var i=t[r],e=r===t.length-1;g(i,n.supportsBinary,(function(t){try{n.doWrite(i,t)}catch(t){}e&&R((function(){n.writable=!0,n.emitReserved("drain")}),n.setTimeoutFn)}))},r=0;r<t.length;r++)i()},r.doClose=function(){void 0!==this.ws&&(this.ws.close(),this.ws=null)},r.uri=function(){var t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=F()),this.supportsBinary||(n.b64=1),this.createUri(t,n)},i(n,[{key:"name",get:function(){return"websocket"}}])}(q),rt=L.WebSocket||L.MozWebSocket,et=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var i=n.prototype;return i.createSocket=function(t,n,i){return nt?new rt(t,n,i):n?new rt(t,n):new rt(t)},i.doWrite=function(t,n){this.ws.send(n)},n}(it),ot=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var r=n.prototype;return r.doOpen=function(){var t=this;try{this.T=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.T.closed.then((function(){t.onClose()})).catch((function(n){t.onError("webtransport error",n)})),this.T.ready.then((function(){t.T.createBidirectionalStream().then((function(n){var i=function(t,n){O||(O=new TextDecoder);var i=[],r=0,e=-1,o=!1;return new TransformStream({transform:function(s,u){for(i.push(s);;){if(0===r){if(M(i)<1)break;var h=x(i,1);o=!(128&~h[0]),e=127&h[0],r=e<126?3:126===e?1:2}else if(1===r){if(M(i)<2)break;var f=x(i,2);e=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),r=3}else if(2===r){if(M(i)<8)break;var c=x(i,8),a=new DataView(c.buffer,c.byteOffset,c.length),v=a.getUint32(0);if(v>Math.pow(2,21)-1){u.enqueue(d);break}e=v*Math.pow(2,32)+a.getUint32(4),r=3}else{if(M(i)<e)break;var l=x(i,e);u.enqueue(S(o?l:O.decode(l),n)),r=0}if(0===e||e>t){u.enqueue(d);break}}}})}(Number.MAX_SAFE_INTEGER,t.socket.binaryType),r=n.readable.pipeThrough(i).getReader(),e=U();e.readable.pipeTo(n.writable),t.U=e.writable.getWriter();!function n(){r.read().then((function(i){var r=i.done,e=i.value;r||(t.onPacket(e),n())})).catch((function(t){}))}();var o={type:"open"};t.query.sid&&(o.data='{"sid":"'.concat(t.query.sid,'"}')),t.U.write(o).then((function(){return t.onOpen()}))}))}))},r.write=function(t){var n=this;this.writable=!1;for(var i=function(){var i=t[r],e=r===t.length-1;n.U.write(i).then((function(){e&&R((function(){n.writable=!0,n.emitReserved("drain")}),n.setTimeoutFn)}))},r=0;r<t.length;r++)i()},r.doClose=function(){var t;null===(t=this.T)||void 0===t||t.close()},i(n,[{key:"name",get:function(){return"webtransport"}}])}(q),st={websocket:et,webtransport:ot,polling:Z},ut=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ht=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ft(t){if(t.length>8e3)throw"URI too long";var n=t,i=t.indexOf("["),r=t.indexOf("]");-1!=i&&-1!=r&&(t=t.substring(0,i)+t.substring(i,r).replace(/:/g,";")+t.substring(r,t.length));for(var e,o,s=ut.exec(t||""),u={},h=14;h--;)u[ht[h]]=s[h]||"";return-1!=i&&-1!=r&&(u.source=n,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=function(t,n){var i=/\/{2,9}/g,r=n.replace(i,"/").split("/");"/"!=n.slice(0,1)&&0!==n.length||r.splice(0,1);"/"==n.slice(-1)&&r.splice(r.length-1,1);return r}(0,u.path),u.queryKey=(e=u.query,o={},e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,n,i){n&&(o[n]=i)})),o),u}var ct="function"==typeof addEventListener&&"function"==typeof removeEventListener,at=[];ct&&addEventListener("offline",(function(){at.forEach((function(t){return t()}))}),!1);var vt=function(t){function n(n,i){var r;if((r=t.call(this)||this).binaryType="arraybuffer",r.writeBuffer=[],r.M=0,r.I=-1,r.R=-1,r.L=-1,r._=1/0,n&&"object"===c(n)&&(i=n,n=null),n){var o=ft(n);i.hostname=o.host,i.secure="https"===o.protocol||"wss"===o.protocol,i.port=o.port,o.query&&(i.query=o.query)}else i.host&&(i.hostname=ft(i.host).host);return $(r,i),r.secure=null!=i.secure?i.secure:"undefined"!=typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=r.secure?"443":"80"),r.hostname=i.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=i.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=[],r.D={},i.transports.forEach((function(t){var n=t.prototype.name;r.transports.push(n),r.D[n]=t})),r.opts=e({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),r.opts.path=r.opts.path.replace(/\/$/,"")+(r.opts.addTrailingSlash?"/":""),"string"==typeof r.opts.query&&(r.opts.query=function(t){for(var n={},i=t.split("&"),r=0,e=i.length;r<e;r++){var o=i[r].split("=");n[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return n}(r.opts.query)),ct&&(r.opts.closeOnBeforeunload&&(r.P=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.P,!1)),"localhost"!==r.hostname&&(r.$=function(){r.F("transport close",{description:"network connection lost"})},at.push(r.$))),r.opts.withCredentials&&(r.V=void 0),r.q(),r}s(n,t);var i=n.prototype;return i.createTransport=function(t){var n=e({},this.opts.query);n.EIO=4,n.transport=t,this.id&&(n.sid=this.id);var i=e({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.D[t](i)},i.q=function(){var t=this;if(0!==this.transports.length){var i=this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";var r=this.createTransport(i);r.open(),this.setTransport(r)}else this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0)},i.setTransport=function(t){var n=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.X.bind(this)).on("packet",this.H.bind(this)).on("error",this.B.bind(this)).on("close",(function(t){return n.F("transport close",t)}))},i.onOpen=function(){this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()},i.H=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.J("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.K();break;case"error":var n=new Error("server error");n.code=t.data,this.B(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}},i.onHandshake=function(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.I=t.pingInterval,this.R=t.pingTimeout,this.L=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.K()},i.K=function(){var t=this;this.clearTimeoutFn(this.Y);var n=this.I+this.R;this._=Date.now()+n,this.Y=this.setTimeoutFn((function(){t.F("ping timeout")}),n),this.opts.autoUnref&&this.Y.unref()},i.X=function(){this.writeBuffer.splice(0,this.M),this.M=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()},i.flush=function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var t=this.G();this.transport.send(t),this.M=t.length,this.emitReserved("flush")}},i.G=function(){if(!(this.L&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var t,n=1,i=0;i<this.writeBuffer.length;i++){var r=this.writeBuffer[i].data;if(r&&(n+="string"==typeof(t=r)?function(t){for(var n=0,i=0,r=0,e=t.length;r<e;r++)(n=t.charCodeAt(r))<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(r++,i+=4);return i}(t):Math.ceil(1.33*(t.byteLength||t.size))),i>0&&n>this.L)return this.writeBuffer.slice(0,i);n+=2}return this.writeBuffer},i.W=function(){var t=this;if(!this._)return!0;var n=Date.now()>this._;return n&&(this._=0,R((function(){t.F("ping timeout")}),this.setTimeoutFn)),n},i.write=function(t,n,i){return this.J("message",t,n,i),this},i.send=function(t,n,i){return this.J("message",t,n,i),this},i.J=function(t,n,i,r){if("function"==typeof n&&(r=n,n=void 0),"function"==typeof i&&(r=i,i=null),"closing"!==this.readyState&&"closed"!==this.readyState){(i=i||{}).compress=!1!==i.compress;var e={type:t,data:n,options:i};this.emitReserved("packetCreate",e),this.writeBuffer.push(e),r&&this.once("flush",r),this.flush()}},i.close=function(){var t=this,n=function(){t.F("forced close"),t.transport.close()},i=function i(){t.off("upgrade",i),t.off("upgradeError",i),n()},r=function(){t.once("upgrade",i),t.once("upgradeError",i)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){t.upgrading?r():n()})):this.upgrading?r():n()),this},i.B=function(t){if(n.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.q();this.emitReserved("error",t),this.F("transport error",t)},i.F=function(t,n){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.Y),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ct&&(this.P&&removeEventListener("beforeunload",this.P,!1),this.$)){var i=at.indexOf(this.$);-1!==i&&at.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.M=0}},n}(I);vt.protocol=4;var lt=function(t){function n(){var n;return(n=t.apply(this,arguments)||this).Z=[],n}s(n,t);var i=n.prototype;return i.onOpen=function(){if(t.prototype.onOpen.call(this),"open"===this.readyState&&this.opts.upgrade)for(var n=0;n<this.Z.length;n++)this.tt(this.Z[n])},i.tt=function(t){var n=this,i=this.createTransport(t),r=!1;vt.priorWebsocketSuccess=!1;var e=function(){r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",(function(t){if(!r)if("pong"===t.type&&"probe"===t.data){if(n.upgrading=!0,n.emitReserved("upgrading",i),!i)return;vt.priorWebsocketSuccess="websocket"===i.name,n.transport.pause((function(){r||"closed"!==n.readyState&&(c(),n.setTransport(i),i.send([{type:"upgrade"}]),n.emitReserved("upgrade",i),i=null,n.upgrading=!1,n.flush())}))}else{var e=new Error("probe error");e.transport=i.name,n.emitReserved("upgradeError",e)}})))};function o(){r||(r=!0,c(),i.close(),i=null)}var s=function(t){var r=new Error("probe error: "+t);r.transport=i.name,o(),n.emitReserved("upgradeError",r)};function u(){s("transport closed")}function h(){s("socket closed")}function f(t){i&&t.name!==i.name&&o()}var c=function(){i.removeListener("open",e),i.removeListener("error",s),i.removeListener("close",u),n.off("close",h),n.off("upgrading",f)};i.once("open",e),i.once("error",s),i.once("close",u),this.once("close",h),this.once("upgrading",f),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((function(){r||i.open()}),200):i.open()},i.onHandshake=function(n){this.Z=this.nt(n.upgrades),t.prototype.onHandshake.call(this,n)},i.nt=function(t){for(var n=[],i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&n.push(t[i]);return n},n}(vt),pt=function(t){function n(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="object"===c(n)?n:i;return(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map((function(t){return st[t]})).filter((function(t){return!!t}))),t.call(this,n,r)||this}return s(n,t),n}(lt);pt.protocol;var dt="function"==typeof ArrayBuffer,yt=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer},bt=Object.prototype.toString,wt="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===bt.call(Blob),gt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===bt.call(File);function mt(t){return dt&&(t instanceof ArrayBuffer||yt(t))||wt&&t instanceof Blob||gt&&t instanceof File}function kt(t,n){if(!t||"object"!==c(t))return!1;if(Array.isArray(t)){for(var i=0,r=t.length;i<r;i++)if(kt(t[i]))return!0;return!1}if(mt(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return kt(t.toJSON(),!0);for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&kt(t[e]))return!0;return!1}function At(t){var n=[],i=t.data,r=t;return r.data=jt(i,n),r.attachments=n.length,{packet:r,buffers:n}}function jt(t,n){if(!t)return t;if(mt(t)){var i={it:!0,num:n.length};return n.push(t),i}if(Array.isArray(t)){for(var r=new Array(t.length),e=0;e<t.length;e++)r[e]=jt(t[e],n);return r}if("object"===c(t)&&!(t instanceof Date)){var o={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=jt(t[s],n));return o}return t}function Et(t,n){return t.data=Ot(t.data,n),delete t.attachments,t}function Ot(t,n){if(!t)return t;if(t&&!0===t.it){if("number"==typeof t.num&&t.num>=0&&t.num<n.length)return n[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(var i=0;i<t.length;i++)t[i]=Ot(t[i],n);else if("object"===c(t))for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Ot(t[r],n));return t}var Bt,St=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];!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"}(Bt||(Bt={}));var Nt=function(){function t(t){this.replacer=t}var n=t.prototype;return n.encode=function(t){return t.type!==Bt.EVENT&&t.type!==Bt.ACK||!kt(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Bt.EVENT?Bt.BINARY_EVENT:Bt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})},n.encodeAsString=function(t){var n=""+t.type;return t.type!==Bt.BINARY_EVENT&&t.type!==Bt.BINARY_ACK||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data&&(n+=JSON.stringify(t.data,this.replacer)),n},n.encodeAsBinary=function(t){var n=At(t),i=this.encodeAsString(n.packet),r=n.buffers;return r.unshift(i),r},t}(),Ct=function(t){function n(n){var i;return(i=t.call(this)||this).reviver=n,i}s(n,t);var i=n.prototype;return i.add=function(n){var i;if("string"==typeof n){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");var r=(i=this.decodeString(n)).type===Bt.BINARY_EVENT;r||i.type===Bt.BINARY_ACK?(i.type=r?Bt.EVENT:Bt.ACK,this.reconstructor=new Tt(i),0===i.attachments&&t.prototype.emitReserved.call(this,"decoded",i)):t.prototype.emitReserved.call(this,"decoded",i)}else{if(!mt(n)&&!n.base64)throw new Error("Unknown type: "+n);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(i=this.reconstructor.takeBinaryData(n))&&(this.reconstructor=null,t.prototype.emitReserved.call(this,"decoded",i))}},i.decodeString=function(t){var i=0,r={type:Number(t.charAt(0))};if(void 0===Bt[r.type])throw new Error("unknown packet type "+r.type);if(r.type===Bt.BINARY_EVENT||r.type===Bt.BINARY_ACK){for(var e=i+1;"-"!==t.charAt(++i)&&i!=t.length;);var o=t.substring(e,i);if(o!=Number(o)||"-"!==t.charAt(i))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(i+1)){for(var s=i+1;++i;){if(","===t.charAt(i))break;if(i===t.length)break}r.nsp=t.substring(s,i)}else r.nsp="/";var u=t.charAt(i+1);if(""!==u&&Number(u)==u){for(var h=i+1;++i;){var f=t.charAt(i);if(null==f||Number(f)!=f){--i;break}if(i===t.length)break}r.id=Number(t.substring(h,i+1))}if(t.charAt(++i)){var c=this.tryParse(t.substr(i));if(!n.isPayloadValid(r.type,c))throw new Error("invalid payload");r.data=c}return r},i.tryParse=function(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}},n.isPayloadValid=function(t,n){switch(t){case Bt.CONNECT:return Mt(n);case Bt.DISCONNECT:return void 0===n;case Bt.CONNECT_ERROR:return"string"==typeof n||Mt(n);case Bt.EVENT:case Bt.BINARY_EVENT:return Array.isArray(n)&&("number"==typeof n[0]||"string"==typeof n[0]&&-1===St.indexOf(n[0]));case Bt.ACK:case Bt.BINARY_ACK:return Array.isArray(n)}},i.destroy=function(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)},n}(I),Tt=function(){function t(t){this.packet=t,this.buffers=[],this.reconPack=t}var n=t.prototype;return n.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var n=Et(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null},n.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]},t}();var Ut=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function Mt(t){return"[object Object]"===Object.prototype.toString.call(t)}var xt=Object.freeze({__proto__:null,protocol:5,get PacketType(){return Bt},Encoder:Nt,Decoder:Ct,isPacketValid:function(t){return"string"==typeof t.nsp&&(void 0===(n=t.id)||Ut(n))&&function(t,n){switch(t){case Bt.CONNECT:return void 0===n||Mt(n);case Bt.DISCONNECT:return void 0===n;case Bt.EVENT:return Array.isArray(n)&&("number"==typeof n[0]||"string"==typeof n[0]&&-1===St.indexOf(n[0]));case Bt.ACK:return Array.isArray(n);case Bt.CONNECT_ERROR:return"string"==typeof n||Mt(n);default:return!1}}(t.type,t.data);var n}});function It(t,n,i){return t.on(n,i),function(){t.off(n,i)}}var Rt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Lt=function(t){function n(n,i,r){var o;return(o=t.call(this)||this).connected=!1,o.recovered=!1,o.receiveBuffer=[],o.sendBuffer=[],o.rt=[],o.et=0,o.ids=0,o.acks={},o.flags={},o.io=n,o.nsp=i,r&&r.auth&&(o.auth=r.auth),o.l=e({},r),o.io.ot&&o.open(),o}s(n,t);var o=n.prototype;return o.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[It(t,"open",this.onopen.bind(this)),It(t,"packet",this.onpacket.bind(this)),It(t,"error",this.onerror.bind(this)),It(t,"close",this.onclose.bind(this))]}},o.connect=function(){return this.connected||(this.subEvents(),this.io.st||this.io.open(),"open"===this.io.ut&&this.onopen()),this},o.open=function(){return this.connect()},o.send=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.unshift("message"),this.emit.apply(this,n),this},o.emit=function(t){var n,i,r;if(Rt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');for(var e=arguments.length,o=new Array(e>1?e-1:0),s=1;s<e;s++)o[s-1]=arguments[s];if(o.unshift(t),this.l.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.ht(o),this;var u={type:Bt.EVENT,data:o,options:{}};if(u.options.compress=!1!==this.flags.compress,"function"==typeof o[o.length-1]){var h=this.ids++,f=o.pop();this.ft(h,f),u.id=h}var c=null===(i=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===i?void 0:i.writable,a=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r.W());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this},o.ft=function(t,n){var i,r=this,e=null!==(i=this.flags.timeout)&&void 0!==i?i:this.l.ackTimeout;if(void 0!==e){var o=this.io.setTimeoutFn((function(){delete r.acks[t];for(var i=0;i<r.sendBuffer.length;i++)r.sendBuffer[i].id===t&&r.sendBuffer.splice(i,1);n.call(r,new Error("operation has timed out"))}),e),s=function(){r.io.clearTimeoutFn(o);for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];n.apply(r,i)};s.withError=!0,this.acks[t]=s}else this.acks[t]=n},o.emitWithAck=function(t){for(var n=this,i=arguments.length,r=new Array(i>1?i-1:0),e=1;e<i;e++)r[e-1]=arguments[e];return new Promise((function(i,e){var o=function(t,n){return t?e(t):i(n)};o.withError=!0,r.push(o),n.emit.apply(n,[t].concat(r))}))},o.ht=function(t){var n,i=this;"function"==typeof t[t.length-1]&&(n=t.pop());var r={id:this.et++,tryCount:0,pending:!1,args:t,flags:e({fromQueue:!0},this.flags)};t.push((function(t){if(r===i.rt[0]){if(null!==t)r.tryCount>i.l.retries&&(i.rt.shift(),n&&n(t));else if(i.rt.shift(),n){for(var e=arguments.length,o=new Array(e>1?e-1:0),s=1;s<e;s++)o[s-1]=arguments[s];n.apply(void 0,[null].concat(o))}return r.pending=!1,i.ct()}})),this.rt.push(r),this.ct()},o.ct=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.connected&&0!==this.rt.length){var n=this.rt[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}},o.packet=function(t){t.nsp=this.nsp,this.io.vt(t)},o.onopen=function(){var t=this;"function"==typeof this.auth?this.auth((function(n){t.lt(n)})):this.lt(this.auth)},o.lt=function(t){this.packet({type:Bt.CONNECT,data:this.dt?e({pid:this.dt,offset:this.yt},t):t})},o.onerror=function(t){this.connected||this.emitReserved("connect_error",t)},o.onclose=function(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this.bt()},o.bt=function(){var t=this;Object.keys(this.acks).forEach((function(n){if(!t.sendBuffer.some((function(t){return String(t.id)===n}))){var i=t.acks[n];delete t.acks[n],i.withError&&i.call(t,new Error("socket has been disconnected"))}}))},o.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case Bt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 Bt.EVENT:case Bt.BINARY_EVENT:this.onevent(t);break;case Bt.ACK:case Bt.BINARY_ACK:this.onack(t);break;case Bt.DISCONNECT:this.ondisconnect();break;case Bt.CONNECT_ERROR:this.destroy();var n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n)}},o.onevent=function(t){var n=t.data||[];null!=t.id&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))},o.emitEvent=function(n){if(this.wt&&this.wt.length){var i,e=r(this.wt.slice());try{for(e.s();!(i=e.n()).done;){i.value.apply(this,n)}}catch(t){e.e(t)}finally{e.f()}}t.prototype.emit.apply(this,n),this.dt&&n.length&&"string"==typeof n[n.length-1]&&(this.yt=n[n.length-1])},o.ack=function(t){var n=this,i=!1;return function(){if(!i){i=!0;for(var r=arguments.length,e=new Array(r),o=0;o<r;o++)e[o]=arguments[o];n.packet({type:Bt.ACK,id:t,data:e})}}},o.onack=function(t){var n=this.acks[t.id];"function"==typeof n&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))},o.onconnect=function(t,n){this.id=t,this.recovered=n&&this.dt===n,this.dt=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.ct(!0)},o.emitBuffered=function(){var t=this;this.receiveBuffer.forEach((function(n){return t.emitEvent(n)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(n){t.notifyOutgoingListeners(n),t.packet(n)})),this.sendBuffer=[]},o.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},o.destroy=function(){this.subs&&(this.subs.forEach((function(t){return t()})),this.subs=void 0),this.io.gt(this)},o.disconnect=function(){return this.connected&&this.packet({type:Bt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},o.close=function(){return this.disconnect()},o.compress=function(t){return this.flags.compress=t,this},o.timeout=function(t){return this.flags.timeout=t,this},o.onAny=function(t){return this.wt=this.wt||[],this.wt.push(t),this},o.prependAny=function(t){return this.wt=this.wt||[],this.wt.unshift(t),this},o.offAny=function(t){if(!this.wt)return this;if(t){for(var n=this.wt,i=0;i<n.length;i++)if(t===n[i])return n.splice(i,1),this}else this.wt=[];return this},o.listenersAny=function(){return this.wt||[]},o.onAnyOutgoing=function(t){return this.kt=this.kt||[],this.kt.push(t),this},o.prependAnyOutgoing=function(t){return this.kt=this.kt||[],this.kt.unshift(t),this},o.offAnyOutgoing=function(t){if(!this.kt)return this;if(t){for(var n=this.kt,i=0;i<n.length;i++)if(t===n[i])return n.splice(i,1),this}else this.kt=[];return this},o.listenersAnyOutgoing=function(){return this.kt||[]},o.notifyOutgoingListeners=function(t){if(this.kt&&this.kt.length){var n,i=r(this.kt.slice());try{for(i.s();!(n=i.n()).done;){n.value.apply(this,t.data)}}catch(t){i.e(t)}finally{i.f()}}},i(n,[{key:"disconnected",get:function(){return!this.connected}},{key:"active",get:function(){return!!this.subs}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}}])}(I);function _t(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}_t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*t);t=1&Math.floor(10*n)?t+i:t-i}return 0|Math.min(t,this.max)},_t.prototype.reset=function(){this.attempts=0},_t.prototype.setMin=function(t){this.ms=t},_t.prototype.setMax=function(t){this.max=t},_t.prototype.setJitter=function(t){this.jitter=t};var Dt=function(t){function n(n,i){var r,e;(r=t.call(this)||this).nsps={},r.subs=[],n&&"object"===c(n)&&(i=n,n=void 0),(i=i||{}).path=i.path||"/socket.io",r.opts=i,$(r,i),r.reconnection(!1!==i.reconnection),r.reconnectionAttempts(i.reconnectionAttempts||1/0),r.reconnectionDelay(i.reconnectionDelay||1e3),r.reconnectionDelayMax(i.reconnectionDelayMax||5e3),r.randomizationFactor(null!==(e=i.randomizationFactor)&&void 0!==e?e:.5),r.backoff=new _t({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==i.timeout?2e4:i.timeout),r.ut="closed",r.uri=n;var o=i.parser||xt;return r.encoder=new o.Encoder,r.decoder=new o.Decoder,r.ot=!1!==i.autoConnect,r.ot&&r.open(),r}s(n,t);var i=n.prototype;return i.reconnection=function(t){return arguments.length?(this.At=!!t,t||(this.skipReconnect=!0),this):this.At},i.reconnectionAttempts=function(t){return void 0===t?this.jt:(this.jt=t,this)},i.reconnectionDelay=function(t){var n;return void 0===t?this.Et:(this.Et=t,null===(n=this.backoff)||void 0===n||n.setMin(t),this)},i.randomizationFactor=function(t){var n;return void 0===t?this.Ot:(this.Ot=t,null===(n=this.backoff)||void 0===n||n.setJitter(t),this)},i.reconnectionDelayMax=function(t){var n;return void 0===t?this.Bt:(this.Bt=t,null===(n=this.backoff)||void 0===n||n.setMax(t),this)},i.timeout=function(t){return arguments.length?(this.St=t,this):this.St},i.maybeReconnectOnOpen=function(){!this.st&&this.At&&0===this.backoff.attempts&&this.reconnect()},i.open=function(t){var n=this;if(~this.ut.indexOf("open"))return this;this.engine=new pt(this.uri,this.opts);var i=this.engine,r=this;this.ut="opening",this.skipReconnect=!1;var e=It(i,"open",(function(){r.onopen(),t&&t()})),o=function(i){n.cleanup(),n.ut="closed",n.emitReserved("error",i),t?t(i):n.maybeReconnectOnOpen()},s=It(i,"error",o);if(!1!==this.St){var u=this.St,h=this.setTimeoutFn((function(){e(),o(new Error("timeout")),i.close()}),u);this.opts.autoUnref&&h.unref(),this.subs.push((function(){n.clearTimeoutFn(h)}))}return this.subs.push(e),this.subs.push(s),this},i.connect=function(t){return this.open(t)},i.onopen=function(){this.cleanup(),this.ut="open",this.emitReserved("open");var t=this.engine;this.subs.push(It(t,"ping",this.onping.bind(this)),It(t,"data",this.ondata.bind(this)),It(t,"error",this.onerror.bind(this)),It(t,"close",this.onclose.bind(this)),It(this.decoder,"decoded",this.ondecoded.bind(this)))},i.onping=function(){this.emitReserved("ping")},i.ondata=function(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}},i.ondecoded=function(t){var n=this;R((function(){n.emitReserved("packet",t)}),this.setTimeoutFn)},i.onerror=function(t){this.emitReserved("error",t)},i.socket=function(t,n){var i=this.nsps[t];return i?this.ot&&!i.active&&i.connect():(i=new Lt(this,t,n),this.nsps[t]=i),i},i.gt=function(t){for(var n=0,i=Object.keys(this.nsps);n<i.length;n++){var r=i[n];if(this.nsps[r].active)return}this.Nt()},i.vt=function(t){for(var n=this.encoder.encode(t),i=0;i<n.length;i++)this.engine.write(n[i],t.options)},i.cleanup=function(){this.subs.forEach((function(t){return t()})),this.subs.length=0,this.decoder.destroy()},i.Nt=function(){this.skipReconnect=!0,this.st=!1,this.onclose("forced close")},i.disconnect=function(){return this.Nt()},i.onclose=function(t,n){var i;this.cleanup(),null===(i=this.engine)||void 0===i||i.close(),this.backoff.reset(),this.ut="closed",this.emitReserved("close",t,n),this.At&&!this.skipReconnect&&this.reconnect()},i.reconnect=function(){var t=this;if(this.st||this.skipReconnect)return this;var n=this;if(this.backoff.attempts>=this.jt)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.st=!1;else{var i=this.backoff.duration();this.st=!0;var r=this.setTimeoutFn((function(){n.skipReconnect||(t.emitReserved("reconnect_attempt",n.backoff.attempts),n.skipReconnect||n.open((function(i){i?(n.st=!1,n.reconnect(),t.emitReserved("reconnect_error",i)):n.onreconnect()})))}),i);this.opts.autoUnref&&r.unref(),this.subs.push((function(){t.clearTimeoutFn(r)}))}},i.onreconnect=function(){var t=this.backoff.attempts;this.st=!1,this.backoff.reset(),this.emitReserved("reconnect",t)},n}(I),Pt={};function $t(t,n){"object"===c(t)&&(n=t,t=void 0);var i,r=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,r=t;i=i||"undefined"!=typeof location&&location,null==t&&(t=i.protocol+"//"+i.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?i.protocol+t:i.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==i?i.protocol+"//"+t:"https://"+t),r=ft(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var e=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+e+":"+r.port+n,r.href=r.protocol+"://"+e+(i&&i.port===r.port?"":":"+r.port),r}(t,(n=n||{}).path||"/socket.io"),e=r.source,o=r.id,s=r.path,u=Pt[o]&&s in Pt[o].nsps;return n.forceNew||n["force new connection"]||!1===n.multiplex||u?i=new Dt(e,n):(Pt[o]||(Pt[o]=new Dt(e,n)),i=Pt[o]),r.query&&!n.query&&(n.query=r.queryKey),i.socket(r.path,n)}return e($t,{Manager:Dt,Socket:Lt,io:$t,connect:$t}),$t})); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).io=n()}(this,(function(){"use strict";function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=Array(n);i<n;i++)r[i]=t[i];return r}function n(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,f(r.key),r)}}function i(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(n,i){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=function(n,i){if(n){if("string"==typeof n)return t(n,i);var r={}.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,i):void 0}}(n))||i&&n&&"number"==typeof n.length){r&&(n=r);var e=0,o=function(){};return{s:o,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,h=!1;return{s:function(){r=r.call(n)},n:function(){var t=r.next();return u=t.done,t},e:function(t){h=!0,s=t},f:function(){try{u||null==r.return||r.return()}finally{if(h)throw s}}}}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},e.apply(null,arguments)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function s(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,h(t,n)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(u=function(){return!!t})()}function h(t,n){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},h(t,n)}function f(t){var n=function(t,n){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:n+""}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function a(t){var n="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,i)}function i(){return function(t,n,i){if(u())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,n);var e=new(t.bind.apply(t,r));return i&&h(e,i.prototype),e}(t,arguments,o(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),h(i,t)},a(t)}var v=Object.create(null);v.open="0",v.close="1",v.ping="2",v.pong="3",v.message="4",v.upgrade="5",v.noop="6";var l=Object.create(null);Object.keys(v).forEach((function(t){l[v[t]]=t}));var p,d={type:"error",data:"parser error"},y="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),b="function"==typeof ArrayBuffer,w=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},g=function(t,n,i){var r=t.type,e=t.data;return y&&e instanceof Blob?n?i(e):m(e,i):b&&(e instanceof ArrayBuffer||w(e))?n?i(e):m(new Blob([e]),i):i(v[r]+(e||""))},m=function(t,n){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];n("b"+(t||""))},i.readAsDataURL(t)};function k(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}for(var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256),E=0;E<64;E++)j[A.charCodeAt(E)]=E;var O,B="function"==typeof ArrayBuffer,S=function(t,n){if("string"!=typeof t)return{type:"message",data:C(t,n)};var i=t.charAt(0);return"b"===i?{type:"message",data:N(t.substring(1),n)}:l[i]?t.length>1?{type:l[i],data:t.substring(1)}:{type:l[i]}:d},N=function(t,n){if(B){var i=function(t){var n,i,r,e,o,s=.75*t.length,u=t.length,h=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var f=new ArrayBuffer(s),c=new Uint8Array(f);for(n=0;n<u;n+=4)i=j[t.charCodeAt(n)],r=j[t.charCodeAt(n+1)],e=j[t.charCodeAt(n+2)],o=j[t.charCodeAt(n+3)],c[h++]=i<<2|r>>4,c[h++]=(15&r)<<4|e>>2,c[h++]=(3&e)<<6|63&o;return f}(t);return C(i,n)}return{base64:!0,data:t}},C=function(t,n){return"blob"===n?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer},T=String.fromCharCode(30);function U(){return new TransformStream({transform:function(t,n){!function(t,n){y&&t.data instanceof Blob?t.data.arrayBuffer().then(k).then(n):b&&(t.data instanceof ArrayBuffer||w(t.data))?n(k(t.data)):g(t,!1,(function(t){p||(p=new TextEncoder),n(p.encode(t))}))}(t,(function(i){var r,e=i.length;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);var o=new DataView(r.buffer);o.setUint8(0,126),o.setUint16(1,e)}else{r=new Uint8Array(9);var s=new DataView(r.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(e))}t.data&&"string"!=typeof t.data&&(r[0]|=128),n.enqueue(r),n.enqueue(i)}))}})}function M(t){return t.reduce((function(t,n){return t+n.length}),0)}function x(t,n){if(t[0].length===n)return t.shift();for(var i=new Uint8Array(n),r=0,e=0;e<n;e++)i[e]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),i}function I(t){if(t)return function(t){for(var n in I.prototype)t[n]=I.prototype[n];return t}(t)}I.prototype.on=I.prototype.addEventListener=function(t,n){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(n),this},I.prototype.once=function(t,n){function i(){this.off(t,i),n.apply(this,arguments)}return i.fn=n,this.on(t,i),this},I.prototype.off=I.prototype.removeListener=I.prototype.removeAllListeners=I.prototype.removeEventListener=function(t,n){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var i,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var e=0;e<r.length;e++)if((i=r[e])===n||i.fn===n){r.splice(e,1);break}return 0===r.length&&delete this.t["$"+t],this},I.prototype.emit=function(t){this.t=this.t||{};for(var n=new Array(arguments.length-1),i=this.t["$"+t],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(i){r=0;for(var e=(i=i.slice(0)).length;r<e;++r)i[r].apply(this,n)}return this},I.prototype.emitReserved=I.prototype.emit,I.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},I.prototype.hasListeners=function(t){return!!this.listeners(t).length};var R="function"==typeof Promise&&"function"==typeof Promise.resolve?function(t){return Promise.resolve().then(t)}:function(t,n){return n(t,0)},L="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function _(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.reduce((function(n,i){return t.hasOwnProperty(i)&&(n[i]=t[i]),n}),{})}var D=L.setTimeout,P=L.clearTimeout;function $(t,n){n.useNativeTimers?(t.setTimeoutFn=D.bind(L),t.clearTimeoutFn=P.bind(L)):(t.setTimeoutFn=L.setTimeout.bind(L),t.clearTimeoutFn=L.clearTimeout.bind(L))}function F(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var V=function(t){function n(n,i,r){var e;return(e=t.call(this,n)||this).description=i,e.context=r,e.type="TransportError",e}return s(n,t),n}(a(Error)),q=function(t){function n(n){var i;return(i=t.call(this)||this).writable=!1,$(i,n),i.opts=n,i.query=n.query,i.socket=n.socket,i.supportsBinary=!n.forceBase64,i}s(n,t);var i=n.prototype;return i.onError=function(n,i,r){return t.prototype.emitReserved.call(this,"error",new V(n,i,r)),this},i.open=function(){return this.readyState="opening",this.doOpen(),this},i.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.send=function(t){"open"===this.readyState&&this.write(t)},i.onOpen=function(){this.readyState="open",this.writable=!0,t.prototype.emitReserved.call(this,"open")},i.onData=function(t){var n=S(t,this.socket.binaryType);this.onPacket(n)},i.onPacket=function(n){t.prototype.emitReserved.call(this,"packet",n)},i.onClose=function(n){this.readyState="closed",t.prototype.emitReserved.call(this,"close",n)},i.pause=function(t){},i.createUri=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t+"://"+this.i()+this.o()+this.opts.path+this.u(n)},i.i=function(){var t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"},i.o=function(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""},i.u=function(t){var n=function(t){var n="";for(var i in t)t.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return n}(t);return n.length?"?"+n:""},n}(I),X=function(t){function n(){var n;return(n=t.apply(this,arguments)||this).h=!1,n}s(n,t);var r=n.prototype;return r.doOpen=function(){this.v()},r.pause=function(t){var n=this;this.readyState="pausing";var i=function(){n.readyState="paused",t()};if(this.h||!this.writable){var r=0;this.h&&(r++,this.once("pollComplete",(function(){--r||i()}))),this.writable||(r++,this.once("drain",(function(){--r||i()})))}else i()},r.v=function(){this.h=!0,this.doPoll(),this.emitReserved("poll")},r.onData=function(t){var n=this;(function(t,n){for(var i=t.split(T),r=[],e=0;e<i.length;e++){var o=S(i[e],n);if(r.push(o),"error"===o.type)break}return r})(t,this.socket.binaryType).forEach((function(t){if("opening"===n.readyState&&"open"===t.type&&n.onOpen(),"close"===t.type)return n.onClose({description:"transport closed by the server"}),!1;n.onPacket(t)})),"closed"!==this.readyState&&(this.h=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.v())},r.doClose=function(){var t=this,n=function(){t.write([{type:"close"}])};"open"===this.readyState?n():this.once("open",n)},r.write=function(t){var n=this;this.writable=!1,function(t,n){var i=t.length,r=new Array(i),e=0;t.forEach((function(t,o){g(t,!1,(function(t){r[o]=t,++e===i&&n(r.join(T))}))}))}(t,(function(t){n.doWrite(t,(function(){n.writable=!0,n.emitReserved("drain")}))}))},r.uri=function(){var t=this.opts.secure?"https":"http",n=this.query||{};return!1!==this.opts.timestampRequests&&(n[this.opts.timestampParam]=F()),this.supportsBinary||n.sid||(n.b64=1),this.createUri(t,n)},i(n,[{key:"name",get:function(){return"polling"}}])}(q),H=!1;try{H="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}var z=H;function J(){}var K=function(t){function n(n){var i;if(i=t.call(this,n)||this,"undefined"!=typeof location){var r="https:"===location.protocol,e=location.port;e||(e=r?"443":"80"),i.xd="undefined"!=typeof location&&n.hostname!==location.hostname||e!==n.port}return i}s(n,t);var i=n.prototype;return i.doWrite=function(t,n){var i=this,r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(function(t,n){i.onError("xhr post error",t,n)}))},i.doPoll=function(){var t=this,n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(function(n,i){t.onError("xhr poll error",n,i)})),this.pollXhr=n},n}(X),Y=function(t){function n(n,i,r){var e;return(e=t.call(this)||this).createRequest=n,$(e,r),e.l=r,e.p=r.method||"GET",e.m=i,e.k=void 0!==r.data?r.data:null,e.A(),e}s(n,t);var i=n.prototype;return i.A=function(){var t,i=this,r=_(this.l,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.l.xd;var e=this.j=this.createRequest(r);try{e.open(this.p,this.m,!0);try{if(this.l.extraHeaders)for(var o in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.l.extraHeaders)this.l.extraHeaders.hasOwnProperty(o)&&e.setRequestHeader(o,this.l.extraHeaders[o])}catch(t){}if("POST"===this.p)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.l.cookieJar)||void 0===t||t.addCookies(e),"withCredentials"in e&&(e.withCredentials=this.l.withCredentials),this.l.requestTimeout&&(e.timeout=this.l.requestTimeout),e.onreadystatechange=function(){var t;3===e.readyState&&(null===(t=i.l.cookieJar)||void 0===t||t.parseCookies(e.getResponseHeader("set-cookie"))),4===e.readyState&&(200===e.status||1223===e.status?i.O():i.setTimeoutFn((function(){i.B("number"==typeof e.status?e.status:0)}),0))},e.send(this.k)}catch(t){return void this.setTimeoutFn((function(){i.B(t)}),0)}"undefined"!=typeof document&&(this.S=n.requestsCount++,n.requests[this.S]=this)},i.B=function(t){this.emitReserved("error",t,this.j),this.N(!0)},i.N=function(t){if(void 0!==this.j&&null!==this.j){if(this.j.onreadystatechange=J,t)try{this.j.abort()}catch(t){}"undefined"!=typeof document&&delete n.requests[this.S],this.j=null}},i.O=function(){var t=this.j.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.N())},i.abort=function(){this.N()},n}(I);if(Y.requestsCount=0,Y.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",G);else if("function"==typeof addEventListener){addEventListener("onpagehide"in L?"pagehide":"unload",G,!1)}function G(){for(var t in Y.requests)Y.requests.hasOwnProperty(t)&&Y.requests[t].abort()}var Q,W=(Q=tt({xdomain:!1}))&&null!==Q.responseType,Z=function(t){function n(n){var i;i=t.call(this,n)||this;var r=n&&n.forceBase64;return i.supportsBinary=W&&!r,i}return s(n,t),n.prototype.request=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e(t,{xd:this.xd},this.opts),new Y(tt,this.uri(),t)},n}(K);function tt(t){var n=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!n||z))return new XMLHttpRequest}catch(t){}if(!n)try{return new(L[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}var nt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),it=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var r=n.prototype;return r.doOpen=function(){var t=this.uri(),n=this.opts.protocols,i=nt?{}:_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,i)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()},r.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws.C.unref(),t.onOpen()},this.ws.onclose=function(n){return t.onClose({description:"websocket connection closed",context:n})},this.ws.onmessage=function(n){return t.onData(n.data)},this.ws.onerror=function(n){return t.onError("websocket error",n)}},r.write=function(t){var n=this;this.writable=!1;for(var i=function(){var i=t[r],e=r===t.length-1;g(i,n.supportsBinary,(function(t){try{n.doWrite(i,t)}catch(t){}e&&R((function(){n.writable=!0,n.emitReserved("drain")}),n.setTimeoutFn)}))},r=0;r<t.length;r++)i()},r.doClose=function(){void 0!==this.ws&&(this.ws.onerror=function(){},this.ws.close(),this.ws=null)},r.uri=function(){var t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=F()),this.supportsBinary||(n.b64=1),this.createUri(t,n)},i(n,[{key:"name",get:function(){return"websocket"}}])}(q),rt=L.WebSocket||L.MozWebSocket,et=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var i=n.prototype;return i.createSocket=function(t,n,i){return nt?new rt(t,n,i):n?new rt(t,n):new rt(t)},i.doWrite=function(t,n){this.ws.send(n)},n}(it),ot=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var r=n.prototype;return r.doOpen=function(){var t=this;try{this.T=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.T.closed.then((function(){t.onClose()})).catch((function(n){t.onError("webtransport error",n)})),this.T.ready.then((function(){t.T.createBidirectionalStream().then((function(n){var i=function(t,n){O||(O=new TextDecoder);var i=[],r=0,e=-1,o=!1;return new TransformStream({transform:function(s,u){for(i.push(s);;){if(0===r){if(M(i)<1)break;var h=x(i,1);o=!(128&~h[0]),e=127&h[0],r=e<126?3:126===e?1:2}else if(1===r){if(M(i)<2)break;var f=x(i,2);e=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),r=3}else if(2===r){if(M(i)<8)break;var c=x(i,8),a=new DataView(c.buffer,c.byteOffset,c.length),v=a.getUint32(0);if(v>Math.pow(2,21)-1){u.enqueue(d);break}e=v*Math.pow(2,32)+a.getUint32(4),r=3}else{if(M(i)<e)break;var l=x(i,e);u.enqueue(S(o?l:O.decode(l),n)),r=0}if(0===e||e>t){u.enqueue(d);break}}}})}(Number.MAX_SAFE_INTEGER,t.socket.binaryType),r=n.readable.pipeThrough(i).getReader(),e=U();e.readable.pipeTo(n.writable),t.U=e.writable.getWriter();!function n(){r.read().then((function(i){var r=i.done,e=i.value;r||(t.onPacket(e),n())})).catch((function(t){}))}();var o={type:"open"};t.query.sid&&(o.data='{"sid":"'.concat(t.query.sid,'"}')),t.U.write(o).then((function(){return t.onOpen()}))}))}))},r.write=function(t){var n=this;this.writable=!1;for(var i=function(){var i=t[r],e=r===t.length-1;n.U.write(i).then((function(){e&&R((function(){n.writable=!0,n.emitReserved("drain")}),n.setTimeoutFn)}))},r=0;r<t.length;r++)i()},r.doClose=function(){var t;null===(t=this.T)||void 0===t||t.close()},i(n,[{key:"name",get:function(){return"webtransport"}}])}(q),st={websocket:et,webtransport:ot,polling:Z},ut=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ht=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ft(t){if(t.length>8e3)throw"URI too long";var n=t,i=t.indexOf("["),r=t.indexOf("]");-1!=i&&-1!=r&&(t=t.substring(0,i)+t.substring(i,r).replace(/:/g,";")+t.substring(r,t.length));for(var e,o,s=ut.exec(t||""),u={},h=14;h--;)u[ht[h]]=s[h]||"";return-1!=i&&-1!=r&&(u.source=n,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=function(t,n){var i=/\/{2,9}/g,r=n.replace(i,"/").split("/");"/"!=n.slice(0,1)&&0!==n.length||r.splice(0,1);"/"==n.slice(-1)&&r.splice(r.length-1,1);return r}(0,u.path),u.queryKey=(e=u.query,o={},e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,n,i){n&&(o[n]=i)})),o),u}var ct="function"==typeof addEventListener&&"function"==typeof removeEventListener,at=[];ct&&addEventListener("offline",(function(){at.forEach((function(t){return t()}))}),!1);var vt=function(t){function n(n,i){var r;if((r=t.call(this)||this).binaryType="arraybuffer",r.writeBuffer=[],r.M=0,r.I=-1,r.R=-1,r.L=-1,r._=1/0,n&&"object"===c(n)&&(i=n,n=null),n){var o=ft(n);i.hostname=o.host,i.secure="https"===o.protocol||"wss"===o.protocol,i.port=o.port,o.query&&(i.query=o.query)}else i.host&&(i.hostname=ft(i.host).host);return $(r,i),r.secure=null!=i.secure?i.secure:"undefined"!=typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=r.secure?"443":"80"),r.hostname=i.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=i.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=[],r.D={},i.transports.forEach((function(t){var n=t.prototype.name;r.transports.push(n),r.D[n]=t})),r.opts=e({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),r.opts.path=r.opts.path.replace(/\/$/,"")+(r.opts.addTrailingSlash?"/":""),"string"==typeof r.opts.query&&(r.opts.query=function(t){for(var n={},i=t.split("&"),r=0,e=i.length;r<e;r++){var o=i[r].split("=");n[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return n}(r.opts.query)),ct&&(r.opts.closeOnBeforeunload&&(r.P=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.P,!1)),"localhost"!==r.hostname&&(r.$=function(){r.F("transport close",{description:"network connection lost"})},at.push(r.$))),r.opts.withCredentials&&(r.V=void 0),r.q(),r}s(n,t);var i=n.prototype;return i.createTransport=function(t){var n=e({},this.opts.query);n.EIO=4,n.transport=t,this.id&&(n.sid=this.id);var i=e({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.D[t](i)},i.q=function(){var t=this;if(0!==this.transports.length){var i=this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";var r=this.createTransport(i);r.open(),this.setTransport(r)}else this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0)},i.setTransport=function(t){var n=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.X.bind(this)).on("packet",this.H.bind(this)).on("error",this.B.bind(this)).on("close",(function(t){return n.F("transport close",t)}))},i.onOpen=function(){this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()},i.H=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.J("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.K();break;case"error":var n=new Error("server error");n.code=t.data,this.B(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}},i.onHandshake=function(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.I=t.pingInterval,this.R=t.pingTimeout,this.L=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.K()},i.K=function(){var t=this;this.clearTimeoutFn(this.Y);var n=this.I+this.R;this._=Date.now()+n,this.Y=this.setTimeoutFn((function(){t.F("ping timeout")}),n),this.opts.autoUnref&&this.Y.unref()},i.X=function(){this.writeBuffer.splice(0,this.M),this.M=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()},i.flush=function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var t=this.G();this.transport.send(t),this.M=t.length,this.emitReserved("flush")}},i.G=function(){if(!(this.L&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var t,n=1,i=0;i<this.writeBuffer.length;i++){var r=this.writeBuffer[i].data;if(r&&(n+="string"==typeof(t=r)?function(t){for(var n=0,i=0,r=0,e=t.length;r<e;r++)(n=t.charCodeAt(r))<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(r++,i+=4);return i}(t):Math.ceil(1.33*(t.byteLength||t.size))),i>0&&n>this.L)return this.writeBuffer.slice(0,i);n+=2}return this.writeBuffer},i.W=function(){var t=this;if(!this._)return!0;var n=Date.now()>this._;return n&&(this._=0,R((function(){t.F("ping timeout")}),this.setTimeoutFn)),n},i.write=function(t,n,i){return this.J("message",t,n,i),this},i.send=function(t,n,i){return this.J("message",t,n,i),this},i.J=function(t,n,i,r){if("function"==typeof n&&(r=n,n=void 0),"function"==typeof i&&(r=i,i=null),"closing"!==this.readyState&&"closed"!==this.readyState){(i=i||{}).compress=!1!==i.compress;var e={type:t,data:n,options:i};this.emitReserved("packetCreate",e),this.writeBuffer.push(e),r&&this.once("flush",r),this.flush()}},i.close=function(){var t=this,n=function(){t.F("forced close"),t.transport.close()},i=function i(){t.off("upgrade",i),t.off("upgradeError",i),n()},r=function(){t.once("upgrade",i),t.once("upgradeError",i)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){t.upgrading?r():n()})):this.upgrading?r():n()),this},i.B=function(t){if(n.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.q();this.emitReserved("error",t),this.F("transport error",t)},i.F=function(t,n){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.Y),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ct&&(this.P&&removeEventListener("beforeunload",this.P,!1),this.$)){var i=at.indexOf(this.$);-1!==i&&at.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.M=0}},n}(I);vt.protocol=4;var lt=function(t){function n(){var n;return(n=t.apply(this,arguments)||this).Z=[],n}s(n,t);var i=n.prototype;return i.onOpen=function(){if(t.prototype.onOpen.call(this),"open"===this.readyState&&this.opts.upgrade)for(var n=0;n<this.Z.length;n++)this.tt(this.Z[n])},i.tt=function(t){var n=this,i=this.createTransport(t),r=!1;vt.priorWebsocketSuccess=!1;var e=function(){r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",(function(t){if(!r)if("pong"===t.type&&"probe"===t.data){if(n.upgrading=!0,n.emitReserved("upgrading",i),!i)return;vt.priorWebsocketSuccess="websocket"===i.name,n.transport.pause((function(){r||"closed"!==n.readyState&&(c(),n.setTransport(i),i.send([{type:"upgrade"}]),n.emitReserved("upgrade",i),i=null,n.upgrading=!1,n.flush())}))}else{var e=new Error("probe error");e.transport=i.name,n.emitReserved("upgradeError",e)}})))};function o(){r||(r=!0,c(),i.close(),i=null)}var s=function(t){var r=new Error("probe error: "+t);r.transport=i.name,o(),n.emitReserved("upgradeError",r)};function u(){s("transport closed")}function h(){s("socket closed")}function f(t){i&&t.name!==i.name&&o()}var c=function(){i.removeListener("open",e),i.removeListener("error",s),i.removeListener("close",u),n.off("close",h),n.off("upgrading",f)};i.once("open",e),i.once("error",s),i.once("close",u),this.once("close",h),this.once("upgrading",f),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((function(){r||i.open()}),200):i.open()},i.onHandshake=function(n){this.Z=this.nt(n.upgrades),t.prototype.onHandshake.call(this,n)},i.nt=function(t){for(var n=[],i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&n.push(t[i]);return n},n}(vt),pt=function(t){function n(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="object"===c(n)?n:i;return(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map((function(t){return st[t]})).filter((function(t){return!!t}))),t.call(this,n,r)||this}return s(n,t),n}(lt);pt.protocol;var dt="function"==typeof ArrayBuffer,yt=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer},bt=Object.prototype.toString,wt="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===bt.call(Blob),gt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===bt.call(File);function mt(t){return dt&&(t instanceof ArrayBuffer||yt(t))||wt&&t instanceof Blob||gt&&t instanceof File}function kt(t,n){if(!t||"object"!==c(t))return!1;if(Array.isArray(t)){for(var i=0,r=t.length;i<r;i++)if(kt(t[i]))return!0;return!1}if(mt(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return kt(t.toJSON(),!0);for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&kt(t[e]))return!0;return!1}function At(t){var n=[],i=t.data,r=t;return r.data=jt(i,n),r.attachments=n.length,{packet:r,buffers:n}}function jt(t,n){if(!t)return t;if(mt(t)){var i={_placeholder:!0,num:n.length};return n.push(t),i}if(Array.isArray(t)){for(var r=new Array(t.length),e=0;e<t.length;e++)r[e]=jt(t[e],n);return r}if("object"===c(t)&&!(t instanceof Date)){var o={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=jt(t[s],n));return o}return t}function Et(t,n){return t.data=Ot(t.data,n),delete t.attachments,t}function Ot(t,n){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<n.length)return n[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(var i=0;i<t.length;i++)t[i]=Ot(t[i],n);else if("object"===c(t))for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Ot(t[r],n));return t}var Bt,St=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];!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"}(Bt||(Bt={}));var Nt=function(){function t(t){this.replacer=t}var n=t.prototype;return n.encode=function(t){return t.type!==Bt.EVENT&&t.type!==Bt.ACK||!kt(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Bt.EVENT?Bt.BINARY_EVENT:Bt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})},n.encodeAsString=function(t){var n=""+t.type;return t.type!==Bt.BINARY_EVENT&&t.type!==Bt.BINARY_ACK||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data&&(n+=JSON.stringify(t.data,this.replacer)),n},n.encodeAsBinary=function(t){var n=At(t),i=this.encodeAsString(n.packet),r=n.buffers;return r.unshift(i),r},t}(),Ct=function(t){function n(n){var i;return(i=t.call(this)||this).reviver=n,i}s(n,t);var i=n.prototype;return i.add=function(n){var i;if("string"==typeof n){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");var r=(i=this.decodeString(n)).type===Bt.BINARY_EVENT;r||i.type===Bt.BINARY_ACK?(i.type=r?Bt.EVENT:Bt.ACK,this.reconstructor=new Tt(i),0===i.attachments&&t.prototype.emitReserved.call(this,"decoded",i)):t.prototype.emitReserved.call(this,"decoded",i)}else{if(!mt(n)&&!n.base64)throw new Error("Unknown type: "+n);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(i=this.reconstructor.takeBinaryData(n))&&(this.reconstructor=null,t.prototype.emitReserved.call(this,"decoded",i))}},i.decodeString=function(t){var i=0,r={type:Number(t.charAt(0))};if(void 0===Bt[r.type])throw new Error("unknown packet type "+r.type);if(r.type===Bt.BINARY_EVENT||r.type===Bt.BINARY_ACK){for(var e=i+1;"-"!==t.charAt(++i)&&i!=t.length;);var o=t.substring(e,i);if(o!=Number(o)||"-"!==t.charAt(i))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(i+1)){for(var s=i+1;++i;){if(","===t.charAt(i))break;if(i===t.length)break}r.nsp=t.substring(s,i)}else r.nsp="/";var u=t.charAt(i+1);if(""!==u&&Number(u)==u){for(var h=i+1;++i;){var f=t.charAt(i);if(null==f||Number(f)!=f){--i;break}if(i===t.length)break}r.id=Number(t.substring(h,i+1))}if(t.charAt(++i)){var c=this.tryParse(t.substr(i));if(!n.isPayloadValid(r.type,c))throw new Error("invalid payload");r.data=c}return r},i.tryParse=function(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}},n.isPayloadValid=function(t,n){switch(t){case Bt.CONNECT:return Mt(n);case Bt.DISCONNECT:return void 0===n;case Bt.CONNECT_ERROR:return"string"==typeof n||Mt(n);case Bt.EVENT:case Bt.BINARY_EVENT:return Array.isArray(n)&&("number"==typeof n[0]||"string"==typeof n[0]&&-1===St.indexOf(n[0]));case Bt.ACK:case Bt.BINARY_ACK:return Array.isArray(n)}},i.destroy=function(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)},n}(I),Tt=function(){function t(t){this.packet=t,this.buffers=[],this.reconPack=t}var n=t.prototype;return n.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var n=Et(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null},n.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]},t}();var Ut=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function Mt(t){return"[object Object]"===Object.prototype.toString.call(t)}var xt=Object.freeze({__proto__:null,protocol:5,get PacketType(){return Bt},Encoder:Nt,Decoder:Ct,isPacketValid:function(t){return"string"==typeof t.nsp&&(void 0===(n=t.id)||Ut(n))&&function(t,n){switch(t){case Bt.CONNECT:return void 0===n||Mt(n);case Bt.DISCONNECT:return void 0===n;case Bt.EVENT:return Array.isArray(n)&&("number"==typeof n[0]||"string"==typeof n[0]&&-1===St.indexOf(n[0]));case Bt.ACK:return Array.isArray(n);case Bt.CONNECT_ERROR:return"string"==typeof n||Mt(n);default:return!1}}(t.type,t.data);var n}});function It(t,n,i){return t.on(n,i),function(){t.off(n,i)}}var Rt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Lt=function(t){function n(n,i,r){var o;return(o=t.call(this)||this).connected=!1,o.recovered=!1,o.receiveBuffer=[],o.sendBuffer=[],o.it=[],o.rt=0,o.ids=0,o.acks={},o.flags={},o.io=n,o.nsp=i,r&&r.auth&&(o.auth=r.auth),o.l=e({},r),o.io.et&&o.open(),o}s(n,t);var o=n.prototype;return o.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[It(t,"open",this.onopen.bind(this)),It(t,"packet",this.onpacket.bind(this)),It(t,"error",this.onerror.bind(this)),It(t,"close",this.onclose.bind(this))]}},o.connect=function(){return this.connected||(this.subEvents(),this.io.ot||this.io.open(),"open"===this.io.st&&this.onopen()),this},o.open=function(){return this.connect()},o.send=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.unshift("message"),this.emit.apply(this,n),this},o.emit=function(t){var n,i,r;if(Rt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');for(var e=arguments.length,o=new Array(e>1?e-1:0),s=1;s<e;s++)o[s-1]=arguments[s];if(o.unshift(t),this.l.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.ut(o),this;var u={type:Bt.EVENT,data:o,options:{}};if(u.options.compress=!1!==this.flags.compress,"function"==typeof o[o.length-1]){var h=this.ids++,f=o.pop();this.ht(h,f),u.id=h}var c=null===(i=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===i?void 0:i.writable,a=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r.W());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this},o.ht=function(t,n){var i,r=this,e=null!==(i=this.flags.timeout)&&void 0!==i?i:this.l.ackTimeout;if(void 0!==e){var o=this.io.setTimeoutFn((function(){delete r.acks[t];for(var i=0;i<r.sendBuffer.length;i++)r.sendBuffer[i].id===t&&r.sendBuffer.splice(i,1);n.call(r,new Error("operation has timed out"))}),e),s=function(){r.io.clearTimeoutFn(o);for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];n.apply(r,i)};s.withError=!0,this.acks[t]=s}else this.acks[t]=n},o.emitWithAck=function(t){for(var n=this,i=arguments.length,r=new Array(i>1?i-1:0),e=1;e<i;e++)r[e-1]=arguments[e];return new Promise((function(i,e){var o=function(t,n){return t?e(t):i(n)};o.withError=!0,r.push(o),n.emit.apply(n,[t].concat(r))}))},o.ut=function(t){var n,i=this;"function"==typeof t[t.length-1]&&(n=t.pop());var r={id:this.rt++,tryCount:0,pending:!1,args:t,flags:e({fromQueue:!0},this.flags)};t.push((function(t){if(r===i.it[0]){if(null!==t)r.tryCount>i.l.retries&&(i.it.shift(),n&&n(t));else if(i.it.shift(),n){for(var e=arguments.length,o=new Array(e>1?e-1:0),s=1;s<e;s++)o[s-1]=arguments[s];n.apply(void 0,[null].concat(o))}return r.pending=!1,i.ft()}})),this.it.push(r),this.ft()},o.ft=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.connected&&0!==this.it.length){var n=this.it[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}},o.packet=function(t){t.nsp=this.nsp,this.io.ct(t)},o.onopen=function(){var t=this;"function"==typeof this.auth?this.auth((function(n){t.vt(n)})):this.vt(this.auth)},o.vt=function(t){this.packet({type:Bt.CONNECT,data:this.lt?e({pid:this.lt,offset:this.dt},t):t})},o.onerror=function(t){this.connected||this.emitReserved("connect_error",t)},o.onclose=function(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this.yt()},o.yt=function(){var t=this;Object.keys(this.acks).forEach((function(n){if(!t.sendBuffer.some((function(t){return String(t.id)===n}))){var i=t.acks[n];delete t.acks[n],i.withError&&i.call(t,new Error("socket has been disconnected"))}}))},o.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case Bt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 Bt.EVENT:case Bt.BINARY_EVENT:this.onevent(t);break;case Bt.ACK:case Bt.BINARY_ACK:this.onack(t);break;case Bt.DISCONNECT:this.ondisconnect();break;case Bt.CONNECT_ERROR:this.destroy();var n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n)}},o.onevent=function(t){var n=t.data||[];null!=t.id&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))},o.emitEvent=function(n){if(this.bt&&this.bt.length){var i,e=r(this.bt.slice());try{for(e.s();!(i=e.n()).done;){i.value.apply(this,n)}}catch(t){e.e(t)}finally{e.f()}}t.prototype.emit.apply(this,n),this.lt&&n.length&&"string"==typeof n[n.length-1]&&(this.dt=n[n.length-1])},o.ack=function(t){var n=this,i=!1;return function(){if(!i){i=!0;for(var r=arguments.length,e=new Array(r),o=0;o<r;o++)e[o]=arguments[o];n.packet({type:Bt.ACK,id:t,data:e})}}},o.onack=function(t){var n=this.acks[t.id];"function"==typeof n&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))},o.onconnect=function(t,n){this.id=t,this.recovered=n&&this.lt===n,this.lt=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.ft(!0)},o.emitBuffered=function(){var t=this;this.receiveBuffer.forEach((function(n){return t.emitEvent(n)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(n){t.notifyOutgoingListeners(n),t.packet(n)})),this.sendBuffer=[]},o.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},o.destroy=function(){this.subs&&(this.subs.forEach((function(t){return t()})),this.subs=void 0),this.io.wt(this)},o.disconnect=function(){return this.connected&&this.packet({type:Bt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},o.close=function(){return this.disconnect()},o.compress=function(t){return this.flags.compress=t,this},o.timeout=function(t){return this.flags.timeout=t,this},o.onAny=function(t){return this.bt=this.bt||[],this.bt.push(t),this},o.prependAny=function(t){return this.bt=this.bt||[],this.bt.unshift(t),this},o.offAny=function(t){if(!this.bt)return this;if(t){for(var n=this.bt,i=0;i<n.length;i++)if(t===n[i])return n.splice(i,1),this}else this.bt=[];return this},o.listenersAny=function(){return this.bt||[]},o.onAnyOutgoing=function(t){return this.gt=this.gt||[],this.gt.push(t),this},o.prependAnyOutgoing=function(t){return this.gt=this.gt||[],this.gt.unshift(t),this},o.offAnyOutgoing=function(t){if(!this.gt)return this;if(t){for(var n=this.gt,i=0;i<n.length;i++)if(t===n[i])return n.splice(i,1),this}else this.gt=[];return this},o.listenersAnyOutgoing=function(){return this.gt||[]},o.notifyOutgoingListeners=function(t){if(this.gt&&this.gt.length){var n,i=r(this.gt.slice());try{for(i.s();!(n=i.n()).done;){n.value.apply(this,t.data)}}catch(t){i.e(t)}finally{i.f()}}},i(n,[{key:"disconnected",get:function(){return!this.connected}},{key:"active",get:function(){return!!this.subs}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}}])}(I);function _t(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}_t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*t);t=1&Math.floor(10*n)?t+i:t-i}return 0|Math.min(t,this.max)},_t.prototype.reset=function(){this.attempts=0},_t.prototype.setMin=function(t){this.ms=t},_t.prototype.setMax=function(t){this.max=t},_t.prototype.setJitter=function(t){this.jitter=t};var Dt=function(t){function n(n,i){var r,e;(r=t.call(this)||this).nsps={},r.subs=[],n&&"object"===c(n)&&(i=n,n=void 0),(i=i||{}).path=i.path||"/socket.io",r.opts=i,$(r,i),r.reconnection(!1!==i.reconnection),r.reconnectionAttempts(i.reconnectionAttempts||1/0),r.reconnectionDelay(i.reconnectionDelay||1e3),r.reconnectionDelayMax(i.reconnectionDelayMax||5e3),r.randomizationFactor(null!==(e=i.randomizationFactor)&&void 0!==e?e:.5),r.backoff=new _t({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==i.timeout?2e4:i.timeout),r.st="closed",r.uri=n;var o=i.parser||xt;return r.encoder=new o.Encoder,r.decoder=new o.Decoder,r.et=!1!==i.autoConnect,r.et&&r.open(),r}s(n,t);var i=n.prototype;return i.reconnection=function(t){return arguments.length?(this.kt=!!t,t||(this.skipReconnect=!0),this):this.kt},i.reconnectionAttempts=function(t){return void 0===t?this.At:(this.At=t,this)},i.reconnectionDelay=function(t){var n;return void 0===t?this.jt:(this.jt=t,null===(n=this.backoff)||void 0===n||n.setMin(t),this)},i.randomizationFactor=function(t){var n;return void 0===t?this.Et:(this.Et=t,null===(n=this.backoff)||void 0===n||n.setJitter(t),this)},i.reconnectionDelayMax=function(t){var n;return void 0===t?this.Ot:(this.Ot=t,null===(n=this.backoff)||void 0===n||n.setMax(t),this)},i.timeout=function(t){return arguments.length?(this.Bt=t,this):this.Bt},i.maybeReconnectOnOpen=function(){!this.ot&&this.kt&&0===this.backoff.attempts&&this.reconnect()},i.open=function(t){var n=this;if(~this.st.indexOf("open"))return this;this.engine=new pt(this.uri,this.opts);var i=this.engine,r=this;this.st="opening",this.skipReconnect=!1;var e=It(i,"open",(function(){r.onopen(),t&&t()})),o=function(i){n.cleanup(),n.st="closed",n.emitReserved("error",i),t?t(i):n.maybeReconnectOnOpen()},s=It(i,"error",o);if(!1!==this.Bt){var u=this.Bt,h=this.setTimeoutFn((function(){e(),o(new Error("timeout")),i.close()}),u);this.opts.autoUnref&&h.unref(),this.subs.push((function(){n.clearTimeoutFn(h)}))}return this.subs.push(e),this.subs.push(s),this},i.connect=function(t){return this.open(t)},i.onopen=function(){this.cleanup(),this.st="open",this.emitReserved("open");var t=this.engine;this.subs.push(It(t,"ping",this.onping.bind(this)),It(t,"data",this.ondata.bind(this)),It(t,"error",this.onerror.bind(this)),It(t,"close",this.onclose.bind(this)),It(this.decoder,"decoded",this.ondecoded.bind(this)))},i.onping=function(){this.emitReserved("ping")},i.ondata=function(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}},i.ondecoded=function(t){var n=this;R((function(){n.emitReserved("packet",t)}),this.setTimeoutFn)},i.onerror=function(t){this.emitReserved("error",t)},i.socket=function(t,n){var i=this.nsps[t];return i?this.et&&!i.active&&i.connect():(i=new Lt(this,t,n),this.nsps[t]=i),i},i.wt=function(t){for(var n=0,i=Object.keys(this.nsps);n<i.length;n++){var r=i[n];if(this.nsps[r].active)return}this.St()},i.ct=function(t){for(var n=this.encoder.encode(t),i=0;i<n.length;i++)this.engine.write(n[i],t.options)},i.cleanup=function(){this.subs.forEach((function(t){return t()})),this.subs.length=0,this.decoder.destroy()},i.St=function(){this.skipReconnect=!0,this.ot=!1,this.onclose("forced close")},i.disconnect=function(){return this.St()},i.onclose=function(t,n){var i;this.cleanup(),null===(i=this.engine)||void 0===i||i.close(),this.backoff.reset(),this.st="closed",this.emitReserved("close",t,n),this.kt&&!this.skipReconnect&&this.reconnect()},i.reconnect=function(){var t=this;if(this.ot||this.skipReconnect)return this;var n=this;if(this.backoff.attempts>=this.At)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.ot=!1;else{var i=this.backoff.duration();this.ot=!0;var r=this.setTimeoutFn((function(){n.skipReconnect||(t.emitReserved("reconnect_attempt",n.backoff.attempts),n.skipReconnect||n.open((function(i){i?(n.ot=!1,n.reconnect(),t.emitReserved("reconnect_error",i)):n.onreconnect()})))}),i);this.opts.autoUnref&&r.unref(),this.subs.push((function(){t.clearTimeoutFn(r)}))}},i.onreconnect=function(){var t=this.backoff.attempts;this.ot=!1,this.backoff.reset(),this.emitReserved("reconnect",t)},n}(I),Pt={};function $t(t,n){"object"===c(t)&&(n=t,t=void 0);var i,r=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,r=t;i=i||"undefined"!=typeof location&&location,null==t&&(t=i.protocol+"//"+i.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?i.protocol+t:i.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==i?i.protocol+"//"+t:"https://"+t),r=ft(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var e=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+e+":"+r.port+n,r.href=r.protocol+"://"+e+(i&&i.port===r.port?"":":"+r.port),r}(t,(n=n||{}).path||"/socket.io"),e=r.source,o=r.id,s=r.path,u=Pt[o]&&s in Pt[o].nsps;return n.forceNew||n["force new connection"]||!1===n.multiplex||u?i=new Dt(e,n):(Pt[o]||(Pt[o]=new Dt(e,n)),i=Pt[o]),r.query&&!n.query&&(n.query=r.queryKey),i.socket(r.path,n)}return e($t,{Manager:Dt,Socket:Lt,io:$t,connect:$t}),$t})); | ||
//# sourceMappingURL=socket.io.min.js.map |
/*! | ||
* Socket.IO v4.8.0 | ||
* Socket.IO v4.8.1 | ||
* (c) 2014-2024 Guillermo Rauch | ||
* Released under the MIT License. | ||
*/ | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).io=i()}(this,(function(){"use strict";function t(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}}))})),Object.freeze(t)}function i(t,i){(null==i||i>t.length)&&(i=t.length);for(var n=0,r=Array(i);n<i;n++)r[n]=t[n];return r}function n(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function r(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return i(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var e=0,s=function(){};return{s:s,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,h=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return h=t.done,t},e:function(t){u=!0,o=t},f:function(){try{h||null==r.return||r.return()}finally{if(u)throw o}}}}function s(){return s=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(null,arguments)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function h(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,f(t,i)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(u=function(){return!!t})()}function f(t,i){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},f(t,i)}function c(t){var i=function(t,i){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,i||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:i+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function v(t){var i="function"==typeof Map?new Map:void 0;return v=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(i){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,n)}function n(){return function(t,i,n){if(u())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,i);var e=new(t.bind.apply(t,r));return n&&f(e,n.prototype),e}(t,arguments,o(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,t)},v(t)}var l=Object.create(null);l.open="0",l.close="1",l.ping="2",l.pong="3",l.message="4",l.upgrade="5",l.noop="6";var d=Object.create(null);Object.keys(l).forEach((function(t){d[l[t]]=t}));var p,y={type:"error",data:"parser error"},w="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),b="function"==typeof ArrayBuffer,g=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},m=function(t,i,n){var r=t.type,e=t.data;return w&&e instanceof Blob?i?n(e):k(e,n):b&&(e instanceof ArrayBuffer||g(e))?i?n(e):k(new Blob([e]),n):n(l[r]+(e||""))},k=function(t,i){var n=new FileReader;return n.onload=function(){var t=n.result.split(",")[1];i("b"+(t||""))},n.readAsDataURL(t)};function A(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}for(var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256),O=0;O<64;O++)j[E.charCodeAt(O)]=O;var M,S="function"==typeof ArrayBuffer,B=function(t,i){if("string"!=typeof t)return{type:"message",data:T(t,i)};var n=t.charAt(0);return"b"===n?{type:"message",data:C(t.substring(1),i)}:d[n]?t.length>1?{type:d[n],data:t.substring(1)}:{type:d[n]}:y},C=function(t,i){if(S){var n=function(t){var i,n,r,e,s,o=.75*t.length,h=t.length,u=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);var f=new ArrayBuffer(o),c=new Uint8Array(f);for(i=0;i<h;i+=4)n=j[t.charCodeAt(i)],r=j[t.charCodeAt(i+1)],e=j[t.charCodeAt(i+2)],s=j[t.charCodeAt(i+3)],c[u++]=n<<2|r>>4,c[u++]=(15&r)<<4|e>>2,c[u++]=(3&e)<<6|63&s;return f}(t);return T(n,i)}return{base64:!0,data:t}},T=function(t,i){return"blob"===i?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer},U=String.fromCharCode(30);function _(){return new TransformStream({transform:function(t,i){!function(t,i){w&&t.data instanceof Blob?t.data.arrayBuffer().then(A).then(i):b&&(t.data instanceof ArrayBuffer||g(t.data))?i(A(t.data)):m(t,!1,(function(t){p||(p=new TextEncoder),i(p.encode(t))}))}(t,(function(n){var r,e=n.length;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);var s=new DataView(r.buffer);s.setUint8(0,126),s.setUint16(1,e)}else{r=new Uint8Array(9);var o=new DataView(r.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(e))}t.data&&"string"!=typeof t.data&&(r[0]|=128),i.enqueue(r),i.enqueue(n)}))}})}function x(t){return t.reduce((function(t,i){return t+i.length}),0)}function D(t,i){if(t[0].length===i)return t.shift();for(var n=new Uint8Array(i),r=0,e=0;e<i;e++)n[e]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function $(t){if(t)return function(t){for(var i in $.prototype)t[i]=$.prototype[i];return t}(t)}$.prototype.on=$.prototype.addEventListener=function(t,i){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(i),this},$.prototype.once=function(t,i){function n(){this.off(t,n),i.apply(this,arguments)}return n.fn=i,this.on(t,n),this},$.prototype.off=$.prototype.removeListener=$.prototype.removeAllListeners=$.prototype.removeEventListener=function(t,i){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var n,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var e=0;e<r.length;e++)if((n=r[e])===i||n.fn===i){r.splice(e,1);break}return 0===r.length&&delete this.t["$"+t],this},$.prototype.emit=function(t){this.t=this.t||{};for(var i=new Array(arguments.length-1),n=this.t["$"+t],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(n){r=0;for(var e=(n=n.slice(0)).length;r<e;++r)n[r].apply(this,i)}return this},$.prototype.emitReserved=$.prototype.emit,$.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},$.prototype.hasListeners=function(t){return!!this.listeners(t).length};var I="function"==typeof Promise&&"function"==typeof Promise.resolve?function(t){return Promise.resolve().then(t)}:function(t,i){return i(t,0)},R="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function L(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.reduce((function(i,n){return t.hasOwnProperty(n)&&(i[n]=t[n]),i}),{})}var N=R.setTimeout,P=R.clearTimeout;function V(t,i){i.useNativeTimers?(t.setTimeoutFn=N.bind(R),t.clearTimeoutFn=P.bind(R)):(t.setTimeoutFn=R.setTimeout.bind(R),t.clearTimeoutFn=R.clearTimeout.bind(R))}function q(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var F=function(t){function i(i,n,r){var e;return(e=t.call(this,i)||this).description=n,e.context=r,e.type="TransportError",e}return h(i,t),i}(v(Error)),X=function(t){function i(i){var n;return(n=t.call(this)||this).writable=!1,V(n,i),n.opts=i,n.query=i.query,n.socket=i.socket,n.supportsBinary=!i.forceBase64,n}h(i,t);var n=i.prototype;return n.onError=function(i,n,r){return t.prototype.emitReserved.call(this,"error",new F(i,n,r)),this},n.open=function(){return this.readyState="opening",this.doOpen(),this},n.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},n.send=function(t){"open"===this.readyState&&this.write(t)},n.onOpen=function(){this.readyState="open",this.writable=!0,t.prototype.emitReserved.call(this,"open")},n.onData=function(t){var i=B(t,this.socket.binaryType);this.onPacket(i)},n.onPacket=function(i){t.prototype.emitReserved.call(this,"packet",i)},n.onClose=function(i){this.readyState="closed",t.prototype.emitReserved.call(this,"close",i)},n.pause=function(t){},n.createUri=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t+"://"+this.i()+this.o()+this.opts.path+this.h(i)},n.i=function(){var t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"},n.o=function(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""},n.h=function(t){var i=function(t){var i="";for(var n in t)t.hasOwnProperty(n)&&(i.length&&(i+="&"),i+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return i}(t);return i.length?"?"+i:""},i}($),H=function(t){function i(){var i;return(i=t.apply(this,arguments)||this).u=!1,i}h(i,t);var n=i.prototype;return n.doOpen=function(){this.v()},n.pause=function(t){var i=this;this.readyState="pausing";var n=function(){i.readyState="paused",t()};if(this.u||!this.writable){var r=0;this.u&&(r++,this.once("pollComplete",(function(){--r||n()}))),this.writable||(r++,this.once("drain",(function(){--r||n()})))}else n()},n.v=function(){this.u=!0,this.doPoll(),this.emitReserved("poll")},n.onData=function(t){var i=this;(function(t,i){for(var n=t.split(U),r=[],e=0;e<n.length;e++){var s=B(n[e],i);if(r.push(s),"error"===s.type)break}return r})(t,this.socket.binaryType).forEach((function(t){if("opening"===i.readyState&&"open"===t.type&&i.onOpen(),"close"===t.type)return i.onClose({description:"transport closed by the server"}),!1;i.onPacket(t)})),"closed"!==this.readyState&&(this.u=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.v())},n.doClose=function(){var t=this,i=function(){t.write([{type:"close"}])};"open"===this.readyState?i():this.once("open",i)},n.write=function(t){var i=this;this.writable=!1,function(t,i){var n=t.length,r=new Array(n),e=0;t.forEach((function(t,s){m(t,!1,(function(t){r[s]=t,++e===n&&i(r.join(U))}))}))}(t,(function(t){i.doWrite(t,(function(){i.writable=!0,i.emitReserved("drain")}))}))},n.uri=function(){var t=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=q()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(t,i)},r(i,[{key:"name",get:function(){return"polling"}}])}(X),z=!1;try{z="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}var G=z;function J(){}var K=function(t){function i(i){var n;if(n=t.call(this,i)||this,"undefined"!=typeof location){var r="https:"===location.protocol,e=location.port;e||(e=r?"443":"80"),n.xd="undefined"!=typeof location&&i.hostname!==location.hostname||e!==i.port}return n}h(i,t);var n=i.prototype;return n.doWrite=function(t,i){var n=this,r=this.request({method:"POST",data:t});r.on("success",i),r.on("error",(function(t,i){n.onError("xhr post error",t,i)}))},n.doPoll=function(){var t=this,i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(function(i,n){t.onError("xhr poll error",i,n)})),this.pollXhr=i},i}(H),Q=function(t){function i(i,n,r){var e;return(e=t.call(this)||this).createRequest=i,V(e,r),e.l=r,e.p=r.method||"GET",e.m=n,e.k=void 0!==r.data?r.data:null,e.A(),e}h(i,t);var n=i.prototype;return n.A=function(){var t,n=this,r=L(this.l,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.l.xd;var e=this.j=this.createRequest(r);try{e.open(this.p,this.m,!0);try{if(this.l.extraHeaders)for(var s in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.l.extraHeaders)this.l.extraHeaders.hasOwnProperty(s)&&e.setRequestHeader(s,this.l.extraHeaders[s])}catch(t){}if("POST"===this.p)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.l.cookieJar)||void 0===t||t.addCookies(e),"withCredentials"in e&&(e.withCredentials=this.l.withCredentials),this.l.requestTimeout&&(e.timeout=this.l.requestTimeout),e.onreadystatechange=function(){var t;3===e.readyState&&(null===(t=n.l.cookieJar)||void 0===t||t.parseCookies(e.getResponseHeader("set-cookie"))),4===e.readyState&&(200===e.status||1223===e.status?n.O():n.setTimeoutFn((function(){n.M("number"==typeof e.status?e.status:0)}),0))},e.send(this.k)}catch(t){return void this.setTimeoutFn((function(){n.M(t)}),0)}"undefined"!=typeof document&&(this.S=i.requestsCount++,i.requests[this.S]=this)},n.M=function(t){this.emitReserved("error",t,this.j),this.B(!0)},n.B=function(t){if(void 0!==this.j&&null!==this.j){if(this.j.onreadystatechange=J,t)try{this.j.abort()}catch(t){}"undefined"!=typeof document&&delete i.requests[this.S],this.j=null}},n.O=function(){var t=this.j.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.B())},n.abort=function(){this.B()},i}($);if(Q.requestsCount=0,Q.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",W);else if("function"==typeof addEventListener){addEventListener("onpagehide"in R?"pagehide":"unload",W,!1)}function W(){for(var t in Q.requests)Q.requests.hasOwnProperty(t)&&Q.requests[t].abort()}var Y,Z=(Y=it({xdomain:!1}))&&null!==Y.responseType,tt=function(t){function i(i){var n;n=t.call(this,i)||this;var r=i&&i.forceBase64;return n.supportsBinary=Z&&!r,n}return h(i,t),i.prototype.request=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(t,{xd:this.xd},this.opts),new Q(it,this.uri(),t)},i}(K);function it(t){var i=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!i||G))return new XMLHttpRequest}catch(t){}if(!i)try{return new(R[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}var nt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),rt=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var n=i.prototype;return n.doOpen=function(){var t=this.uri(),i=this.opts.protocols,n=nt?{}:L(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,n)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()},n.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws.C.unref(),t.onOpen()},this.ws.onclose=function(i){return t.onClose({description:"websocket connection closed",context:i})},this.ws.onmessage=function(i){return t.onData(i.data)},this.ws.onerror=function(i){return t.onError("websocket error",i)}},n.write=function(t){var i=this;this.writable=!1;for(var n=function(){var n=t[r],e=r===t.length-1;m(n,i.supportsBinary,(function(t){try{i.doWrite(n,t)}catch(t){}e&&I((function(){i.writable=!0,i.emitReserved("drain")}),i.setTimeoutFn)}))},r=0;r<t.length;r++)n()},n.doClose=function(){void 0!==this.ws&&(this.ws.close(),this.ws=null)},n.uri=function(){var t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=q()),this.supportsBinary||(i.b64=1),this.createUri(t,i)},r(i,[{key:"name",get:function(){return"websocket"}}])}(X),et=R.WebSocket||R.MozWebSocket,st=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var n=i.prototype;return n.createSocket=function(t,i,n){return nt?new et(t,i,n):i?new et(t,i):new et(t)},n.doWrite=function(t,i){this.ws.send(i)},i}(rt),ot=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var n=i.prototype;return n.doOpen=function(){var t=this;try{this.T=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.T.closed.then((function(){t.onClose()})).catch((function(i){t.onError("webtransport error",i)})),this.T.ready.then((function(){t.T.createBidirectionalStream().then((function(i){var n=function(t,i){M||(M=new TextDecoder);var n=[],r=0,e=-1,s=!1;return new TransformStream({transform:function(o,h){for(n.push(o);;){if(0===r){if(x(n)<1)break;var u=D(n,1);s=!(128&~u[0]),e=127&u[0],r=e<126?3:126===e?1:2}else if(1===r){if(x(n)<2)break;var f=D(n,2);e=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),r=3}else if(2===r){if(x(n)<8)break;var c=D(n,8),a=new DataView(c.buffer,c.byteOffset,c.length),v=a.getUint32(0);if(v>Math.pow(2,21)-1){h.enqueue(y);break}e=v*Math.pow(2,32)+a.getUint32(4),r=3}else{if(x(n)<e)break;var l=D(n,e);h.enqueue(B(s?l:M.decode(l),i)),r=0}if(0===e||e>t){h.enqueue(y);break}}}})}(Number.MAX_SAFE_INTEGER,t.socket.binaryType),r=i.readable.pipeThrough(n).getReader(),e=_();e.readable.pipeTo(i.writable),t.U=e.writable.getWriter();!function i(){r.read().then((function(n){var r=n.done,e=n.value;r||(t.onPacket(e),i())})).catch((function(t){}))}();var s={type:"open"};t.query.sid&&(s.data='{"sid":"'.concat(t.query.sid,'"}')),t.U.write(s).then((function(){return t.onOpen()}))}))}))},n.write=function(t){var i=this;this.writable=!1;for(var n=function(){var n=t[r],e=r===t.length-1;i.U.write(n).then((function(){e&&I((function(){i.writable=!0,i.emitReserved("drain")}),i.setTimeoutFn)}))},r=0;r<t.length;r++)n()},n.doClose=function(){var t;null===(t=this.T)||void 0===t||t.close()},r(i,[{key:"name",get:function(){return"webtransport"}}])}(X),ht={websocket:st,webtransport:ot,polling:tt},ut=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ft=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ct(t){if(t.length>8e3)throw"URI too long";var i=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));for(var e,s,o=ut.exec(t||""),h={},u=14;u--;)h[ft[u]]=o[u]||"";return-1!=n&&-1!=r&&(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=function(t,i){var n=/\/{2,9}/g,r=i.replace(n,"/").split("/");"/"!=i.slice(0,1)&&0!==i.length||r.splice(0,1);"/"==i.slice(-1)&&r.splice(r.length-1,1);return r}(0,h.path),h.queryKey=(e=h.query,s={},e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,i,n){i&&(s[i]=n)})),s),h}var at="function"==typeof addEventListener&&"function"==typeof removeEventListener,vt=[];at&&addEventListener("offline",(function(){vt.forEach((function(t){return t()}))}),!1);var lt=function(t){function i(i,n){var r;if((r=t.call(this)||this).binaryType="arraybuffer",r.writeBuffer=[],r._=0,r.D=-1,r.$=-1,r.I=-1,r.R=1/0,i&&"object"===a(i)&&(n=i,i=null),i){var e=ct(i);n.hostname=e.host,n.secure="https"===e.protocol||"wss"===e.protocol,n.port=e.port,e.query&&(n.query=e.query)}else n.host&&(n.hostname=ct(n.host).host);return V(r,n),r.secure=null!=n.secure?n.secure:"undefined"!=typeof location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=r.secure?"443":"80"),r.hostname=n.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=n.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=[],r.L={},n.transports.forEach((function(t){var i=t.prototype.name;r.transports.push(i),r.L[i]=t})),r.opts=s({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),r.opts.path=r.opts.path.replace(/\/$/,"")+(r.opts.addTrailingSlash?"/":""),"string"==typeof r.opts.query&&(r.opts.query=function(t){for(var i={},n=t.split("&"),r=0,e=n.length;r<e;r++){var s=n[r].split("=");i[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return i}(r.opts.query)),at&&(r.opts.closeOnBeforeunload&&(r.N=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.N,!1)),"localhost"!==r.hostname&&(r.P=function(){r.V("transport close",{description:"network connection lost"})},vt.push(r.P))),r.opts.withCredentials&&(r.q=void 0),r.F(),r}h(i,t);var n=i.prototype;return n.createTransport=function(t){var i=s({},this.opts.query);i.EIO=4,i.transport=t,this.id&&(i.sid=this.id);var n=s({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.L[t](n)},n.F=function(){var t=this;if(0!==this.transports.length){var n=this.opts.rememberUpgrade&&i.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";var r=this.createTransport(n);r.open(),this.setTransport(r)}else this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0)},n.setTransport=function(t){var i=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.X.bind(this)).on("packet",this.H.bind(this)).on("error",this.M.bind(this)).on("close",(function(t){return i.V("transport close",t)}))},n.onOpen=function(){this.readyState="open",i.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()},n.H=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.G("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.J();break;case"error":var i=new Error("server error");i.code=t.data,this.M(i);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}},n.onHandshake=function(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.D=t.pingInterval,this.$=t.pingTimeout,this.I=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.J()},n.J=function(){var t=this;this.clearTimeoutFn(this.K);var i=this.D+this.$;this.R=Date.now()+i,this.K=this.setTimeoutFn((function(){t.V("ping timeout")}),i),this.opts.autoUnref&&this.K.unref()},n.X=function(){this.writeBuffer.splice(0,this._),this._=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()},n.flush=function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var t=this.W();this.transport.send(t),this._=t.length,this.emitReserved("flush")}},n.W=function(){if(!(this.I&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var t,i=1,n=0;n<this.writeBuffer.length;n++){var r=this.writeBuffer[n].data;if(r&&(i+="string"==typeof(t=r)?function(t){for(var i=0,n=0,r=0,e=t.length;r<e;r++)(i=t.charCodeAt(r))<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&i>this.I)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer},n.Y=function(){var t=this;if(!this.R)return!0;var i=Date.now()>this.R;return i&&(this.R=0,I((function(){t.V("ping timeout")}),this.setTimeoutFn)),i},n.write=function(t,i,n){return this.G("message",t,i,n),this},n.send=function(t,i,n){return this.G("message",t,i,n),this},n.G=function(t,i,n,r){if("function"==typeof i&&(r=i,i=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var e={type:t,data:i,options:n};this.emitReserved("packetCreate",e),this.writeBuffer.push(e),r&&this.once("flush",r),this.flush()}},n.close=function(){var t=this,i=function(){t.V("forced close"),t.transport.close()},n=function n(){t.off("upgrade",n),t.off("upgradeError",n),i()},r=function(){t.once("upgrade",n),t.once("upgradeError",n)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){t.upgrading?r():i()})):this.upgrading?r():i()),this},n.M=function(t){if(i.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.F();this.emitReserved("error",t),this.V("transport error",t)},n.V=function(t,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.K),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),at&&(this.N&&removeEventListener("beforeunload",this.N,!1),this.P)){var n=vt.indexOf(this.P);-1!==n&&vt.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,i),this.writeBuffer=[],this._=0}},i}($);lt.protocol=4;var dt=function(t){function i(){var i;return(i=t.apply(this,arguments)||this).Z=[],i}h(i,t);var n=i.prototype;return n.onOpen=function(){if(t.prototype.onOpen.call(this),"open"===this.readyState&&this.opts.upgrade)for(var i=0;i<this.Z.length;i++)this.tt(this.Z[i])},n.tt=function(t){var i=this,n=this.createTransport(t),r=!1;lt.priorWebsocketSuccess=!1;var e=function(){r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",(function(t){if(!r)if("pong"===t.type&&"probe"===t.data){if(i.upgrading=!0,i.emitReserved("upgrading",n),!n)return;lt.priorWebsocketSuccess="websocket"===n.name,i.transport.pause((function(){r||"closed"!==i.readyState&&(c(),i.setTransport(n),n.send([{type:"upgrade"}]),i.emitReserved("upgrade",n),n=null,i.upgrading=!1,i.flush())}))}else{var e=new Error("probe error");e.transport=n.name,i.emitReserved("upgradeError",e)}})))};function s(){r||(r=!0,c(),n.close(),n=null)}var o=function(t){var r=new Error("probe error: "+t);r.transport=n.name,s(),i.emitReserved("upgradeError",r)};function h(){o("transport closed")}function u(){o("socket closed")}function f(t){n&&t.name!==n.name&&s()}var c=function(){n.removeListener("open",e),n.removeListener("error",o),n.removeListener("close",h),i.off("close",u),i.off("upgrading",f)};n.once("open",e),n.once("error",o),n.once("close",h),this.once("close",u),this.once("upgrading",f),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((function(){r||n.open()}),200):n.open()},n.onHandshake=function(i){this.Z=this.it(i.upgrades),t.prototype.onHandshake.call(this,i)},n.it=function(t){for(var i=[],n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&i.push(t[n]);return i},i}(lt),pt=function(t){function i(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="object"===a(i)?i:n;return(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map((function(t){return ht[t]})).filter((function(t){return!!t}))),t.call(this,i,r)||this}return h(i,t),i}(dt);pt.protocol;var yt={},wt={};function bt(t,i,n){for(var r=0,e=0,s=n.length;e<s;e++)(r=n.charCodeAt(e))<128?t.setUint8(i++,r):r<2048?(t.setUint8(i++,192|r>>6),t.setUint8(i++,128|63&r)):r<55296||r>=57344?(t.setUint8(i++,224|r>>12),t.setUint8(i++,128|r>>6&63),t.setUint8(i++,128|63&r)):(e++,r=65536+((1023&r)<<10|1023&n.charCodeAt(e)),t.setUint8(i++,240|r>>18),t.setUint8(i++,128|r>>12&63),t.setUint8(i++,128|r>>6&63),t.setUint8(i++,128|63&r))}function gt(t,i,n){var r=a(n),e=0,s=0,o=0,h=0,u=0,f=0;if("string"===r){if(u=function(t){for(var i=0,n=0,r=0,e=t.length;r<e;r++)(i=t.charCodeAt(r))<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(r++,n+=4);return n}(n),u<32)t.push(160|u),f=1;else if(u<256)t.push(217,u),f=2;else if(u<65536)t.push(218,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("String too long");t.push(219,u>>24,u>>16,u>>8,u),f=5}return i.push({nt:n,rt:u,et:t.length}),f+u}if("number"===r)return Math.floor(n)===n&&isFinite(n)?n>=0?n<128?(t.push(n),1):n<256?(t.push(204,n),2):n<65536?(t.push(205,n>>8,n),3):n<4294967296?(t.push(206,n>>24,n>>16,n>>8,n),5):(o=n/Math.pow(2,32)|0,h=n>>>0,t.push(207,o>>24,o>>16,o>>8,o,h>>24,h>>16,h>>8,h),9):n>=-32?(t.push(n),1):n>=-128?(t.push(208,n),2):n>=-32768?(t.push(209,n>>8,n),3):n>=-2147483648?(t.push(210,n>>24,n>>16,n>>8,n),5):(o=Math.floor(n/Math.pow(2,32)),h=n>>>0,t.push(211,o>>24,o>>16,o>>8,o,h>>24,h>>16,h>>8,h),9):(t.push(203),i.push({st:n,rt:8,et:t.length}),9);if("object"===r){if(null===n)return t.push(192),1;if(Array.isArray(n)){if((u=n.length)<16)t.push(144|u),f=1;else if(u<65536)t.push(220,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("Array too large");t.push(221,u>>24,u>>16,u>>8,u),f=5}for(e=0;e<u;e++)f+=gt(t,i,n[e]);return f}if(n instanceof Date){var c=n.getTime();return o=Math.floor(c/Math.pow(2,32)),h=c>>>0,t.push(215,0,o>>24,o>>16,o>>8,o,h>>24,h>>16,h>>8,h),10}if(n instanceof ArrayBuffer){if((u=n.byteLength)<256)t.push(196,u),f=2;else if(u<65536)t.push(197,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("Buffer too large");t.push(198,u>>24,u>>16,u>>8,u),f=5}return i.push({ot:n,rt:u,et:t.length}),f+u}if("function"==typeof n.toJSON)return gt(t,i,n.toJSON());var v=[],l="",d=Object.keys(n);for(e=0,s=d.length;e<s;e++)"function"!=typeof n[l=d[e]]&&v.push(l);if((u=v.length)<16)t.push(128|u),f=1;else if(u<65536)t.push(222,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("Object too large");t.push(223,u>>24,u>>16,u>>8,u),f=5}for(e=0;e<u;e++)f+=gt(t,i,l=v[e]),f+=gt(t,i,n[l]);return f}if("boolean"===r)return t.push(n?195:194),1;if("undefined"===r)return t.push(212,0,0),3;throw new Error("Could not encode")}var mt=function(t){var i=[],n=[],r=gt(i,n,t),e=new ArrayBuffer(r),s=new DataView(e),o=0,h=0,u=-1;n.length>0&&(u=n[0].et);for(var f,c=0,a=0,v=0,l=i.length;v<l;v++)if(s.setUint8(h+v,i[v]),v+1===u){if(c=(f=n[o]).rt,a=h+u,f.ot)for(var d=new Uint8Array(f.ot),p=0;p<c;p++)s.setUint8(a+p,d[p]);else f.nt?bt(s,a,f.nt):void 0!==f.st&&s.setFloat64(a,f.st);h+=c,n[++o]&&(u=n[o].et)}return e};function kt(t){if(this.et=0,t instanceof ArrayBuffer)this.ht=t,this.ut=new DataView(this.ht);else{if(!ArrayBuffer.isView(t))throw new Error("Invalid argument");this.ht=t.buffer,this.ut=new DataView(this.ht,t.byteOffset,t.byteLength)}}kt.prototype.ft=function(t){for(var i=new Array(t),n=0;n<t;n++)i[n]=this.ct();return i},kt.prototype.vt=function(t){for(var i={},n=0;n<t;n++)i[this.ct()]=this.ct();return i},kt.prototype.nt=function(t){var i=function(t,i,n){for(var r="",e=0,s=i,o=i+n;s<o;s++){var h=t.getUint8(s);if(128&h)if(192!=(224&h))if(224!=(240&h)){if(240!=(248&h))throw new Error("Invalid byte "+h.toString(16));(e=(7&h)<<18|(63&t.getUint8(++s))<<12|(63&t.getUint8(++s))<<6|63&t.getUint8(++s))>=65536?(e-=65536,r+=String.fromCharCode(55296+(e>>>10),56320+(1023&e))):r+=String.fromCharCode(e)}else r+=String.fromCharCode((15&h)<<12|(63&t.getUint8(++s))<<6|63&t.getUint8(++s));else r+=String.fromCharCode((31&h)<<6|63&t.getUint8(++s));else r+=String.fromCharCode(h)}return r}(this.ut,this.et,t);return this.et+=t,i},kt.prototype.ot=function(t){var i=this.ht.slice(this.et,this.et+t);return this.et+=t,i},kt.prototype.ct=function(){var t,i=this.ut.getUint8(this.et++),n=0,r=0,e=0,s=0;if(i<192)return i<128?i:i<144?this.vt(15&i):i<160?this.ft(15&i):this.nt(31&i);if(i>223)return-1*(255-i+1);switch(i){case 192:return null;case 194:return!1;case 195:return!0;case 196:return n=this.ut.getUint8(this.et),this.et+=1,this.ot(n);case 197:return n=this.ut.getUint16(this.et),this.et+=2,this.ot(n);case 198:return n=this.ut.getUint32(this.et),this.et+=4,this.ot(n);case 199:return n=this.ut.getUint8(this.et),r=this.ut.getInt8(this.et+1),this.et+=2,[r,this.ot(n)];case 200:return n=this.ut.getUint16(this.et),r=this.ut.getInt8(this.et+2),this.et+=3,[r,this.ot(n)];case 201:return n=this.ut.getUint32(this.et),r=this.ut.getInt8(this.et+4),this.et+=5,[r,this.ot(n)];case 202:return t=this.ut.getFloat32(this.et),this.et+=4,t;case 203:return t=this.ut.getFloat64(this.et),this.et+=8,t;case 204:return t=this.ut.getUint8(this.et),this.et+=1,t;case 205:return t=this.ut.getUint16(this.et),this.et+=2,t;case 206:return t=this.ut.getUint32(this.et),this.et+=4,t;case 207:return e=this.ut.getUint32(this.et)*Math.pow(2,32),s=this.ut.getUint32(this.et+4),this.et+=8,e+s;case 208:return t=this.ut.getInt8(this.et),this.et+=1,t;case 209:return t=this.ut.getInt16(this.et),this.et+=2,t;case 210:return t=this.ut.getInt32(this.et),this.et+=4,t;case 211:return e=this.ut.getInt32(this.et)*Math.pow(2,32),s=this.ut.getUint32(this.et+4),this.et+=8,e+s;case 212:return r=this.ut.getInt8(this.et),this.et+=1,0===r?void(this.et+=1):[r,this.ot(1)];case 213:return r=this.ut.getInt8(this.et),this.et+=1,[r,this.ot(2)];case 214:return r=this.ut.getInt8(this.et),this.et+=1,[r,this.ot(4)];case 215:return r=this.ut.getInt8(this.et),this.et+=1,0===r?(e=this.ut.getInt32(this.et)*Math.pow(2,32),s=this.ut.getUint32(this.et+4),this.et+=8,new Date(e+s)):[r,this.ot(8)];case 216:return r=this.ut.getInt8(this.et),this.et+=1,[r,this.ot(16)];case 217:return n=this.ut.getUint8(this.et),this.et+=1,this.nt(n);case 218:return n=this.ut.getUint16(this.et),this.et+=2,this.nt(n);case 219:return n=this.ut.getUint32(this.et),this.et+=4,this.nt(n);case 220:return n=this.ut.getUint16(this.et),this.et+=2,this.ft(n);case 221:return n=this.ut.getUint32(this.et),this.et+=4,this.ft(n);case 222:return n=this.ut.getUint16(this.et),this.et+=2,this.vt(n);case 223:return n=this.ut.getUint32(this.et),this.et+=4,this.vt(n)}throw new Error("Could not parse")};var At=function(t){var i=new kt(t),n=i.ct();if(i.et!==t.byteLength)throw new Error(t.byteLength-i.et+" trailing bytes");return n};wt.encode=mt,wt.decode=At;var Et={exports:{}};!function(t){function i(t){if(t)return function(t){for(var n in i.prototype)t[n]=i.prototype[n];return t}(t)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,i){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(i),this},i.prototype.once=function(t,i){function n(){this.off(t,n),i.apply(this,arguments)}return n.fn=i,this.on(t,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,i){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var n,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var e=0;e<r.length;e++)if((n=r[e])===i||n.fn===i){r.splice(e,1);break}return 0===r.length&&delete this.t["$"+t],this},i.prototype.emit=function(t){this.t=this.t||{};for(var i=new Array(arguments.length-1),n=this.t["$"+t],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(n){r=0;for(var e=(n=n.slice(0)).length;r<e;++r)n[r].apply(this,i)}return this},i.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}}(Et);var jt,Ot=wt,Mt=Et.exports,St=yt.protocol=5,Bt=jt=yt.PacketType={CONNECT:0,DISCONNECT:1,EVENT:2,ACK:3,CONNECT_ERROR:4},Ct=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Tt=function(t){return"string"==typeof t},Ut=function(t){return"[object Object]"===Object.prototype.toString.call(t)};function _t(){}function xt(){}_t.prototype.encode=function(t){return[Ot.encode(t)]},Mt(xt.prototype),xt.prototype.add=function(t){var i=Ot.decode(t);this.checkPacket(i),this.emit("decoded",i)},xt.prototype.checkPacket=function(t){if(!(Ct(t.type)&&t.type>=Bt.CONNECT&&t.type<=Bt.CONNECT_ERROR))throw new Error("invalid packet type");if(!Tt(t.nsp))throw new Error("invalid namespace");if(!function(t){switch(t.type){case Bt.CONNECT:return void 0===t.data||Ut(t.data);case Bt.DISCONNECT:return void 0===t.data;case Bt.CONNECT_ERROR:return Tt(t.data)||Ut(t.data);default:return Array.isArray(t.data)}}(t))throw new Error("invalid payload");if(!(void 0===t.id||Ct(t.id)))throw new Error("invalid packet id")},xt.prototype.destroy=function(){};var Dt=yt.Encoder=_t,$t=yt.Decoder=xt,It=t({__proto__:null,protocol:St,get PacketType(){return jt},Encoder:Dt,Decoder:$t,default:yt},[yt]);function Rt(t,i,n){return t.on(i,n),function(){t.off(i,n)}}var Lt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Nt=function(t){function i(i,n,r){var e;return(e=t.call(this)||this).connected=!1,e.recovered=!1,e.receiveBuffer=[],e.sendBuffer=[],e.lt=[],e.dt=0,e.ids=0,e.acks={},e.flags={},e.io=i,e.nsp=n,r&&r.auth&&(e.auth=r.auth),e.l=s({},r),e.io.yt&&e.open(),e}h(i,t);var n=i.prototype;return n.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[Rt(t,"open",this.onopen.bind(this)),Rt(t,"packet",this.onpacket.bind(this)),Rt(t,"error",this.onerror.bind(this)),Rt(t,"close",this.onclose.bind(this))]}},n.connect=function(){return this.connected||(this.subEvents(),this.io.wt||this.io.open(),"open"===this.io.bt&&this.onopen()),this},n.open=function(){return this.connect()},n.send=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.unshift("message"),this.emit.apply(this,i),this},n.emit=function(t){var i,n,r;if(Lt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');for(var e=arguments.length,s=new Array(e>1?e-1:0),o=1;o<e;o++)s[o-1]=arguments[o];if(s.unshift(t),this.l.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.gt(s),this;var h={type:jt.EVENT,data:s,options:{}};if(h.options.compress=!1!==this.flags.compress,"function"==typeof s[s.length-1]){var u=this.ids++,f=s.pop();this.kt(u,f),h.id=u}var c=null===(n=null===(i=this.io.engine)||void 0===i?void 0:i.transport)||void 0===n?void 0:n.writable,a=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r.Y());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this},n.kt=function(t,i){var n,r=this,e=null!==(n=this.flags.timeout)&&void 0!==n?n:this.l.ackTimeout;if(void 0!==e){var s=this.io.setTimeoutFn((function(){delete r.acks[t];for(var n=0;n<r.sendBuffer.length;n++)r.sendBuffer[n].id===t&&r.sendBuffer.splice(n,1);i.call(r,new Error("operation has timed out"))}),e),o=function(){r.io.clearTimeoutFn(s);for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];i.apply(r,n)};o.withError=!0,this.acks[t]=o}else this.acks[t]=i},n.emitWithAck=function(t){for(var i=this,n=arguments.length,r=new Array(n>1?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];return new Promise((function(n,e){var s=function(t,i){return t?e(t):n(i)};s.withError=!0,r.push(s),i.emit.apply(i,[t].concat(r))}))},n.gt=function(t){var i,n=this;"function"==typeof t[t.length-1]&&(i=t.pop());var r={id:this.dt++,tryCount:0,pending:!1,args:t,flags:s({fromQueue:!0},this.flags)};t.push((function(t){if(r===n.lt[0]){if(null!==t)r.tryCount>n.l.retries&&(n.lt.shift(),i&&i(t));else if(n.lt.shift(),i){for(var e=arguments.length,s=new Array(e>1?e-1:0),o=1;o<e;o++)s[o-1]=arguments[o];i.apply(void 0,[null].concat(s))}return r.pending=!1,n.At()}})),this.lt.push(r),this.At()},n.At=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.connected&&0!==this.lt.length){var i=this.lt[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}},n.packet=function(t){t.nsp=this.nsp,this.io.Et(t)},n.onopen=function(){var t=this;"function"==typeof this.auth?this.auth((function(i){t.jt(i)})):this.jt(this.auth)},n.jt=function(t){this.packet({type:jt.CONNECT,data:this.Ot?s({pid:this.Ot,offset:this.Mt},t):t})},n.onerror=function(t){this.connected||this.emitReserved("connect_error",t)},n.onclose=function(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this.St()},n.St=function(){var t=this;Object.keys(this.acks).forEach((function(i){if(!t.sendBuffer.some((function(t){return String(t.id)===i}))){var n=t.acks[i];delete t.acks[i],n.withError&&n.call(t,new Error("socket has been disconnected"))}}))},n.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case jt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 jt.EVENT:case jt.BINARY_EVENT:this.onevent(t);break;case jt.ACK:case jt.BINARY_ACK:this.onack(t);break;case jt.DISCONNECT:this.ondisconnect();break;case jt.CONNECT_ERROR:this.destroy();var i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i)}},n.onevent=function(t){var i=t.data||[];null!=t.id&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))},n.emitEvent=function(i){if(this.Bt&&this.Bt.length){var n,r=e(this.Bt.slice());try{for(r.s();!(n=r.n()).done;){n.value.apply(this,i)}}catch(t){r.e(t)}finally{r.f()}}t.prototype.emit.apply(this,i),this.Ot&&i.length&&"string"==typeof i[i.length-1]&&(this.Mt=i[i.length-1])},n.ack=function(t){var i=this,n=!1;return function(){if(!n){n=!0;for(var r=arguments.length,e=new Array(r),s=0;s<r;s++)e[s]=arguments[s];i.packet({type:jt.ACK,id:t,data:e})}}},n.onack=function(t){var i=this.acks[t.id];"function"==typeof i&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))},n.onconnect=function(t,i){this.id=t,this.recovered=i&&this.Ot===i,this.Ot=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.At(!0)},n.emitBuffered=function(){var t=this;this.receiveBuffer.forEach((function(i){return t.emitEvent(i)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(i){t.notifyOutgoingListeners(i),t.packet(i)})),this.sendBuffer=[]},n.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},n.destroy=function(){this.subs&&(this.subs.forEach((function(t){return t()})),this.subs=void 0),this.io.Ct(this)},n.disconnect=function(){return this.connected&&this.packet({type:jt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},n.close=function(){return this.disconnect()},n.compress=function(t){return this.flags.compress=t,this},n.timeout=function(t){return this.flags.timeout=t,this},n.onAny=function(t){return this.Bt=this.Bt||[],this.Bt.push(t),this},n.prependAny=function(t){return this.Bt=this.Bt||[],this.Bt.unshift(t),this},n.offAny=function(t){if(!this.Bt)return this;if(t){for(var i=this.Bt,n=0;n<i.length;n++)if(t===i[n])return i.splice(n,1),this}else this.Bt=[];return this},n.listenersAny=function(){return this.Bt||[]},n.onAnyOutgoing=function(t){return this.Tt=this.Tt||[],this.Tt.push(t),this},n.prependAnyOutgoing=function(t){return this.Tt=this.Tt||[],this.Tt.unshift(t),this},n.offAnyOutgoing=function(t){if(!this.Tt)return this;if(t){for(var i=this.Tt,n=0;n<i.length;n++)if(t===i[n])return i.splice(n,1),this}else this.Tt=[];return this},n.listenersAnyOutgoing=function(){return this.Tt||[]},n.notifyOutgoingListeners=function(t){if(this.Tt&&this.Tt.length){var i,n=e(this.Tt.slice());try{for(n.s();!(i=n.n()).done;){i.value.apply(this,t.data)}}catch(t){n.e(t)}finally{n.f()}}},r(i,[{key:"disconnected",get:function(){return!this.connected}},{key:"active",get:function(){return!!this.subs}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}}])}($);function Pt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Pt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),n=Math.floor(i*this.jitter*t);t=1&Math.floor(10*i)?t+n:t-n}return 0|Math.min(t,this.max)},Pt.prototype.reset=function(){this.attempts=0},Pt.prototype.setMin=function(t){this.ms=t},Pt.prototype.setMax=function(t){this.max=t},Pt.prototype.setJitter=function(t){this.jitter=t};var Vt=function(t){function i(i,n){var r,e;(r=t.call(this)||this).nsps={},r.subs=[],i&&"object"===a(i)&&(n=i,i=void 0),(n=n||{}).path=n.path||"/socket.io",r.opts=n,V(r,n),r.reconnection(!1!==n.reconnection),r.reconnectionAttempts(n.reconnectionAttempts||1/0),r.reconnectionDelay(n.reconnectionDelay||1e3),r.reconnectionDelayMax(n.reconnectionDelayMax||5e3),r.randomizationFactor(null!==(e=n.randomizationFactor)&&void 0!==e?e:.5),r.backoff=new Pt({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==n.timeout?2e4:n.timeout),r.bt="closed",r.uri=i;var s=n.parser||It;return r.encoder=new s.Encoder,r.decoder=new s.Decoder,r.yt=!1!==n.autoConnect,r.yt&&r.open(),r}h(i,t);var n=i.prototype;return n.reconnection=function(t){return arguments.length?(this.Ut=!!t,t||(this.skipReconnect=!0),this):this.Ut},n.reconnectionAttempts=function(t){return void 0===t?this._t:(this._t=t,this)},n.reconnectionDelay=function(t){var i;return void 0===t?this.xt:(this.xt=t,null===(i=this.backoff)||void 0===i||i.setMin(t),this)},n.randomizationFactor=function(t){var i;return void 0===t?this.Dt:(this.Dt=t,null===(i=this.backoff)||void 0===i||i.setJitter(t),this)},n.reconnectionDelayMax=function(t){var i;return void 0===t?this.$t:(this.$t=t,null===(i=this.backoff)||void 0===i||i.setMax(t),this)},n.timeout=function(t){return arguments.length?(this.It=t,this):this.It},n.maybeReconnectOnOpen=function(){!this.wt&&this.Ut&&0===this.backoff.attempts&&this.reconnect()},n.open=function(t){var i=this;if(~this.bt.indexOf("open"))return this;this.engine=new pt(this.uri,this.opts);var n=this.engine,r=this;this.bt="opening",this.skipReconnect=!1;var e=Rt(n,"open",(function(){r.onopen(),t&&t()})),s=function(n){i.cleanup(),i.bt="closed",i.emitReserved("error",n),t?t(n):i.maybeReconnectOnOpen()},o=Rt(n,"error",s);if(!1!==this.It){var h=this.It,u=this.setTimeoutFn((function(){e(),s(new Error("timeout")),n.close()}),h);this.opts.autoUnref&&u.unref(),this.subs.push((function(){i.clearTimeoutFn(u)}))}return this.subs.push(e),this.subs.push(o),this},n.connect=function(t){return this.open(t)},n.onopen=function(){this.cleanup(),this.bt="open",this.emitReserved("open");var t=this.engine;this.subs.push(Rt(t,"ping",this.onping.bind(this)),Rt(t,"data",this.ondata.bind(this)),Rt(t,"error",this.onerror.bind(this)),Rt(t,"close",this.onclose.bind(this)),Rt(this.decoder,"decoded",this.ondecoded.bind(this)))},n.onping=function(){this.emitReserved("ping")},n.ondata=function(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}},n.ondecoded=function(t){var i=this;I((function(){i.emitReserved("packet",t)}),this.setTimeoutFn)},n.onerror=function(t){this.emitReserved("error",t)},n.socket=function(t,i){var n=this.nsps[t];return n?this.yt&&!n.active&&n.connect():(n=new Nt(this,t,i),this.nsps[t]=n),n},n.Ct=function(t){for(var i=0,n=Object.keys(this.nsps);i<n.length;i++){var r=n[i];if(this.nsps[r].active)return}this.Rt()},n.Et=function(t){for(var i=this.encoder.encode(t),n=0;n<i.length;n++)this.engine.write(i[n],t.options)},n.cleanup=function(){this.subs.forEach((function(t){return t()})),this.subs.length=0,this.decoder.destroy()},n.Rt=function(){this.skipReconnect=!0,this.wt=!1,this.onclose("forced close")},n.disconnect=function(){return this.Rt()},n.onclose=function(t,i){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this.bt="closed",this.emitReserved("close",t,i),this.Ut&&!this.skipReconnect&&this.reconnect()},n.reconnect=function(){var t=this;if(this.wt||this.skipReconnect)return this;var i=this;if(this.backoff.attempts>=this._t)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.wt=!1;else{var n=this.backoff.duration();this.wt=!0;var r=this.setTimeoutFn((function(){i.skipReconnect||(t.emitReserved("reconnect_attempt",i.backoff.attempts),i.skipReconnect||i.open((function(n){n?(i.wt=!1,i.reconnect(),t.emitReserved("reconnect_error",n)):i.onreconnect()})))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){t.clearTimeoutFn(r)}))}},n.onreconnect=function(){var t=this.backoff.attempts;this.wt=!1,this.backoff.reset(),this.emitReserved("reconnect",t)},i}($),qt={};function Ft(t,i){"object"===a(t)&&(i=t,t=void 0);var n,r=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=ct(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var e=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+e+":"+r.port+i,r.href=r.protocol+"://"+e+(n&&n.port===r.port?"":":"+r.port),r}(t,(i=i||{}).path||"/socket.io"),e=r.source,s=r.id,o=r.path,h=qt[s]&&o in qt[s].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||h?n=new Vt(e,i):(qt[s]||(qt[s]=new Vt(e,i)),n=qt[s]),r.query&&!i.query&&(i.query=r.queryKey),n.socket(r.path,i)}return s(Ft,{Manager:Vt,Socket:Nt,io:Ft,connect:Ft}),Ft})); | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).io=i()}(this,(function(){"use strict";function t(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}}))})),Object.freeze(t)}function i(t,i){(null==i||i>t.length)&&(i=t.length);for(var n=0,r=Array(i);n<i;n++)r[n]=t[n];return r}function n(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function r(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return i(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var e=0,s=function(){};return{s:s,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,h=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return h=t.done,t},e:function(t){u=!0,o=t},f:function(){try{h||null==r.return||r.return()}finally{if(u)throw o}}}}function s(){return s=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(null,arguments)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function h(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,f(t,i)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(u=function(){return!!t})()}function f(t,i){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},f(t,i)}function c(t){var i=function(t,i){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,i||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:i+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function v(t){var i="function"==typeof Map?new Map:void 0;return v=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(i){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,n)}function n(){return function(t,i,n){if(u())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,i);var e=new(t.bind.apply(t,r));return n&&f(e,n.prototype),e}(t,arguments,o(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,t)},v(t)}var l=Object.create(null);l.open="0",l.close="1",l.ping="2",l.pong="3",l.message="4",l.upgrade="5",l.noop="6";var d=Object.create(null);Object.keys(l).forEach((function(t){d[l[t]]=t}));var p,y={type:"error",data:"parser error"},w="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),b="function"==typeof ArrayBuffer,g=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},m=function(t,i,n){var r=t.type,e=t.data;return w&&e instanceof Blob?i?n(e):k(e,n):b&&(e instanceof ArrayBuffer||g(e))?i?n(e):k(new Blob([e]),n):n(l[r]+(e||""))},k=function(t,i){var n=new FileReader;return n.onload=function(){var t=n.result.split(",")[1];i("b"+(t||""))},n.readAsDataURL(t)};function A(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}for(var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256),O=0;O<64;O++)j[E.charCodeAt(O)]=O;var M,S="function"==typeof ArrayBuffer,B=function(t,i){if("string"!=typeof t)return{type:"message",data:T(t,i)};var n=t.charAt(0);return"b"===n?{type:"message",data:C(t.substring(1),i)}:d[n]?t.length>1?{type:d[n],data:t.substring(1)}:{type:d[n]}:y},C=function(t,i){if(S){var n=function(t){var i,n,r,e,s,o=.75*t.length,h=t.length,u=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);var f=new ArrayBuffer(o),c=new Uint8Array(f);for(i=0;i<h;i+=4)n=j[t.charCodeAt(i)],r=j[t.charCodeAt(i+1)],e=j[t.charCodeAt(i+2)],s=j[t.charCodeAt(i+3)],c[u++]=n<<2|r>>4,c[u++]=(15&r)<<4|e>>2,c[u++]=(3&e)<<6|63&s;return f}(t);return T(n,i)}return{base64:!0,data:t}},T=function(t,i){return"blob"===i?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer},U=String.fromCharCode(30);function _(){return new TransformStream({transform:function(t,i){!function(t,i){w&&t.data instanceof Blob?t.data.arrayBuffer().then(A).then(i):b&&(t.data instanceof ArrayBuffer||g(t.data))?i(A(t.data)):m(t,!1,(function(t){p||(p=new TextEncoder),i(p.encode(t))}))}(t,(function(n){var r,e=n.length;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);var s=new DataView(r.buffer);s.setUint8(0,126),s.setUint16(1,e)}else{r=new Uint8Array(9);var o=new DataView(r.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(e))}t.data&&"string"!=typeof t.data&&(r[0]|=128),i.enqueue(r),i.enqueue(n)}))}})}function x(t){return t.reduce((function(t,i){return t+i.length}),0)}function D(t,i){if(t[0].length===i)return t.shift();for(var n=new Uint8Array(i),r=0,e=0;e<i;e++)n[e]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function $(t){if(t)return function(t){for(var i in $.prototype)t[i]=$.prototype[i];return t}(t)}$.prototype.on=$.prototype.addEventListener=function(t,i){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(i),this},$.prototype.once=function(t,i){function n(){this.off(t,n),i.apply(this,arguments)}return n.fn=i,this.on(t,n),this},$.prototype.off=$.prototype.removeListener=$.prototype.removeAllListeners=$.prototype.removeEventListener=function(t,i){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var n,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var e=0;e<r.length;e++)if((n=r[e])===i||n.fn===i){r.splice(e,1);break}return 0===r.length&&delete this.t["$"+t],this},$.prototype.emit=function(t){this.t=this.t||{};for(var i=new Array(arguments.length-1),n=this.t["$"+t],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(n){r=0;for(var e=(n=n.slice(0)).length;r<e;++r)n[r].apply(this,i)}return this},$.prototype.emitReserved=$.prototype.emit,$.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},$.prototype.hasListeners=function(t){return!!this.listeners(t).length};var I="function"==typeof Promise&&"function"==typeof Promise.resolve?function(t){return Promise.resolve().then(t)}:function(t,i){return i(t,0)},R="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function L(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.reduce((function(i,n){return t.hasOwnProperty(n)&&(i[n]=t[n]),i}),{})}var N=R.setTimeout,P=R.clearTimeout;function V(t,i){i.useNativeTimers?(t.setTimeoutFn=N.bind(R),t.clearTimeoutFn=P.bind(R)):(t.setTimeoutFn=R.setTimeout.bind(R),t.clearTimeoutFn=R.clearTimeout.bind(R))}function q(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var F=function(t){function i(i,n,r){var e;return(e=t.call(this,i)||this).description=n,e.context=r,e.type="TransportError",e}return h(i,t),i}(v(Error)),X=function(t){function i(i){var n;return(n=t.call(this)||this).writable=!1,V(n,i),n.opts=i,n.query=i.query,n.socket=i.socket,n.supportsBinary=!i.forceBase64,n}h(i,t);var n=i.prototype;return n.onError=function(i,n,r){return t.prototype.emitReserved.call(this,"error",new F(i,n,r)),this},n.open=function(){return this.readyState="opening",this.doOpen(),this},n.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},n.send=function(t){"open"===this.readyState&&this.write(t)},n.onOpen=function(){this.readyState="open",this.writable=!0,t.prototype.emitReserved.call(this,"open")},n.onData=function(t){var i=B(t,this.socket.binaryType);this.onPacket(i)},n.onPacket=function(i){t.prototype.emitReserved.call(this,"packet",i)},n.onClose=function(i){this.readyState="closed",t.prototype.emitReserved.call(this,"close",i)},n.pause=function(t){},n.createUri=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t+"://"+this.i()+this.o()+this.opts.path+this.h(i)},n.i=function(){var t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"},n.o=function(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""},n.h=function(t){var i=function(t){var i="";for(var n in t)t.hasOwnProperty(n)&&(i.length&&(i+="&"),i+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return i}(t);return i.length?"?"+i:""},i}($),H=function(t){function i(){var i;return(i=t.apply(this,arguments)||this).u=!1,i}h(i,t);var n=i.prototype;return n.doOpen=function(){this.v()},n.pause=function(t){var i=this;this.readyState="pausing";var n=function(){i.readyState="paused",t()};if(this.u||!this.writable){var r=0;this.u&&(r++,this.once("pollComplete",(function(){--r||n()}))),this.writable||(r++,this.once("drain",(function(){--r||n()})))}else n()},n.v=function(){this.u=!0,this.doPoll(),this.emitReserved("poll")},n.onData=function(t){var i=this;(function(t,i){for(var n=t.split(U),r=[],e=0;e<n.length;e++){var s=B(n[e],i);if(r.push(s),"error"===s.type)break}return r})(t,this.socket.binaryType).forEach((function(t){if("opening"===i.readyState&&"open"===t.type&&i.onOpen(),"close"===t.type)return i.onClose({description:"transport closed by the server"}),!1;i.onPacket(t)})),"closed"!==this.readyState&&(this.u=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.v())},n.doClose=function(){var t=this,i=function(){t.write([{type:"close"}])};"open"===this.readyState?i():this.once("open",i)},n.write=function(t){var i=this;this.writable=!1,function(t,i){var n=t.length,r=new Array(n),e=0;t.forEach((function(t,s){m(t,!1,(function(t){r[s]=t,++e===n&&i(r.join(U))}))}))}(t,(function(t){i.doWrite(t,(function(){i.writable=!0,i.emitReserved("drain")}))}))},n.uri=function(){var t=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=q()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(t,i)},r(i,[{key:"name",get:function(){return"polling"}}])}(X),z=!1;try{z="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}var G=z;function J(){}var K=function(t){function i(i){var n;if(n=t.call(this,i)||this,"undefined"!=typeof location){var r="https:"===location.protocol,e=location.port;e||(e=r?"443":"80"),n.xd="undefined"!=typeof location&&i.hostname!==location.hostname||e!==i.port}return n}h(i,t);var n=i.prototype;return n.doWrite=function(t,i){var n=this,r=this.request({method:"POST",data:t});r.on("success",i),r.on("error",(function(t,i){n.onError("xhr post error",t,i)}))},n.doPoll=function(){var t=this,i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(function(i,n){t.onError("xhr poll error",i,n)})),this.pollXhr=i},i}(H),Q=function(t){function i(i,n,r){var e;return(e=t.call(this)||this).createRequest=i,V(e,r),e.l=r,e.p=r.method||"GET",e.m=n,e.k=void 0!==r.data?r.data:null,e.A(),e}h(i,t);var n=i.prototype;return n.A=function(){var t,n=this,r=L(this.l,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.l.xd;var e=this.j=this.createRequest(r);try{e.open(this.p,this.m,!0);try{if(this.l.extraHeaders)for(var s in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.l.extraHeaders)this.l.extraHeaders.hasOwnProperty(s)&&e.setRequestHeader(s,this.l.extraHeaders[s])}catch(t){}if("POST"===this.p)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.l.cookieJar)||void 0===t||t.addCookies(e),"withCredentials"in e&&(e.withCredentials=this.l.withCredentials),this.l.requestTimeout&&(e.timeout=this.l.requestTimeout),e.onreadystatechange=function(){var t;3===e.readyState&&(null===(t=n.l.cookieJar)||void 0===t||t.parseCookies(e.getResponseHeader("set-cookie"))),4===e.readyState&&(200===e.status||1223===e.status?n.O():n.setTimeoutFn((function(){n.M("number"==typeof e.status?e.status:0)}),0))},e.send(this.k)}catch(t){return void this.setTimeoutFn((function(){n.M(t)}),0)}"undefined"!=typeof document&&(this.S=i.requestsCount++,i.requests[this.S]=this)},n.M=function(t){this.emitReserved("error",t,this.j),this.B(!0)},n.B=function(t){if(void 0!==this.j&&null!==this.j){if(this.j.onreadystatechange=J,t)try{this.j.abort()}catch(t){}"undefined"!=typeof document&&delete i.requests[this.S],this.j=null}},n.O=function(){var t=this.j.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.B())},n.abort=function(){this.B()},i}($);if(Q.requestsCount=0,Q.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",W);else if("function"==typeof addEventListener){addEventListener("onpagehide"in R?"pagehide":"unload",W,!1)}function W(){for(var t in Q.requests)Q.requests.hasOwnProperty(t)&&Q.requests[t].abort()}var Y,Z=(Y=it({xdomain:!1}))&&null!==Y.responseType,tt=function(t){function i(i){var n;n=t.call(this,i)||this;var r=i&&i.forceBase64;return n.supportsBinary=Z&&!r,n}return h(i,t),i.prototype.request=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(t,{xd:this.xd},this.opts),new Q(it,this.uri(),t)},i}(K);function it(t){var i=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!i||G))return new XMLHttpRequest}catch(t){}if(!i)try{return new(R[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}var nt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),rt=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var n=i.prototype;return n.doOpen=function(){var t=this.uri(),i=this.opts.protocols,n=nt?{}:L(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,n)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()},n.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws.C.unref(),t.onOpen()},this.ws.onclose=function(i){return t.onClose({description:"websocket connection closed",context:i})},this.ws.onmessage=function(i){return t.onData(i.data)},this.ws.onerror=function(i){return t.onError("websocket error",i)}},n.write=function(t){var i=this;this.writable=!1;for(var n=function(){var n=t[r],e=r===t.length-1;m(n,i.supportsBinary,(function(t){try{i.doWrite(n,t)}catch(t){}e&&I((function(){i.writable=!0,i.emitReserved("drain")}),i.setTimeoutFn)}))},r=0;r<t.length;r++)n()},n.doClose=function(){void 0!==this.ws&&(this.ws.onerror=function(){},this.ws.close(),this.ws=null)},n.uri=function(){var t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=q()),this.supportsBinary||(i.b64=1),this.createUri(t,i)},r(i,[{key:"name",get:function(){return"websocket"}}])}(X),et=R.WebSocket||R.MozWebSocket,st=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var n=i.prototype;return n.createSocket=function(t,i,n){return nt?new et(t,i,n):i?new et(t,i):new et(t)},n.doWrite=function(t,i){this.ws.send(i)},i}(rt),ot=function(t){function i(){return t.apply(this,arguments)||this}h(i,t);var n=i.prototype;return n.doOpen=function(){var t=this;try{this.T=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.T.closed.then((function(){t.onClose()})).catch((function(i){t.onError("webtransport error",i)})),this.T.ready.then((function(){t.T.createBidirectionalStream().then((function(i){var n=function(t,i){M||(M=new TextDecoder);var n=[],r=0,e=-1,s=!1;return new TransformStream({transform:function(o,h){for(n.push(o);;){if(0===r){if(x(n)<1)break;var u=D(n,1);s=!(128&~u[0]),e=127&u[0],r=e<126?3:126===e?1:2}else if(1===r){if(x(n)<2)break;var f=D(n,2);e=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),r=3}else if(2===r){if(x(n)<8)break;var c=D(n,8),a=new DataView(c.buffer,c.byteOffset,c.length),v=a.getUint32(0);if(v>Math.pow(2,21)-1){h.enqueue(y);break}e=v*Math.pow(2,32)+a.getUint32(4),r=3}else{if(x(n)<e)break;var l=D(n,e);h.enqueue(B(s?l:M.decode(l),i)),r=0}if(0===e||e>t){h.enqueue(y);break}}}})}(Number.MAX_SAFE_INTEGER,t.socket.binaryType),r=i.readable.pipeThrough(n).getReader(),e=_();e.readable.pipeTo(i.writable),t.U=e.writable.getWriter();!function i(){r.read().then((function(n){var r=n.done,e=n.value;r||(t.onPacket(e),i())})).catch((function(t){}))}();var s={type:"open"};t.query.sid&&(s.data='{"sid":"'.concat(t.query.sid,'"}')),t.U.write(s).then((function(){return t.onOpen()}))}))}))},n.write=function(t){var i=this;this.writable=!1;for(var n=function(){var n=t[r],e=r===t.length-1;i.U.write(n).then((function(){e&&I((function(){i.writable=!0,i.emitReserved("drain")}),i.setTimeoutFn)}))},r=0;r<t.length;r++)n()},n.doClose=function(){var t;null===(t=this.T)||void 0===t||t.close()},r(i,[{key:"name",get:function(){return"webtransport"}}])}(X),ht={websocket:st,webtransport:ot,polling:tt},ut=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ft=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ct(t){if(t.length>8e3)throw"URI too long";var i=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));for(var e,s,o=ut.exec(t||""),h={},u=14;u--;)h[ft[u]]=o[u]||"";return-1!=n&&-1!=r&&(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=function(t,i){var n=/\/{2,9}/g,r=i.replace(n,"/").split("/");"/"!=i.slice(0,1)&&0!==i.length||r.splice(0,1);"/"==i.slice(-1)&&r.splice(r.length-1,1);return r}(0,h.path),h.queryKey=(e=h.query,s={},e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,i,n){i&&(s[i]=n)})),s),h}var at="function"==typeof addEventListener&&"function"==typeof removeEventListener,vt=[];at&&addEventListener("offline",(function(){vt.forEach((function(t){return t()}))}),!1);var lt=function(t){function i(i,n){var r;if((r=t.call(this)||this).binaryType="arraybuffer",r.writeBuffer=[],r._=0,r.D=-1,r.$=-1,r.I=-1,r.R=1/0,i&&"object"===a(i)&&(n=i,i=null),i){var e=ct(i);n.hostname=e.host,n.secure="https"===e.protocol||"wss"===e.protocol,n.port=e.port,e.query&&(n.query=e.query)}else n.host&&(n.hostname=ct(n.host).host);return V(r,n),r.secure=null!=n.secure?n.secure:"undefined"!=typeof location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=r.secure?"443":"80"),r.hostname=n.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=n.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=[],r.L={},n.transports.forEach((function(t){var i=t.prototype.name;r.transports.push(i),r.L[i]=t})),r.opts=s({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),r.opts.path=r.opts.path.replace(/\/$/,"")+(r.opts.addTrailingSlash?"/":""),"string"==typeof r.opts.query&&(r.opts.query=function(t){for(var i={},n=t.split("&"),r=0,e=n.length;r<e;r++){var s=n[r].split("=");i[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return i}(r.opts.query)),at&&(r.opts.closeOnBeforeunload&&(r.N=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.N,!1)),"localhost"!==r.hostname&&(r.P=function(){r.V("transport close",{description:"network connection lost"})},vt.push(r.P))),r.opts.withCredentials&&(r.q=void 0),r.F(),r}h(i,t);var n=i.prototype;return n.createTransport=function(t){var i=s({},this.opts.query);i.EIO=4,i.transport=t,this.id&&(i.sid=this.id);var n=s({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.L[t](n)},n.F=function(){var t=this;if(0!==this.transports.length){var n=this.opts.rememberUpgrade&&i.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";var r=this.createTransport(n);r.open(),this.setTransport(r)}else this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0)},n.setTransport=function(t){var i=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.X.bind(this)).on("packet",this.H.bind(this)).on("error",this.M.bind(this)).on("close",(function(t){return i.V("transport close",t)}))},n.onOpen=function(){this.readyState="open",i.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()},n.H=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.G("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.J();break;case"error":var i=new Error("server error");i.code=t.data,this.M(i);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}},n.onHandshake=function(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.D=t.pingInterval,this.$=t.pingTimeout,this.I=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.J()},n.J=function(){var t=this;this.clearTimeoutFn(this.K);var i=this.D+this.$;this.R=Date.now()+i,this.K=this.setTimeoutFn((function(){t.V("ping timeout")}),i),this.opts.autoUnref&&this.K.unref()},n.X=function(){this.writeBuffer.splice(0,this._),this._=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()},n.flush=function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var t=this.W();this.transport.send(t),this._=t.length,this.emitReserved("flush")}},n.W=function(){if(!(this.I&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var t,i=1,n=0;n<this.writeBuffer.length;n++){var r=this.writeBuffer[n].data;if(r&&(i+="string"==typeof(t=r)?function(t){for(var i=0,n=0,r=0,e=t.length;r<e;r++)(i=t.charCodeAt(r))<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&i>this.I)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer},n.Y=function(){var t=this;if(!this.R)return!0;var i=Date.now()>this.R;return i&&(this.R=0,I((function(){t.V("ping timeout")}),this.setTimeoutFn)),i},n.write=function(t,i,n){return this.G("message",t,i,n),this},n.send=function(t,i,n){return this.G("message",t,i,n),this},n.G=function(t,i,n,r){if("function"==typeof i&&(r=i,i=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var e={type:t,data:i,options:n};this.emitReserved("packetCreate",e),this.writeBuffer.push(e),r&&this.once("flush",r),this.flush()}},n.close=function(){var t=this,i=function(){t.V("forced close"),t.transport.close()},n=function n(){t.off("upgrade",n),t.off("upgradeError",n),i()},r=function(){t.once("upgrade",n),t.once("upgradeError",n)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){t.upgrading?r():i()})):this.upgrading?r():i()),this},n.M=function(t){if(i.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.F();this.emitReserved("error",t),this.V("transport error",t)},n.V=function(t,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.K),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),at&&(this.N&&removeEventListener("beforeunload",this.N,!1),this.P)){var n=vt.indexOf(this.P);-1!==n&&vt.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,i),this.writeBuffer=[],this._=0}},i}($);lt.protocol=4;var dt=function(t){function i(){var i;return(i=t.apply(this,arguments)||this).Z=[],i}h(i,t);var n=i.prototype;return n.onOpen=function(){if(t.prototype.onOpen.call(this),"open"===this.readyState&&this.opts.upgrade)for(var i=0;i<this.Z.length;i++)this.tt(this.Z[i])},n.tt=function(t){var i=this,n=this.createTransport(t),r=!1;lt.priorWebsocketSuccess=!1;var e=function(){r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",(function(t){if(!r)if("pong"===t.type&&"probe"===t.data){if(i.upgrading=!0,i.emitReserved("upgrading",n),!n)return;lt.priorWebsocketSuccess="websocket"===n.name,i.transport.pause((function(){r||"closed"!==i.readyState&&(c(),i.setTransport(n),n.send([{type:"upgrade"}]),i.emitReserved("upgrade",n),n=null,i.upgrading=!1,i.flush())}))}else{var e=new Error("probe error");e.transport=n.name,i.emitReserved("upgradeError",e)}})))};function s(){r||(r=!0,c(),n.close(),n=null)}var o=function(t){var r=new Error("probe error: "+t);r.transport=n.name,s(),i.emitReserved("upgradeError",r)};function h(){o("transport closed")}function u(){o("socket closed")}function f(t){n&&t.name!==n.name&&s()}var c=function(){n.removeListener("open",e),n.removeListener("error",o),n.removeListener("close",h),i.off("close",u),i.off("upgrading",f)};n.once("open",e),n.once("error",o),n.once("close",h),this.once("close",u),this.once("upgrading",f),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((function(){r||n.open()}),200):n.open()},n.onHandshake=function(i){this.Z=this.it(i.upgrades),t.prototype.onHandshake.call(this,i)},n.it=function(t){for(var i=[],n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&i.push(t[n]);return i},i}(lt),pt=function(t){function i(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="object"===a(i)?i:n;return(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map((function(t){return ht[t]})).filter((function(t){return!!t}))),t.call(this,i,r)||this}return h(i,t),i}(dt);pt.protocol;var yt={},wt={};function bt(t,i,n){for(var r=0,e=0,s=n.length;e<s;e++)(r=n.charCodeAt(e))<128?t.setUint8(i++,r):r<2048?(t.setUint8(i++,192|r>>6),t.setUint8(i++,128|63&r)):r<55296||r>=57344?(t.setUint8(i++,224|r>>12),t.setUint8(i++,128|r>>6&63),t.setUint8(i++,128|63&r)):(e++,r=65536+((1023&r)<<10|1023&n.charCodeAt(e)),t.setUint8(i++,240|r>>18),t.setUint8(i++,128|r>>12&63),t.setUint8(i++,128|r>>6&63),t.setUint8(i++,128|63&r))}function gt(t,i,n){var r=a(n),e=0,s=0,o=0,h=0,u=0,f=0;if("string"===r){if(u=function(t){for(var i=0,n=0,r=0,e=t.length;r<e;r++)(i=t.charCodeAt(r))<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(r++,n+=4);return n}(n),u<32)t.push(160|u),f=1;else if(u<256)t.push(217,u),f=2;else if(u<65536)t.push(218,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("String too long");t.push(219,u>>24,u>>16,u>>8,u),f=5}return i.push({nt:n,rt:u,et:t.length}),f+u}if("number"===r)return Math.floor(n)===n&&isFinite(n)?n>=0?n<128?(t.push(n),1):n<256?(t.push(204,n),2):n<65536?(t.push(205,n>>8,n),3):n<4294967296?(t.push(206,n>>24,n>>16,n>>8,n),5):(o=n/Math.pow(2,32)|0,h=n>>>0,t.push(207,o>>24,o>>16,o>>8,o,h>>24,h>>16,h>>8,h),9):n>=-32?(t.push(n),1):n>=-128?(t.push(208,n),2):n>=-32768?(t.push(209,n>>8,n),3):n>=-2147483648?(t.push(210,n>>24,n>>16,n>>8,n),5):(o=Math.floor(n/Math.pow(2,32)),h=n>>>0,t.push(211,o>>24,o>>16,o>>8,o,h>>24,h>>16,h>>8,h),9):(t.push(203),i.push({st:n,rt:8,et:t.length}),9);if("object"===r){if(null===n)return t.push(192),1;if(Array.isArray(n)){if((u=n.length)<16)t.push(144|u),f=1;else if(u<65536)t.push(220,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("Array too large");t.push(221,u>>24,u>>16,u>>8,u),f=5}for(e=0;e<u;e++)f+=gt(t,i,n[e]);return f}if(n instanceof Date){var c=n.getTime();return o=Math.floor(c/Math.pow(2,32)),h=c>>>0,t.push(215,0,o>>24,o>>16,o>>8,o,h>>24,h>>16,h>>8,h),10}if(n instanceof ArrayBuffer){if((u=n.byteLength)<256)t.push(196,u),f=2;else if(u<65536)t.push(197,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("Buffer too large");t.push(198,u>>24,u>>16,u>>8,u),f=5}return i.push({ot:n,rt:u,et:t.length}),f+u}if("function"==typeof n.toJSON)return gt(t,i,n.toJSON());var v=[],l="",d=Object.keys(n);for(e=0,s=d.length;e<s;e++)"function"!=typeof n[l=d[e]]&&v.push(l);if((u=v.length)<16)t.push(128|u),f=1;else if(u<65536)t.push(222,u>>8,u),f=3;else{if(!(u<4294967296))throw new Error("Object too large");t.push(223,u>>24,u>>16,u>>8,u),f=5}for(e=0;e<u;e++)f+=gt(t,i,l=v[e]),f+=gt(t,i,n[l]);return f}if("boolean"===r)return t.push(n?195:194),1;if("undefined"===r)return t.push(212,0,0),3;throw new Error("Could not encode")}var mt=function(t){var i=[],n=[],r=gt(i,n,t),e=new ArrayBuffer(r),s=new DataView(e),o=0,h=0,u=-1;n.length>0&&(u=n[0].et);for(var f,c=0,a=0,v=0,l=i.length;v<l;v++)if(s.setUint8(h+v,i[v]),v+1===u){if(c=(f=n[o]).rt,a=h+u,f.ot)for(var d=new Uint8Array(f.ot),p=0;p<c;p++)s.setUint8(a+p,d[p]);else f.nt?bt(s,a,f.nt):void 0!==f.st&&s.setFloat64(a,f.st);h+=c,n[++o]&&(u=n[o].et)}return e};function kt(t){if(this.et=0,t instanceof ArrayBuffer)this.ht=t,this.ut=new DataView(this.ht);else{if(!ArrayBuffer.isView(t))throw new Error("Invalid argument");this.ht=t.buffer,this.ut=new DataView(this.ht,t.byteOffset,t.byteLength)}}kt.prototype.ft=function(t){for(var i=new Array(t),n=0;n<t;n++)i[n]=this.ct();return i},kt.prototype.vt=function(t){for(var i={},n=0;n<t;n++)i[this.ct()]=this.ct();return i},kt.prototype.nt=function(t){var i=function(t,i,n){for(var r="",e=0,s=i,o=i+n;s<o;s++){var h=t.getUint8(s);if(128&h)if(192!=(224&h))if(224!=(240&h)){if(240!=(248&h))throw new Error("Invalid byte "+h.toString(16));(e=(7&h)<<18|(63&t.getUint8(++s))<<12|(63&t.getUint8(++s))<<6|63&t.getUint8(++s))>=65536?(e-=65536,r+=String.fromCharCode(55296+(e>>>10),56320+(1023&e))):r+=String.fromCharCode(e)}else r+=String.fromCharCode((15&h)<<12|(63&t.getUint8(++s))<<6|63&t.getUint8(++s));else r+=String.fromCharCode((31&h)<<6|63&t.getUint8(++s));else r+=String.fromCharCode(h)}return r}(this.ut,this.et,t);return this.et+=t,i},kt.prototype.ot=function(t){var i=this.ht.slice(this.et,this.et+t);return this.et+=t,i},kt.prototype.ct=function(){var t,i=this.ut.getUint8(this.et++),n=0,r=0,e=0,s=0;if(i<192)return i<128?i:i<144?this.vt(15&i):i<160?this.ft(15&i):this.nt(31&i);if(i>223)return-1*(255-i+1);switch(i){case 192:return null;case 194:return!1;case 195:return!0;case 196:return n=this.ut.getUint8(this.et),this.et+=1,this.ot(n);case 197:return n=this.ut.getUint16(this.et),this.et+=2,this.ot(n);case 198:return n=this.ut.getUint32(this.et),this.et+=4,this.ot(n);case 199:return n=this.ut.getUint8(this.et),r=this.ut.getInt8(this.et+1),this.et+=2,[r,this.ot(n)];case 200:return n=this.ut.getUint16(this.et),r=this.ut.getInt8(this.et+2),this.et+=3,[r,this.ot(n)];case 201:return n=this.ut.getUint32(this.et),r=this.ut.getInt8(this.et+4),this.et+=5,[r,this.ot(n)];case 202:return t=this.ut.getFloat32(this.et),this.et+=4,t;case 203:return t=this.ut.getFloat64(this.et),this.et+=8,t;case 204:return t=this.ut.getUint8(this.et),this.et+=1,t;case 205:return t=this.ut.getUint16(this.et),this.et+=2,t;case 206:return t=this.ut.getUint32(this.et),this.et+=4,t;case 207:return e=this.ut.getUint32(this.et)*Math.pow(2,32),s=this.ut.getUint32(this.et+4),this.et+=8,e+s;case 208:return t=this.ut.getInt8(this.et),this.et+=1,t;case 209:return t=this.ut.getInt16(this.et),this.et+=2,t;case 210:return t=this.ut.getInt32(this.et),this.et+=4,t;case 211:return e=this.ut.getInt32(this.et)*Math.pow(2,32),s=this.ut.getUint32(this.et+4),this.et+=8,e+s;case 212:return r=this.ut.getInt8(this.et),this.et+=1,0===r?void(this.et+=1):[r,this.ot(1)];case 213:return r=this.ut.getInt8(this.et),this.et+=1,[r,this.ot(2)];case 214:return r=this.ut.getInt8(this.et),this.et+=1,[r,this.ot(4)];case 215:return r=this.ut.getInt8(this.et),this.et+=1,0===r?(e=this.ut.getInt32(this.et)*Math.pow(2,32),s=this.ut.getUint32(this.et+4),this.et+=8,new Date(e+s)):[r,this.ot(8)];case 216:return r=this.ut.getInt8(this.et),this.et+=1,[r,this.ot(16)];case 217:return n=this.ut.getUint8(this.et),this.et+=1,this.nt(n);case 218:return n=this.ut.getUint16(this.et),this.et+=2,this.nt(n);case 219:return n=this.ut.getUint32(this.et),this.et+=4,this.nt(n);case 220:return n=this.ut.getUint16(this.et),this.et+=2,this.ft(n);case 221:return n=this.ut.getUint32(this.et),this.et+=4,this.ft(n);case 222:return n=this.ut.getUint16(this.et),this.et+=2,this.vt(n);case 223:return n=this.ut.getUint32(this.et),this.et+=4,this.vt(n)}throw new Error("Could not parse")};var At=function(t){var i=new kt(t),n=i.ct();if(i.et!==t.byteLength)throw new Error(t.byteLength-i.et+" trailing bytes");return n};wt.encode=mt,wt.decode=At;var Et={exports:{}};!function(t){function i(t){if(t)return function(t){for(var n in i.prototype)t[n]=i.prototype[n];return t}(t)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,i){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(i),this},i.prototype.once=function(t,i){function n(){this.off(t,n),i.apply(this,arguments)}return n.fn=i,this.on(t,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,i){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var n,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var e=0;e<r.length;e++)if((n=r[e])===i||n.fn===i){r.splice(e,1);break}return 0===r.length&&delete this.t["$"+t],this},i.prototype.emit=function(t){this.t=this.t||{};for(var i=new Array(arguments.length-1),n=this.t["$"+t],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(n){r=0;for(var e=(n=n.slice(0)).length;r<e;++r)n[r].apply(this,i)}return this},i.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}}(Et);var jt,Ot=wt,Mt=Et.exports,St=yt.protocol=5,Bt=jt=yt.PacketType={CONNECT:0,DISCONNECT:1,EVENT:2,ACK:3,CONNECT_ERROR:4},Ct=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Tt=function(t){return"string"==typeof t},Ut=function(t){return"[object Object]"===Object.prototype.toString.call(t)};function _t(){}function xt(){}_t.prototype.encode=function(t){return[Ot.encode(t)]},Mt(xt.prototype),xt.prototype.add=function(t){var i=Ot.decode(t);this.checkPacket(i),this.emit("decoded",i)},xt.prototype.checkPacket=function(t){if(!(Ct(t.type)&&t.type>=Bt.CONNECT&&t.type<=Bt.CONNECT_ERROR))throw new Error("invalid packet type");if(!Tt(t.nsp))throw new Error("invalid namespace");if(!function(t){switch(t.type){case Bt.CONNECT:return void 0===t.data||Ut(t.data);case Bt.DISCONNECT:return void 0===t.data;case Bt.CONNECT_ERROR:return Tt(t.data)||Ut(t.data);default:return Array.isArray(t.data)}}(t))throw new Error("invalid payload");if(!(void 0===t.id||Ct(t.id)))throw new Error("invalid packet id")},xt.prototype.destroy=function(){};var Dt=yt.Encoder=_t,$t=yt.Decoder=xt,It=t({__proto__:null,protocol:St,get PacketType(){return jt},Encoder:Dt,Decoder:$t,default:yt},[yt]);function Rt(t,i,n){return t.on(i,n),function(){t.off(i,n)}}var Lt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Nt=function(t){function i(i,n,r){var e;return(e=t.call(this)||this).connected=!1,e.recovered=!1,e.receiveBuffer=[],e.sendBuffer=[],e.lt=[],e.dt=0,e.ids=0,e.acks={},e.flags={},e.io=i,e.nsp=n,r&&r.auth&&(e.auth=r.auth),e.l=s({},r),e.io.yt&&e.open(),e}h(i,t);var n=i.prototype;return n.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[Rt(t,"open",this.onopen.bind(this)),Rt(t,"packet",this.onpacket.bind(this)),Rt(t,"error",this.onerror.bind(this)),Rt(t,"close",this.onclose.bind(this))]}},n.connect=function(){return this.connected||(this.subEvents(),this.io.wt||this.io.open(),"open"===this.io.bt&&this.onopen()),this},n.open=function(){return this.connect()},n.send=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.unshift("message"),this.emit.apply(this,i),this},n.emit=function(t){var i,n,r;if(Lt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');for(var e=arguments.length,s=new Array(e>1?e-1:0),o=1;o<e;o++)s[o-1]=arguments[o];if(s.unshift(t),this.l.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.gt(s),this;var h={type:jt.EVENT,data:s,options:{}};if(h.options.compress=!1!==this.flags.compress,"function"==typeof s[s.length-1]){var u=this.ids++,f=s.pop();this.kt(u,f),h.id=u}var c=null===(n=null===(i=this.io.engine)||void 0===i?void 0:i.transport)||void 0===n?void 0:n.writable,a=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r.Y());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this},n.kt=function(t,i){var n,r=this,e=null!==(n=this.flags.timeout)&&void 0!==n?n:this.l.ackTimeout;if(void 0!==e){var s=this.io.setTimeoutFn((function(){delete r.acks[t];for(var n=0;n<r.sendBuffer.length;n++)r.sendBuffer[n].id===t&&r.sendBuffer.splice(n,1);i.call(r,new Error("operation has timed out"))}),e),o=function(){r.io.clearTimeoutFn(s);for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];i.apply(r,n)};o.withError=!0,this.acks[t]=o}else this.acks[t]=i},n.emitWithAck=function(t){for(var i=this,n=arguments.length,r=new Array(n>1?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];return new Promise((function(n,e){var s=function(t,i){return t?e(t):n(i)};s.withError=!0,r.push(s),i.emit.apply(i,[t].concat(r))}))},n.gt=function(t){var i,n=this;"function"==typeof t[t.length-1]&&(i=t.pop());var r={id:this.dt++,tryCount:0,pending:!1,args:t,flags:s({fromQueue:!0},this.flags)};t.push((function(t){if(r===n.lt[0]){if(null!==t)r.tryCount>n.l.retries&&(n.lt.shift(),i&&i(t));else if(n.lt.shift(),i){for(var e=arguments.length,s=new Array(e>1?e-1:0),o=1;o<e;o++)s[o-1]=arguments[o];i.apply(void 0,[null].concat(s))}return r.pending=!1,n.At()}})),this.lt.push(r),this.At()},n.At=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.connected&&0!==this.lt.length){var i=this.lt[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}},n.packet=function(t){t.nsp=this.nsp,this.io.Et(t)},n.onopen=function(){var t=this;"function"==typeof this.auth?this.auth((function(i){t.jt(i)})):this.jt(this.auth)},n.jt=function(t){this.packet({type:jt.CONNECT,data:this.Ot?s({pid:this.Ot,offset:this.Mt},t):t})},n.onerror=function(t){this.connected||this.emitReserved("connect_error",t)},n.onclose=function(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this.St()},n.St=function(){var t=this;Object.keys(this.acks).forEach((function(i){if(!t.sendBuffer.some((function(t){return String(t.id)===i}))){var n=t.acks[i];delete t.acks[i],n.withError&&n.call(t,new Error("socket has been disconnected"))}}))},n.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case jt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 jt.EVENT:case jt.BINARY_EVENT:this.onevent(t);break;case jt.ACK:case jt.BINARY_ACK:this.onack(t);break;case jt.DISCONNECT:this.ondisconnect();break;case jt.CONNECT_ERROR:this.destroy();var i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i)}},n.onevent=function(t){var i=t.data||[];null!=t.id&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))},n.emitEvent=function(i){if(this.Bt&&this.Bt.length){var n,r=e(this.Bt.slice());try{for(r.s();!(n=r.n()).done;){n.value.apply(this,i)}}catch(t){r.e(t)}finally{r.f()}}t.prototype.emit.apply(this,i),this.Ot&&i.length&&"string"==typeof i[i.length-1]&&(this.Mt=i[i.length-1])},n.ack=function(t){var i=this,n=!1;return function(){if(!n){n=!0;for(var r=arguments.length,e=new Array(r),s=0;s<r;s++)e[s]=arguments[s];i.packet({type:jt.ACK,id:t,data:e})}}},n.onack=function(t){var i=this.acks[t.id];"function"==typeof i&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))},n.onconnect=function(t,i){this.id=t,this.recovered=i&&this.Ot===i,this.Ot=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.At(!0)},n.emitBuffered=function(){var t=this;this.receiveBuffer.forEach((function(i){return t.emitEvent(i)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(i){t.notifyOutgoingListeners(i),t.packet(i)})),this.sendBuffer=[]},n.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},n.destroy=function(){this.subs&&(this.subs.forEach((function(t){return t()})),this.subs=void 0),this.io.Ct(this)},n.disconnect=function(){return this.connected&&this.packet({type:jt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},n.close=function(){return this.disconnect()},n.compress=function(t){return this.flags.compress=t,this},n.timeout=function(t){return this.flags.timeout=t,this},n.onAny=function(t){return this.Bt=this.Bt||[],this.Bt.push(t),this},n.prependAny=function(t){return this.Bt=this.Bt||[],this.Bt.unshift(t),this},n.offAny=function(t){if(!this.Bt)return this;if(t){for(var i=this.Bt,n=0;n<i.length;n++)if(t===i[n])return i.splice(n,1),this}else this.Bt=[];return this},n.listenersAny=function(){return this.Bt||[]},n.onAnyOutgoing=function(t){return this.Tt=this.Tt||[],this.Tt.push(t),this},n.prependAnyOutgoing=function(t){return this.Tt=this.Tt||[],this.Tt.unshift(t),this},n.offAnyOutgoing=function(t){if(!this.Tt)return this;if(t){for(var i=this.Tt,n=0;n<i.length;n++)if(t===i[n])return i.splice(n,1),this}else this.Tt=[];return this},n.listenersAnyOutgoing=function(){return this.Tt||[]},n.notifyOutgoingListeners=function(t){if(this.Tt&&this.Tt.length){var i,n=e(this.Tt.slice());try{for(n.s();!(i=n.n()).done;){i.value.apply(this,t.data)}}catch(t){n.e(t)}finally{n.f()}}},r(i,[{key:"disconnected",get:function(){return!this.connected}},{key:"active",get:function(){return!!this.subs}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}}])}($);function Pt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Pt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),n=Math.floor(i*this.jitter*t);t=1&Math.floor(10*i)?t+n:t-n}return 0|Math.min(t,this.max)},Pt.prototype.reset=function(){this.attempts=0},Pt.prototype.setMin=function(t){this.ms=t},Pt.prototype.setMax=function(t){this.max=t},Pt.prototype.setJitter=function(t){this.jitter=t};var Vt=function(t){function i(i,n){var r,e;(r=t.call(this)||this).nsps={},r.subs=[],i&&"object"===a(i)&&(n=i,i=void 0),(n=n||{}).path=n.path||"/socket.io",r.opts=n,V(r,n),r.reconnection(!1!==n.reconnection),r.reconnectionAttempts(n.reconnectionAttempts||1/0),r.reconnectionDelay(n.reconnectionDelay||1e3),r.reconnectionDelayMax(n.reconnectionDelayMax||5e3),r.randomizationFactor(null!==(e=n.randomizationFactor)&&void 0!==e?e:.5),r.backoff=new Pt({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==n.timeout?2e4:n.timeout),r.bt="closed",r.uri=i;var s=n.parser||It;return r.encoder=new s.Encoder,r.decoder=new s.Decoder,r.yt=!1!==n.autoConnect,r.yt&&r.open(),r}h(i,t);var n=i.prototype;return n.reconnection=function(t){return arguments.length?(this.Ut=!!t,t||(this.skipReconnect=!0),this):this.Ut},n.reconnectionAttempts=function(t){return void 0===t?this._t:(this._t=t,this)},n.reconnectionDelay=function(t){var i;return void 0===t?this.xt:(this.xt=t,null===(i=this.backoff)||void 0===i||i.setMin(t),this)},n.randomizationFactor=function(t){var i;return void 0===t?this.Dt:(this.Dt=t,null===(i=this.backoff)||void 0===i||i.setJitter(t),this)},n.reconnectionDelayMax=function(t){var i;return void 0===t?this.$t:(this.$t=t,null===(i=this.backoff)||void 0===i||i.setMax(t),this)},n.timeout=function(t){return arguments.length?(this.It=t,this):this.It},n.maybeReconnectOnOpen=function(){!this.wt&&this.Ut&&0===this.backoff.attempts&&this.reconnect()},n.open=function(t){var i=this;if(~this.bt.indexOf("open"))return this;this.engine=new pt(this.uri,this.opts);var n=this.engine,r=this;this.bt="opening",this.skipReconnect=!1;var e=Rt(n,"open",(function(){r.onopen(),t&&t()})),s=function(n){i.cleanup(),i.bt="closed",i.emitReserved("error",n),t?t(n):i.maybeReconnectOnOpen()},o=Rt(n,"error",s);if(!1!==this.It){var h=this.It,u=this.setTimeoutFn((function(){e(),s(new Error("timeout")),n.close()}),h);this.opts.autoUnref&&u.unref(),this.subs.push((function(){i.clearTimeoutFn(u)}))}return this.subs.push(e),this.subs.push(o),this},n.connect=function(t){return this.open(t)},n.onopen=function(){this.cleanup(),this.bt="open",this.emitReserved("open");var t=this.engine;this.subs.push(Rt(t,"ping",this.onping.bind(this)),Rt(t,"data",this.ondata.bind(this)),Rt(t,"error",this.onerror.bind(this)),Rt(t,"close",this.onclose.bind(this)),Rt(this.decoder,"decoded",this.ondecoded.bind(this)))},n.onping=function(){this.emitReserved("ping")},n.ondata=function(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}},n.ondecoded=function(t){var i=this;I((function(){i.emitReserved("packet",t)}),this.setTimeoutFn)},n.onerror=function(t){this.emitReserved("error",t)},n.socket=function(t,i){var n=this.nsps[t];return n?this.yt&&!n.active&&n.connect():(n=new Nt(this,t,i),this.nsps[t]=n),n},n.Ct=function(t){for(var i=0,n=Object.keys(this.nsps);i<n.length;i++){var r=n[i];if(this.nsps[r].active)return}this.Rt()},n.Et=function(t){for(var i=this.encoder.encode(t),n=0;n<i.length;n++)this.engine.write(i[n],t.options)},n.cleanup=function(){this.subs.forEach((function(t){return t()})),this.subs.length=0,this.decoder.destroy()},n.Rt=function(){this.skipReconnect=!0,this.wt=!1,this.onclose("forced close")},n.disconnect=function(){return this.Rt()},n.onclose=function(t,i){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this.bt="closed",this.emitReserved("close",t,i),this.Ut&&!this.skipReconnect&&this.reconnect()},n.reconnect=function(){var t=this;if(this.wt||this.skipReconnect)return this;var i=this;if(this.backoff.attempts>=this._t)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.wt=!1;else{var n=this.backoff.duration();this.wt=!0;var r=this.setTimeoutFn((function(){i.skipReconnect||(t.emitReserved("reconnect_attempt",i.backoff.attempts),i.skipReconnect||i.open((function(n){n?(i.wt=!1,i.reconnect(),t.emitReserved("reconnect_error",n)):i.onreconnect()})))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){t.clearTimeoutFn(r)}))}},n.onreconnect=function(){var t=this.backoff.attempts;this.wt=!1,this.backoff.reset(),this.emitReserved("reconnect",t)},i}($),qt={};function Ft(t,i){"object"===a(t)&&(i=t,t=void 0);var n,r=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=ct(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var e=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+e+":"+r.port+i,r.href=r.protocol+"://"+e+(n&&n.port===r.port?"":":"+r.port),r}(t,(i=i||{}).path||"/socket.io"),e=r.source,s=r.id,o=r.path,h=qt[s]&&o in qt[s].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||h?n=new Vt(e,i):(qt[s]||(qt[s]=new Vt(e,i)),n=qt[s]),r.query&&!i.query&&(i.query=r.queryKey),n.socket(r.path,i)}return s(Ft,{Manager:Vt,Socket:Nt,io:Ft,connect:Ft}),Ft})); | ||
//# sourceMappingURL=socket.io.msgpack.min.js.map |
@@ -84,3 +84,3 @@ import { Socket } from "./socket"; | ||
readonly server: Server<ListenEvents, EmitEvents, ServerSideEvents, SocketData>; | ||
protected _fns: Array<(socket: Socket<ListenEvents, EmitEvents, ServerSideEvents, SocketData>, next: (err?: ExtendedError) => void) => void>; | ||
private _fns; | ||
/** @private */ | ||
@@ -87,0 +87,0 @@ _ids: number; |
@@ -46,3 +46,3 @@ "use strict"; | ||
const namespace = new namespace_1.Namespace(this.server, name); | ||
this._fns.forEach((fn) => namespace.use(fn)); | ||
this["_fns"].forEach((fn) => namespace.use(fn)); | ||
this.listeners("connect").forEach((listener) => namespace.on("connect", listener)); | ||
@@ -49,0 +49,0 @@ this.listeners("connection").forEach((listener) => namespace.on("connection", listener)); |
{ | ||
"name": "socket.io", | ||
"version": "4.8.0", | ||
"version": "4.8.1", | ||
"description": "node.js realtime framework server", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1412386
11073
2
0