import{c as U}from"./@babel-145f18f6.js";(function(){try{var D=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j=new Error().stack;j&&(D._sentryDebugIds=D._sentryDebugIds||{},D._sentryDebugIds[j]="39ee5721-fb0a-4f78-9a22-eb54be4038a8",D._sentryDebugIdIdentifier="sentry-dbid-39ee5721-fb0a-4f78-9a22-eb54be4038a8")}catch{}})();var I={exports:{}};/*!
 * Socket.IO v2.5.0
 * (c) 2014-2021 Guillermo Rauch
 * Released under the MIT License.
 */(function(D,j){(function(k,c){D.exports=c()})(U,function(){return function(k){function c(e){if(s[e])return s[e].exports;var p=s[e]={exports:{},id:e,loaded:!1};return k[e].call(p.exports,p,p.exports,c),p.loaded=!0,p.exports}var s={};return c.m=k,c.c=s,c.p="",c(0)}([function(k,c,s){function e(y,a){typeof y=="object"&&(a=y,y=void 0),a=a||{};var n,r=p(y),i=r.source,t=r.id,o=r.path,d=f[t]&&o in f[t].nsps,m=a.forceNew||a["force new connection"]||a.multiplex===!1||d;return m?(l("ignoring socket cache for %s",i),n=h(i,a)):(f[t]||(l("new io instance for %s",i),f[t]=h(i,a)),n=f[t]),r.query&&!a.query&&(a.query=r.query),n.socket(r.path,a)}var p=s(1),u=s(7),h=s(12),l=s(3)("socket.io-client");k.exports=c=e;var f=c.managers={};c.protocol=u.protocol,c.connect=e,c.Manager=s(12),c.Socket=s(37)},function(k,c,s){function e(h,l){var f=h;l=l||typeof location<"u"&&location,h==null&&(h=l.protocol+"//"+l.host),typeof h=="string"&&(h.charAt(0)==="/"&&(h=h.charAt(1)==="/"?l.protocol+h:l.host+h),/^(https?|wss?):\/\//.test(h)||(u("protocol-less url %s",h),h=typeof l<"u"?l.protocol+"//"+h:"https://"+h),u("parse %s",h),f=p(h)),f.port||(/^(http|ws)$/.test(f.protocol)?f.port="80":/^(http|ws)s$/.test(f.protocol)&&(f.port="443")),f.path=f.path||"/";var y=f.host.indexOf(":")!==-1,a=y?"["+f.host+"]":f.host;return f.id=f.protocol+"://"+a+":"+f.port,f.href=f.protocol+"://"+a+(l&&l.port===f.port?"":":"+f.port),f}var p=s(2),u=s(3)("socket.io-client:url");k.exports=e},function(k,c){function s(h,l){var f=/\/{2,9}/g,y=l.replace(f,"/").split("/");return l.substr(0,1)!="/"&&l.length!==0||y.splice(0,1),l.substr(l.length-1,1)=="/"&&y.splice(y.length-1,1),y}function e(h,l){var f={};return l.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(y,a,n){a&&(f[a]=n)}),f}var p=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,u=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];k.exports=function(h){var l=h,f=h.indexOf("["),y=h.indexOf("]");f!=-1&&y!=-1&&(h=h.substring(0,f)+h.substring(f,y).replace(/:/g,";")+h.substring(y,h.length));for(var a=p.exec(h||""),n={},r=14;r--;)n[u[r]]=a[r]||"";return f!=-1&&y!=-1&&(n.source=l,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=s(n,n.path),n.queryKey=e(n,n.query),n}},function(k,c,s){(function(e){function p(){return!(typeof window>"u"||!window.process||window.process.type!=="renderer")||(typeof navigator>"u"||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function u(n){var r=this.useColors;if(n[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+n[0]+(r?"%c ":" ")+"+"+c.humanize(this.diff),r){var i="color: "+this.color;n.splice(1,0,i,"color: inherit");var t=0,o=0;n[0].replace(/%[a-zA-Z%]/g,function(d){d!=="%%"&&(t++,d==="%c"&&(o=t))}),n.splice(o,0,i)}}function h(){return(typeof console>"u"?"undefined":a(console))==="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function l(n){try{n==null?c.storage.removeItem("debug"):c.storage.debug=n}catch{}}function f(){var n;try{n=c.storage.debug}catch{}return!n&&typeof e<"u"&&"env"in e&&(n=e.env.DEBUG),n}function y(){try{return window.localStorage}catch{}}var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};c=k.exports=s(5),c.log=h,c.formatArgs=u,c.save=l,c.load=f,c.useColors=p,c.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:y(),c.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],c.formatters.j=function(n){try{return JSON.stringify(n)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}},c.enable(f())}).call(c,s(4))},function(k,c){function s(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function p(m){if(a===setTimeout)return setTimeout(m,0);if((a===s||!a)&&setTimeout)return a=setTimeout,setTimeout(m,0);try{return a(m,0)}catch{try{return a.call(null,m,0)}catch{return a.call(this,m,0)}}}function u(m){if(n===clearTimeout)return clearTimeout(m);if((n===e||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(m);try{return n(m)}catch{try{return n.call(null,m)}catch{return n.call(this,m)}}}function h(){o&&i&&(o=!1,i.length?t=i.concat(t):d=-1,t.length&&l())}function l(){if(!o){var m=p(h);o=!0;for(var g=t.length;g;){for(i=t,t=[];++d<g;)i&&i[d].run();d=-1,g=t.length}i=null,o=!1,u(m)}}function f(m,g){this.fun=m,this.array=g}function y(){}var a,n,r=k.exports={};(function(){try{a=typeof setTimeout=="function"?setTimeout:s}catch{a=s}try{n=typeof clearTimeout=="function"?clearTimeout:e}catch{n=e}})();var i,t=[],o=!1,d=-1;r.nextTick=function(m){var g=new Array(arguments.length-1);if(arguments.length>1)for(var w=1;w<arguments.length;w++)g[w-1]=arguments[w];t.push(new f(m,g)),t.length!==1||o||p(l)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,r.listeners=function(m){return[]},r.binding=function(m){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(m){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(k,c,s){function e(a){var n,r=0;for(n in a)r=(r<<5)-r+a.charCodeAt(n),r|=0;return c.colors[Math.abs(r)%c.colors.length]}function p(a){function n(){if(n.enabled){var i=n,t=+new Date,o=t-(r||t);i.diff=o,i.prev=r,i.curr=t,r=t;for(var d=new Array(arguments.length),m=0;m<d.length;m++)d[m]=arguments[m];d[0]=c.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");var g=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,function(b,E){if(b==="%%")return b;g++;var v=c.formatters[E];if(typeof v=="function"){var C=d[g];b=v.call(i,C),d.splice(g,1),g--}return b}),c.formatArgs.call(i,d);var w=n.log||c.log||console.log.bind(console);w.apply(i,d)}}var r;return n.namespace=a,n.enabled=c.enabled(a),n.useColors=c.useColors(),n.color=e(a),n.destroy=u,typeof c.init=="function"&&c.init(n),c.instances.push(n),n}function u(){var a=c.instances.indexOf(this);return a!==-1&&(c.instances.splice(a,1),!0)}function h(a){c.save(a),c.names=[],c.skips=[];var n,r=(typeof a=="string"?a:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&(a=r[n].replace(/\*/g,".*?"),a[0]==="-"?c.skips.push(new RegExp("^"+a.substr(1)+"$")):c.names.push(new RegExp("^"+a+"$")));for(n=0;n<c.instances.length;n++){var t=c.instances[n];t.enabled=c.enabled(t.namespace)}}function l(){c.enable("")}function f(a){if(a[a.length-1]==="*")return!0;var n,r;for(n=0,r=c.skips.length;n<r;n++)if(c.skips[n].test(a))return!1;for(n=0,r=c.names.length;n<r;n++)if(c.names[n].test(a))return!0;return!1}function y(a){return a instanceof Error?a.stack||a.message:a}c=k.exports=p.debug=p.default=p,c.coerce=y,c.disable=l,c.enable=h,c.enabled=f,c.humanize=s(6),c.instances=[],c.names=[],c.skips=[],c.formatters={}},function(k,c){function s(n){if(n=String(n),!(n.length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n);if(r){var i=parseFloat(r[1]),t=(r[2]||"ms").toLowerCase();switch(t){case"years":case"year":case"yrs":case"yr":case"y":return i*a;case"days":case"day":case"d":return i*y;case"hours":case"hour":case"hrs":case"hr":case"h":return i*f;case"minutes":case"minute":case"mins":case"min":case"m":return i*l;case"seconds":case"second":case"secs":case"sec":case"s":return i*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function e(n){return n>=y?Math.round(n/y)+"d":n>=f?Math.round(n/f)+"h":n>=l?Math.round(n/l)+"m":n>=h?Math.round(n/h)+"s":n+"ms"}function p(n){return u(n,y,"day")||u(n,f,"hour")||u(n,l,"minute")||u(n,h,"second")||n+" ms"}function u(n,r,i){if(!(n<r))return n<1.5*r?Math.floor(n/r)+" "+i:Math.ceil(n/r)+" "+i+"s"}var h=1e3,l=60*h,f=60*l,y=24*f,a=365.25*y;k.exports=function(n,r){r=r||{};var i=typeof n;if(i==="string"&&n.length>0)return s(n);if(i==="number"&&isNaN(n)===!1)return r.long?p(n):e(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))}},function(k,c,s){function e(){}function p(g){var w=""+g.type;if(c.BINARY_EVENT!==g.type&&c.BINARY_ACK!==g.type||(w+=g.attachments+"-"),g.nsp&&g.nsp!=="/"&&(w+=g.nsp+","),g.id!=null&&(w+=g.id),g.data!=null){var b=u(g.data);if(b===!1)return m;w+=b}return r("encoded %j as %s",g,w),w}function u(g){try{return JSON.stringify(g)}catch{return!1}}function h(g,w){function b(E){var v=t.deconstructPacket(E),C=p(v.packet),x=v.buffers;x.unshift(C),w(x)}t.removeBlobs(g,b)}function l(){this.reconstructor=null}function f(g){var w=0,b={type:Number(g.charAt(0))};if(c.types[b.type]==null)return n("unknown packet type "+b.type);if(c.BINARY_EVENT===b.type||c.BINARY_ACK===b.type){for(var E="";g.charAt(++w)!=="-"&&(E+=g.charAt(w),w!=g.length););if(E!=Number(E)||g.charAt(w)!=="-")throw new Error("Illegal attachments");b.attachments=Number(E)}if(g.charAt(w+1)==="/")for(b.nsp="";++w;){var v=g.charAt(w);if(v===","||(b.nsp+=v,w===g.length))break}else b.nsp="/";var C=g.charAt(w+1);if(C!==""&&Number(C)==C){for(b.id="";++w;){var v=g.charAt(w);if(v==null||Number(v)!=v){--w;break}if(b.id+=g.charAt(w),w===g.length)break}b.id=Number(b.id)}if(g.charAt(++w)){var x=y(g.substr(w)),B=x!==!1&&(b.type===c.ERROR||o(x));if(!B)return n("invalid payload");b.data=x}return r("decoded %s as %j",g,b),b}function y(g){try{return JSON.parse(g)}catch{return!1}}function a(g){this.reconPack=g,this.buffers=[]}function n(g){return{type:c.ERROR,data:"parser error: "+g}}var r=s(3)("socket.io-parser"),i=s(8),t=s(9),o=s(10),d=s(11);c.protocol=4,c.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],c.CONNECT=0,c.DISCONNECT=1,c.EVENT=2,c.ACK=3,c.ERROR=4,c.BINARY_EVENT=5,c.BINARY_ACK=6,c.Encoder=e,c.Decoder=l;var m=c.ERROR+'"encode error"';e.prototype.encode=function(g,w){if(r("encoding packet %j",g),c.BINARY_EVENT===g.type||c.BINARY_ACK===g.type)h(g,w);else{var b=p(g);w([b])}},i(l.prototype),l.prototype.add=function(g){var w;if(typeof g=="string")w=f(g),c.BINARY_EVENT===w.type||c.BINARY_ACK===w.type?(this.reconstructor=new a(w),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",w)):this.emit("decoded",w);else{if(!d(g)&&!g.base64)throw new Error("Unknown type: "+g);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");w=this.reconstructor.takeBinaryData(g),w&&(this.reconstructor=null,this.emit("decoded",w))}},l.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},a.prototype.takeBinaryData=function(g){if(this.buffers.push(g),this.buffers.length===this.reconPack.attachments){var w=t.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),w}return null},a.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(k,c,s){function e(u){if(u)return p(u)}function p(u){for(var h in e.prototype)u[h]=e.prototype[h];return u}k.exports=e,e.prototype.on=e.prototype.addEventListener=function(u,h){return this._callbacks=this._callbacks||{},(this._callbacks["$"+u]=this._callbacks["$"+u]||[]).push(h),this},e.prototype.once=function(u,h){function l(){this.off(u,l),h.apply(this,arguments)}return l.fn=h,this.on(u,l),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(u,h){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var l=this._callbacks["$"+u];if(!l)return this;if(arguments.length==1)return delete this._callbacks["$"+u],this;for(var f,y=0;y<l.length;y++)if(f=l[y],f===h||f.fn===h){l.splice(y,1);break}return l.length===0&&delete this._callbacks["$"+u],this},e.prototype.emit=function(u){this._callbacks=this._callbacks||{};for(var h=new Array(arguments.length-1),l=this._callbacks["$"+u],f=1;f<arguments.length;f++)h[f-1]=arguments[f];if(l){l=l.slice(0);for(var f=0,y=l.length;f<y;++f)l[f].apply(this,h)}return this},e.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks["$"+u]||[]},e.prototype.hasListeners=function(u){return!!this.listeners(u).length}},function(k,c,s){function e(a,n){if(!a)return a;if(h(a)){var r={_placeholder:!0,num:n.length};return n.push(a),r}if(u(a)){for(var i=new Array(a.length),t=0;t<a.length;t++)i[t]=e(a[t],n);return i}if(typeof a=="object"&&!(a instanceof Date)){var i={};for(var o in a)i[o]=e(a[o],n);return i}return a}function p(a,n){if(!a)return a;if(a&&a._placeholder)return n[a.num];if(u(a))for(var r=0;r<a.length;r++)a[r]=p(a[r],n);else if(typeof a=="object")for(var i in a)a[i]=p(a[i],n);return a}var u=s(10),h=s(11),l=Object.prototype.toString,f=typeof Blob=="function"||typeof Blob<"u"&&l.call(Blob)==="[object BlobConstructor]",y=typeof File=="function"||typeof File<"u"&&l.call(File)==="[object FileConstructor]";c.deconstructPacket=function(a){var n=[],r=a.data,i=a;return i.data=e(r,n),i.attachments=n.length,{packet:i,buffers:n}},c.reconstructPacket=function(a,n){return a.data=p(a.data,n),a.attachments=void 0,a},c.removeBlobs=function(a,n){function r(o,d,m){if(!o)return o;if(f&&o instanceof Blob||y&&o instanceof File){i++;var g=new FileReader;g.onload=function(){m?m[d]=this.result:t=this.result,--i||n(t)},g.readAsArrayBuffer(o)}else if(u(o))for(var w=0;w<o.length;w++)r(o[w],w,o);else if(typeof o=="object"&&!h(o))for(var b in o)r(o[b],b,o)}var i=0,t=a;r(t),i||n(t)}},function(k,c){var s={}.toString;k.exports=Array.isArray||function(e){return s.call(e)=="[object Array]"}},function(k,c){function s(h){return e&&Buffer.isBuffer(h)||p&&(h instanceof ArrayBuffer||u(h))}k.exports=s;var e=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",p=typeof ArrayBuffer=="function",u=function(h){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(h):h.buffer instanceof ArrayBuffer}},function(k,c,s){function e(t,o){if(!(this instanceof e))return new e(t,o);t&&typeof t=="object"&&(o=t,t=void 0),o=o||{},o.path=o.path||"/socket.io",this.nsps={},this.subs=[],this.opts=o,this.reconnection(o.reconnection!==!1),this.reconnectionAttempts(o.reconnectionAttempts||1/0),this.reconnectionDelay(o.reconnectionDelay||1e3),this.reconnectionDelayMax(o.reconnectionDelayMax||5e3),this.randomizationFactor(o.randomizationFactor||.5),this.backoff=new r({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(o.timeout==null?2e4:o.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var d=o.parser||l;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this.autoConnect=o.autoConnect!==!1,this.autoConnect&&this.open()}var p=s(13),u=s(37),h=s(8),l=s(7),f=s(39),y=s(40),a=s(3)("socket.io-client:manager"),n=s(36),r=s(41),i=Object.prototype.hasOwnProperty;k.exports=e,e.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)i.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},e.prototype.updateSocketIds=function(){for(var t in this.nsps)i.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},e.prototype.generateId=function(t){return(t==="/"?"":t+"#")+this.engine.id},h(e.prototype),e.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},e.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},e.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},e.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},e.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},e.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},e.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},e.prototype.open=e.prototype.connect=function(t,o){if(a("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;a("opening %s",this.uri),this.engine=p(this.uri,this.opts);var d=this.engine,m=this;this.readyState="opening",this.skipReconnect=!1;var g=f(d,"open",function(){m.onopen(),t&&t()}),w=f(d,"error",function(v){if(a("connect_error"),m.cleanup(),m.readyState="closed",m.emitAll("connect_error",v),t){var C=new Error("Connection error");C.data=v,t(C)}else m.maybeReconnectOnOpen()});if(this._timeout!==!1){var b=this._timeout;a("connect attempt will timeout after %d",b),b===0&&g.destroy();var E=setTimeout(function(){a("connect attempt timed out after %d",b),g.destroy(),d.close(),d.emit("error","timeout"),m.emitAll("connect_timeout",b)},b);this.subs.push({destroy:function(){clearTimeout(E)}})}return this.subs.push(g),this.subs.push(w),this},e.prototype.onopen=function(){a("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(f(t,"data",y(this,"ondata"))),this.subs.push(f(t,"ping",y(this,"onping"))),this.subs.push(f(t,"pong",y(this,"onpong"))),this.subs.push(f(t,"error",y(this,"onerror"))),this.subs.push(f(t,"close",y(this,"onclose"))),this.subs.push(f(this.decoder,"decoded",y(this,"ondecoded")))},e.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},e.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},e.prototype.ondata=function(t){this.decoder.add(t)},e.prototype.ondecoded=function(t){this.emit("packet",t)},e.prototype.onerror=function(t){a("error",t),this.emitAll("error",t)},e.prototype.socket=function(t,o){function d(){~n(g.connecting,m)||g.connecting.push(m)}var m=this.nsps[t];if(!m){m=new u(this,t,o),this.nsps[t]=m;var g=this;m.on("connecting",d),m.on("connect",function(){m.id=g.generateId(t)}),this.autoConnect&&d()}return m},e.prototype.destroy=function(t){var o=n(this.connecting,t);~o&&this.connecting.splice(o,1),this.connecting.length||this.close()},e.prototype.packet=function(t){a("writing packet %j",t);var o=this;t.query&&t.type===0&&(t.nsp+="?"+t.query),o.encoding?o.packetBuffer.push(t):(o.encoding=!0,this.encoder.encode(t,function(d){for(var m=0;m<d.length;m++)o.engine.write(d[m],t.options);o.encoding=!1,o.processPacketQueue()}))},e.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},e.prototype.cleanup=function(){a("cleanup");for(var t=this.subs.length,o=0;o<t;o++){var d=this.subs.shift();d.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},e.prototype.close=e.prototype.disconnect=function(){a("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},e.prototype.onclose=function(t){a("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},e.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)a("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var o=this.backoff.duration();a("will wait %dms before reconnect attempt",o),this.reconnecting=!0;var d=setTimeout(function(){t.skipReconnect||(a("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(m){m?(a("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",m.data)):(a("reconnect success"),t.onreconnect())}))},o);this.subs.push({destroy:function(){clearTimeout(d)}})}},e.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(k,c,s){k.exports=s(14),k.exports.parser=s(22)},function(k,c,s){function e(r,i){return this instanceof e?(i=i||{},r&&typeof r=="object"&&(i=r,r=null),r?(r=a(r),i.hostname=r.host,i.secure=r.protocol==="https"||r.protocol==="wss",i.port=r.port,r.query&&(i.query=r.query)):i.host&&(i.hostname=a(i.host).host),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.agent=i.agent||!1,this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?443:80),this.query=i.query||{},typeof this.query=="string"&&(this.query=n.decode(this.query)),this.upgrade=i.upgrade!==!1,this.path=(i.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!i.forceJSONP,this.jsonp=i.jsonp!==!1,this.forceBase64=!!i.forceBase64,this.enablesXDR=!!i.enablesXDR,this.withCredentials=i.withCredentials!==!1,this.timestampParam=i.timestampParam||"t",this.timestampRequests=i.timestampRequests,this.transports=i.transports||["polling","websocket"],this.transportOptions=i.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=i.policyPort||843,this.rememberUpgrade=i.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=i.onlyBinaryUpgrades,this.perMessageDeflate=i.perMessageDeflate!==!1&&(i.perMessageDeflate||{}),this.perMessageDeflate===!0&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=i.pfx||null,this.key=i.key||null,this.passphrase=i.passphrase||null,this.cert=i.cert||null,this.ca=i.ca||null,this.ciphers=i.ciphers||null,this.rejectUnauthorized=i.rejectUnauthorized===void 0||i.rejectUnauthorized,this.forceNode=!!i.forceNode,this.isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",(typeof self>"u"||this.isReactNative)&&(i.extraHeaders&&Object.keys(i.extraHeaders).length>0&&(this.extraHeaders=i.extraHeaders),i.localAddress&&(this.localAddress=i.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,void this.open()):new e(r,i)}function p(r){var i={};for(var t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);return i}var u=s(15),h=s(8),l=s(3)("engine.io-client:socket"),f=s(36),y=s(22),a=s(2),n=s(30);k.exports=e,e.priorWebsocketSuccess=!1,h(e.prototype),e.protocol=y.protocol,e.Socket=e,e.Transport=s(21),e.transports=s(15),e.parser=s(22),e.prototype.createTransport=function(r){l('creating transport "%s"',r);var i=p(this.query);i.EIO=y.protocol,i.transport=r;var t=this.transportOptions[r]||{};this.id&&(i.sid=this.id);var o=new u[r]({query:i,socket:this,agent:t.agent||this.agent,hostname:t.hostname||this.hostname,port:t.port||this.port,secure:t.secure||this.secure,path:t.path||this.path,forceJSONP:t.forceJSONP||this.forceJSONP,jsonp:t.jsonp||this.jsonp,forceBase64:t.forceBase64||this.forceBase64,enablesXDR:t.enablesXDR||this.enablesXDR,withCredentials:t.withCredentials||this.withCredentials,timestampRequests:t.timestampRequests||this.timestampRequests,timestampParam:t.timestampParam||this.timestampParam,policyPort:t.policyPort||this.policyPort,pfx:t.pfx||this.pfx,key:t.key||this.key,passphrase:t.passphrase||this.passphrase,cert:t.cert||this.cert,ca:t.ca||this.ca,ciphers:t.ciphers||this.ciphers,rejectUnauthorized:t.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:t.perMessageDeflate||this.perMessageDeflate,extraHeaders:t.extraHeaders||this.extraHeaders,forceNode:t.forceNode||this.forceNode,localAddress:t.localAddress||this.localAddress,requestTimeout:t.requestTimeout||this.requestTimeout,protocols:t.protocols||void 0,isReactNative:this.isReactNative});return o},e.prototype.open=function(){var r;if(this.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)r="websocket";else{if(this.transports.length===0){var i=this;return void setTimeout(function(){i.emit("error","No transports available")},0)}r=this.transports[0]}this.readyState="opening";try{r=this.createTransport(r)}catch{return this.transports.shift(),void this.open()}r.open(),this.setTransport(r)},e.prototype.setTransport=function(r){l("setting transport %s",r.name);var i=this;this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=r,r.on("drain",function(){i.onDrain()}).on("packet",function(t){i.onPacket(t)}).on("error",function(t){i.onError(t)}).on("close",function(){i.onClose("transport close")})},e.prototype.probe=function(r){function i(){if(v.onlyBinaryUpgrades){var C=!this.supportsBinary&&v.transport.supportsBinary;E=E||C}E||(l('probe transport "%s" opened',r),b.send([{type:"ping",data:"probe"}]),b.once("packet",function(x){if(!E)if(x.type==="pong"&&x.data==="probe"){if(l('probe transport "%s" pong',r),v.upgrading=!0,v.emit("upgrading",b),!b)return;e.priorWebsocketSuccess=b.name==="websocket",l('pausing current transport "%s"',v.transport.name),v.transport.pause(function(){E||v.readyState!=="closed"&&(l("changing transport and sending upgrade packet"),w(),v.setTransport(b),b.send([{type:"upgrade"}]),v.emit("upgrade",b),b=null,v.upgrading=!1,v.flush())})}else{l('probe transport "%s" failed',r);var B=new Error("probe error");B.transport=b.name,v.emit("upgradeError",B)}}))}function t(){E||(E=!0,w(),b.close(),b=null)}function o(C){var x=new Error("probe error: "+C);x.transport=b.name,t(),l('probe transport "%s" failed because of error: %s',r,C),v.emit("upgradeError",x)}function d(){o("transport closed")}function m(){o("socket closed")}function g(C){b&&C.name!==b.name&&(l('"%s" works - aborting "%s"',C.name,b.name),t())}function w(){b.removeListener("open",i),b.removeListener("error",o),b.removeListener("close",d),v.removeListener("close",m),v.removeListener("upgrading",g)}l('probing transport "%s"',r);var b=this.createTransport(r,{probe:1}),E=!1,v=this;e.priorWebsocketSuccess=!1,b.once("open",i),b.once("error",o),b.once("close",d),this.once("close",m),this.once("upgrading",g),b.open()},e.prototype.onOpen=function(){if(l("socket open"),this.readyState="open",e.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){l("starting upgrade probes");for(var r=0,i=this.upgrades.length;r<i;r++)this.probe(this.upgrades[r])}},e.prototype.onPacket=function(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(l('socket receive: type "%s", data "%s"',r.type,r.data),this.emit("packet",r),this.emit("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var i=new Error("server error");i.code=r.data,this.onError(i);break;case"message":this.emit("data",r.data),this.emit("message",r.data)}else l('packet received with socket readyState "%s"',this.readyState)},e.prototype.onHandshake=function(r){this.emit("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this.upgrades=this.filterUpgrades(r.upgrades),this.pingInterval=r.pingInterval,this.pingTimeout=r.pingTimeout,this.onOpen(),this.readyState!=="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},e.prototype.onHeartbeat=function(r){clearTimeout(this.pingTimeoutTimer);var i=this;i.pingTimeoutTimer=setTimeout(function(){i.readyState!=="closed"&&i.onClose("ping timeout")},r||i.pingInterval+i.pingTimeout)},e.prototype.setPing=function(){var r=this;clearTimeout(r.pingIntervalTimer),r.pingIntervalTimer=setTimeout(function(){l("writing ping packet - expecting pong within %sms",r.pingTimeout),r.ping(),r.onHeartbeat(r.pingTimeout)},r.pingInterval)},e.prototype.ping=function(){var r=this;this.sendPacket("ping",function(){r.emit("ping")})},e.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()},e.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(l("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},e.prototype.write=e.prototype.send=function(r,i,t){return this.sendPacket("message",r,i,t),this},e.prototype.sendPacket=function(r,i,t,o){if(typeof i=="function"&&(o=i,i=void 0),typeof t=="function"&&(o=t,t=null),this.readyState!=="closing"&&this.readyState!=="closed"){t=t||{},t.compress=t.compress!==!1;var d={type:r,data:i,options:t};this.emit("packetCreate",d),this.writeBuffer.push(d),o&&this.once("flush",o),this.flush()}},e.prototype.close=function(){function r(){o.onClose("forced close"),l("socket closing - telling transport to close"),o.transport.close()}function i(){o.removeListener("upgrade",i),o.removeListener("upgradeError",i),r()}function t(){o.once("upgrade",i),o.once("upgradeError",i)}if(this.readyState==="opening"||this.readyState==="open"){this.readyState="closing";var o=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?t():r()}):this.upgrading?t():r()}return this},e.prototype.onError=function(r){l("socket error %j",r),e.priorWebsocketSuccess=!1,this.emit("error",r),this.onClose("transport error",r)},e.prototype.onClose=function(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){l('socket close with reason: "%s"',r);var t=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",r,i),t.writeBuffer=[],t.prevBufferLen=0}},e.prototype.filterUpgrades=function(r){for(var i=[],t=0,o=r.length;t<o;t++)~f(this.transports,r[t])&&i.push(r[t]);return i}},function(k,c,s){function e(f){var y,a=!1,n=!1,r=f.jsonp!==!1;if(typeof location<"u"){var i=location.protocol==="https:",t=location.port;t||(t=i?443:80),a=f.hostname!==location.hostname||t!==f.port,n=f.secure!==i}if(f.xdomain=a,f.xscheme=n,y=new p(f),"open"in y&&!f.forceJSONP)return new u(f);if(!r)throw new Error("JSONP disabled");return new h(f)}var p=s(16),u=s(19),h=s(33),l=s(34);c.polling=e,c.websocket=l},function(k,c,s){var e=s(17),p=s(18);k.exports=function(u){var h=u.xdomain,l=u.xscheme,f=u.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!h||e))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!l&&f)return new XDomainRequest}catch{}if(!h)try{return new p[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}},function(k,c){try{k.exports=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{k.exports=!1}},function(k,c){k.exports=function(){return typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}()},function(k,c,s){function e(){}function p(t){if(f.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,typeof location<"u"){var o=location.protocol==="https:",d=location.port;d||(d=o?443:80),this.xd=typeof location<"u"&&t.hostname!==location.hostname||d!==t.port,this.xs=t.secure!==o}}function u(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function h(){for(var t in u.requests)u.requests.hasOwnProperty(t)&&u.requests[t].abort()}var l=s(16),f=s(20),y=s(8),a=s(31),n=s(3)("engine.io-client:polling-xhr"),r=s(18);if(k.exports=p,k.exports.Request=u,a(p,f),p.prototype.supportsBinary=!0,p.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.withCredentials=this.withCredentials,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new u(t)},p.prototype.doWrite=function(t,o){var d=typeof t!="string"&&t!==void 0,m=this.request({method:"POST",data:t,isBinary:d}),g=this;m.on("success",o),m.on("error",function(w){g.onError("xhr post error",w)}),this.sendXhr=m},p.prototype.doPoll=function(){n("xhr poll");var t=this.request(),o=this;t.on("data",function(d){o.onData(d)}),t.on("error",function(d){o.onError("xhr poll error",d)}),this.pollXhr=t},y(u.prototype),u.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var o=this.xhr=new l(t),d=this;try{n("xhr open %s: %s",this.method,this.uri),o.open(this.method,this.uri,this.async);try{if(this.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(var m in this.extraHeaders)this.extraHeaders.hasOwnProperty(m)&&o.setRequestHeader(m,this.extraHeaders[m])}}catch{}if(this.method==="POST")try{this.isBinary?o.setRequestHeader("Content-type","application/octet-stream"):o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in o&&(o.withCredentials=this.withCredentials),this.requestTimeout&&(o.timeout=this.requestTimeout),this.hasXDR()?(o.onload=function(){d.onLoad()},o.onerror=function(){d.onError(o.responseText)}):o.onreadystatechange=function(){if(o.readyState===2)try{var g=o.getResponseHeader("Content-Type");(d.supportsBinary&&g==="application/octet-stream"||g==="application/octet-stream; charset=UTF-8")&&(o.responseType="arraybuffer")}catch{}o.readyState===4&&(o.status===200||o.status===1223?d.onLoad():setTimeout(function(){d.onError(typeof o.status=="number"?o.status:0)},0))},n("xhr data %s",this.data),o.send(this.data)}catch(g){return void setTimeout(function(){d.onError(g)},0)}typeof document<"u"&&(this.index=u.requestsCount++,u.requests[this.index]=this)},u.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},u.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},u.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},u.prototype.cleanup=function(t){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=e:this.xhr.onreadystatechange=e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete u.requests[this.index],this.xhr=null}},u.prototype.onLoad=function(){var t;try{var o;try{o=this.xhr.getResponseHeader("Content-Type")}catch{}t=o==="application/octet-stream"||o==="application/octet-stream; charset=UTF-8"?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(d){this.onError(d)}t!=null&&this.onData(t)},u.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR},u.prototype.abort=function(){this.cleanup()},u.requestsCount=0,u.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",h);else if(typeof addEventListener=="function"){var i="onpagehide"in r?"pagehide":"unload";addEventListener(i,h,!1)}}},function(k,c,s){function e(n){var r=n&&n.forceBase64;a&&!r||(this.supportsBinary=!1),p.call(this,n)}var p=s(21),u=s(30),h=s(22),l=s(31),f=s(32),y=s(3)("engine.io-client:polling");k.exports=e;var a=function(){var n=s(16),r=new n({xdomain:!1});return r.responseType!=null}();l(e,p),e.prototype.name="polling",e.prototype.doOpen=function(){this.poll()},e.prototype.pause=function(n){function r(){y("paused"),i.readyState="paused",n()}var i=this;if(this.readyState="pausing",this.polling||!this.writable){var t=0;this.polling&&(y("we are currently polling - waiting to pause"),t++,this.once("pollComplete",function(){y("pre-pause polling complete"),--t||r()})),this.writable||(y("we are currently writing - waiting to pause"),t++,this.once("drain",function(){y("pre-pause writing complete"),--t||r()}))}else r()},e.prototype.poll=function(){y("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},e.prototype.onData=function(n){var r=this;y("polling got data %s",n);var i=function(t,o,d){return r.readyState==="opening"&&t.type==="open"&&r.onOpen(),t.type==="close"?(r.onClose(),!1):void r.onPacket(t)};h.decodePayload(n,this.socket.binaryType,i),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():y('ignoring poll - transport state "%s"',this.readyState))},e.prototype.doClose=function(){function n(){y("writing close packet"),r.write([{type:"close"}])}var r=this;this.readyState==="open"?(y("transport open - closing"),n()):(y("transport not open - deferring close"),this.once("open",n))},e.prototype.write=function(n){var r=this;this.writable=!1;var i=function(){r.writable=!0,r.emit("drain")};h.encodePayload(n,this.supportsBinary,function(t){r.doWrite(t,i)})},e.prototype.uri=function(){var n=this.query||{},r=this.secure?"https":"http",i="";this.timestampRequests!==!1&&(n[this.timestampParam]=f()),this.supportsBinary||n.sid||(n.b64=1),n=u.encode(n),this.port&&(r==="https"&&Number(this.port)!==443||r==="http"&&Number(this.port)!==80)&&(i=":"+this.port),n.length&&(n="?"+n);var t=this.hostname.indexOf(":")!==-1;return r+"://"+(t?"["+this.hostname+"]":this.hostname)+i+this.path+n}},function(k,c,s){function e(h){this.path=h.path,this.hostname=h.hostname,this.port=h.port,this.secure=h.secure,this.query=h.query,this.timestampParam=h.timestampParam,this.timestampRequests=h.timestampRequests,this.readyState="",this.agent=h.agent||!1,this.socket=h.socket,this.enablesXDR=h.enablesXDR,this.withCredentials=h.withCredentials,this.pfx=h.pfx,this.key=h.key,this.passphrase=h.passphrase,this.cert=h.cert,this.ca=h.ca,this.ciphers=h.ciphers,this.rejectUnauthorized=h.rejectUnauthorized,this.forceNode=h.forceNode,this.isReactNative=h.isReactNative,this.extraHeaders=h.extraHeaders,this.localAddress=h.localAddress}var p=s(22),u=s(8);k.exports=e,u(e.prototype),e.prototype.onError=function(h,l){var f=new Error(h);return f.type="TransportError",f.description=l,this.emit("error",f),this},e.prototype.open=function(){return this.readyState!=="closed"&&this.readyState!==""||(this.readyState="opening",this.doOpen()),this},e.prototype.close=function(){return this.readyState!=="opening"&&this.readyState!=="open"||(this.doClose(),this.onClose()),this},e.prototype.send=function(h){if(this.readyState!=="open")throw new Error("Transport not open");this.write(h)},e.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},e.prototype.onData=function(h){var l=p.decodePacket(h,this.socket.binaryType);this.onPacket(l)},e.prototype.onPacket=function(h){this.emit("packet",h)},e.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(k,c,s){function e(v,C){var x="b"+c.packets[v.type]+v.data.data;return C(x)}function p(v,C,x){if(!C)return c.encodeBase64Packet(v,x);var B=v.data,A=new Uint8Array(B),S=new Uint8Array(1+B.byteLength);S[0]=g[v.type];for(var T=0;T<A.length;T++)S[T+1]=A[T];return x(S.buffer)}function u(v,C,x){if(!C)return c.encodeBase64Packet(v,x);var B=new FileReader;return B.onload=function(){c.encodePacket({type:v.type,data:B.result},C,!0,x)},B.readAsArrayBuffer(v.data)}function h(v,C,x){if(!C)return c.encodeBase64Packet(v,x);if(m)return u(v,C,x);var B=new Uint8Array(1);B[0]=g[v.type];var A=new E([B.buffer,v.data]);return x(A)}function l(v){try{v=t.decode(v,{strict:!1})}catch{return!1}return v}function f(v,C,x){for(var B=new Array(v.length),A=i(v.length,x),S=function(N,R,F){C(R,function(P,q){B[N]=q,F(P,B)})},T=0;T<v.length;T++)S(T,v[T],A)}var y,a=s(23),n=s(24),r=s(25),i=s(26),t=s(27);typeof ArrayBuffer<"u"&&(y=s(28));var o=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),d=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),m=o||d;c.protocol=3;var g=c.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},w=a(g),b={type:"error",data:"parser error"},E=s(29);c.encodePacket=function(v,C,x,B){typeof C=="function"&&(B=C,C=!1),typeof x=="function"&&(B=x,x=null);var A=v.data===void 0?void 0:v.data.buffer||v.data;if(typeof ArrayBuffer<"u"&&A instanceof ArrayBuffer)return p(v,C,B);if(typeof E<"u"&&A instanceof E)return h(v,C,B);if(A&&A.base64)return e(v,B);var S=g[v.type];return v.data!==void 0&&(S+=x?t.encode(String(v.data),{strict:!1}):String(v.data)),B(""+S)},c.encodeBase64Packet=function(v,C){var x="b"+c.packets[v.type];if(typeof E<"u"&&v.data instanceof E){var B=new FileReader;return B.onload=function(){var R=B.result.split(",")[1];C(x+R)},B.readAsDataURL(v.data)}var A;try{A=String.fromCharCode.apply(null,new Uint8Array(v.data))}catch{for(var S=new Uint8Array(v.data),T=new Array(S.length),N=0;N<S.length;N++)T[N]=S[N];A=String.fromCharCode.apply(null,T)}return x+=btoa(A),C(x)},c.decodePacket=function(v,C,x){if(v===void 0)return b;if(typeof v=="string"){if(v.charAt(0)==="b")return c.decodeBase64Packet(v.substr(1),C);if(x&&(v=l(v),v===!1))return b;var A=v.charAt(0);return Number(A)==A&&w[A]?v.length>1?{type:w[A],data:v.substring(1)}:{type:w[A]}:b}var B=new Uint8Array(v),A=B[0],S=r(v,1);return E&&C==="blob"&&(S=new E([S])),{type:w[A],data:S}},c.decodeBase64Packet=function(v,C){var x=w[v.charAt(0)];if(!y)return{type:x,data:{base64:!0,data:v.substr(1)}};var B=y.decode(v.substr(1));return C==="blob"&&E&&(B=new E([B])),{type:x,data:B}},c.encodePayload=function(v,C,x){function B(T){return T.length+":"+T}function A(T,N){c.encodePacket(T,!!S&&C,!1,function(R){N(null,B(R))})}typeof C=="function"&&(x=C,C=null);var S=n(v);return C&&S?E&&!m?c.encodePayloadAsBlob(v,x):c.encodePayloadAsArrayBuffer(v,x):v.length?void f(v,A,function(T,N){return x(N.join(""))}):x("0:")},c.decodePayload=function(v,C,x){if(typeof v!="string")return c.decodePayloadAsBinary(v,C,x);typeof C=="function"&&(x=C,C=null);var B;if(v==="")return x(b,0,1);for(var A,S,T="",N=0,R=v.length;N<R;N++){var F=v.charAt(N);if(F===":"){if(T===""||T!=(A=Number(T))||(S=v.substr(N+1,A),T!=S.length))return x(b,0,1);if(S.length){if(B=c.decodePacket(S,C,!1),b.type===B.type&&b.data===B.data)return x(b,0,1);var P=x(B,N+A,R);if(P===!1)return}N+=A,T=""}else T+=F}return T!==""?x(b,0,1):void 0},c.encodePayloadAsArrayBuffer=function(v,C){function x(B,A){c.encodePacket(B,!0,!0,function(S){return A(null,S)})}return v.length?void f(v,x,function(B,A){var S=A.reduce(function(R,F){var P;return P=typeof F=="string"?F.length:F.byteLength,R+P.toString().length+P+2},0),T=new Uint8Array(S),N=0;return A.forEach(function(R){var F=typeof R=="string",P=R;if(F){for(var q=new Uint8Array(R.length),O=0;O<R.length;O++)q[O]=R.charCodeAt(O);P=q.buffer}F?T[N++]=0:T[N++]=1;for(var _=P.byteLength.toString(),O=0;O<_.length;O++)T[N++]=parseInt(_[O]);T[N++]=255;for(var q=new Uint8Array(P),O=0;O<q.length;O++)T[N++]=q[O]}),C(T.buffer)}):C(new ArrayBuffer(0))},c.encodePayloadAsBlob=function(v,C){function x(B,A){c.encodePacket(B,!0,!0,function(S){var T=new Uint8Array(1);if(T[0]=1,typeof S=="string"){for(var N=new Uint8Array(S.length),R=0;R<S.length;R++)N[R]=S.charCodeAt(R);S=N.buffer,T[0]=0}for(var F=S instanceof ArrayBuffer?S.byteLength:S.size,P=F.toString(),q=new Uint8Array(P.length+1),R=0;R<P.length;R++)q[R]=parseInt(P[R]);if(q[P.length]=255,E){var O=new E([T.buffer,q.buffer,S]);A(null,O)}})}f(v,x,function(B,A){return C(new E(A))})},c.decodePayloadAsBinary=function(v,C,x){typeof C=="function"&&(x=C,C=null);for(var B=v,A=[];B.byteLength>0;){for(var S=new Uint8Array(B),T=S[0]===0,N="",R=1;S[R]!==255;R++){if(N.length>310)return x(b,0,1);N+=S[R]}B=r(B,2+N.length),N=parseInt(N);var F=r(B,0,N);if(T)try{F=String.fromCharCode.apply(null,new Uint8Array(F))}catch{var P=new Uint8Array(F);F="";for(var R=0;R<P.length;R++)F+=String.fromCharCode(P[R])}A.push(F),B=r(B,N)}var q=A.length;A.forEach(function(O,_){x(c.decodePacket(O,C,!0),_,q)})}},function(k,c){k.exports=Object.keys||function(s){var e=[],p=Object.prototype.hasOwnProperty;for(var u in s)p.call(s,u)&&e.push(u);return e}},function(k,c,s){function e(f){if(!f||typeof f!="object")return!1;if(p(f)){for(var y=0,a=f.length;y<a;y++)if(e(f[y]))return!0;return!1}if(typeof Buffer=="function"&&Buffer.isBuffer&&Buffer.isBuffer(f)||typeof ArrayBuffer=="function"&&f instanceof ArrayBuffer||h&&f instanceof Blob||l&&f instanceof File)return!0;if(f.toJSON&&typeof f.toJSON=="function"&&arguments.length===1)return e(f.toJSON(),!0);for(var n in f)if(Object.prototype.hasOwnProperty.call(f,n)&&e(f[n]))return!0;return!1}var p=s(10),u=Object.prototype.toString,h=typeof Blob=="function"||typeof Blob<"u"&&u.call(Blob)==="[object BlobConstructor]",l=typeof File=="function"||typeof File<"u"&&u.call(File)==="[object FileConstructor]";k.exports=e},function(k,c){k.exports=function(s,e,p){var u=s.byteLength;if(e=e||0,p=p||u,s.slice)return s.slice(e,p);if(e<0&&(e+=u),p<0&&(p+=u),p>u&&(p=u),e>=u||e>=p||u===0)return new ArrayBuffer(0);for(var h=new Uint8Array(s),l=new Uint8Array(p-e),f=e,y=0;f<p;f++,y++)l[y]=h[f];return l.buffer}},function(k,c){function s(p,u,h){function l(y,a){if(l.count<=0)throw new Error("after called too many times");--l.count,y?(f=!0,u(y),u=h):l.count!==0||f||u(null,a)}var f=!1;return h=h||e,l.count=p,p===0?u():l}function e(){}k.exports=s},function(k,c){function s(o){for(var d,m,g=[],w=0,b=o.length;w<b;)d=o.charCodeAt(w++),d>=55296&&d<=56319&&w<b?(m=o.charCodeAt(w++),(64512&m)==56320?g.push(((1023&d)<<10)+(1023&m)+65536):(g.push(d),w--)):g.push(d);return g}function e(o){for(var d,m=o.length,g=-1,w="";++g<m;)d=o[g],d>65535&&(d-=65536,w+=t(d>>>10&1023|55296),d=56320|1023&d),w+=t(d);return w}function p(o,d){if(o>=55296&&o<=57343){if(d)throw Error("Lone surrogate U+"+o.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function u(o,d){return t(o>>d&63|128)}function h(o,d){if((4294967168&o)==0)return t(o);var m="";return(4294965248&o)==0?m=t(o>>6&31|192):(4294901760&o)==0?(p(o,d)||(o=65533),m=t(o>>12&15|224),m+=u(o,6)):(4292870144&o)==0&&(m=t(o>>18&7|240),m+=u(o,12),m+=u(o,6)),m+=t(63&o|128)}function l(o,d){d=d||{};for(var m,g=d.strict!==!1,w=s(o),b=w.length,E=-1,v="";++E<b;)m=w[E],v+=h(m,g);return v}function f(){if(i>=r)throw Error("Invalid byte index");var o=255&n[i];if(i++,(192&o)==128)return 63&o;throw Error("Invalid continuation byte")}function y(o){var d,m,g,w,b;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(d=255&n[i],i++,(128&d)==0)return d;if((224&d)==192){if(m=f(),b=(31&d)<<6|m,b>=128)return b;throw Error("Invalid continuation byte")}if((240&d)==224){if(m=f(),g=f(),b=(15&d)<<12|m<<6|g,b>=2048)return p(b,o)?b:65533;throw Error("Invalid continuation byte")}if((248&d)==240&&(m=f(),g=f(),w=f(),b=(7&d)<<18|m<<12|g<<6|w,b>=65536&&b<=1114111))return b;throw Error("Invalid UTF-8 detected")}function a(o,d){d=d||{};var m=d.strict!==!1;n=s(o),r=n.length,i=0;for(var g,w=[];(g=y(m))!==!1;)w.push(g);return e(w)}/*! https://mths.be/utf8js v2.1.2 by @mathias */var n,r,i,t=String.fromCharCode;k.exports={version:"2.1.2",encode:l,decode:a}},function(k,c){(function(s){c.encode=function(e){var p,u=new Uint8Array(e),h=u.length,l="";for(p=0;p<h;p+=3)l+=s[u[p]>>2],l+=s[(3&u[p])<<4|u[p+1]>>4],l+=s[(15&u[p+1])<<2|u[p+2]>>6],l+=s[63&u[p+2]];return h%3===2?l=l.substring(0,l.length-1)+"=":h%3===1&&(l=l.substring(0,l.length-2)+"=="),l},c.decode=function(e){var p,u,h,l,f,y=.75*e.length,a=e.length,n=0;e[e.length-1]==="="&&(y--,e[e.length-2]==="="&&y--);var r=new ArrayBuffer(y),i=new Uint8Array(r);for(p=0;p<a;p+=4)u=s.indexOf(e[p]),h=s.indexOf(e[p+1]),l=s.indexOf(e[p+2]),f=s.indexOf(e[p+3]),i[n++]=u<<2|h>>4,i[n++]=(15&h)<<4|l>>2,i[n++]=(3&l)<<6|63&f;return r}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},function(k,c){function s(y){return y.map(function(a){if(a.buffer instanceof ArrayBuffer){var n=a.buffer;if(a.byteLength!==n.byteLength){var r=new Uint8Array(a.byteLength);r.set(new Uint8Array(n,a.byteOffset,a.byteLength)),n=r.buffer}return n}return a})}function e(y,a){a=a||{};var n=new u;return s(y).forEach(function(r){n.append(r)}),a.type?n.getBlob(a.type):n.getBlob()}function p(y,a){return new Blob(s(y),a||{})}var u=typeof u<"u"?u:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"&&MozBlobBuilder,h=function(){try{var y=new Blob(["hi"]);return y.size===2}catch{return!1}}(),l=h&&function(){try{var y=new Blob([new Uint8Array([1,2])]);return y.size===2}catch{return!1}}(),f=u&&u.prototype.append&&u.prototype.getBlob;typeof Blob<"u"&&(e.prototype=Blob.prototype,p.prototype=Blob.prototype),k.exports=function(){return h?l?Blob:p:f?e:void 0}()},function(k,c){c.encode=function(s){var e="";for(var p in s)s.hasOwnProperty(p)&&(e.length&&(e+="&"),e+=encodeURIComponent(p)+"="+encodeURIComponent(s[p]));return e},c.decode=function(s){for(var e={},p=s.split("&"),u=0,h=p.length;u<h;u++){var l=p[u].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}},function(k,c){k.exports=function(s,e){var p=function(){};p.prototype=e.prototype,s.prototype=new p,s.prototype.constructor=s}},function(k,c){function s(n){var r="";do r=h[n%l]+r,n=Math.floor(n/l);while(n>0);return r}function e(n){var r=0;for(a=0;a<n.length;a++)r=r*l+f[n.charAt(a)];return r}function p(){var n=s(+new Date);return n!==u?(y=0,u=n):n+"."+s(y++)}for(var u,h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),l=64,f={},y=0,a=0;a<l;a++)f[h[a]]=a;p.encode=s,p.decode=e,k.exports=p},function(k,c,s){function e(){}function p(n){u.call(this,n),this.query=this.query||{},f||(f=l.___eio=l.___eio||[]),this.index=f.length;var r=this;f.push(function(i){r.onData(i)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){r.script&&(r.script.onerror=e)},!1)}var u=s(20),h=s(31),l=s(18);k.exports=p;var f,y=/\n/g,a=/\\n/g;h(p,u),p.prototype.supportsBinary=!1,p.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),u.prototype.doClose.call(this)},p.prototype.doPoll=function(){var n=this,r=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),r.async=!0,r.src=this.uri(),r.onerror=function(o){n.onError("jsonp poll error",o)};var i=document.getElementsByTagName("script")[0];i?i.parentNode.insertBefore(r,i):(document.head||document.body).appendChild(r),this.script=r;var t=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);t&&setTimeout(function(){var o=document.createElement("iframe");document.body.appendChild(o),document.body.removeChild(o)},100)},p.prototype.doWrite=function(n,r){function i(){t(),r()}function t(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(E){o.onError("jsonp polling iframe removal error",E)}try{var b='<iframe src="javascript:0" name="'+o.iframeId+'">';d=document.createElement(b)}catch{d=document.createElement("iframe"),d.name=o.iframeId,d.src="javascript:0"}d.id=o.iframeId,o.form.appendChild(d),o.iframe=d}var o=this;if(!this.form){var d,m=document.createElement("form"),g=document.createElement("textarea"),w=this.iframeId="eio_iframe_"+this.index;m.className="socketio",m.style.position="absolute",m.style.top="-1000px",m.style.left="-1000px",m.target=w,m.method="POST",m.setAttribute("accept-charset","utf-8"),g.name="d",m.appendChild(g),document.body.appendChild(m),this.form=m,this.area=g}this.form.action=this.uri(),t(),n=n.replace(a,`\\
`),this.area.value=n.replace(y,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){o.iframe.readyState==="complete"&&i()}:this.iframe.onload=i}},function(k,c,s){function e(i){var t=i&&i.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=i.perMessageDeflate,this.usingBrowserWebSocket=p&&!i.forceNode,this.protocols=i.protocols,this.usingBrowserWebSocket||(r=u),h.call(this,i)}var p,u,h=s(21),l=s(22),f=s(30),y=s(31),a=s(32),n=s(3)("engine.io-client:websocket");if(typeof WebSocket<"u"?p=WebSocket:typeof self<"u"&&(p=self.WebSocket||self.MozWebSocket),typeof window>"u")try{u=s(35)}catch{}var r=p||u;k.exports=e,y(e,h),e.prototype.name="websocket",e.prototype.supportsBinary=!0,e.prototype.doOpen=function(){if(this.check()){var i=this.uri(),t=this.protocols,o={};this.isReactNative||(o.agent=this.agent,o.perMessageDeflate=this.perMessageDeflate,o.pfx=this.pfx,o.key=this.key,o.passphrase=this.passphrase,o.cert=this.cert,o.ca=this.ca,o.ciphers=this.ciphers,o.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(o.headers=this.extraHeaders),this.localAddress&&(o.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new r(i,t):new r(i):new r(i,t,o)}catch(d){return this.emit("error",d)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},e.prototype.addEventListeners=function(){var i=this;this.ws.onopen=function(){i.onOpen()},this.ws.onclose=function(){i.onClose()},this.ws.onmessage=function(t){i.onData(t.data)},this.ws.onerror=function(t){i.onError("websocket error",t)}},e.prototype.write=function(i){function t(){o.emit("flush"),setTimeout(function(){o.writable=!0,o.emit("drain")},0)}var o=this;this.writable=!1;for(var d=i.length,m=0,g=d;m<g;m++)(function(w){l.encodePacket(w,o.supportsBinary,function(b){if(!o.usingBrowserWebSocket){var E={};if(w.options&&(E.compress=w.options.compress),o.perMessageDeflate){var v=typeof b=="string"?Buffer.byteLength(b):b.length;v<o.perMessageDeflate.threshold&&(E.compress=!1)}}try{o.usingBrowserWebSocket?o.ws.send(b):o.ws.send(b,E)}catch{n("websocket closed before onclose event")}--d||t()})})(i[m])},e.prototype.onClose=function(){h.prototype.onClose.call(this)},e.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},e.prototype.uri=function(){var i=this.query||{},t=this.secure?"wss":"ws",o="";this.port&&(t==="wss"&&Number(this.port)!==443||t==="ws"&&Number(this.port)!==80)&&(o=":"+this.port),this.timestampRequests&&(i[this.timestampParam]=a()),this.supportsBinary||(i.b64=1),i=f.encode(i),i.length&&(i="?"+i);var d=this.hostname.indexOf(":")!==-1;return t+"://"+(d?"["+this.hostname+"]":this.hostname)+o+this.path+i},e.prototype.check=function(){return!(!r||"__initialize"in r&&this.name===e.prototype.name)}},function(k,c){},function(k,c){var s=[].indexOf;k.exports=function(e,p){if(s)return e.indexOf(p);for(var u=0;u<e.length;++u)if(e[u]===p)return u;return-1}},function(k,c,s){function e(t,o,d){this.io=t,this.nsp=o,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},d&&d.query&&(this.query=d.query),this.io.autoConnect&&this.open()}var p=s(7),u=s(8),h=s(38),l=s(39),f=s(40),y=s(3)("socket.io-client:socket"),a=s(30),n=s(24);k.exports=e;var r={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},i=u.prototype.emit;u(e.prototype),e.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[l(t,"open",f(this,"onopen")),l(t,"packet",f(this,"onpacket")),l(t,"close",f(this,"onclose"))]}},e.prototype.open=e.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState==="open"&&this.onopen(),this.emit("connecting"),this)},e.prototype.send=function(){var t=h(arguments);return t.unshift("message"),this.emit.apply(this,t),this},e.prototype.emit=function(t){if(r.hasOwnProperty(t))return i.apply(this,arguments),this;var o=h(arguments),d={type:(this.flags.binary!==void 0?this.flags.binary:n(o))?p.BINARY_EVENT:p.EVENT,data:o};return d.options={},d.options.compress=!this.flags||this.flags.compress!==!1,typeof o[o.length-1]=="function"&&(y("emitting packet with ack id %d",this.ids),this.acks[this.ids]=o.pop(),d.id=this.ids++),this.connected?this.packet(d):this.sendBuffer.push(d),this.flags={},this},e.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},e.prototype.onopen=function(){if(y("transport is open - connecting"),this.nsp!=="/")if(this.query){var t=typeof this.query=="object"?a.encode(this.query):this.query;y("sending connect packet with query %s",t),this.packet({type:p.CONNECT,query:t})}else this.packet({type:p.CONNECT})},e.prototype.onclose=function(t){y("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},e.prototype.onpacket=function(t){var o=t.nsp===this.nsp,d=t.type===p.ERROR&&t.nsp==="/";if(o||d)switch(t.type){case p.CONNECT:this.onconnect();break;case p.EVENT:this.onevent(t);break;case p.BINARY_EVENT:this.onevent(t);break;case p.ACK:this.onack(t);break;case p.BINARY_ACK:this.onack(t);break;case p.DISCONNECT:this.ondisconnect();break;case p.ERROR:this.emit("error",t.data)}},e.prototype.onevent=function(t){var o=t.data||[];y("emitting event %j",o),t.id!=null&&(y("attaching ack callback to event"),o.push(this.ack(t.id))),this.connected?i.apply(this,o):this.receiveBuffer.push(o)},e.prototype.ack=function(t){var o=this,d=!1;return function(){if(!d){d=!0;var m=h(arguments);y("sending ack %j",m),o.packet({type:n(m)?p.BINARY_ACK:p.ACK,id:t,data:m})}}},e.prototype.onack=function(t){var o=this.acks[t.id];typeof o=="function"?(y("calling ack %s with %j",t.id,t.data),o.apply(this,t.data),delete this.acks[t.id]):y("bad ack %s",t.id)},e.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit("connect")},e.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)i.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},e.prototype.ondisconnect=function(){y("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},e.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},e.prototype.close=e.prototype.disconnect=function(){return this.connected&&(y("performing disconnect (%s)",this.nsp),this.packet({type:p.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},e.prototype.compress=function(t){return this.flags.compress=t,this},e.prototype.binary=function(t){return this.flags.binary=t,this}},function(k,c){function s(e,p){var u=[];p=p||0;for(var h=p||0;h<e.length;h++)u[h-p]=e[h];return u}k.exports=s},function(k,c){function s(e,p,u){return e.on(p,u),{destroy:function(){e.removeListener(p,u)}}}k.exports=s},function(k,c){var s=[].slice;k.exports=function(e,p){if(typeof p=="string"&&(p=e[p]),typeof p!="function")throw new Error("bind() requires a function");var u=s.call(arguments,2);return function(){return p.apply(e,u.concat(s.call(arguments)))}}},function(k,c){function s(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}k.exports=s,s.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var p=Math.random(),u=Math.floor(p*this.jitter*e);e=(1&Math.floor(10*p))==0?e-u:e+u}return 0|Math.min(e,this.max)},s.prototype.reset=function(){this.attempts=0},s.prototype.setMin=function(e){this.ms=e},s.prototype.setMax=function(e){this.max=e},s.prototype.setJitter=function(e){this.jitter=e}}])})})(I);var M=I.exports;export{M as i};
