!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define(e):(t="undefined"!=typeofglobalThis?globalThis:t||self).io=e()}(this,(function(){"use strict";functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionn(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}functionr(t,e,r){returne&&n(t.prototype,e),r&&n(t,r),t}functiono(){returno=Object.assign||function(t){for(vare=1;e<arguments.length;e++){varn=arguments[e];for(varrinn)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}returnt},o.apply(this,arguments)}functioni(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}functions(t){returns=Object.setPrototypeOf?Object.getPrototypeOf:function(t){returnt.__proto__||Object.getPrototypeOf(t)},s(t)}functiona(t,e){returna=Object.setPrototypeOf||function(t,e){returnt.__proto__=e,t},a(t,e)}functionc(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionu(t,e){if(e&&("object"==typeofe||"function"==typeofe))returne;if(void0!==e)thrownewTypeError("Derived constructors may only return object or undefined");returnc(t)}functionh(t){vare=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();returnfunction(){varn,r=s(t);if(e){varo=s(this).constructor;n=Reflect.construct(r,arguments,o)}elsen=r.apply(this,arguments);returnu(this,n)}}functionf(t,e,n){returnf="undefined"!=typeofReflect&&Reflect.get?Reflect.get:function(t,e,n){varr=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););returnt}(t,e);if(r){varo=Object.getOwnPropertyDescriptor(r,e);returno.get?o.get.call(n):o.value}},f(t,e,n||t)}functionl(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,r=newArray(e);n<e;n++)r[n]=t[n];returnr}functionp(t,e){varn="undefined"!=typeofSymbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeoft)returnl(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void0}}(t))||e&&t&&"number"==typeoft.length){n&&(t=n);varr=0,o=function(){};return{s:o,n:function(){returnr>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throwt},f:o}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}vari,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){vart=n.next();returns=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throwi}}}}vard=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,y=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],v=function(t){vare=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(varo,i,s=d.exec(t||""),a={},c=14;c--;)a[y[c]]=s[c]||"";return-1!=n&&-1!=r&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(t,e){varn=/\/{2,9}/g,r=e.replace(n,"/").split("/");"/"!=e.substr(0,1)&&0!==e.length||r.splice(0,1);"/"==e.substr(e.length-1,1)&&r.splice(r.length-1,1);returnr}(0,a.path),a.queryKey=(o=a.query,i={},o.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,n){e&&(i[e]=n)})),i),a};varm={exports:{}};try{m.exports="undefined"!=typeofXMLHttpRequest&&"withCredentials"innewXMLHttpRequest}catch(t){m.exports=!1}varg=m.exports,k="undefined"!=typeofself?self:"undefined"!=typeofwindow?window:Function("return this")();functionb(t){vare=t.xdomain;try{if("undefined"!=typeofXMLHttpRequest&&(!e||g))returnnewXMLHttpRequest}catch(t){}if(!e)try{returnnew(k[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}functionw(t){for(vare=arguments.length,n=newArray(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];returnn.reduce((function(e,n){returnt.hasOwnProperty(n)&&(e[n]=t[n]),e}),{})}var_=setTimeout,E=clearTimeout;functionA(t,e){e.useNativeTimers?(t.setTimeoutFn=_.bind(k),t.clearTimeoutFn=E.bind(k)):(t.setTimeoutFn=setTimeout.bind(k),t.clearTimeoutFn=clearTimeout.bind(k))}varR=T;functionT(t){if(t)returnfunction(t){for(vareinT.prototype)t[e]=T.prototype[e];returnt}(t)}T.prototype.on=T.prototype.addEventListener=function(t,e){returnthis._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},T.prototype.once=function(t,e){functionn(){this.off(t,n),e.apply(this,arguments)}returnn.fn=e,this.on(t,n),this},T.prototype.off=T.prototype.removeListener=T.prototype.removeAllListeners=T.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)returnthis._callbacks={},this;varn,r=this._callbacks["$"+t];if(!r)returnthis;if(1==arguments.length)returndeletethis._callbacks["$"+t],this;for(varo=0;o<r.length;o++)if((n=r[o])===e||n.fn===e){r.splice(o,1);break}return0===r.length&&deletethis._callbacks["$"+t],this},T.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(vare=newArray(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(varo=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,e)}returnthis},T.prototype.emitReserved=T.prototype.emit,T.prototype.listeners=function(t){returnthis._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},T.prototype.hasListeners=function(t){return!!this.listeners(t).length};varC=Object.create(null);C.open="0",C.close="1",C.ping="2",C.pong="3",C.message="4",C.upgrade="5",C.noop="6";varO=Object.create(null);Object.keys(C).forEach((function(t){O[C[t]]=t}));for(varS={type:"error",data:"parser error"},B="function"==typeofBlob||"undefined"!=typeofBlob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),N="function"==typeofArrayBuffer,x=function(t,e,n){varr,o=t.type,i=t.data;returnB&&iinstanceofBlob?e?n(i):L(i,n):N&&(iinstanceofArrayBuffer||(r=i,"function"==typeofArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.bufferinstanceofArrayBuffer))?e?n(i):L(newBlob([i]),n):n(C[o]+(i||""))},L=function(t,e){varn=newFileReader;returnn.onload=function(){vart=n.result.split(",")[1];e("b"+t)},n.readAsDataURL(t)},j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P="undefined"==typeofUint8Array?[]:newUint8Array(256),q=0;q<j.length;q++)P[j.charCodeAt(q)]=q;varD,I="function"==typeofArrayBuffer,F=function(t,e){if("string"!=typeoft)return{type:"message",data:U(t,e)};varn=t.charAt(0);return"b"===n?{type:"message",data:M(t.substring(1),e)}:O[n]?t.length>1?{type:O[n],data:t.substring(1)}:{type:O[n]}:S},M=function(t,e){if(I){varn=function(t){vare,n,r,o,i,s=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);varu=newArrayBuffer(s),h=newUint8Array(u);for(e=0;e<a;e+=4)n=P[t.charCodeAt(e)],r=P[t.charCodeAt(e+1)],o=P[t.charCodeAt(e+2)],i=P[t.charCodeAt(e+3)],h[c++]=n<<2|r>>4,h[c++]=(15&r)<<4|o>>2,h[c++]=(3&o)<<6|63&i;returnu}(t);returnU(n,e)}return{base64:!0,data:t}},U=function(t,e){return"blob"===e&&tinstanceofArrayBuffer?newBlob([t]):t},V=String.fromCharCode(30),H=function(t){i(o,t);varn=h(o);functiono(t){varr;returne(this,o),(r=n.call(this)).writable=!1,A(c(r),t),r.opts=t,r.query=t.query,r.readyState="",r.socket=t.socket,r}returnr(o,[{key:"onError",value:function(t,e){varn=newError(t);returnn.type="TransportError",n.description=e,f(s(o.prototype),"emit",this).call(this,"error",n),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(t){"open"===this.readyState&&this.write(t)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,f(s(o.prototype),"emit",this).call(this,"open")}},{key:"onData",value:function(t){vare=F(t,this.socket.binaryType);this.onPacket(e)}},{key:"onPacket",value:function(t){f(s(o.prototype),"emit",this).call(this,"packet",t)}},{key:"onClose",value:function(){this.readyState="closed",f(s(o.prototype),"emit",this).call(this,"close")}}]),o}(R),K="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Y={},z=0,$=0;functionW(t){vare="";do{e=K[t%64]+e,t=Math.floor(t/64)}while(t>0);returne}functionJ(){vart=W(+newDate);returnt!==D?(z=0,D=t):t+"."+W(z++)}for(;$<64;$++)Y[K[$]]=$;J.encode=W,J.decode=function(t){vare=0;for($=0;$<t.length;$++)e=64*e+Y[t.charAt($)];returne};varX=J,G={encode:function(t){vare="";for(varnint)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));returne},decode:function(t){for(vare={},n=t.split("&"),r=0,o=n.length;r<o;r++){vari=n[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}returne}},Q=function(t){i(o,t);varn=h(o);functiono(){vart;returne(this,o),(t=n.apply(this,arguments)).polling=!1,t}returnr(o,[{key:"name",get:function(){return"polling"}},{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(t){vare=this;this.readyState="pausing";varn=function(){e.readyState="paused",t()};if(this.polling||!this.writable){varr=0;this.polling&&(r++,this.once("pollComplete",(function(){--r||n()}))),this.writable||(r++,this.once("drain",(function(){--r||n()})))}elsen()}},{key:"poll",value:function(){this.polling=!0,this.doPoll(),this.emit("poll")}},{key:"onData",value:function(t){vare=this;(function(t,e){for(varn=t.split(V),r=[],o=0;o<n.length;o++){vari=F(n[o],e);if(r.push(i),"error"===i.type)break}returnr})(t,this.socket.binaryType).forEach((function(t){if("opening"===e.readyState&&"open"===t.type&&e.onOpen(),"close"===t.type)returne.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState&&this.poll())}},{key:"doClose",value:function(){vart=this,e=function(){t.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}},{key:"write",value:function(t){vare=this;this.writable=!1,function(t,e){varn=t.length,r=newArray(n),o=0;t.forEach((function(t,i){x(t,!1,(function(t){r[i]=t,++o===n&&e(r.join(V))}))}))}(t,(function(t){e.doWrite(t,(function(){e.writable=!0,e.emit("drain")}))}))}},{key:"uri",value:function(){vart=this.query||{},e=this.opts.secure?"https":"http",n="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=X()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);varr=G.encode(t);returne+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}}]),o}(H);functionZ(){}vartt=null!=newb({xdomain:!1}).responseType,et=function(t){i(s,t);varn=h(s);functions(t){varr;if(e(this,s),r=n.call(this,t),"undefined"!=typeoflocation){varo="https:"===location.protocol,i=location.port;i||(i=o?"443":"80"),r.xd="undefined"!=typeoflocation&&t.hostname!==location.hostname||i!==t.port,r.xs=t.secure!==o}vara=t&&t.forceBase64;returnr.supportsBinary=tt&&!a,r}returnr(s,[{key:"request",value:function(){vart=arguments.length>0&&void0!==arguments[0]?arguments[0]:{};returno(t,{xd:this.xd,xs:this.xs},this.opts),newnt(this.uri(),t)}},{key:"doWrite",value:function(t,e){varn=this,r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",(function(t){n.onError("xhr post error",t)}))}},{key:"doPoll",value:function(){vart=this,e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e}}]),s}(Q),nt=function(t){i(o,t);varn=h(o);functiono(t,r){vari;returne(this,o),A(c(i=n.call(this)),r),i.opts=r,i.method=r.method||"GET",i.uri=t,i.async=!1!==r.async,i.data=void0!==r.data?r.data:null,i.create(),i}returnr(o,[{key:"create",value:function(){vart=this,e=w(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;varn=this.xhr=newb(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(varrinn.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}catch(t){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{n.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"inn&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=function(){4===n.readyState&&(200===n.status||1223===n.status?t.onLoad():t.setTimeoutFn((function(){t.onError("number"==typeofn.status?n.status:0)}),0))},n.send(this.data)}catch(e){returnvoidthis.setTimeoutFn((function(){t.onError(e)}),0)}"undefined"!=typeofdocument&&(this.index=o.requestsCount++,o.requests[this.index]=this)}},{key:"onSuccess",value:function(){this.emit("success"),this.cleanup()}},{key:"onData",value:function(t){this.emit("data",t),this.onSuccess()}},{key:"onError",value:function(t){this.emit("error",t),this.cleanup(!0)}},{key:"cleanup",value:function(t){if(void0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=Z,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeofdocument&&deleteo.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){vart=this.xhr.responseText;null!==t&&this.onData(t)}},{key:"abort",value:function(){this.cleanup()}}]),o}(R);if(nt.requestsCount=0,nt.requests={},"undefined"!=typeofdocument)if("function"==typeofattachEvent)attachEvent("onunload",rt);elseif("function"==typeofaddEventListener){addEventListener("onpagehide"ink?"pagehide":"unload",rt,!1)}functionrt(){for(vartinnt.requests)nt.requests.hasOwnProperty(t)&&nt.requests[t].abort()}varot="function"==typeofPromise&&"function"==typeofPromise.resolve?function(t){returnPromise.resolve().then(t)}:function(t,e){returne(t,0)},it=k.WebSocket||k.MozWebSocket,st="undefined"!=typeofnavigator&&"string"==typeofnavigator.product&&"reactnative"===navigator.product.toLowerCase(),at=function(t){i(o,t);varn=h(o);functiono(t){varr;returne(this,o),(r=n.call(this,t)).supportsBinary=!t.forceBase64,r}returnr(o,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){vart=this.uri(),e=this.opts.protocols,n=st?{}:w(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=st?newit(t,e,n):e?newit(t,e):newit(t)}catch(t){returnthis.emit("error",t)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}}},{key:"addEventListeners",value:function(){vart=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws._socket.unref(),t.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=function(e){returnt.onData(e.data)},this.ws.onerror=function(e){returnt.onError("websocket error",e)}}},{key:"write",value:function(t){vare=this;this.writable=!1;for(varn=function(n){varr=t[n],o=n===t.length-1;x(r,e.supportsBinary,(function(t){try{e.ws.send(t)}catch(t){}o&&ot((function(){e.writable=!0,e.emit("drain")}),e.setTimeoutFn)}))},r=0;r<t.length;r++)n(r)}},{key:"doClose",value:function(){void0!==this.ws&&(this.ws.close(),this.ws=null)}},{key:"uri",value:function(){vart=this.query||{},e=this.opts.secure?"wss":"ws",n="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=X()),this.supportsBinary||(t.b64=1);varr=G.encode(t);returne+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}},{key:"check",value:function(){return!(!it||"__initialize"init&&this.name===o.prototype.name)}}]),o}(H),ct={websocket:at,polling:et},ut=function(n){i(a,n);vars=h(a);functiona(n){varr,i=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};returne(this,a),r=s.call(this),n&&"object"===t(n)&&(i=n,n=null),n?(n=v(n),i.hostname=n.host,i.secure="https"===n.protocol||"wss"===n.protocol,i.port=n.port,n.query&&(i.query=n.query)):i.host&&(i.hostname=v(i.host).host),A(c(r),i),r.secure=null!=i.secure?i.secure:"undefined"!=typeoflocation&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=r.secure?"443":"80"),r.hostname=i.hostname||("undefined"!=typeoflocation?location.hostname:"localhost"),r.port=i.port||("undefined"!=typeoflocation&&location.port?location.port:r.secure?"443":"80"),r.transports=i.transports||["polling","websocket"],r.readyState="",r.writeBuffer=[],r.prevBufferLen=0,r.opts=o({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},i),r.opts.path=r.opts.path.replace(/\/$/,"")+"/","string"==typeofr.opts.query&&(r.opts.query=G.decode(r.opts.query)),r.id=null,r.upgrades=null,r.pingInterval=null,r.pingTimeout=null,r.pingTimeoutTimer=null,"function"==typeofaddEventListener&&(r.opts.closeOnBeforeunload&&addEventListener("beforeunload",(function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())}),!1),"localhost"!==r.hostname&&(r.offlineEventListener=function(){r.onClose("transport close")},addEventListener("offline",r.offlineEventListener,!1))),r.open(),r}returnr(a,[{key:"createTransport",value:function(t){vare=function(t){vare={};for(varnint)t.hasOwnProperty(n)&&(e[n]=t[n]);returne}(this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);varn=o({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});returnnewct[t](n)}},{key:"open",value:function(){vart,e=this;if(this.opts.rememberUpgrade&&a.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)returnvoidthis.setTimeoutFn((function(){e.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){returnthis.transports.shift(),voidthis.open()}t.open(),this.setTransport(t)}},{key:"setTransport",value:function(t){vare=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(function(){e.onClose("transport close")}))}},{key:"probe",value:function(t){vare=this,n=this.createTransport(t),r=!1;a.priorWebsocketSuccess=!1;varo=function(){r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",(function(t){if(!r)if("pong"===t.type&&"probe"===t.data){if(e.upgrading=!0,e.emitReserved("upgrading",n),!n)return;a.priorWebsocketSuccess="websocket"===n.name,e.transport.pause((function(){r||"closed"!==e.readyState&&(f(),e.setTransport(n),n.send([{type:"upgrade"}]),e.emitReserved("upgrade",n),n=null,e.upgrading=!1,e.flush())}))}else{varo=newError("probe error");o.transport=n.name,e.emitReserved("upgradeError",o)}})))};functioni(){r||(r=!0,f(),n.close(),n=null)}vars=function(t){varr=newError("probe error: "+t);r.transport=n.name,i(),e.emitReserved("upgradeError",r)};functionc(){s("transport closed")}functionu(){s("socket closed")}functionh(t){n&&t.name!==n.name&&i()}varf=function(){n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",c),e.off("close",u),e.off("upgrading",h)};n.once("open",o),n.once("error",s),n.once("close",c),this.once("close",u),this.once("upgrading",h),n.open()}},{key:"onOpen",value:function(){if(this.readyState="open",a.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause)for(vart=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},{key:"onPacket",value: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.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":vare=newError("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}},{key:"onHandshake",value:function(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}},{key:"resetPingTimeout",value:function(){vart=this;this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((function(){t.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:"onDrain",value:function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}},{key:"flush",value:function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emitReserved("flush"))}},{key:"write",value:function(t,e,n){returnthis.sendPacket("message",t,e,n),this}},{key:"send",value:function(t,e,n){returnthis.sendPacket("message",t,e,n),this}},{key:"sendPacket",value:function(t,e,n,r){if("function"==typeofe&&(r=e,e=void0),"function"==typeofn&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;varo={type:t,data:e,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}}},{key:"close",value:function(){vart=this,e=function(){t.onClose("forced close"),t.transport.close()},n=functionn(){t.off("upgrade",n),t.off("upgradeError",n),e()},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():e()})):this.upgrading?r():e()),this}},{key:"onError",value:function(t){a.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}},{key:"onClose",value:function(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeofremoveEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(t){for(vare=[],n=0,r=t.length;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);returne}}]),a}(R);ut.protocol=4;varht="function"==typeofArrayBuffer,ft=Object.prototype.toString,lt="function"==typeofBlob||"undefined"!=typeofBlob&&"[object BlobConstructor]"===ft.call(Blob),pt="function"==typeofFile||"undefined"!=typeofFile&&"[object FileConstructor]"===ft.call(File);functiondt(t){returnht&&(tinstanceofArrayBuffer||function(t){return"function"==typeofArrayBuffer.isView?ArrayBuffer.isView(t):t.bufferinstanceofArrayBuffer}(t))||lt&&tinstanceofBlob||pt&&tinstanceofFile}functionyt(e,n){if(!e||"object"!==t(e))return!1;if(Array.isArray(e)){for(varr=0,o=e.length;r<o;r++)if(yt(e[r]))return!0;return!1}if(dt(e))return!0;if(e.toJSON&&"function"==typeofe.toJSON&&1===arguments.length)returnyt(e.toJSON(),!0);for(variine)if(Object.prototype.hasOwnProperty.call(e,i)&&yt(e[i]))return!0;return!1}functionvt(t){vare=[],n=t.data,r=t;returnr.data=mt(n,e),r.attachments=e.length,{packet:r,buffers:e}}functionmt(e,n){if(!e)returne;if(dt(e)){varr={_placeholder:!0,num:n.length};returnn.push(e),r}if(Array.isArray(e)){for(varo=newArray(e.length),i=0;i<e.length;i++)o[i]=mt(e[i],n);returno}if("object"===t(e)&&!(einstanceofDate)){vars={};for(varaine)e.hasOwnProperty(a)&&(s[a]=mt(e[a],n));returns}returne}functiongt(t,e){returnt.data=kt(t.data,e),t.attachments=void0,t}functionkt(e,n){if(!e)returne;if(e&&e._placeholder)returnn[e.num];if(Array.isArray(e))for(varr=0;r<e.length;r++)e[r]=kt(e[r],n);elseif("object"===t(e))for(varoine)e.hasOwnProperty(o)&&(e[o]=kt(e[o],n));returne}varbt;!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={}));varwt=function(){functiont(){e(this,t)}returnr(t,[{key:"encode",value:function(t){returnt.type!==bt.EVENT&&t.type!==bt.ACK||!yt(t)?[this.encodeAsString(t)]:(t.type=t.type===bt.EVENT?bt.BINARY_EVENT:bt.BINARY_ACK,this.encodeAsBinary(t))}},{key:"encodeAsString",value:function(t){vare=""+t.type;returnt.type!==bt.BINARY_EVENT&&t.type!==bt.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data)),e}},{key:"encodeAsBinary",value:function(t){vare=vt(t),n=this.encodeAsString(e.packet),r=e.buffers;returnr.unshift(n),r}}]),t}(),_t=function(n){i(a,n);varo=h(a);functiona(){returne(this,a),o.call(this)}returnr(a,[{key:"add",value:function(t){vare;if("string"==typeoft)(e=this.decodeString(t)).type===bt.BINARY_EVENT||e.type===bt.BINARY_ACK?(this.reconstructor=newEt(e),0===e.attachments&&f(s(a.prototype),"emitReserved",this).call(this,"decoded",e)):f(s(a.prototype),"emitReserved",this).call(this,"decoded",e);else{if(!dt(t)&&!t.base64)thrownewError("Unknown type: "+t);if(!this.reconstructor)thrownewError("got binary data when not reconstructing a packet");(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,f(s(a.prototype),"emitReserved",this).call(this,"decoded",e))}}},{key:"decodeString",value:function(t){vare=0,n={type:Number(t.charAt(0))};if(void0===bt[n.type])thrownewError("unknown packet type "+n.type);if(n.type===bt.BINARY_EVENT||n.type===bt.BINARY_ACK){for(varr=e+1;"-"!==t.charAt(++e)&&e!=t.length;);varo=t.substring(r,e);if(o!=Number(o)||"-"!==t.charAt(e))thrownewError("Illegal attachments");n.attachments=Number(o)}if("/"===t.charAt(e+1)){for(vari=e+1;++e;){if(","===t.charAt(e))break;if(e===t.length)break}n.nsp=t.substring(i,e)}elsen.nsp="/";vars=t.charAt(e+1);if(""!==s&&Number(s)==s){for(varc=e+1;++e;){varu=t.charAt(e);if(null==u||Number(u)!=u){--e;break}if(e===t.length)break}n.id=Number(t.substring(c,e+1))}if(t.charAt(++e)){varh=function(t){try{returnJSON.parse(t)}catch(t){return!1}}(t.substr(e));if(!a.isPayloadValid(n.type,h))thrownewError("invalid payload");n.data=h}returnn}},{key:"destroy",value:function(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}],[{key:"isPayloadValid",value:function(e,n){switch(e){casebt.CONNECT:return"object"===t(n);casebt.DISCONNECT:returnvoid0===n;casebt.CONNECT_ERROR:return"string"==typeofn||"object"===t(n);casebt.EVENT:casebt.BINARY_EVENT:returnArray.isArray(n)&&n.length>0;casebt.ACK:casebt.BINARY_ACK:returnArray.isArray(n)}}}]),a}(R);varEt=function(){functiont(n){e(this,t),this.packet=n,this.buffers=[],this.reconPack=n}returnr(t,[{key:"takeBinaryData",value:function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){vare=gt(this.reconPack,this.buffers);returnthis.finishedReconstruction(),e}returnnull}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),t}(),At=Object.freeze({__proto__:null,protocol:5,getPacketType(){returnbt},Encoder:wt,Decoder:_t});functionRt(t,e,n){returnt.on(e,n),function(){t.off(e,n)}}varTt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Ct=function(t){i(o,t);varn=h(o);functiono(t,r,i){vars;returne(this,o),(s=n.call(this)).connected=!1,s.disconnected=!0,s.receiveBuffer=[],s.sendBuffer=[],s.ids=0,s.acks={},s.flags={},s.io=t,s.nsp=r,i&&i.auth&&(s.auth=i.auth),s.io._autoConnect&&s.open(),s}returnr(o,[{key:"subEvents",value:function(){if(!this.subs){vart=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))]}}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){returnthis.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){returnthis.connect()}},{key:"send",value:function(){for(vart=arguments.length,e=newArray(t),n=0;n<t;n++)e[n]=arguments[n];returne.unshift("message"),this.emit.apply(this,e),this}},{key:"emit",value:function(t){if(Tt.hasOwnProperty(t))thrownewError('"'+t+'" is a reserved event name');for(vare=arguments.length,n=newArray(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];n.unshift(t);varo={type:bt.EVENT,data:n,options:{}};if(o.options.compress=!1!==this.flags.compress,"function"==typeofn[n.length-1]){vari=this.ids++,s=n.pop();this._registerAckCallback(i,s),o.id=i}vara=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,c=this.flags.volatile&&(!a||!this.connected);returnc||(this.connected?this.packet(o):this.sendBuffer.push(o)),this.flags={},this}},{key:"_registerAckCallback",value:function(t,e){varn=this,r=this.flags.timeout;if(void0!==r){varo=this.io.setTimeoutFn((function(){deleten.acks[t];for(varr=0;r<n.sendBuffer.length;r++)n.sendBuffer[r].id===t&&n.sendBuffer.splice(r,1);e.call(n,newError("operation has timed out"))}),r);this.acks[t]=function(){n.io.clearTimeoutFn(o);for(vart=arguments.length,r=newArray(t),i=0;i<t;i++)r[i]=arguments[i];e.apply(n,[null].concat(r))}}elsethis.acks[t]=e}},{key:"packet",value:function(t){t.nsp=this.nsp,this.io._packet(t)}},{key:"onopen",value:function(){vart=this;"function"==typeofthis.auth?this.auth((function(e){t.packet({type:bt.CONNECT,data:e})})):this.packet({type:bt.CONNECT,data:this.auth})}},{key:"onerror",value:function(t){this.connected||this.emitReserved("connect_error",t)}},{key:"onclose",value:function(t){this.connected=!1,this.disconnected=!0,deletethis.id,this.emitReserved("disconnect",t)}},{key:"onpacket",value:function(t){if(t.nsp===this.nsp)switch(t.type){casebt.CONNECT:if(t.data&&t.data.sid){vare=t.data.sid;this.onconnect(e)}elsethis.emitReserved("connect_error",newError("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;casebt.EVENT:casebt.BINARY_EVENT:this.onevent(t);break;casebt.ACK:casebt.BINARY_ACK:this.onack(t);break;casebt.DISCONNECT:this.ondisconnect();break;casebt.CONNECT_ERROR:this.destroy();varn=newError(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n)}}},{key:"onevent",value:function(t){vare=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}},{key:"emitEvent",value:function(t){if(this._anyListeners&&this._anyListeners.length){vare,n=p(this._anyListeners.slice());try{for(n.s();!(e=n.n()).done;){e.value.apply(this,t)}}catch(t){n.e(t)}finally{n.f()}}f(s(o.prototype),"emit",this).apply(this,t)}},{key:"ack",value:function(t){vare=this,n=!1;returnfunction(){if(!n){n=!0;for(varr=arguments.length,o=newArray(r),i=0;i<r;i++)o[i]=arguments[i];e.packet({type:bt.ACK,id:t,data:o})}}}},{key:"onack",value:function(t){vare=this.acks[t.id];"function"==typeofe&&(e.apply(this,t.data),deletethis.acks[t.id])}},{key:"onconnect",value:function(t){this.id=t,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}},{key:"emitBuffered",value:function(){vart=this;this.receiveBuffer.forEach((function(e){returnt.emitEvent(e)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(e){returnt.packet(e)})),this.sendBuffer=[]}},{key:"ondisconnect",value:function(){this.destroy(),this.onclose("io server disconnect")}},{key:"destroy",value:function(){this.subs&&(this.subs.forEach((function(t){returnt()})),this.subs=void0),this.io._destroy(this)}},{key:"disconnect",value:function(){returnthis.connected&&this.packet({type:bt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{key:"close",value:function(){returnthis.disconnect()}},{key:"compress",value:function(t){returnthis.flags.compress=t,this}},{key:"volatile",get:function(){returnthis.flags.volatile=!0,this}},{key:"timeout",value:function(t){returnthis.flags.timeout=t,this}},{key:"onAny",value:function(t){returnthis._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}},{key:"prependAny",value:function(t){returnthis._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}},{key:"offAny",value:function(t){if(!this._anyListeners)returnthis;if(t){for(vare=this._anyListeners,n=0;n<e.length;n++)if(t===e[n])returne.splice(n,1),this}elsethis._anyListeners=[];returnthis}},{key:"listenersAny",value:function(){returnthis._anyListeners||[]}}]),o}(R),Ot=St;functionSt(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}St.prototype.duration=function(){vart=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){vare=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return0|Math.min(t,this.max)},St.prototype.reset=function(){this.attempts=0},St.prototype.setMin=function(t){this.ms=t},St.prototype.setMax=function(t){this.max=t},St.prototype.setJitter=function(t){this.jitter=t};varBt=function(n){i(s,n);varo=h(s);functions(n,r){vari,a;e(this,s),(i=o.call(this)).nsps={},i.subs=[],n&&"object"===t(n)&&(r=n,n=void0),(r=r||{}).path=r.path||"/socket.io",i.opts=r,A(c(i),r),i.reconnection(!1!==r.reconnection),i.reconnectionAttempts(r.reconnectionAttempts||1/0),i.reconnectionDelay(r.reconnectionDelay||1e3),i.reconnectionDelayMax(r.reconnectionDelayMax||5e3),i.randomizationFactor(null!==(a=r.randomizationFactor)&&void0!==a?a:.5),i.backoff=newOt({min:i.reconnectionDelay(),max:i.reconnectionDelayMax(),jitter:i.randomizationFactor()}),i.timeout(null==r.timeout?2e4:r.timeout),i._readyState="closed",i.uri=n;varu=r.parser||At;returni.encoder=newu.Encoder,i.decoder=newu.Decoder,i._autoConnect=!1!==r.autoConnect,i._autoConnect&&i.open(),i}returnr(s,[{key:"reconnection",value:function(t){returnarguments.length?(this._reconnection=!!t,this):this._reconnection}},{key:"reconnectionAttempts",value:function(t){returnvoid0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}},{key:"reconnectionDelay",value:function(t){vare;returnvoid0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void0===e||e.setMin(t),this)}},{key:"randomizationFactor",value:function(t){vare;returnvoid0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void0===e||e.setJitter(t),this)}},{key:"reconnectionDelayMax",value:function(t){vare;returnvoid0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void0===e||e.setMax(t),this)}},{key:"timeout",value:function(t){returnarguments.length?(this._timeout=t,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(t){vare=this;if(~this._readyState.indexOf("open"))returnthis;this.engine=newut(this.uri,this.opts);varn=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;varo=Rt(n,"open",(function(){r.onopen(),t&&t()})),i=Rt(n,"error",(function(n){r.cleanup(),r._readyState="closed",e.emitReserved("error",n),t?t(n):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){vars=this._timeout;0===s&&o();vara=this.setTimeoutFn((function(){o(),n.close(),n.emit("error",newError("timeout"))}),s);this.opts.autoUnref&&a.unref(),this.subs.push((function(){clearTimeout(a)}))}returnthis.subs.push(o),this.subs.push(i),this}},{key:"connect",value:function(t){returnthis.open(t)}},{key:"onopen",value:function(){this.cleanup(),this._readyState="open",this.emitReserved("open");vart=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)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(t){this.decoder.add(t)}},{key:"ondecoded",value:function(t){this.emitReserved("packet",t)}},{key:"onerror",value:function(t){this.emitReserved("error",t)}},{key:"socket",value:function(t,e){varn=this.nsps[t];returnn||(n=newCt(this,t,e),this.nsps[t]=n),n}},{key:"_destroy",value:function(t){for(vare=0,n=Object.keys(this.nsps);e<n.length;e++){varr=n[e];if(this.nsps[r].active)return}this._close()}},{key:"_packet",value:function(t){for(vare=this.encoder.encode(t),n=0;n<e.length;n++)this.engine.write(e[n],t.options)}},{key:"cleanup",value:function(){this.subs.forEach((function(t){returnt()})),this.subs.length=0,this.decoder.destroy()}},{key:"_close",value:function(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}},{key:"disconnect",value:function(){returnthis._close()}},{key:"onclose",value:function(t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()}},{key:"reconnect",value:function(){vart=this;if(this._reconnecting||this.skipReconnect)returnthis;vare=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{varn=this.backoff.duration();this._reconnecting=!0;varr=this.setTimeoutFn((function(){e.skipReconnect||(t.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((function(n){n?(e._reconnecting=!1,e.reconnect(),t.emitReserved("reconnect_error",n)):e.onreconnect()})))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}},{key:"onreconnect",value:function(){vart=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}]),s}(R),Nt={};functionxt(e,n){"object"===t(e)&&(n=e,e=void0);varr,o=function(t){vare=arguments.length>1&&void0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void0,r=t;n=n||"undefined"!=typeoflocation&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeoft&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void0!==n?n.protocol+"//"+t:"https://"+t),r=v(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";varo=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;returnr.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(n=n||{}).path||"/socket.io"),i=o.source,s=o.id,a=o.path,c=Nt[s]&&ainNt[s].nsps;returnn.forceNew||n["force new connection"]||!1===n.multiplex||c?r=newBt(i,n):(Nt[s]||(Nt[s]=newBt(i,n)),r=Nt[s]),o.query&&!n.query&&(n.query=o.queryKey),r.socket(o.path,n)}returno(xt,{Manager:Bt,Socket:Ct,io:xt,connect:xt}),xt}));