@ahmedrowaihi/pdf-forge-preview 1.0.0-canary.0 → 1.0.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/preview/[...slug]/page/server-reference-manifest.json +4 -4
- package/.next/server/app/preview/[...slug]/page.js +1 -1
- package/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1536282c._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1536282c._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__95852430._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__95852430._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__cb0c7b1a._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__ecac8617._.js +2 -2
- package/.next/server/chunks/ssr/_810f54e9._.js +1 -1
- package/.next/server/chunks/ssr/_810f54e9._.js.map +1 -1
- package/.next/server/chunks/ssr/_c57c12df._.js +1 -1
- package/.next/server/chunks/ssr/_c57c12df._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_preview-server_src_e17a2a9b._.js +1 -1
- package/.next/server/chunks/ssr/packages_preview-server_src_e17a2a9b._.js.map +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +5 -5
- package/.next/static/chunks/{959ed978a6e89a66.js → 2ecbbe3fa6012870.js} +1 -1
- package/.next/static/chunks/{a6db6456c5b75734.js → 8adcb219445d6056.js} +1 -1
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/CHANGELOG.md +18 -0
- package/next.config.mjs +1 -1
- package/package.json +5 -5
- package/src/actions/export-single-template.ts +114 -21
- package/src/app/preview/[...slug]/download-button.tsx +1 -6
- package/src/app/preview/[...slug]/preview.tsx +3 -3
- package/src/utils/asset-registry.ts +152 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__025eaae9._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__025eaae9._.js.map +0 -1
- /package/.next/static/{cdYIhKFtJ0GB-yJK5ywz_ → MJwu4qo8243SZCjO3lRNL}/_buildManifest.js +0 -0
- /package/.next/static/{cdYIhKFtJ0GB-yJK5ywz_ → MJwu4qo8243SZCjO3lRNL}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{cdYIhKFtJ0GB-yJK5ywz_ → MJwu4qo8243SZCjO3lRNL}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
module.exports=[60910,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e={ACTION_HMR_REFRESH:function(){return k},ACTION_NAVIGATE:function(){return h},ACTION_REFRESH:function(){return g},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return l},ACTION_SERVER_PATCH:function(){return j},PrefetchKind:function(){return m}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});let g="refresh",h="navigate",i="restore",j="server-patch",k="hmr-refresh",l="server-action";var m=((d={}).AUTO="auto",d.FULL="full",d);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},3988,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},5546,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})},13745,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},useActionQueue:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(3988)._(a.r(66808)),g=a.r(5546),h=null;function i(a){if(null===h)throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0});h(a)}function j(a){let[b,c]=f.default.useState(a.state);h=b=>a.dispatch(b,c);let d=(0,f.useMemo)(()=>b,[b]);return(0,g.isThenable)(d)?(0,f.use)(d):d}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},18003,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(66808),e=a.r(60910),f=a.r(13745);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},6874,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},16084,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(18003),g=a.r(6874),h=a.r(28192)},22734,(a,b,c)=>{b.exports=a.x("fs",()=>require("fs"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},33405,(a,b,c)=>{b.exports=a.x("child_process",()=>require("child_process"))},21517,(a,b,c)=>{b.exports=a.x("http",()=>require("http"))},24836,(a,b,c)=>{b.exports=a.x("https",()=>require("https"))},12416,(a,b,c)=>{var d=a.r(22734),e=a.r(92509),f=a.r(33405).spawn;function g(b){"use strict";b=b||{};var c,g,h=this,i=a.r(21517),j=a.r(24836),k={},l=!1,m={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},n=Object.assign({},m),o=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],p=["TRACE","TRACK","CONNECT"],q=!1,r=!1,s=!1,t={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.response=Buffer.alloc(0),this.status=null,this.statusText=null,this.open=function(a,b,c,d,e){if(this.abort(),r=!1,s=!1,!(a&&-1===p.indexOf(a)))throw Error("SecurityError: Request method not allowed");k={method:a,url:b.toString(),async:"boolean"!=typeof c||c,user:d||null,password:e||null},u(this.OPENED)},this.setDisableHeaderCheck=function(a){l=a},this.setRequestHeader=function(a,b){if(this.readyState!=this.OPENED)throw Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!l&&(!a||-1!==o.indexOf(a.toLowerCase())))return console.warn('Refused to set unsafe header "'+a+'"'),!1;if(q)throw Error("INVALID_STATE_ERR: send flag is true");return n[a]=b,!0},this.getResponseHeader=function(a){return"string"==typeof a&&this.readyState>this.OPENED&&g.headers[a.toLowerCase()]&&!r?g.headers[a.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||r)return"";var a="";for(var b in g.headers)"set-cookie"!==b&&"set-cookie2"!==b&&(a+=b+": "+g.headers[b]+"\r\n");return a.substr(0,a.length-2)},this.getRequestHeader=function(a){return"string"==typeof a&&n[a]?n[a]:""},this.send=function(a){if(this.readyState!=this.OPENED)throw Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(q)throw Error("INVALID_STATE_ERR: send has already been called");var l,m=!1,o=!1,p=e.parse(k.url);switch(p.protocol){case"https:":m=!0;case"http:":l=p.hostname;break;case"file:":o=!0;break;case void 0:case"":l="localhost";break;default:throw Error("Protocol not supported.")}if(o){if("GET"!==k.method)throw Error("XMLHttpRequest: Only GET method is supported");if(k.async)d.readFile(unescape(p.pathname),function(a,b){a?h.handleError(a,a.errno||-1):(h.status=200,h.responseText=b.toString("utf8"),h.response=b,u(h.DONE))});else try{this.response=d.readFileSync(unescape(p.pathname)),this.responseText=this.response.toString("utf8"),this.status=200,u(h.DONE)}catch(a){this.handleError(a,a.errno||-1)}return}var s=p.port||(m?443:80),t=p.pathname+(p.search?p.search:"");if(n.Host=l,m&&443===s||80===s||(n.Host+=":"+p.port),k.user){void 0===k.password&&(k.password="");var v=new Buffer(k.user+":"+k.password);n.Authorization="Basic "+v.toString("base64")}"GET"===k.method||"HEAD"===k.method?a=null:a?(n["Content-Length"]=Buffer.isBuffer(a)?a.length:Buffer.byteLength(a),Object.keys(n).some(function(a){return"content-type"===a.toLowerCase()})||(n["Content-Type"]="text/plain;charset=UTF-8")):"POST"===k.method&&(n["Content-Length"]=0);var w=b.agent||!1,x={host:l,port:s,path:t,method:k.method,headers:n,agent:w};if(m&&(x.pfx=b.pfx,x.key=b.key,x.passphrase=b.passphrase,x.cert=b.cert,x.ca=b.ca,x.ciphers=b.ciphers,x.rejectUnauthorized=!1!==b.rejectUnauthorized),r=!1,k.async){var y=m?j.request:i.request;q=!0,h.dispatchEvent("readystatechange");var z=function(a){if(302===(g=a).statusCode||303===g.statusCode||307===g.statusCode){k.url=g.headers.location;var d=e.parse(k.url);l=d.hostname;var f={hostname:d.hostname,port:d.port,path:d.path,method:303===g.statusCode?"GET":k.method,headers:n};m&&(f.pfx=b.pfx,f.key=b.key,f.passphrase=b.passphrase,f.cert=b.cert,f.ca=b.ca,f.ciphers=b.ciphers,f.rejectUnauthorized=!1!==b.rejectUnauthorized),(c=y(f,z).on("error",A)).end();return}u(h.HEADERS_RECEIVED),h.status=g.statusCode,g.on("data",function(a){if(a){var b=Buffer.from(a);h.response=Buffer.concat([h.response,b])}q&&u(h.LOADING)}),g.on("end",function(){q&&(q=!1,u(h.DONE),h.responseText=h.response.toString("utf8"))}),g.on("error",function(a){h.handleError(a)})},A=function(a){if(c.reusedSocket&&"ECONNRESET"===a.code)return y(x,z).on("error",A);h.handleError(a)};c=y(x,z).on("error",A),b.autoUnref&&c.on("socket",a=>{a.unref()}),a&&c.write(a),c.end(),h.dispatchEvent("loadstart")}else{var B=".node-xmlhttprequest-content-"+process.pid,C=".node-xmlhttprequest-sync-"+process.pid;d.writeFileSync(C,"","utf8");for(var D="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(m?"s":"")+".request;var options = "+JSON.stringify(x)+";var responseText = '';var responseData = Buffer.alloc(0);var req = doRequest(options, function(response) {response.on('data', function(chunk) { var data = Buffer.from(chunk); responseText += data.toString('utf8'); responseData = Buffer.concat([responseData, data]);});response.on('end', function() {fs.writeFileSync('"+B+"', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText, data: responseData.toString('base64')}}), 'utf8');fs.unlinkSync('"+C+"');});response.on('error', function(error) {fs.writeFileSync('"+B+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});}).on('error', function(error) {fs.writeFileSync('"+B+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",E=f(process.argv[0],["-e",D]);d.existsSync(C););if(h.responseText=d.readFileSync(B,"utf8"),E.stdin.end(),d.unlinkSync(B),h.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var F=JSON.parse(h.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,""));h.handleError(F,503)}else{h.status=h.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1");var G=JSON.parse(h.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"));g={statusCode:h.status,headers:G.data.headers},h.responseText=G.data.text,h.response=Buffer.from(G.data.data,"base64"),u(h.DONE,!0)}}},this.handleError=function(a,b){this.status=b||0,this.statusText=a,this.responseText=a.stack,r=!0,u(this.DONE)},this.abort=function(){c&&(c.abort(),c=null),n=Object.assign({},m),this.responseText="",this.responseXML="",this.response=Buffer.alloc(0),r=s=!0,this.readyState!==this.UNSENT&&(this.readyState!==this.OPENED||q)&&this.readyState!==this.DONE&&(q=!1,u(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(a,b){a in t||(t[a]=[]),t[a].push(b)},this.removeEventListener=function(a,b){a in t&&(t[a]=t[a].filter(function(a){return a!==b}))},this.dispatchEvent=function(a){if("function"==typeof h["on"+a]&&(this.readyState===this.DONE&&k.async?setTimeout(function(){h["on"+a]()},0):h["on"+a]()),a in t)for(let b=0,c=t[a].length;b<c;b++)this.readyState===this.DONE?setTimeout(function(){t[a][b].call(h)},0):t[a][b].call(h)};var u=function(a){if(h.readyState!==a&&(h.readyState!==h.UNSENT||!s)&&(h.readyState=a,(k.async||h.readyState<h.OPENED||h.readyState===h.DONE)&&h.dispatchEvent("readystatechange"),h.readyState===h.DONE)){let a;a=s?"abort":r?"error":"load",h.dispatchEvent(a),h.dispatchEvent("loadend")}}}b.exports=g,g.XMLHttpRequest=g},60690,(a,b,c)=>{function d(a,b,c,d){return Math.round(a/c)+" "+d+(b>=1.5*c?"s":"")}b.exports=function(a,b){b=b||{};var c,e,f,g,h=typeof a;if("string"===h&&a.length>0){var i=a;if(!((i=String(i)).length>100)){var j=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(j){var k=parseFloat(j[1]);switch((j[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*k;case"weeks":case"week":case"w":return 6048e5*k;case"days":case"day":case"d":return 864e5*k;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*k;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*k;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*k;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return k;default:break}}}return}if("number"===h&&isFinite(a)){return b.long?(e=Math.abs(c=a))>=864e5?d(c,e,864e5,"day"):e>=36e5?d(c,e,36e5,"hour"):e>=6e4?d(c,e,6e4,"minute"):e>=1e3?d(c,e,1e3,"second"):c+" ms":(g=Math.abs(f=a))>=864e5?Math.round(f/864e5)+"d":g>=36e5?Math.round(f/36e5)+"h":g>=6e4?Math.round(f/6e4)+"m":g>=1e3?Math.round(f/1e3)+"s":f+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}},90332,(a,b,c)=>{b.exports=function(b){function c(a){let b,e,f,g=null;function h(...a){if(!h.enabled)return;let d=Number(new Date);h.diff=d-(b||d),h.prev=b,h.curr=d,b=d,a[0]=c.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");let e=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(b,d)=>{if("%%"===b)return"%";e++;let f=c.formatters[d];if("function"==typeof f){let c=a[e];b=f.call(h,c),a.splice(e,1),e--}return b}),c.formatArgs.call(h,a),(h.log||c.log).apply(h,a)}return h.namespace=a,h.useColors=c.useColors(),h.color=c.selectColor(a),h.extend=d,h.destroy=c.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==g?g:(e!==c.namespaces&&(e=c.namespaces,f=c.enabled(a)),f),set:a=>{g=a}}),"function"==typeof c.init&&c.init(h),h}function d(a,b){let d=c(this.namespace+(void 0===b?":":b)+a);return d.log=this.log,d}function e(a,b){let c=0,d=0,e=-1,f=0;for(;c<a.length;)if(d<b.length&&(b[d]===a[c]||"*"===b[d]))"*"===b[d]?(e=d,f=c):c++,d++;else{if(-1===e)return!1;d=e+1,c=++f}for(;d<b.length&&"*"===b[d];)d++;return d===b.length}return c.debug=c,c.default=c,c.coerce=function(a){return a instanceof Error?a.stack||a.message:a},c.disable=function(){let a=[...c.names,...c.skips.map(a=>"-"+a)].join(",");return c.enable(""),a},c.enable=function(a){for(let b of(c.save(a),c.namespaces=a,c.names=[],c.skips=[],("string"==typeof a?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===b[0]?c.skips.push(b.slice(1)):c.names.push(b)},c.enabled=function(a){for(let b of c.skips)if(e(a,b))return!1;for(let b of c.names)if(e(a,b))return!0;return!1},c.humanize=a.r(60690),c.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(b).forEach(a=>{c[a]=b[a]}),c.names=[],c.skips=[],c.formatters={},c.selectColor=function(a){let b=0;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c)|0;return c.colors[Math.abs(b)%c.colors.length]},c.enable(c.load()),c}},88647,(a,b,c)=>{"use strict";b.exports=(a,b=process.argv)=>{let c=a.startsWith("-")?"":1===a.length?"-":"--",d=b.indexOf(c+a),e=b.indexOf("--");return -1!==d&&(-1===e||d<e)}},12914,(a,b,c)=>{"use strict";let d;a.r(46786);let e=a.r(70722),f=a.r(88647),{env:g}=process;function h(a){return 0!==a&&{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}function i(a,b){if(0===d)return 0;if(f("color=16m")||f("color=full")||f("color=truecolor"))return 3;if(f("color=256"))return 2;if(a&&!b&&void 0===d)return 0;let c=d||0;if("dumb"===g.TERM)return c;if("CI"in g)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in g)||"codeship"===g.CI_NAME?1:c;if("TEAMCITY_VERSION"in g)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION);if("truecolor"===g.COLORTERM)return 3;if("TERM_PROGRAM"in g){let a=parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:c}f("no-color")||f("no-colors")||f("color=false")||f("color=never")?d=0:(f("color")||f("colors")||f("color=true")||f("color=always"))&&(d=1),"FORCE_COLOR"in g&&(d="true"===g.FORCE_COLOR?1:"false"===g.FORCE_COLOR?0:0===g.FORCE_COLOR.length?1:Math.min(parseInt(g.FORCE_COLOR,10),3)),b.exports={supportsColor:function(a){return h(i(a,a&&a.isTTY))},stdout:h(i(!0,e.isatty(1))),stderr:h(i(!0,e.isatty(2)))}},12391,(a,b,c)=>{let d=a.r(70722),e=a.r(24361);c.init=function(a){a.inspectOpts={};let b=Object.keys(c.inspectOpts);for(let d=0;d<b.length;d++)a.inspectOpts[b[d]]=c.inspectOpts[b[d]]},c.log=function(...a){return process.stderr.write(e.formatWithOptions(c.inspectOpts,...a)+"\n")},c.formatArgs=function(a){let{namespace:d,useColors:e}=this;if(e){let c=this.color,e="\x1b[3"+(c<8?c:"8;5;"+c),f=` ${e};1m${d} \u001B[0m`;a[0]=f+a[0].split("\n").join("\n"+f),a.push(e+"m+"+b.exports.humanize(this.diff)+"\x1b[0m")}else a[0]=(c.inspectOpts.hideDate?"":new Date().toISOString()+" ")+d+" "+a[0]},c.save=function(a){a?process.env.DEBUG=a:delete process.env.DEBUG},c.load=function(){return process.env.DEBUG},c.useColors=function(){return"colors"in c.inspectOpts?!!c.inspectOpts.colors:d.isatty(process.stderr.fd)},c.destroy=e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),c.colors=[6,2,3,4,5,1];try{let b=a.r(12914);b&&(b.stderr||b).level>=2&&(c.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(a){}c.inspectOpts=Object.keys(process.env).filter(a=>/^debug_/i.test(a)).reduce((a,b)=>{let c=b.substring(6).toLowerCase().replace(/_([a-z])/g,(a,b)=>b.toUpperCase()),d=process.env[b];return d=!!/^(yes|on|true|enabled)$/i.test(d)||!/^(no|off|false|disabled)$/i.test(d)&&("null"===d?null:Number(d)),a[c]=d,a},{}),b.exports=a.r(90332)(c);let{formatters:f}=b.exports;f.o=function(a){return this.inspectOpts.colors=this.useColors,e.inspect(a,this.inspectOpts).split("\n").map(a=>a.trim()).join(" ")},f.O=function(a){return this.inspectOpts.colors=this.useColors,e.inspect(a,this.inspectOpts)}},10254,(a,b,c)=>{let d;c.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+b.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;a.splice(1,0,c,"color: inherit");let d=0,e=0;a[0].replace(/%[a-zA-Z%]/g,a=>{"%%"!==a&&(d++,"%c"===a&&(e=d))}),a.splice(e,0,c)},c.save=function(a){try{a?c.storage.setItem("debug",a):c.storage.removeItem("debug")}catch(a){}},c.load=function(){let a;try{a=c.storage.getItem("debug")||c.storage.getItem("DEBUG")}catch(a){}return!a&&"undefined"!=typeof process&&"env"in process&&(a=process.env.DEBUG),a},c.useColors=function(){let a;return!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof navigator&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},c.storage=function(){try{return localStorage}catch(a){}}(),d=!1,c.destroy=()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},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.log=console.debug||console.log||(()=>{}),b.exports=a.r(90332)(c);let{formatters:e}=b.exports;e.j=function(a){try{return JSON.stringify(a)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}}},35617,(a,b,c)=>{"undefined"==typeof process||"renderer"===process.type||process.__nwjs?b.exports=a.r(10254):b.exports=a.r(12391)},4446,(a,b,c)=>{b.exports=a.x("net",()=>require("net"))},55004,(a,b,c)=>{b.exports=a.x("tls",()=>require("tls"))},54799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},6461,(a,b,c)=>{b.exports=a.x("zlib",()=>require("zlib"))},25558,(a,b,c)=>{"use strict";let d=["nodebuffer","arraybuffer","fragments"],e="undefined"!=typeof Blob;e&&d.push("blob"),b.exports={BINARY_TYPES:d,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:e,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},54242,(a,b,c)=>{"use strict";let{EMPTY_BUFFER:d}=a.r(25558),e=Buffer[Symbol.species];function f(a,b,c,d,e){for(let f=0;f<e;f++)c[d+f]=a[f]^b[3&f]}function g(a,b){for(let c=0;c<a.length;c++)a[c]^=b[3&c]}function h(a){let b;return(h.readOnly=!0,Buffer.isBuffer(a))?a:(a instanceof ArrayBuffer?b=new e(a):ArrayBuffer.isView(a)?b=new e(a.buffer,a.byteOffset,a.byteLength):(b=Buffer.from(a),h.readOnly=!1),b)}if(b.exports={concat:function(a,b){if(0===a.length)return d;if(1===a.length)return a[0];let c=Buffer.allocUnsafe(b),f=0;for(let b=0;b<a.length;b++){let d=a[b];c.set(d,f),f+=d.length}return f<b?new e(c.buffer,c.byteOffset,f):c},mask:f,toArrayBuffer:function(a){return a.length===a.buffer.byteLength?a.buffer:a.buffer.slice(a.byteOffset,a.byteOffset+a.length)},toBuffer:h,unmask:g},!process.env.WS_NO_BUFFER_UTIL)try{let a=(()=>{let a=Error("Cannot find module 'bufferutil'");throw a.code="MODULE_NOT_FOUND",a})();b.exports.mask=function(b,c,d,e,g){g<48?f(b,c,d,e,g):a.mask(b,c,d,e,g)},b.exports.unmask=function(b,c){b.length<32?g(b,c):a.unmask(b,c)}}catch(a){}},34907,(a,b,c)=>{"use strict";let d=Symbol("kDone"),e=Symbol("kRun");b.exports=class{constructor(a){this[d]=()=>{this.pending--,this[e]()},this.concurrency=a||1/0,this.jobs=[],this.pending=0}add(a){this.jobs.push(a),this[e]()}[e](){if(this.pending!==this.concurrency&&this.jobs.length){let a=this.jobs.shift();this.pending++,a(this[d])}}}},45143,(a,b,c)=>{"use strict";let d,e=a.r(6461),f=a.r(54242),g=a.r(34907),{kStatusCode:h}=a.r(25558),i=Buffer[Symbol.species],j=Buffer.from([0,0,255,255]),k=Symbol("permessage-deflate"),l=Symbol("total-length"),m=Symbol("callback"),n=Symbol("buffers"),o=Symbol("error");function p(a){this[n].push(a),this[l]+=a.length}function q(a){(this[l]+=a.length,this[k]._maxPayload<1||this[l]<=this[k]._maxPayload)?this[n].push(a):(this[o]=RangeError("Max payload size exceeded"),this[o].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[o][h]=1009,this.removeListener("data",q),this.reset())}function r(a){(this[k]._inflate=null,this[o])?this[m](this[o]):(a[h]=1007,this[m](a))}b.exports=class{constructor(a,b,c){this._maxPayload=0|c,this._options=a||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!b,this._deflate=null,this._inflate=null,this.params=null,d||(d=new g(void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10))}static get extensionName(){return"permessage-deflate"}offer(){let a={};return this._options.serverNoContextTakeover&&(a.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(a.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(a.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?a.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(a.client_max_window_bits=!0),a}accept(a){return a=this.normalizeParams(a),this.params=this._isServer?this.acceptAsServer(a):this.acceptAsClient(a),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let a=this._deflate[m];this._deflate.close(),this._deflate=null,a&&a(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(a){let b=this._options,c=a.find(a=>(!1!==b.serverNoContextTakeover||!a.server_no_context_takeover)&&(!a.server_max_window_bits||!1!==b.serverMaxWindowBits&&("number"!=typeof b.serverMaxWindowBits||!(b.serverMaxWindowBits>a.server_max_window_bits)))&&("number"!=typeof b.clientMaxWindowBits||!!a.client_max_window_bits));if(!c)throw Error("None of the extension offers can be accepted");return b.serverNoContextTakeover&&(c.server_no_context_takeover=!0),b.clientNoContextTakeover&&(c.client_no_context_takeover=!0),"number"==typeof b.serverMaxWindowBits&&(c.server_max_window_bits=b.serverMaxWindowBits),"number"==typeof b.clientMaxWindowBits?c.client_max_window_bits=b.clientMaxWindowBits:(!0===c.client_max_window_bits||!1===b.clientMaxWindowBits)&&delete c.client_max_window_bits,c}acceptAsClient(a){let b=a[0];if(!1===this._options.clientNoContextTakeover&&b.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(b.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&b.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(b.client_max_window_bits=this._options.clientMaxWindowBits);return b}normalizeParams(a){return a.forEach(a=>{Object.keys(a).forEach(b=>{let c=a[b];if(c.length>1)throw Error(`Parameter "${b}" must have only a single value`);if(c=c[0],"client_max_window_bits"===b){if(!0!==c){let a=+c;if(!Number.isInteger(a)||a<8||a>15)throw TypeError(`Invalid value for parameter "${b}": ${c}`);c=a}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${b}": ${c}`)}else if("server_max_window_bits"===b){let a=+c;if(!Number.isInteger(a)||a<8||a>15)throw TypeError(`Invalid value for parameter "${b}": ${c}`);c=a}else if("client_no_context_takeover"===b||"server_no_context_takeover"===b){if(!0!==c)throw TypeError(`Invalid value for parameter "${b}": ${c}`)}else throw Error(`Unknown parameter "${b}"`);a[b]=c})}),a}decompress(a,b,c){d.add(d=>{this._decompress(a,b,(a,b)=>{d(),c(a,b)})})}compress(a,b,c){d.add(d=>{this._compress(a,b,(a,b)=>{d(),c(a,b)})})}_decompress(a,b,c){let d=this._isServer?"client":"server";if(!this._inflate){let a=`${d}_max_window_bits`,b="number"!=typeof this.params[a]?e.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=e.createInflateRaw({...this._options.zlibInflateOptions,windowBits:b}),this._inflate[k]=this,this._inflate[l]=0,this._inflate[n]=[],this._inflate.on("error",r),this._inflate.on("data",q)}this._inflate[m]=c,this._inflate.write(a),b&&this._inflate.write(j),this._inflate.flush(()=>{let a=this._inflate[o];if(a){this._inflate.close(),this._inflate=null,c(a);return}let e=f.concat(this._inflate[n],this._inflate[l]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[l]=0,this._inflate[n]=[],b&&this.params[`${d}_no_context_takeover`]&&this._inflate.reset()),c(null,e)})}_compress(a,b,c){let d=this._isServer?"server":"client";if(!this._deflate){let a=`${d}_max_window_bits`,b="number"!=typeof this.params[a]?e.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=e.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:b}),this._deflate[l]=0,this._deflate[n]=[],this._deflate.on("data",p)}this._deflate[m]=c,this._deflate.write(a),this._deflate.flush(e.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=f.concat(this._deflate[n],this._deflate[l]);b&&(a=new i(a.buffer,a.byteOffset,a.length-4)),this._deflate[m]=null,this._deflate[l]=0,this._deflate[n]=[],b&&this.params[`${d}_no_context_takeover`]&&this._deflate.reset(),c(null,a)})}}},57147,(a,b,c)=>{"use strict";let{isUtf8:d}=a.r(874),{hasBlob:e}=a.r(25558);function f(a){let b=a.length,c=0;for(;c<b;)if((128&a[c])==0)c++;else if((224&a[c])==192){if(c+1===b||(192&a[c+1])!=128||(254&a[c])==192)return!1;c+=2}else if((240&a[c])==224){if(c+2>=b||(192&a[c+1])!=128||(192&a[c+2])!=128||224===a[c]&&(224&a[c+1])==128||237===a[c]&&(224&a[c+1])==160)return!1;c+=3}else{if((248&a[c])!=240||c+3>=b||(192&a[c+1])!=128||(192&a[c+2])!=128||(192&a[c+3])!=128||240===a[c]&&(240&a[c+1])==128||244===a[c]&&a[c+1]>143||a[c]>244)return!1;c+=4}return!0}if(b.exports={isBlob:function(a){return e&&"object"==typeof a&&"function"==typeof a.arrayBuffer&&"string"==typeof a.type&&"function"==typeof a.stream&&("Blob"===a[Symbol.toStringTag]||"File"===a[Symbol.toStringTag])},isValidStatusCode:function(a){return a>=1e3&&a<=1014&&1004!==a&&1005!==a&&1006!==a||a>=3e3&&a<=4999},isValidUTF8:f,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},d)b.exports.isValidUTF8=function(a){return a.length<24?f(a):d(a)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let a=(()=>{let a=Error("Cannot find module 'utf-8-validate'");throw a.code="MODULE_NOT_FOUND",a})();b.exports.isValidUTF8=function(b){return b.length<32?f(b):a(b)}}catch(a){}},71345,(a,b,c)=>{"use strict";let{Writable:d}=a.r(88947),e=a.r(45143),{BINARY_TYPES:f,EMPTY_BUFFER:g,kStatusCode:h,kWebSocket:i}=a.r(25558),{concat:j,toArrayBuffer:k,unmask:l}=a.r(54242),{isValidStatusCode:m,isValidUTF8:n}=a.r(57147),o=Buffer[Symbol.species];b.exports=class extends d{constructor(a={}){super(),this._allowSynchronousEvents=void 0===a.allowSynchronousEvents||a.allowSynchronousEvents,this._binaryType=a.binaryType||f[0],this._extensions=a.extensions||{},this._isServer=!!a.isServer,this._maxPayload=0|a.maxPayload,this._skipUTF8Validation=!!a.skipUTF8Validation,this[i]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(a,b,c){if(8===this._opcode&&0==this._state)return c();this._bufferedBytes+=a.length,this._buffers.push(a),this.startLoop(c)}consume(a){if(this._bufferedBytes-=a,a===this._buffers[0].length)return this._buffers.shift();if(a<this._buffers[0].length){let b=this._buffers[0];return this._buffers[0]=new o(b.buffer,b.byteOffset+a,b.length-a),new o(b.buffer,b.byteOffset,a)}let b=Buffer.allocUnsafe(a);do{let c=this._buffers[0],d=b.length-a;a>=c.length?b.set(this._buffers.shift(),d):(b.set(new Uint8Array(c.buffer,c.byteOffset,a),d),this._buffers[0]=new o(c.buffer,c.byteOffset+a,c.length-a)),a-=c.length}while(a>0)return b}startLoop(a){this._loop=!0;do switch(this._state){case 0:this.getInfo(a);break;case 1:this.getPayloadLength16(a);break;case 2:this.getPayloadLength64(a);break;case 3:this.getMask();break;case 4:this.getData(a);break;case 5:case 6:this._loop=!1;return}while(this._loop)this._errored||a()}getInfo(a){if(this._bufferedBytes<2){this._loop=!1;return}let b=this.consume(2);if((48&b[0])!=0)return void a(this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3"));let c=(64&b[0])==64;if(c&&!this._extensions[e.extensionName])return void a(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"));if(this._fin=(128&b[0])==128,this._opcode=15&b[0],this._payloadLength=127&b[1],0===this._opcode){if(c)return void a(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"));if(!this._fragmented)return void a(this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE"));this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return void a(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"));this._compressed=c}else{if(!(this._opcode>7)||!(this._opcode<11))return void a(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"));if(!this._fin)return void a(this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN"));if(c)return void a(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"));if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength)return void a(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"))}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=(128&b[1])==128,this._isServer){if(!this._masked)return void a(this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK"))}else if(this._masked)return void a(this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK"));126===this._payloadLength?this._state=1:127===this._payloadLength?this._state=2:this.haveLength(a)}getPayloadLength16(a){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(a)}getPayloadLength64(a){if(this._bufferedBytes<8){this._loop=!1;return}let b=this.consume(8),c=b.readUInt32BE(0);c>2097151?a(this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=0x100000000*c+b.readUInt32BE(4),this.haveLength(a))}haveLength(a){this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)?a(this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH")):this._masked?this._state=3:this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(a){let b=g;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}b=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!=0&&l(b,this._mask)}if(this._opcode>7)return void this.controlMessage(b,a);if(this._compressed){this._state=5,this.decompress(b,a);return}b.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(b)),this.dataMessage(a)}decompress(a,b){this._extensions[e.extensionName].decompress(a,this._fin,(a,c)=>{if(a)return b(a);if(c.length){if(this._messageLength+=c.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return void b(this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(c)}this.dataMessage(b),0===this._state&&this.startLoop(b)})}dataMessage(a){if(!this._fin){this._state=0;return}let b=this._messageLength,c=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let d;d="nodebuffer"===this._binaryType?j(c,b):"arraybuffer"===this._binaryType?k(j(c,b)):"blob"===this._binaryType?new Blob(c):c,this._allowSynchronousEvents?(this.emit("message",d,!0),this._state=0):(this._state=6,setImmediate(()=>{this.emit("message",d,!0),this._state=0,this.startLoop(a)}))}else{let d=j(c,b);if(!this._skipUTF8Validation&&!n(d))return void a(this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8"));5===this._state||this._allowSynchronousEvents?(this.emit("message",d,!1),this._state=0):(this._state=6,setImmediate(()=>{this.emit("message",d,!1),this._state=0,this.startLoop(a)}))}}controlMessage(a,b){if(8===this._opcode){if(0===a.length)this._loop=!1,this.emit("conclude",1005,g),this.end();else{let c=a.readUInt16BE(0);if(!m(c))return void b(this.createError(RangeError,`invalid status code ${c}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE"));let d=new o(a.buffer,a.byteOffset+2,a.length-2);if(!this._skipUTF8Validation&&!n(d))return void b(this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8"));this._loop=!1,this.emit("conclude",c,d),this.end()}this._state=0;return}this._allowSynchronousEvents?(this.emit(9===this._opcode?"ping":"pong",a),this._state=0):(this._state=6,setImmediate(()=>{this.emit(9===this._opcode?"ping":"pong",a),this._state=0,this.startLoop(b)}))}createError(a,b,c,d,e){this._loop=!1,this._errored=!0;let f=new a(c?`Invalid WebSocket frame: ${b}`:b);return Error.captureStackTrace(f,this.createError),f.code=e,f[h]=d,f}}},78583,(a,b,c)=>{"use strict";let d,{Duplex:e}=a.r(88947),{randomFillSync:f}=a.r(54799),g=a.r(45143),{EMPTY_BUFFER:h,kWebSocket:i,NOOP:j}=a.r(25558),{isBlob:k,isValidStatusCode:l}=a.r(57147),{mask:m,toBuffer:n}=a.r(54242),o=Symbol("kByteLength"),p=Buffer.alloc(4),q=8192;class r{constructor(a,b,c){this._extensions=b||{},c&&(this._generateMask=c,this._maskBuffer=Buffer.alloc(4)),this._socket=a,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=0,this.onerror=j,this[i]=void 0}static frame(a,b){let c,e,g=!1,h=2,i=!1;b.mask&&(c=b.maskBuffer||p,b.generateMask?b.generateMask(c):(8192===q&&(void 0===d&&(d=Buffer.alloc(8192)),f(d,0,8192),q=0),c[0]=d[q++],c[1]=d[q++],c[2]=d[q++],c[3]=d[q++]),i=(c[0]|c[1]|c[2]|c[3])==0,h=6),"string"==typeof a?e=(!b.mask||i)&&void 0!==b[o]?b[o]:(a=Buffer.from(a)).length:(e=a.length,g=b.mask&&b.readOnly&&!i);let j=e;e>=65536?(h+=8,j=127):e>125&&(h+=2,j=126);let k=Buffer.allocUnsafe(g?e+h:h);return(k[0]=b.fin?128|b.opcode:b.opcode,b.rsv1&&(k[0]|=64),k[1]=j,126===j?k.writeUInt16BE(e,2):127===j&&(k[2]=k[3]=0,k.writeUIntBE(e,4,6)),b.mask)?(k[1]|=128,k[h-4]=c[0],k[h-3]=c[1],k[h-2]=c[2],k[h-1]=c[3],i)?[k,a]:g?(m(a,c,k,h,e),[k]):(m(a,c,a,0,e),[k,a]):[k,a]}close(a,b,c,d){let e;if(void 0===a)e=h;else if("number"==typeof a&&l(a))if(void 0!==b&&b.length){let c=Buffer.byteLength(b);if(c>123)throw RangeError("The message must not be greater than 123 bytes");(e=Buffer.allocUnsafe(2+c)).writeUInt16BE(a,0),"string"==typeof b?e.write(b,2):e.set(b,2)}else(e=Buffer.allocUnsafe(2)).writeUInt16BE(a,0);else throw TypeError("First argument must be a valid error code number");let f={[o]:e.length,fin:!0,generateMask:this._generateMask,mask:c,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};0!==this._state?this.enqueue([this.dispatch,e,!1,f,d]):this.sendFrame(r.frame(e,f),d)}ping(a,b,c){let d,e;if("string"==typeof a?(d=Buffer.byteLength(a),e=!1):k(a)?(d=a.size,e=!1):(d=(a=n(a)).length,e=n.readOnly),d>125)throw RangeError("The data size must not be greater than 125 bytes");let f={[o]:d,fin:!0,generateMask:this._generateMask,mask:b,maskBuffer:this._maskBuffer,opcode:9,readOnly:e,rsv1:!1};k(a)?0!==this._state?this.enqueue([this.getBlobData,a,!1,f,c]):this.getBlobData(a,!1,f,c):0!==this._state?this.enqueue([this.dispatch,a,!1,f,c]):this.sendFrame(r.frame(a,f),c)}pong(a,b,c){let d,e;if("string"==typeof a?(d=Buffer.byteLength(a),e=!1):k(a)?(d=a.size,e=!1):(d=(a=n(a)).length,e=n.readOnly),d>125)throw RangeError("The data size must not be greater than 125 bytes");let f={[o]:d,fin:!0,generateMask:this._generateMask,mask:b,maskBuffer:this._maskBuffer,opcode:10,readOnly:e,rsv1:!1};k(a)?0!==this._state?this.enqueue([this.getBlobData,a,!1,f,c]):this.getBlobData(a,!1,f,c):0!==this._state?this.enqueue([this.dispatch,a,!1,f,c]):this.sendFrame(r.frame(a,f),c)}send(a,b,c){let d,e,f=this._extensions[g.extensionName],h=b.binary?2:1,i=b.compress;"string"==typeof a?(d=Buffer.byteLength(a),e=!1):k(a)?(d=a.size,e=!1):(d=(a=n(a)).length,e=n.readOnly),this._firstFragment?(this._firstFragment=!1,i&&f&&f.params[f._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(i=d>=f._threshold),this._compress=i):(i=!1,h=0),b.fin&&(this._firstFragment=!0);let j={[o]:d,fin:b.fin,generateMask:this._generateMask,mask:b.mask,maskBuffer:this._maskBuffer,opcode:h,readOnly:e,rsv1:i};k(a)?0!==this._state?this.enqueue([this.getBlobData,a,this._compress,j,c]):this.getBlobData(a,this._compress,j,c):0!==this._state?this.enqueue([this.dispatch,a,this._compress,j,c]):this.dispatch(a,this._compress,j,c)}getBlobData(a,b,c,d){this._bufferedBytes+=c[o],this._state=2,a.arrayBuffer().then(a=>{if(this._socket.destroyed){let a=Error("The socket was closed while the blob was being read");process.nextTick(s,this,a,d);return}this._bufferedBytes-=c[o];let e=n(a);b?this.dispatch(e,b,c,d):(this._state=0,this.sendFrame(r.frame(e,c),d),this.dequeue())}).catch(a=>{process.nextTick(t,this,a,d)})}dispatch(a,b,c,d){if(!b)return void this.sendFrame(r.frame(a,c),d);let e=this._extensions[g.extensionName];this._bufferedBytes+=c[o],this._state=1,e.compress(a,c.fin,(a,b)=>{this._socket.destroyed?s(this,Error("The socket was closed while data was being compressed"),d):(this._bufferedBytes-=c[o],this._state=0,c.readOnly=!1,this.sendFrame(r.frame(b,c),d),this.dequeue())})}dequeue(){for(;0===this._state&&this._queue.length;){let a=this._queue.shift();this._bufferedBytes-=a[3][o],Reflect.apply(a[0],this,a.slice(1))}}enqueue(a){this._bufferedBytes+=a[3][o],this._queue.push(a)}sendFrame(a,b){2===a.length?(this._socket.cork(),this._socket.write(a[0]),this._socket.write(a[1],b),this._socket.uncork()):this._socket.write(a[0],b)}}function s(a,b,c){"function"==typeof c&&c(b);for(let c=0;c<a._queue.length;c++){let d=a._queue[c],e=d[d.length-1];"function"==typeof e&&e(b)}}function t(a,b,c){s(a,b,c),a.onerror(b)}b.exports=r},21392,(a,b,c)=>{"use strict";let{kForOnEventAttribute:d,kListener:e}=a.r(25558),f=Symbol("kCode"),g=Symbol("kData"),h=Symbol("kError"),i=Symbol("kMessage"),j=Symbol("kReason"),k=Symbol("kTarget"),l=Symbol("kType"),m=Symbol("kWasClean");class n{constructor(a){this[k]=null,this[l]=a}get target(){return this[k]}get type(){return this[l]}}Object.defineProperty(n.prototype,"target",{enumerable:!0}),Object.defineProperty(n.prototype,"type",{enumerable:!0});class o extends n{constructor(a,b={}){super(a),this[f]=void 0===b.code?0:b.code,this[j]=void 0===b.reason?"":b.reason,this[m]=void 0!==b.wasClean&&b.wasClean}get code(){return this[f]}get reason(){return this[j]}get wasClean(){return this[m]}}Object.defineProperty(o.prototype,"code",{enumerable:!0}),Object.defineProperty(o.prototype,"reason",{enumerable:!0}),Object.defineProperty(o.prototype,"wasClean",{enumerable:!0});class p extends n{constructor(a,b={}){super(a),this[h]=void 0===b.error?null:b.error,this[i]=void 0===b.message?"":b.message}get error(){return this[h]}get message(){return this[i]}}Object.defineProperty(p.prototype,"error",{enumerable:!0}),Object.defineProperty(p.prototype,"message",{enumerable:!0});class q extends n{constructor(a,b={}){super(a),this[g]=void 0===b.data?null:b.data}get data(){return this[g]}}function r(a,b,c){"object"==typeof a&&a.handleEvent?a.handleEvent.call(a,c):a.call(b,c)}Object.defineProperty(q.prototype,"data",{enumerable:!0}),b.exports={CloseEvent:o,ErrorEvent:p,Event:n,EventTarget:{addEventListener(a,b,c={}){let f;for(let f of this.listeners(a))if(!c[d]&&f[e]===b&&!f[d])return;if("message"===a)f=function(a,c){let d=new q("message",{data:c?a:a.toString()});d[k]=this,r(b,this,d)};else if("close"===a)f=function(a,c){let d=new o("close",{code:a,reason:c.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});d[k]=this,r(b,this,d)};else if("error"===a)f=function(a){let c=new p("error",{error:a,message:a.message});c[k]=this,r(b,this,c)};else{if("open"!==a)return;f=function(){let a=new n("open");a[k]=this,r(b,this,a)}}f[d]=!!c[d],f[e]=b,c.once?this.once(a,f):this.on(a,f)},removeEventListener(a,b){for(let c of this.listeners(a))if(c[e]===b&&!c[d]){this.removeListener(a,c);break}}},MessageEvent:q}},43017,(a,b,c)=>{"use strict";let{tokenChars:d}=a.r(57147);function e(a,b,c){void 0===a[b]?a[b]=[c]:a[b].push(c)}b.exports={format:function(a){return Object.keys(a).map(b=>{let c=a[b];return Array.isArray(c)||(c=[c]),c.map(a=>[b].concat(Object.keys(a).map(b=>{let c=a[b];return Array.isArray(c)||(c=[c]),c.map(a=>!0===a?b:`${b}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(a){let b,c,f=Object.create(null),g=Object.create(null),h=!1,i=!1,j=!1,k=-1,l=-1,m=-1,n=0;for(;n<a.length;n++)if(l=a.charCodeAt(n),void 0===b)if(-1===m&&1===d[l])-1===k&&(k=n);else if(0!==n&&(32===l||9===l))-1===m&&-1!==k&&(m=n);else if(59===l||44===l){if(-1===k)throw SyntaxError(`Unexpected character at index ${n}`);-1===m&&(m=n);let c=a.slice(k,m);44===l?(e(f,c,g),g=Object.create(null)):b=c,k=m=-1}else throw SyntaxError(`Unexpected character at index ${n}`);else if(void 0===c)if(-1===m&&1===d[l])-1===k&&(k=n);else if(32===l||9===l)-1===m&&-1!==k&&(m=n);else if(59===l||44===l){if(-1===k)throw SyntaxError(`Unexpected character at index ${n}`);-1===m&&(m=n),e(g,a.slice(k,m),!0),44===l&&(e(f,b,g),g=Object.create(null),b=void 0),k=m=-1}else if(61===l&&-1!==k&&-1===m)c=a.slice(k,n),k=m=-1;else throw SyntaxError(`Unexpected character at index ${n}`);else if(i){if(1!==d[l])throw SyntaxError(`Unexpected character at index ${n}`);-1===k?k=n:h||(h=!0),i=!1}else if(j)if(1===d[l])-1===k&&(k=n);else if(34===l&&-1!==k)j=!1,m=n;else if(92===l)i=!0;else throw SyntaxError(`Unexpected character at index ${n}`);else if(34===l&&61===a.charCodeAt(n-1))j=!0;else if(-1===m&&1===d[l])-1===k&&(k=n);else if(-1!==k&&(32===l||9===l))-1===m&&(m=n);else if(59===l||44===l){if(-1===k)throw SyntaxError(`Unexpected character at index ${n}`);-1===m&&(m=n);let d=a.slice(k,m);h&&(d=d.replace(/\\/g,""),h=!1),e(g,c,d),44===l&&(e(f,b,g),g=Object.create(null),b=void 0),c=void 0,k=m=-1}else throw SyntaxError(`Unexpected character at index ${n}`);if(-1===k||j||32===l||9===l)throw SyntaxError("Unexpected end of input");-1===m&&(m=n);let o=a.slice(k,m);return void 0===b?e(f,o,g):(void 0===c?e(g,o,!0):h?e(g,c,o.replace(/\\/g,"")):e(g,c,o),e(f,b,g)),f}}},41649,(a,b,c)=>{"use strict";let d=a.r(27699),e=a.r(24836),f=a.r(21517),g=a.r(4446),h=a.r(55004),{randomBytes:i,createHash:j}=a.r(54799),{Duplex:k,Readable:l}=a.r(88947),{URL:m}=a.r(92509),n=a.r(45143),o=a.r(71345),p=a.r(78583),{isBlob:q}=a.r(57147),{BINARY_TYPES:r,EMPTY_BUFFER:s,GUID:t,kForOnEventAttribute:u,kListener:v,kStatusCode:w,kWebSocket:x,NOOP:y}=a.r(25558),{EventTarget:{addEventListener:z,removeEventListener:A}}=a.r(21392),{format:B,parse:C}=a.r(43017),{toBuffer:D}=a.r(54242),E=Symbol("kAborted"),F=[8,13],G=["CONNECTING","OPEN","CLOSING","CLOSED"],H=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class I extends d{constructor(a,b,c){super(),this._binaryType=r[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=s,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=I.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==a?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===b?b=[]:Array.isArray(b)||("object"==typeof b&&null!==b?(c=b,b=[]):b=[b]),function a(b,c,d,g){let h,k,l,o,p={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:F[1],maxPayload:0x6400000,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...g,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(b._autoPong=p.autoPong,!F.includes(p.protocolVersion))throw RangeError(`Unsupported protocol version: ${p.protocolVersion} (supported versions: ${F.join(", ")})`);if(c instanceof m)h=c;else try{h=new m(c)}catch(a){throw SyntaxError(`Invalid URL: ${c}`)}"http:"===h.protocol?h.protocol="ws:":"https:"===h.protocol&&(h.protocol="wss:"),b._url=h.href;let q="wss:"===h.protocol,r="ws+unix:"===h.protocol;if("ws:"===h.protocol||q||r?r&&!h.pathname?k="The URL's pathname is empty":h.hash&&(k="The URL contains a fragment identifier"):k='The URL\'s protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"',k){let a=SyntaxError(k);if(0!==b._redirects)return void J(b,a);throw a}let s=q?443:80,u=i(16).toString("base64"),v=q?e.request:f.request,w=new Set;if(p.createConnection=p.createConnection||(q?L:K),p.defaultPort=p.defaultPort||s,p.port=h.port||s,p.host=h.hostname.startsWith("[")?h.hostname.slice(1,-1):h.hostname,p.headers={...p.headers,"Sec-WebSocket-Version":p.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},p.path=h.pathname+h.search,p.timeout=p.handshakeTimeout,p.perMessageDeflate&&(l=new n(!0!==p.perMessageDeflate?p.perMessageDeflate:{},!1,p.maxPayload),p.headers["Sec-WebSocket-Extensions"]=B({[n.extensionName]:l.offer()})),d.length){for(let a of d){if("string"!=typeof a||!H.test(a)||w.has(a))throw SyntaxError("An invalid or duplicated subprotocol was specified");w.add(a)}p.headers["Sec-WebSocket-Protocol"]=d.join(",")}if(p.origin&&(p.protocolVersion<13?p.headers["Sec-WebSocket-Origin"]=p.origin:p.headers.Origin=p.origin),(h.username||h.password)&&(p.auth=`${h.username}:${h.password}`),r){let a=p.path.split(":");p.socketPath=a[0],p.path=a[1]}if(p.followRedirects){if(0===b._redirects){b._originalIpc=r,b._originalSecure=q,b._originalHostOrSocketPath=r?p.socketPath:h.host;let a=g&&g.headers;if(g={...g,headers:{}},a)for(let[b,c]of Object.entries(a))g.headers[b.toLowerCase()]=c}else if(0===b.listenerCount("redirect")){let a=r?!!b._originalIpc&&p.socketPath===b._originalHostOrSocketPath:!b._originalIpc&&h.host===b._originalHostOrSocketPath;a&&(!b._originalSecure||q)||(delete p.headers.authorization,delete p.headers.cookie,a||delete p.headers.host,p.auth=void 0)}p.auth&&!g.headers.authorization&&(g.headers.authorization="Basic "+Buffer.from(p.auth).toString("base64")),o=b._req=v(p),b._redirects&&b.emit("redirect",b.url,o)}else o=b._req=v(p);p.timeout&&o.on("timeout",()=>{M(b,o,"Opening handshake has timed out")}),o.on("error",a=>{null===o||o[E]||(o=b._req=null,J(b,a))}),o.on("response",e=>{let f=e.headers.location,h=e.statusCode;if(f&&p.followRedirects&&h>=300&&h<400){let e;if(++b._redirects>p.maxRedirects)return void M(b,o,"Maximum redirects exceeded");o.abort();try{e=new m(f,c)}catch(a){J(b,SyntaxError(`Invalid URL: ${f}`));return}a(b,e,d,g)}else b.emit("unexpected-response",o,e)||M(b,o,`Unexpected server response: ${e.statusCode}`)}),o.on("upgrade",(a,c,d)=>{let e;if(b.emit("upgrade",a),b.readyState!==I.CONNECTING)return;o=b._req=null;let f=a.headers.upgrade;if(void 0===f||"websocket"!==f.toLowerCase())return void M(b,c,"Invalid Upgrade header");let g=j("sha1").update(u+t).digest("base64");if(a.headers["sec-websocket-accept"]!==g)return void M(b,c,"Invalid Sec-WebSocket-Accept header");let h=a.headers["sec-websocket-protocol"];if(void 0!==h?w.size?w.has(h)||(e="Server sent an invalid subprotocol"):e="Server sent a subprotocol but none was requested":w.size&&(e="Server sent no subprotocol"),e)return void M(b,c,e);h&&(b._protocol=h);let i=a.headers["sec-websocket-extensions"];if(void 0!==i){let a;if(!l)return void M(b,c,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");try{a=C(i)}catch(a){M(b,c,"Invalid Sec-WebSocket-Extensions header");return}let d=Object.keys(a);if(1!==d.length||d[0]!==n.extensionName)return void M(b,c,"Server indicated an extension that was not requested");try{l.accept(a[n.extensionName])}catch(a){M(b,c,"Invalid Sec-WebSocket-Extensions header");return}b._extensions[n.extensionName]=l}b.setSocket(c,d,{allowSynchronousEvents:p.allowSynchronousEvents,generateMask:p.generateMask,maxPayload:p.maxPayload,skipUTF8Validation:p.skipUTF8Validation})}),p.finishRequest?p.finishRequest(o,b):o.end()}(this,a,b,c)):(this._autoPong=c.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(a){r.includes(a)&&(this._binaryType=a,this._receiver&&(this._receiver._binaryType=a))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(a,b,c){let d=new o({allowSynchronousEvents:c.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:c.maxPayload,skipUTF8Validation:c.skipUTF8Validation}),e=new p(a,this._extensions,c.generateMask);this._receiver=d,this._sender=e,this._socket=a,d[x]=this,e[x]=this,a[x]=this,d.on("conclude",O),d.on("drain",P),d.on("error",Q),d.on("message",S),d.on("ping",T),d.on("pong",U),e.onerror=W,a.setTimeout&&a.setTimeout(0),a.setNoDelay&&a.setNoDelay(),b.length>0&&a.unshift(b),a.on("close",Y),a.on("data",Z),a.on("end",$),a.on("error",_),this._readyState=I.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=I.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[n.extensionName]&&this._extensions[n.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=I.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(a,b){if(this.readyState!==I.CLOSED){if(this.readyState===I.CONNECTING)return void M(this,this._req,"WebSocket was closed before the connection was established");if(this.readyState===I.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=I.CLOSING,this._sender.close(a,b,!this._isServer,a=>{!a&&(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),X(this)}}pause(){this.readyState!==I.CONNECTING&&this.readyState!==I.CLOSED&&(this._paused=!0,this._socket.pause())}ping(a,b,c){if(this.readyState===I.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");("function"==typeof a?(c=a,a=b=void 0):"function"==typeof b&&(c=b,b=void 0),"number"==typeof a&&(a=a.toString()),this.readyState!==I.OPEN)?N(this,a,c):(void 0===b&&(b=!this._isServer),this._sender.ping(a||s,b,c))}pong(a,b,c){if(this.readyState===I.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");("function"==typeof a?(c=a,a=b=void 0):"function"==typeof b&&(c=b,b=void 0),"number"==typeof a&&(a=a.toString()),this.readyState!==I.OPEN)?N(this,a,c):(void 0===b&&(b=!this._isServer),this._sender.pong(a||s,b,c))}resume(){this.readyState!==I.CONNECTING&&this.readyState!==I.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(a,b,c){if(this.readyState===I.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof b&&(c=b,b={}),"number"==typeof a&&(a=a.toString()),this.readyState!==I.OPEN)return void N(this,a,c);let d={binary:"string"!=typeof a,mask:!this._isServer,compress:!0,fin:!0,...b};this._extensions[n.extensionName]||(d.compress=!1),this._sender.send(a||s,d,c)}terminate(){if(this.readyState!==I.CLOSED){if(this.readyState===I.CONNECTING)return void M(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=I.CLOSING,this._socket.destroy())}}}function J(a,b){a._readyState=I.CLOSING,a._errorEmitted=!0,a.emit("error",b),a.emitClose()}function K(a){return a.path=a.socketPath,g.connect(a)}function L(a){return a.path=void 0,a.servername||""===a.servername||(a.servername=g.isIP(a.host)?"":a.host),h.connect(a)}function M(a,b,c){a._readyState=I.CLOSING;let d=Error(c);Error.captureStackTrace(d,M),b.setHeader?(b[E]=!0,b.abort(),b.socket&&!b.socket.destroyed&&b.socket.destroy(),process.nextTick(J,a,d)):(b.destroy(d),b.once("error",a.emit.bind(a,"error")),b.once("close",a.emitClose.bind(a)))}function N(a,b,c){if(b){let c=q(b)?b.size:D(b).length;a._socket?a._sender._bufferedBytes+=c:a._bufferedAmount+=c}if(c){let b=Error(`WebSocket is not open: readyState ${a.readyState} (${G[a.readyState]})`);process.nextTick(c,b)}}function O(a,b){let c=this[x];c._closeFrameReceived=!0,c._closeMessage=b,c._closeCode=a,void 0!==c._socket[x]&&(c._socket.removeListener("data",Z),process.nextTick(V,c._socket),1005===a?c.close():c.close(a,b))}function P(){let a=this[x];a.isPaused||a._socket.resume()}function Q(a){let b=this[x];void 0!==b._socket[x]&&(b._socket.removeListener("data",Z),process.nextTick(V,b._socket),b.close(a[w])),b._errorEmitted||(b._errorEmitted=!0,b.emit("error",a))}function R(){this[x].emitClose()}function S(a,b){this[x].emit("message",a,b)}function T(a){let b=this[x];b._autoPong&&b.pong(a,!this._isServer,y),b.emit("ping",a)}function U(a){this[x].emit("pong",a)}function V(a){a.resume()}function W(a){let b=this[x];b.readyState!==I.CLOSED&&(b.readyState===I.OPEN&&(b._readyState=I.CLOSING,X(b)),this._socket.end(),b._errorEmitted||(b._errorEmitted=!0,b.emit("error",a)))}function X(a){a._closeTimer=setTimeout(a._socket.destroy.bind(a._socket),3e4)}function Y(){let a,b=this[x];this.removeListener("close",Y),this.removeListener("data",Z),this.removeListener("end",$),b._readyState=I.CLOSING,this._readableState.endEmitted||b._closeFrameReceived||b._receiver._writableState.errorEmitted||null===(a=b._socket.read())||b._receiver.write(a),b._receiver.end(),this[x]=void 0,clearTimeout(b._closeTimer),b._receiver._writableState.finished||b._receiver._writableState.errorEmitted?b.emitClose():(b._receiver.on("error",R),b._receiver.on("finish",R))}function Z(a){this[x]._receiver.write(a)||this.pause()}function $(){let a=this[x];a._readyState=I.CLOSING,a._receiver.end(),this.end()}function _(){let a=this[x];this.removeListener("error",_),this.on("error",y),a&&(a._readyState=I.CLOSING,this.destroy())}Object.defineProperty(I,"CONNECTING",{enumerable:!0,value:G.indexOf("CONNECTING")}),Object.defineProperty(I.prototype,"CONNECTING",{enumerable:!0,value:G.indexOf("CONNECTING")}),Object.defineProperty(I,"OPEN",{enumerable:!0,value:G.indexOf("OPEN")}),Object.defineProperty(I.prototype,"OPEN",{enumerable:!0,value:G.indexOf("OPEN")}),Object.defineProperty(I,"CLOSING",{enumerable:!0,value:G.indexOf("CLOSING")}),Object.defineProperty(I.prototype,"CLOSING",{enumerable:!0,value:G.indexOf("CLOSING")}),Object.defineProperty(I,"CLOSED",{enumerable:!0,value:G.indexOf("CLOSED")}),Object.defineProperty(I.prototype,"CLOSED",{enumerable:!0,value:G.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(a=>{Object.defineProperty(I.prototype,a,{enumerable:!0})}),["open","error","close","message"].forEach(a=>{Object.defineProperty(I.prototype,`on${a}`,{enumerable:!0,get(){for(let b of this.listeners(a))if(b[u])return b[v];return null},set(b){for(let b of this.listeners(a))if(b[u]){this.removeListener(a,b);break}"function"==typeof b&&this.addEventListener(a,b,{[u]:!0})}})}),I.prototype.addEventListener=z,I.prototype.removeEventListener=A,b.exports=I},10578,(a,b,c)=>{"use strict";a.r(41649);let{Duplex:d}=a.r(88947);function e(a){a.emit("close")}function f(){!this.destroyed&&this._writableState.finished&&this.destroy()}function g(a){this.removeListener("error",g),this.destroy(),0===this.listenerCount("error")&&this.emit("error",a)}b.exports=function(a,b){let c=!0,h=new d({...b,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return a.on("message",function(b,c){let d=!c&&h._readableState.objectMode?b.toString():b;h.push(d)||a.pause()}),a.once("error",function(a){h.destroyed||(c=!1,h.destroy(a))}),a.once("close",function(){h.destroyed||h.push(null)}),h._destroy=function(b,d){if(a.readyState===a.CLOSED){d(b),process.nextTick(e,h);return}let f=!1;a.once("error",function(a){f=!0,d(a)}),a.once("close",function(){f||d(b),process.nextTick(e,h)}),c&&a.terminate()},h._final=function(b){a.readyState===a.CONNECTING?a.once("open",function(){h._final(b)}):null!==a._socket&&(a._socket._writableState.finished?(b(),h._readableState.endEmitted&&h.destroy()):(a._socket.once("finish",function(){b()}),a.close()))},h._read=function(){a.isPaused&&a.resume()},h._write=function(b,c,d){a.readyState===a.CONNECTING?a.once("open",function(){h._write(b,c,d)}):a.send(b,d)},h.on("end",f),h.on("error",g),h}},35134,(a,b,c)=>{"use strict";let{tokenChars:d}=a.r(57147);b.exports={parse:function(a){let b=new Set,c=-1,e=-1,f=0;for(;f<a.length;f++){let g=a.charCodeAt(f);if(-1===e&&1===d[g])-1===c&&(c=f);else if(0!==f&&(32===g||9===g))-1===e&&-1!==c&&(e=f);else if(44===g){if(-1===c)throw SyntaxError(`Unexpected character at index ${f}`);-1===e&&(e=f);let d=a.slice(c,e);if(b.has(d))throw SyntaxError(`The "${d}" subprotocol is duplicated`);b.add(d),c=e=-1}else throw SyntaxError(`Unexpected character at index ${f}`)}if(-1===c||-1!==e)throw SyntaxError("Unexpected end of input");let g=a.slice(c,f);if(b.has(g))throw SyntaxError(`The "${g}" subprotocol is duplicated`);return b.add(g),b}}},4294,(a,b,c)=>{"use strict";let d=a.r(27699),e=a.r(21517),{Duplex:f}=a.r(88947),{createHash:g}=a.r(54799),h=a.r(43017),i=a.r(45143),j=a.r(35134),k=a.r(41649),{GUID:l,kWebSocket:m}=a.r(25558),n=/^[+/0-9A-Za-z]{22}==$/;function o(a){a._state=2,a.emit("close")}function p(){this.destroy()}function q(a,b,c,d){c=c||e.STATUS_CODES[b],d={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(c),...d},a.once("finish",a.destroy),a.end(`HTTP/1.1 ${b} ${e.STATUS_CODES[b]}\r
|
|
2
|
-
`+Object.keys(d).map(a=>`${a}: ${d[a]}`).join("\r\n")+"\r\n\r\n"+c)}function r(a,b,c,d,e,f){if(a.listenerCount("wsClientError")){let d=Error(e);Error.captureStackTrace(d,r),a.emit("wsClientError",d,c,b)}else q(c,d,e,f)}b.exports=class extends d{constructor(a,b){if(super(),null==(a={allowSynchronousEvents:!0,autoPong:!0,maxPayload:0x6400000,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:k,...a}).port&&!a.server&&!a.noServer||null!=a.port&&(a.server||a.noServer)||a.server&&a.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=a.port?(this._server=e.createServer((a,b)=>{let c=e.STATUS_CODES[426];b.writeHead(426,{"Content-Length":c.length,"Content-Type":"text/plain"}),b.end(c)}),this._server.listen(a.port,a.host,a.backlog,b)):a.server&&(this._server=a.server),this._server){const a=this.emit.bind(this,"connection");this._removeListeners=function(a,b){for(let c of Object.keys(b))a.on(c,b[c]);return function(){for(let c of Object.keys(b))a.removeListener(c,b[c])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(b,c,d)=>{this.handleUpgrade(b,c,d,a)}})}!0===a.perMessageDeflate&&(a.perMessageDeflate={}),a.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=a,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(a){if(2===this._state){a&&this.once("close",()=>{a(Error("The server is not running"))}),process.nextTick(o,this);return}if(a&&this.once("close",a),1!==this._state)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(o,this);else{let a=this._server;this._removeListeners(),this._removeListeners=this._server=null,a.close(()=>{o(this)})}}shouldHandle(a){if(this.options.path){let b=a.url.indexOf("?");if((-1!==b?a.url.slice(0,b):a.url)!==this.options.path)return!1}return!0}handleUpgrade(a,b,c,d){b.on("error",p);let e=a.headers["sec-websocket-key"],f=a.headers.upgrade,g=+a.headers["sec-websocket-version"];if("GET"!==a.method)return void r(this,a,b,405,"Invalid HTTP method");if(void 0===f||"websocket"!==f.toLowerCase())return void r(this,a,b,400,"Invalid Upgrade header");if(void 0===e||!n.test(e))return void r(this,a,b,400,"Missing or invalid Sec-WebSocket-Key header");if(13!==g&&8!==g)return void r(this,a,b,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});if(!this.shouldHandle(a))return void q(b,400);let k=a.headers["sec-websocket-protocol"],l=new Set;if(void 0!==k)try{l=j.parse(k)}catch(c){r(this,a,b,400,"Invalid Sec-WebSocket-Protocol header");return}let m=a.headers["sec-websocket-extensions"],o={};if(this.options.perMessageDeflate&&void 0!==m){let c=new i(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let a=h.parse(m);a[i.extensionName]&&(c.accept(a[i.extensionName]),o[i.extensionName]=c)}catch(c){r(this,a,b,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:a.headers[`${8===g?"sec-websocket-origin":"origin"}`],secure:!!(a.socket.authorized||a.socket.encrypted),req:a};if(2===this.options.verifyClient.length)return void this.options.verifyClient(f,(f,g,h,i)=>{if(!f)return q(b,g||401,h,i);this.completeUpgrade(o,e,l,a,b,c,d)});if(!this.options.verifyClient(f))return q(b,401)}this.completeUpgrade(o,e,l,a,b,c,d)}completeUpgrade(a,b,c,d,e,f,j){if(!e.readable||!e.writable)return e.destroy();if(e[m])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return q(e,503);let k=g("sha1").update(b+l).digest("base64"),n=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${k}`],r=new this.options.WebSocket(null,void 0,this.options);if(c.size){let a=this.options.handleProtocols?this.options.handleProtocols(c,d):c.values().next().value;a&&(n.push(`Sec-WebSocket-Protocol: ${a}`),r._protocol=a)}if(a[i.extensionName]){let b=a[i.extensionName].params,c=h.format({[i.extensionName]:[b]});n.push(`Sec-WebSocket-Extensions: ${c}`),r._extensions=a}this.emit("headers",n,d),e.write(n.concat("\r\n").join("\r\n")),e.removeListener("error",p),r.setSocket(e,f,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(r),r.on("close",()=>{this.clients.delete(r),this._shouldEmitClose&&!this.clients.size&&process.nextTick(o,this)})),j(r,d)}}},43970,(a,b,c)=>{b.exports=function(b){function c(a){let b,e,f,g=null;function h(...a){if(!h.enabled)return;let d=Number(new Date);h.diff=d-(b||d),h.prev=b,h.curr=d,b=d,a[0]=c.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");let e=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(b,d)=>{if("%%"===b)return"%";e++;let f=c.formatters[d];if("function"==typeof f){let c=a[e];b=f.call(h,c),a.splice(e,1),e--}return b}),c.formatArgs.call(h,a),(h.log||c.log).apply(h,a)}return h.namespace=a,h.useColors=c.useColors(),h.color=c.selectColor(a),h.extend=d,h.destroy=c.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==g?g:(e!==c.namespaces&&(e=c.namespaces,f=c.enabled(a)),f),set:a=>{g=a}}),"function"==typeof c.init&&c.init(h),h}function d(a,b){let d=c(this.namespace+(void 0===b?":":b)+a);return d.log=this.log,d}function e(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}return c.debug=c,c.default=c,c.coerce=function(a){return a instanceof Error?a.stack||a.message:a},c.disable=function(){let a=[...c.names.map(e),...c.skips.map(e).map(a=>"-"+a)].join(",");return c.enable(""),a},c.enable=function(a){let b;c.save(a),c.namespaces=a,c.names=[],c.skips=[];let d=("string"==typeof a?a:"").split(/[\s,]+/),e=d.length;for(b=0;b<e;b++)d[b]&&("-"===(a=d[b].replace(/\*/g,".*?"))[0]?c.skips.push(RegExp("^"+a.slice(1)+"$")):c.names.push(RegExp("^"+a+"$")))},c.enabled=function(a){let b,d;if("*"===a[a.length-1])return!0;for(b=0,d=c.skips.length;b<d;b++)if(c.skips[b].test(a))return!1;for(b=0,d=c.names.length;b<d;b++)if(c.names[b].test(a))return!0;return!1},c.humanize=a.r(60690),c.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(b).forEach(a=>{c[a]=b[a]}),c.names=[],c.skips=[],c.formatters={},c.selectColor=function(a){let b=0;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c)|0;return c.colors[Math.abs(b)%c.colors.length]},c.enable(c.load()),c}},683,(a,b,c)=>{let d=a.r(70722),e=a.r(24361);c.init=function(a){a.inspectOpts={};let b=Object.keys(c.inspectOpts);for(let d=0;d<b.length;d++)a.inspectOpts[b[d]]=c.inspectOpts[b[d]]},c.log=function(...a){return process.stderr.write(e.formatWithOptions(c.inspectOpts,...a)+"\n")},c.formatArgs=function(a){let{namespace:d,useColors:e}=this;if(e){let c=this.color,e="\x1b[3"+(c<8?c:"8;5;"+c),f=` ${e};1m${d} \u001B[0m`;a[0]=f+a[0].split("\n").join("\n"+f),a.push(e+"m+"+b.exports.humanize(this.diff)+"\x1b[0m")}else a[0]=(c.inspectOpts.hideDate?"":new Date().toISOString()+" ")+d+" "+a[0]},c.save=function(a){a?process.env.DEBUG=a:delete process.env.DEBUG},c.load=function(){return process.env.DEBUG},c.useColors=function(){return"colors"in c.inspectOpts?!!c.inspectOpts.colors:d.isatty(process.stderr.fd)},c.destroy=e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),c.colors=[6,2,3,4,5,1];try{let b=a.r(12914);b&&(b.stderr||b).level>=2&&(c.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(a){}c.inspectOpts=Object.keys(process.env).filter(a=>/^debug_/i.test(a)).reduce((a,b)=>{let c=b.substring(6).toLowerCase().replace(/_([a-z])/g,(a,b)=>b.toUpperCase()),d=process.env[b];return d=!!/^(yes|on|true|enabled)$/i.test(d)||!/^(no|off|false|disabled)$/i.test(d)&&("null"===d?null:Number(d)),a[c]=d,a},{}),b.exports=a.r(43970)(c);let{formatters:f}=b.exports;f.o=function(a){return this.inspectOpts.colors=this.useColors,e.inspect(a,this.inspectOpts).split("\n").map(a=>a.trim()).join(" ")},f.O=function(a){return this.inspectOpts.colors=this.useColors,e.inspect(a,this.inspectOpts)}},1372,(a,b,c)=>{let d;c.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+b.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;a.splice(1,0,c,"color: inherit");let d=0,e=0;a[0].replace(/%[a-zA-Z%]/g,a=>{"%%"!==a&&(d++,"%c"===a&&(e=d))}),a.splice(e,0,c)},c.save=function(a){try{a?c.storage.setItem("debug",a):c.storage.removeItem("debug")}catch(a){}},c.load=function(){let a;try{a=c.storage.getItem("debug")}catch(a){}return!a&&"undefined"!=typeof process&&"env"in process&&(a=process.env.DEBUG),a},c.useColors=function(){let a;return!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof navigator&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},c.storage=function(){try{return localStorage}catch(a){}}(),d=!1,c.destroy=()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},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.log=console.debug||console.log||(()=>{}),b.exports=a.r(43970)(c);let{formatters:e}=b.exports;e.j=function(a){try{return JSON.stringify(a)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}}},81855,(a,b,c)=>{"undefined"==typeof process||"renderer"===process.type||process.__nwjs?b.exports=a.r(1372):b.exports=a.r(683)},69431,14358,54049,a=>{"use strict";let b,c,d;var e,f,g=a.i(53213),h=a.i(66808),i=a.i(16084);let j=(0,i.createServerReference)("78b81665c2f52df9f88fe99a7a917efcffc2994c9c",i.callServer,void 0,i.findSourceMapURL,"getTemplatesDirectoryMetadataAction");process.env.USER_PROJECT_LOCATION,process.env.PREVIEW_SERVER_LOCATION,process.env.TEMPLATES_DIR_ABSOLUTE_PATH;let k="true"===process.env.NEXT_PUBLIC_IS_BUILDING,l="true"===process.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT;a.s(["isBuilding",0,k,"isPreviewDevelopment",0,l],14358);var m=a.i(12416);let n=Object.create(null);n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";let o=Object.create(null);Object.keys(n).forEach(a=>{o[n[a]]=a});let p={type:"error",data:"parser error"},q=({type:a,data:b},c,d)=>d(b instanceof ArrayBuffer||ArrayBuffer.isView(b)?c?b:"b"+r(b,!0).toString("base64"):n[a]+(b||"")),r=(a,b)=>Buffer.isBuffer(a)||a instanceof Uint8Array&&!b?a:a instanceof ArrayBuffer?Buffer.from(a):Buffer.from(a.buffer,a.byteOffset,a.byteLength),s=(a,b)=>{if("string"!=typeof a)return{type:"message",data:t(a,b)};let c=a.charAt(0);return"b"===c?{type:"message",data:t(Buffer.from(a.substring(1),"base64"),b)}:o[c]?a.length>1?{type:o[c],data:a.substring(1)}:{type:o[c]}:p},t=(a,b)=>"arraybuffer"===b?a instanceof ArrayBuffer?a:Buffer.isBuffer(a)?a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength):a.buffer:Buffer.isBuffer(a)?a:Buffer.from(a);function u(a){return a.reduce((a,b)=>a+b.length,0)}function v(a,b){if(a[0].length===b)return a.shift();let c=new Uint8Array(b),d=0;for(let e=0;e<b;e++)c[e]=a[0][d++],d===a[0].length&&(a.shift(),d=0);return a.length&&d<a[0].length&&(a[0]=a[0].slice(d)),c}function w(a){if(a){var b=a;for(var c in w.prototype)b[c]=w.prototype[c];return b}}w.prototype.on=w.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(b),this},w.prototype.once=function(a,b){function c(){this.off(a,c),b.apply(this,arguments)}return c.fn=b,this.on(a,c),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c,d=this._callbacks["$"+a];if(!d)return this;if(1==arguments.length)return delete this._callbacks["$"+a],this;for(var e=0;e<d.length;e++)if((c=d[e])===b||c.fn===b){d.splice(e,1);break}return 0===d.length&&delete this._callbacks["$"+a],this},w.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var b=Array(arguments.length-1),c=this._callbacks["$"+a],d=1;d<arguments.length;d++)b[d-1]=arguments[d];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]},w.prototype.hasListeners=function(a){return!!this.listeners(a).length};let x=process.nextTick,y=a.g;class z{constructor(){this._cookies=new Map}parseCookies(a){a&&a.forEach(a=>{let b=function(a){let b=a.split("; "),c=b[0].indexOf("=");if(-1===c)return;let d=b[0].substring(0,c).trim();if(!d.length)return;let e=b[0].substring(c+1).trim();34===e.charCodeAt(0)&&(e=e.slice(1,-1));let f={name:d,value:e};for(let a=1;a<b.length;a++){let c=b[a].split("=");if(2!==c.length)continue;let d=c[0].trim(),e=c[1].trim();switch(d){case"Expires":f.expires=new Date(e);break;case"Max-Age":let g=new Date;g.setUTCSeconds(g.getUTCSeconds()+parseInt(e,10)),f.expires=g}}return f}(a);b&&this._cookies.set(b.name,b)})}get cookies(){let a=Date.now();return this._cookies.forEach((b,c)=>{var d;(null==(d=b.expires)?void 0:d.getTime())<a&&this._cookies.delete(c)}),this._cookies.entries()}addCookies(a){let b=[];for(let[a,c]of this.cookies)b.push(`${a}=${c.value}`);b.length&&(a.setDisableHeaderCheck(!0),a.setRequestHeader("cookie",b.join("; ")))}appendCookies(a){for(let[b,c]of this.cookies)a.append("cookie",`${b}=${c.value}`)}}function A(a,...b){return b.reduce((b,c)=>(a.hasOwnProperty(c)&&(b[c]=a[c]),b),{})}let B=y.setTimeout,C=y.clearTimeout;function D(a,b){b.useNativeTimers?(a.setTimeoutFn=B.bind(y),a.clearTimeoutFn=C.bind(y)):(a.setTimeoutFn=y.setTimeout.bind(y),a.clearTimeoutFn=y.clearTimeout.bind(y))}function E(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var F=a.i(35617);let G=(0,F.default)("engine.io-client:transport");class H extends Error{constructor(a,b,c){super(a),this.description=b,this.context=c,this.type="TransportError"}}class I extends w{constructor(a){super(),this.writable=!1,D(this,a),this.opts=a,this.query=a.query,this.socket=a.socket,this.supportsBinary=!a.forceBase64}onError(a,b,c){return super.emitReserved("error",new H(a,b,c)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(a){"open"===this.readyState?this.write(a):G("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(a){let b=s(a,this.socket.binaryType);this.onPacket(b)}onPacket(a){super.emitReserved("packet",a)}onClose(a){this.readyState="closed",super.emitReserved("close",a)}pause(a){}createUri(a,b={}){return a+"://"+this._hostname()+this._port()+this.opts.path+this._query(b)}_hostname(){let a=this.opts.hostname;return -1===a.indexOf(":")?a:"["+a+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(a){let b=function(a){let b="";for(let c in a)a.hasOwnProperty(c)&&(b.length&&(b+="&"),b+=encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b}(a);return b.length?"?"+b:""}}let J=(0,F.default)("engine.io-client:polling");class K extends I{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(a){this.readyState="pausing";let b=()=>{J("paused"),this.readyState="paused",a()};if(this._polling||!this.writable){let a=0;this._polling&&(J("we are currently polling - waiting to pause"),a++,this.once("pollComplete",function(){J("pre-pause polling complete"),--a||b()})),this.writable||(J("we are currently writing - waiting to pause"),a++,this.once("drain",function(){J("pre-pause writing complete"),--a||b()}))}else b()}_poll(){J("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(a){J("polling got data %s",a);let b=a=>{if("opening"===this.readyState&&"open"===a.type&&this.onOpen(),"close"===a.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};((a,b)=>{let c=a.split("\x1e"),d=[];for(let a=0;a<c.length;a++){let e=s(c[a],b);if(d.push(e),"error"===e.type)break}return d})(a,this.socket.binaryType).forEach(b),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this._poll():J('ignoring poll - transport state "%s"',this.readyState))}doClose(){let a=()=>{J("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(J("transport open - closing"),a()):(J("transport not open - deferring close"),this.once("open",a))}write(a){var b;let c,d,e;this.writable=!1,b=a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})},d=Array(c=a.length),e=0,a.forEach((a,f)=>{q(a,!1,a=>{d[f]=a,++e===c&&b(d.join("\x1e"))})})}uri(){let a=this.opts.secure?"https":"http",b=this.query||{};return!1!==this.opts.timestampRequests&&(b[this.opts.timestampParam]=E()),this.supportsBinary||b.sid||(b.b64=1),this.createUri(a,b)}}let L=!1;try{L="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(a){}let M=L,N=(0,F.default)("engine.io-client:polling");function O(){}class P extends K{constructor(a){if(super(a),"undefined"!=typeof location){const b="https:"===location.protocol;let c=location.port;c||(c=b?"443":"80"),this.xd="undefined"!=typeof location&&a.hostname!==location.hostname||c!==a.port}}doWrite(a,b){let c=this.request({method:"POST",data:a});c.on("success",b),c.on("error",(a,b)=>{this.onError("xhr post error",a,b)})}doPoll(){N("xhr poll");let a=this.request();a.on("data",this.onData.bind(this)),a.on("error",(a,b)=>{this.onError("xhr poll error",a,b)}),this.pollXhr=a}}class Q extends w{constructor(a,b,c){super(),this.createRequest=a,D(this,c),this._opts=c,this._method=c.method||"GET",this._uri=b,this._data=void 0!==c.data?c.data:null,this._create()}_create(){var a;let b=A(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");b.xdomain=!!this._opts.xd;let c=this._xhr=this.createRequest(b);try{N("xhr open %s: %s",this._method,this._uri),c.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let a in c.setDisableHeaderCheck&&c.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&c.setRequestHeader(a,this._opts.extraHeaders[a])}catch(a){}if("POST"===this._method)try{c.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(a){}try{c.setRequestHeader("Accept","*/*")}catch(a){}null==(a=this._opts.cookieJar)||a.addCookies(c),"withCredentials"in c&&(c.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(c.timeout=this._opts.requestTimeout),c.onreadystatechange=()=>{var a;3===c.readyState&&(null==(a=this._opts.cookieJar)||a.parseCookies(c.getResponseHeader("set-cookie"))),4===c.readyState&&(200===c.status||1223===c.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof c.status?c.status:0)},0))},N("xhr data %s",this._data),c.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}"undefined"!=typeof document&&(this._index=Q.requestsCount++,Q.requests[this._index]=this)}_onError(a){this.emitReserved("error",a,this._xhr),this._cleanup(!0)}_cleanup(a){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=O,a)try{this._xhr.abort()}catch(a){}"undefined"!=typeof document&&delete Q.requests[this._index],this._xhr=null}}_onLoad(){let a=this._xhr.responseText;null!==a&&(this.emitReserved("data",a),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function R(){for(let a in Q.requests)Q.requests.hasOwnProperty(a)&&Q.requests[a].abort()}Q.requestsCount=0,Q.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",R):"function"==typeof addEventListener&&addEventListener("onpagehide"in y?"pagehide":"unload",R,!1)),(d=function(a){let b=a.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!b||M))return new XMLHttpRequest}catch(a){}if(!b)try{return new y[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(a){}}({xdomain:!1}))&&d.responseType;let S=m.default||m;a.i(10578),a.i(71345),a.i(78583);var T=a.i(41649);a.i(4294),T.default;let U=(0,F.default)("engine.io-client:websocket"),V="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends I{get name(){return"websocket"}doOpen(){let a=this.uri(),b=this.opts.protocols,c=V?{}:A(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(c.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(a,b,c)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=a=>this.onClose({description:"websocket connection closed",context:a}),this.ws.onmessage=a=>this.onData(a.data),this.ws.onerror=a=>this.onError("websocket error",a)}write(a){this.writable=!1;for(let b=0;b<a.length;b++){let c=a[b],d=b===a.length-1;q(c,this.supportsBinary,a=>{try{this.doWrite(c,a)}catch(a){U("websocket closed before onclose event")}d&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let a=this.opts.secure?"wss":"ws",b=this.query||{};return this.opts.timestampRequests&&(b[this.opts.timestampParam]=E()),this.supportsBinary||(b.b64=1),this.createUri(a,b)}}y.WebSocket||y.MozWebSocket;let X=(0,F.default)("engine.io-client:webtransport"),Y={websocket:class extends W{createSocket(a,b,c){var d;if(null==(d=this.socket)?void 0:d._cookieJar)for(let[a,b]of(c.headers=c.headers||{},c.headers.cookie="string"==typeof c.headers.cookie?[c.headers.cookie]:c.headers.cookie||[],this.socket._cookieJar.cookies))c.headers.cookie.push(`${a}=${b.value}`);return new T.default(a,b,c)}doWrite(a,b){let c={};a.options&&(c.compress=a.options.compress),this.opts.perMessageDeflate&&("string"==typeof b?Buffer.byteLength(b):b.length)<this.opts.perMessageDeflate.threshold&&(c.compress=!1),this.ws.send(b,c)}},webtransport:class extends I{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(a){return this.emitReserved("error",a)}this._transport.closed.then(()=>{X("transport closed gracefully"),this.onClose()}).catch(a=>{X("transport closed due to %s",a),this.onError("webtransport error",a)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(a=>{var d,e;let f,g,h,i,j=(d=Number.MAX_SAFE_INTEGER,e=this.socket.binaryType,c||(c=new TextDecoder),f=[],g=0,h=-1,i=!1,new TransformStream({transform(a,b){for(f.push(a);;){if(0===g){if(1>u(f))break;let a=v(f,1);i=(128&a[0])==128,g=(h=127&a[0])<126?3:126===h?1:2}else if(1===g){if(2>u(f))break;let a=v(f,2);h=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),g=3}else if(2===g){if(8>u(f))break;let a=v(f,8),c=new DataView(a.buffer,a.byteOffset,a.length),d=c.getUint32(0);if(d>2097151){b.enqueue(p);break}h=0x100000000*d+c.getUint32(4),g=3}else{if(u(f)<h)break;let a=v(f,h);b.enqueue(s(i?a:c.decode(a),e)),g=0}if(0===h||h>d){b.enqueue(p);break}}}})),k=a.readable.pipeThrough(j).getReader(),l=new TransformStream({transform(a,c){!function(a,c){if(a.data instanceof ArrayBuffer||ArrayBuffer.isView(a.data))return c(r(a.data,!1));q(a,!0,a=>{b||(b=new TextEncoder),c(b.encode(a))})}(a,b=>{let d,e=b.length;if(e<126)new DataView((d=new Uint8Array(1)).buffer).setUint8(0,e);else if(e<65536){let a=new DataView((d=new Uint8Array(3)).buffer);a.setUint8(0,126),a.setUint16(1,e)}else{let a=new DataView((d=new Uint8Array(9)).buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(e))}a.data&&"string"!=typeof a.data&&(d[0]|=128),c.enqueue(d),c.enqueue(b)})}});l.readable.pipeTo(a.writable),this._writer=l.writable.getWriter();let m=()=>{k.read().then(({done:a,value:b})=>{a?X("session is closed"):(X("received chunk: %o",b),this.onPacket(b),m())}).catch(a=>{X("an error occurred while reading: %s",a)})};m();let n={type:"open"};this.query.sid&&(n.data=`{"sid":"${this.query.sid}"}`),this._writer.write(n).then(()=>this.onOpen())})})}write(a){this.writable=!1;for(let b=0;b<a.length;b++){let c=a[b],d=b===a.length-1;this._writer.write(c).then(()=>{d&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var a;null==(a=this._transport)||a.close()}},polling:class extends P{request(a={}){var b;return Object.assign(a,{xd:this.xd,cookieJar:null==(b=this.socket)?void 0:b._cookieJar},this.opts),new Q(a=>new S(a),this.uri(),a)}}},Z=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _(a){var b,c;let d,e;if(a.length>8e3)throw"URI too long";let f=a,g=a.indexOf("["),h=a.indexOf("]");-1!=g&&-1!=h&&(a=a.substring(0,g)+a.substring(g,h).replace(/:/g,";")+a.substring(h,a.length));let i=Z.exec(a||""),j={},k=14;for(;k--;)j[$[k]]=i[k]||"";return -1!=g&&-1!=h&&(j.source=f,j.host=j.host.substring(1,j.host.length-1).replace(/;/g,":"),j.authority=j.authority.replace("[","").replace("]","").replace(/;/g,":"),j.ipv6uri=!0),d=(b=j.path).replace(/\/{2,9}/g,"/").split("/"),("/"==b.slice(0,1)||0===b.length)&&d.splice(0,1),"/"==b.slice(-1)&&d.splice(d.length-1,1),j.pathNames=d,c=j.query,e={},c.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,b,c){b&&(e[b]=c)}),j.queryKey=e,j}let aa=(0,F.default)("engine.io-client:socket"),ab="function"==typeof addEventListener&&"function"==typeof removeEventListener,ac=[];ab&&addEventListener("offline",()=>{aa("closing %d connection(s) because the network was lost",ac.length),ac.forEach(a=>a())},!1);class ad extends w{constructor(a,b){if(super(),this.binaryType="nodebuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,a&&"object"==typeof a&&(b=a,a=null),a){const c=_(a);b.hostname=c.host,b.secure="https"===c.protocol||"wss"===c.protocol,b.port=c.port,c.query&&(b.query=c.query)}else b.host&&(b.hostname=_(b.host).host);D(this,b),this.secure=null!=b.secure?b.secure:"undefined"!=typeof location&&"https:"===location.protocol,b.hostname&&!b.port&&(b.port=this.secure?"443":"80"),this.hostname=b.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=b.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},b.transports.forEach(a=>{let b=a.prototype.name;this.transports.push(b),this._transportsByName[b]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},b),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(a){let b={},c=a.split("&");for(let a=0,d=c.length;a<d;a++){let d=c[a].split("=");b[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return b}(this.opts.query)),ab&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(aa("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ac.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=new z),this._open()}createTransport(a){aa('creating transport "%s"',a);let b=Object.assign({},this.opts.query);b.EIO=4,b.transport=a,this.id&&(b.sid=this.id);let c=Object.assign({},this.opts,{query:b,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[a]);return aa("options: %j",c),new this._transportsByName[a](c)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let a=this.opts.rememberUpgrade&&ad.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let b=this.createTransport(a);b.open(),this.setTransport(b)}setTransport(a){aa("setting transport %s",a.name),this.transport&&(aa("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=a,a.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){aa("socket open"),this.readyState="open",ad.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(a){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(aa('socket receive: type "%s", data "%s"',a.type,a.data),this.emitReserved("packet",a),this.emitReserved("heartbeat"),a.type){case"open":this.onHandshake(JSON.parse(a.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let b=Error("server error");b.code=a.data,this._onError(b);break;case"message":this.emitReserved("data",a.data),this.emitReserved("message",a.data)}else aa('packet received with socket readyState "%s"',this.readyState)}onHandshake(a){this.emitReserved("handshake",a),this.id=a.sid,this.transport.query.sid=a.sid,this._pingInterval=a.pingInterval,this._pingTimeout=a.pingTimeout,this._maxPayload=a.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let a=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+a,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},a),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let a=this._getWritablePackets();aa("flushing %d packets in socket",a.length),this.transport.send(a),this._prevBufferLen=a.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let b=0;b<this.writeBuffer.length;b++){let c=this.writeBuffer[b].data;if(c&&(a+="string"==typeof c?function(a){let b=0,c=0;for(let d=0,e=a.length;d<e;d++)(b=a.charCodeAt(d))<128?c+=1:b<2048?c+=2:b<55296||b>=57344?c+=3:(d++,c+=4);return c}(c):Math.ceil(1.33*(c.byteLength||c.size))),b>0&&a>this._maxPayload)return aa("only send %d out of %d packets",b,this.writeBuffer.length),this.writeBuffer.slice(0,b);a+=2}return aa("payload size is %d (max: %d)",a,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let a=Date.now()>this._pingTimeoutTime;return a&&(aa("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),a}write(a,b,c){return this._sendPacket("message",a,b,c),this}send(a,b,c){return this._sendPacket("message",a,b,c),this}_sendPacket(a,b,c,d){if("function"==typeof b&&(d=b,b=void 0),"function"==typeof c&&(d=c,c=null),"closing"===this.readyState||"closed"===this.readyState)return;(c=c||{}).compress=!1!==c.compress;let e={type:a,data:b,options:c};this.emitReserved("packetCreate",e),this.writeBuffer.push(e),d&&this.once("flush",d),this.flush()}close(){let a=()=>{this._onClose("forced close"),aa("socket closing - telling transport to close"),this.transport.close()},b=()=>{this.off("upgrade",b),this.off("upgradeError",b),a()},c=()=>{this.once("upgrade",b),this.once("upgradeError",b)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?c():a()}):this.upgrading?c():a()),this}_onError(a){if(aa("socket error %j",a),ad.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return aa("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",a),this._onClose("transport error",a)}_onClose(a,b){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(aa('socket close with reason: "%s"',a),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ab&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let a=ac.indexOf(this._offlineEventListener);-1!==a&&(aa("removing listener for the 'offline' event"),ac.splice(a,1))}this.readyState="closed",this.id=null,this.emitReserved("close",a,b),this.writeBuffer=[],this._prevBufferLen=0}}}ad.protocol=4;class ae extends ad{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade){aa("starting upgrade probes");for(let a=0;a<this._upgrades.length;a++)this._probe(this._upgrades[a])}}_probe(a){aa('probing transport "%s"',a);let b=this.createTransport(a),c=!1;ad.priorWebsocketSuccess=!1;let d=()=>{c||(aa('probe transport "%s" opened',a),b.send([{type:"ping",data:"probe"}]),b.once("packet",d=>{if(!c)if("pong"===d.type&&"probe"===d.data){if(aa('probe transport "%s" pong',a),this.upgrading=!0,this.emitReserved("upgrading",b),!b)return;ad.priorWebsocketSuccess="websocket"===b.name,aa('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{c||"closed"!==this.readyState&&(aa("changing transport and sending upgrade packet"),j(),this.setTransport(b),b.send([{type:"upgrade"}]),this.emitReserved("upgrade",b),b=null,this.upgrading=!1,this.flush())})}else{aa('probe transport "%s" failed',a);let c=Error("probe error");c.transport=b.name,this.emitReserved("upgradeError",c)}}))};function e(){c||(c=!0,j(),b.close(),b=null)}let f=c=>{let d=Error("probe error: "+c);d.transport=b.name,e(),aa('probe transport "%s" failed because of error: %s',a,c),this.emitReserved("upgradeError",d)};function g(){f("transport closed")}function h(){f("socket closed")}function i(a){b&&a.name!==b.name&&(aa('"%s" works - aborting "%s"',a.name,b.name),e())}let j=()=>{b.removeListener("open",d),b.removeListener("error",f),b.removeListener("close",g),this.off("close",h),this.off("upgrading",i)};b.once("open",d),b.once("error",f),b.once("close",g),this.once("close",h),this.once("upgrading",i),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==a?this.setTimeoutFn(()=>{c||b.open()},200):b.open()}onHandshake(a){this._upgrades=this._filterUpgrades(a.upgrades),super.onHandshake(a)}_filterUpgrades(a){let b=[];for(let c=0;c<a.length;c++)~this.transports.indexOf(a[c])&&b.push(a[c]);return b}}class af extends ae{constructor(a,b={}){const c="object"==typeof a?a:b;(!c.transports||c.transports&&"string"==typeof c.transports[0])&&(c.transports=(c.transports||["polling","websocket","webtransport"]).map(a=>Y[a]).filter(a=>!!a)),super(a,c)}}af.protocol;var ag=a.i(81855);let ah=(0,ag.default)("socket.io-client:url"),ai="function"==typeof ArrayBuffer,aj=Object.prototype.toString,ak="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===aj.call(Blob),al="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===aj.call(File);function am(a){return ai&&(a instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer))||ak&&a instanceof Blob||al&&a instanceof File}let an=(0,F.default)("socket.io-parser"),ao=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(e=f||(f={}))[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK";class ap{constructor(a){this.replacer=a}encode(a){return(an("encoding packet %j",a),(a.type===f.EVENT||a.type===f.ACK)&&function a(b,c){if(!b||"object"!=typeof b)return!1;if(Array.isArray(b)){for(let c=0,d=b.length;c<d;c++)if(a(b[c]))return!0;return!1}if(am(b))return!0;if(b.toJSON&&"function"==typeof b.toJSON&&1==arguments.length)return a(b.toJSON(),!0);for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&a(b[c]))return!0;return!1}(a))?this.encodeAsBinary({type:a.type===f.EVENT?f.BINARY_EVENT:f.BINARY_ACK,nsp:a.nsp,data:a.data,id:a.id}):[this.encodeAsString(a)]}encodeAsString(a){let b=""+a.type;return(a.type===f.BINARY_EVENT||a.type===f.BINARY_ACK)&&(b+=a.attachments+"-"),a.nsp&&"/"!==a.nsp&&(b+=a.nsp+","),null!=a.id&&(b+=a.id),null!=a.data&&(b+=JSON.stringify(a.data,this.replacer)),an("encoded %j as %s",a,b),b}encodeAsBinary(a){let b,c,d=(b=[],c=a.data,a.data=function a(b,c){if(!b)return b;if(am(b)){let a={_placeholder:!0,num:c.length};return c.push(b),a}if(Array.isArray(b)){let d=Array(b.length);for(let e=0;e<b.length;e++)d[e]=a(b[e],c);return d}if("object"==typeof b&&!(b instanceof Date)){let d={};for(let e in b)Object.prototype.hasOwnProperty.call(b,e)&&(d[e]=a(b[e],c));return d}return b}(c,b),a.attachments=b.length,{packet:a,buffers:b}),e=this.encodeAsString(d.packet),f=d.buffers;return f.unshift(e),f}}class aq extends w{constructor(a){super(),this.reviver=a}add(a){let b;if("string"==typeof a){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let c=(b=this.decodeString(a)).type===f.BINARY_EVENT;c||b.type===f.BINARY_ACK?(b.type=c?f.EVENT:f.ACK,this.reconstructor=new ar(b),0===b.attachments&&super.emitReserved("decoded",b)):super.emitReserved("decoded",b)}else if(am(a)||a.base64)if(this.reconstructor)(b=this.reconstructor.takeBinaryData(a))&&(this.reconstructor=null,super.emitReserved("decoded",b));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+a)}decodeString(a){let b=0,c={type:Number(a.charAt(0))};if(void 0===f[c.type])throw Error("unknown packet type "+c.type);if(c.type===f.BINARY_EVENT||c.type===f.BINARY_ACK){let d=b+1;for(;"-"!==a.charAt(++b)&&b!=a.length;);let e=a.substring(d,b);if(e!=Number(e)||"-"!==a.charAt(b))throw Error("Illegal attachments");c.attachments=Number(e)}if("/"===a.charAt(b+1)){let d=b+1;for(;++b&&","!==a.charAt(b)&&b!==a.length;);c.nsp=a.substring(d,b)}else c.nsp="/";let d=a.charAt(b+1);if(""!==d&&Number(d)==d){let d=b+1;for(;++b;){let c=a.charAt(b);if(null==c||Number(c)!=c){--b;break}if(b===a.length)break}c.id=Number(a.substring(d,b+1))}if(a.charAt(++b)){let d=this.tryParse(a.substr(b));if(aq.isPayloadValid(c.type,d))c.data=d;else throw Error("invalid payload")}return an("decoded %s as %j",a,c),c}tryParse(a){try{return JSON.parse(a,this.reviver)}catch(a){return!1}}static isPayloadValid(a,b){switch(a){case f.CONNECT:return at(b);case f.DISCONNECT:return void 0===b;case f.CONNECT_ERROR:return"string"==typeof b||at(b);case f.EVENT:case f.BINARY_EVENT:return Array.isArray(b)&&("number"==typeof b[0]||"string"==typeof b[0]&&-1===ao.indexOf(b[0]));case f.ACK:case f.BINARY_ACK:return Array.isArray(b)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ar{constructor(a){this.packet=a,this.buffers=[],this.reconPack=a}takeBinaryData(a){if(this.buffers.push(a),this.buffers.length===this.reconPack.attachments){var b,c;let a=(b=this.reconPack,c=this.buffers,b.data=function a(b,c){if(!b)return b;if(b&&!0===b._placeholder){if("number"==typeof b.num&&b.num>=0&&b.num<c.length)return c[b.num];throw Error("illegal attachments")}if(Array.isArray(b))for(let d=0;d<b.length;d++)b[d]=a(b[d],c);else if("object"==typeof b)for(let d in b)Object.prototype.hasOwnProperty.call(b,d)&&(b[d]=a(b[d],c));return b}(b.data,c),delete b.attachments,b);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let as=Number.isInteger||function(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a};function at(a){return"[object Object]"===Object.prototype.toString.call(a)}function au(a){var b;return"string"==typeof a.nsp&&(void 0===(b=a.id)||as(b))&&function(a,b){switch(a){case f.CONNECT:return void 0===b||at(b);case f.DISCONNECT:return void 0===b;case f.EVENT:return Array.isArray(b)&&("number"==typeof b[0]||"string"==typeof b[0]&&-1===ao.indexOf(b[0]));case f.ACK:return Array.isArray(b);case f.CONNECT_ERROR:return"string"==typeof b||at(b);default:return!1}}(a.type,a.data)}function av(a,b,c){return a.on(b,c),function(){a.off(b,c)}}a.s(["Decoder",()=>aq,"Encoder",()=>ap,"PacketType",()=>f,"isPacketValid",()=>au,"protocol",0,5],64889);let aw=(0,ag.default)("socket.io-client:socket"),ax=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ay extends w{constructor(a,b,c){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=a,this.nsp=b,c&&c.auth&&(this.auth=c.auth),this._opts=Object.assign({},c),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let a=this.io;this.subs=[av(a,"open",this.onopen.bind(this)),av(a,"packet",this.onpacket.bind(this)),av(a,"error",this.onerror.bind(this)),av(a,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...a){return a.unshift("message"),this.emit.apply(this,a),this}emit(a,...b){var c,d,e;if(ax.hasOwnProperty(a))throw Error('"'+a.toString()+'" is a reserved event name');if(b.unshift(a),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(b),this;let g={type:f.EVENT,data:b};if(g.options={},g.options.compress=!1!==this.flags.compress,"function"==typeof b[b.length-1]){let a=this.ids++;aw("emitting packet with ack id %d",a);let c=b.pop();this._registerAckCallback(a,c),g.id=a}let h=null==(d=null==(c=this.io.engine)?void 0:c.transport)?void 0:d.writable,i=this.connected&&!(null==(e=this.io.engine)?void 0:e._hasPingExpired());return this.flags.volatile&&!h?aw("discard packet as the transport is not currently writable"):i?(this.notifyOutgoingListeners(g),this.packet(g)):this.sendBuffer.push(g),this.flags={},this}_registerAckCallback(a,b){var c;let d=null!=(c=this.flags.timeout)?c:this._opts.ackTimeout;if(void 0===d){this.acks[a]=b;return}let e=this.io.setTimeoutFn(()=>{delete this.acks[a];for(let b=0;b<this.sendBuffer.length;b++)this.sendBuffer[b].id===a&&(aw("removing packet with ack id %d from the buffer",a),this.sendBuffer.splice(b,1));aw("event with ack id %d has timed out after %d ms",a,d),b.call(this,Error("operation has timed out"))},d),f=(...a)=>{this.io.clearTimeoutFn(e),b.apply(this,a)};f.withError=!0,this.acks[a]=f}emitWithAck(a,...b){return new Promise((c,d)=>{let e=(a,b)=>a?d(a):c(b);e.withError=!0,b.push(e),this.emit(a,...b)})}_addToQueue(a){let b;"function"==typeof a[a.length-1]&&(b=a.pop());let c={id:this._queueSeq++,tryCount:0,pending:!1,args:a,flags:Object.assign({fromQueue:!0},this.flags)};a.push((a,...d)=>{if(c===this._queue[0])return null!==a?c.tryCount>this._opts.retries&&(aw("packet [%d] is discarded after %d tries",c.id,c.tryCount),this._queue.shift(),b&&b(a)):(aw("packet [%d] was successfully sent",c.id),this._queue.shift(),b&&b(null,...d)),c.pending=!1,this._drainQueue()}),this._queue.push(c),this._drainQueue()}_drainQueue(a=!1){if(aw("draining queue"),!this.connected||0===this._queue.length)return;let b=this._queue[0];b.pending&&!a?aw("packet [%d] has already been sent and is waiting for an ack",b.id):(b.pending=!0,b.tryCount++,aw("sending packet [%d] (try n°%d)",b.id,b.tryCount),this.flags=b.flags,this.emit.apply(this,b.args))}packet(a){a.nsp=this.nsp,this.io._packet(a)}onopen(){aw("transport is open - connecting"),"function"==typeof this.auth?this.auth(a=>{this._sendConnectPacket(a)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(a){this.packet({type:f.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},a):a})}onerror(a){this.connected||this.emitReserved("connect_error",a)}onclose(a,b){aw("close (%s)",a),this.connected=!1,delete this.id,this.emitReserved("disconnect",a,b),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(a=>{if(!this.sendBuffer.some(b=>String(b.id)===a)){let b=this.acks[a];delete this.acks[a],b.withError&&b.call(this,Error("socket has been disconnected"))}})}onpacket(a){if(a.nsp===this.nsp)switch(a.type){case f.CONNECT:a.data&&a.data.sid?this.onconnect(a.data.sid,a.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case f.EVENT:case f.BINARY_EVENT:this.onevent(a);break;case f.ACK:case f.BINARY_ACK:this.onack(a);break;case f.DISCONNECT:this.ondisconnect();break;case f.CONNECT_ERROR:this.destroy();let b=Error(a.data.message);b.data=a.data.data,this.emitReserved("connect_error",b)}}onevent(a){let b=a.data||[];aw("emitting event %j",b),null!=a.id&&(aw("attaching ack callback to event"),b.push(this.ack(a.id))),this.connected?this.emitEvent(b):this.receiveBuffer.push(Object.freeze(b))}emitEvent(a){if(this._anyListeners&&this._anyListeners.length)for(let b of this._anyListeners.slice())b.apply(this,a);super.emit.apply(this,a),this._pid&&a.length&&"string"==typeof a[a.length-1]&&(this._lastOffset=a[a.length-1])}ack(a){let b=this,c=!1;return function(...d){c||(c=!0,aw("sending ack %j",d),b.packet({type:f.ACK,id:a,data:d}))}}onack(a){let b=this.acks[a.id];"function"!=typeof b?aw("bad ack %s",a.id):(delete this.acks[a.id],aw("calling ack %s with %j",a.id,a.data),b.withError&&a.data.unshift(null),b.apply(this,a.data))}onconnect(a,b){aw("socket connected with id %s",a),this.id=a,this.recovered=b&&this._pid===b,this._pid=b,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(a=>this.emitEvent(a)),this.receiveBuffer=[],this.sendBuffer.forEach(a=>{this.notifyOutgoingListeners(a),this.packet(a)}),this.sendBuffer=[]}ondisconnect(){aw("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(a=>a()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(aw("performing disconnect (%s)",this.nsp),this.packet({type:f.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(a){return this.flags.compress=a,this}get volatile(){return this.flags.volatile=!0,this}timeout(a){return this.flags.timeout=a,this}onAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(a),this}prependAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(a),this}offAny(a){if(!this._anyListeners)return this;if(a){let b=this._anyListeners;for(let c=0;c<b.length;c++)if(a===b[c]){b.splice(c,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(a),this}prependAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(a),this}offAnyOutgoing(a){if(!this._anyOutgoingListeners)return this;if(a){let b=this._anyOutgoingListeners;for(let c=0;c<b.length;c++)if(a===b[c]){b.splice(c,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(a){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let b of this._anyOutgoingListeners.slice())b.apply(this,a.data)}}var az=a.i(64889);function aA(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}aA.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var b=Math.random(),c=Math.floor(b*this.jitter*a);a=(1&Math.floor(10*b))==0?a-c:a+c}return 0|Math.min(a,this.max)},aA.prototype.reset=function(){this.attempts=0},aA.prototype.setMin=function(a){this.ms=a},aA.prototype.setMax=function(a){this.max=a},aA.prototype.setJitter=function(a){this.jitter=a};let aB=(0,ag.default)("socket.io-client:manager");class aC extends w{constructor(a,b){var c;super(),this.nsps={},this.subs=[],a&&"object"==typeof a&&(b=a,a=void 0),(b=b||{}).path=b.path||"/socket.io",this.opts=b,D(this,b),this.reconnection(!1!==b.reconnection),this.reconnectionAttempts(b.reconnectionAttempts||1/0),this.reconnectionDelay(b.reconnectionDelay||1e3),this.reconnectionDelayMax(b.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(c=b.randomizationFactor)?c:.5),this.backoff=new aA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==b.timeout?2e4:b.timeout),this._readyState="closed",this.uri=a;const d=b.parser||az;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=!1!==b.autoConnect,this._autoConnect&&this.open()}reconnection(a){return arguments.length?(this._reconnection=!!a,a||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(a){return void 0===a?this._reconnectionAttempts:(this._reconnectionAttempts=a,this)}reconnectionDelay(a){var b;return void 0===a?this._reconnectionDelay:(this._reconnectionDelay=a,null==(b=this.backoff)||b.setMin(a),this)}randomizationFactor(a){var b;return void 0===a?this._randomizationFactor:(this._randomizationFactor=a,null==(b=this.backoff)||b.setJitter(a),this)}reconnectionDelayMax(a){var b;return void 0===a?this._reconnectionDelayMax:(this._reconnectionDelayMax=a,null==(b=this.backoff)||b.setMax(a),this)}timeout(a){return arguments.length?(this._timeout=a,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(a){if(aB("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;aB("opening %s",this.uri),this.engine=new af(this.uri,this.opts);let b=this.engine,c=this;this._readyState="opening",this.skipReconnect=!1;let d=av(b,"open",function(){c.onopen(),a&&a()}),e=b=>{aB("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",b),a?a(b):this.maybeReconnectOnOpen()},f=av(b,"error",e);if(!1!==this._timeout){let a=this._timeout;aB("connect attempt will timeout after %d",a);let c=this.setTimeoutFn(()=>{aB("connect attempt timed out after %d",a),d(),e(Error("timeout")),b.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(d),this.subs.push(f),this}connect(a){return this.open(a)}onopen(){aB("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let a=this.engine;this.subs.push(av(a,"ping",this.onping.bind(this)),av(a,"data",this.ondata.bind(this)),av(a,"error",this.onerror.bind(this)),av(a,"close",this.onclose.bind(this)),av(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(a){try{this.decoder.add(a)}catch(a){this.onclose("parse error",a)}}ondecoded(a){x(()=>{this.emitReserved("packet",a)},this.setTimeoutFn)}onerror(a){aB("error",a),this.emitReserved("error",a)}socket(a,b){let c=this.nsps[a];return c?this._autoConnect&&!c.active&&c.connect():(c=new ay(this,a,b),this.nsps[a]=c),c}_destroy(a){for(let a of Object.keys(this.nsps))if(this.nsps[a].active)return void aB("socket %s is still active, skipping close",a);this._close()}_packet(a){aB("writing packet %j",a);let b=this.encoder.encode(a);for(let c=0;c<b.length;c++)this.engine.write(b[c],a.options)}cleanup(){aB("cleanup"),this.subs.forEach(a=>a()),this.subs.length=0,this.decoder.destroy()}_close(){aB("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(a,b){var c;aB("closed due to %s",a),this.cleanup(),null==(c=this.engine)||c.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",a,b),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let a=this;if(this.backoff.attempts>=this._reconnectionAttempts)aB("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let b=this.backoff.duration();aB("will wait %dms before reconnect attempt",b),this._reconnecting=!0;let c=this.setTimeoutFn(()=>{a.skipReconnect||(aB("attempting reconnect"),this.emitReserved("reconnect_attempt",a.backoff.attempts),a.skipReconnect||a.open(b=>{b?(aB("reconnect attempt error"),a._reconnecting=!1,a.reconnect(),this.emitReserved("reconnect_error",b)):(aB("reconnect success"),a.onreconnect())}))},b);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}}onreconnect(){let a=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",a)}}let aD=(0,ag.default)("socket.io-client"),aE={};function aF(a,b){let c;"object"==typeof a&&(b=a,a=void 0);let d=function(a,b="",c){let d=a;c=c||"undefined"!=typeof location&&location,null==a&&(a=c.protocol+"//"+c.host),"string"==typeof a&&("/"===a.charAt(0)&&(a="/"===a.charAt(1)?c.protocol+a:c.host+a),/^(https?|wss?):\/\//.test(a)||(ah("protocol-less url %s",a),a=void 0!==c?c.protocol+"//"+a:"https://"+a),ah("parse %s",a),d=_(a)),!d.port&&(/^(http|ws)$/.test(d.protocol)?d.port="80":/^(http|ws)s$/.test(d.protocol)&&(d.port="443")),d.path=d.path||"/";let e=-1!==d.host.indexOf(":")?"["+d.host+"]":d.host;return d.id=d.protocol+"://"+e+":"+d.port+b,d.href=d.protocol+"://"+e+(c&&c.port===d.port?"":":"+d.port),d}(a,(b=b||{}).path||"/socket.io"),e=d.source,f=d.id,g=d.path,h=aE[f]&&g in aE[f].nsps;return b.forceNew||b["force new connection"]||!1===b.multiplex||h?(aD("ignoring socket cache for %s",e),c=new aC(e,b)):(aE[f]||(aD("new io instance for %s",e),aE[f]=new aC(e,b)),c=aE[f]),d.query&&!b.query&&(b.query=d.queryKey),c.socket(d.path,b)}Object.assign(aF,{Manager:aC,Socket:ay,io:aF,connect:aF});let aG=a=>{let b=(0,h.useRef)(null);(0,h.useEffect)(()=>{b.current||(b.current=aF());let c=b.current;return c.on("reload",b=>{console.debug("Reloading..."),a(b)}),()=>{c.off()}},[a])};a.s(["useHotreload",0,aG],54049);let aH=(0,h.createContext)(void 0);a.s(["TemplatesProvider",0,a=>{let[b,c]=(0,h.useState)(a.initialTemplatesDirectoryMetadata);return k||l||aG(()=>{j(a.initialTemplatesDirectoryMetadata.absolutePath).then(a=>{if(a)c(a);else throw Error("Hot reloading: unable to find the templates directory to update the sidebar")})}),(0,g.jsx)(aH.Provider,{value:{templatesDirectoryMetadata:b},children:a.children})},"useTemplates",0,()=>{let a=(0,h.useContext)(aH);if(void 0===a)throw Error("Cannot call `useTemplates` outside of a `TemplatesContext` provider.");return a}],69431)}];
|
|
2
|
+
`+Object.keys(d).map(a=>`${a}: ${d[a]}`).join("\r\n")+"\r\n\r\n"+c)}function r(a,b,c,d,e,f){if(a.listenerCount("wsClientError")){let d=Error(e);Error.captureStackTrace(d,r),a.emit("wsClientError",d,c,b)}else q(c,d,e,f)}b.exports=class extends d{constructor(a,b){if(super(),null==(a={allowSynchronousEvents:!0,autoPong:!0,maxPayload:0x6400000,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:k,...a}).port&&!a.server&&!a.noServer||null!=a.port&&(a.server||a.noServer)||a.server&&a.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=a.port?(this._server=e.createServer((a,b)=>{let c=e.STATUS_CODES[426];b.writeHead(426,{"Content-Length":c.length,"Content-Type":"text/plain"}),b.end(c)}),this._server.listen(a.port,a.host,a.backlog,b)):a.server&&(this._server=a.server),this._server){const a=this.emit.bind(this,"connection");this._removeListeners=function(a,b){for(let c of Object.keys(b))a.on(c,b[c]);return function(){for(let c of Object.keys(b))a.removeListener(c,b[c])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(b,c,d)=>{this.handleUpgrade(b,c,d,a)}})}!0===a.perMessageDeflate&&(a.perMessageDeflate={}),a.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=a,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(a){if(2===this._state){a&&this.once("close",()=>{a(Error("The server is not running"))}),process.nextTick(o,this);return}if(a&&this.once("close",a),1!==this._state)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(o,this);else{let a=this._server;this._removeListeners(),this._removeListeners=this._server=null,a.close(()=>{o(this)})}}shouldHandle(a){if(this.options.path){let b=a.url.indexOf("?");if((-1!==b?a.url.slice(0,b):a.url)!==this.options.path)return!1}return!0}handleUpgrade(a,b,c,d){b.on("error",p);let e=a.headers["sec-websocket-key"],f=a.headers.upgrade,g=+a.headers["sec-websocket-version"];if("GET"!==a.method)return void r(this,a,b,405,"Invalid HTTP method");if(void 0===f||"websocket"!==f.toLowerCase())return void r(this,a,b,400,"Invalid Upgrade header");if(void 0===e||!n.test(e))return void r(this,a,b,400,"Missing or invalid Sec-WebSocket-Key header");if(13!==g&&8!==g)return void r(this,a,b,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});if(!this.shouldHandle(a))return void q(b,400);let k=a.headers["sec-websocket-protocol"],l=new Set;if(void 0!==k)try{l=j.parse(k)}catch(c){r(this,a,b,400,"Invalid Sec-WebSocket-Protocol header");return}let m=a.headers["sec-websocket-extensions"],o={};if(this.options.perMessageDeflate&&void 0!==m){let c=new i(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let a=h.parse(m);a[i.extensionName]&&(c.accept(a[i.extensionName]),o[i.extensionName]=c)}catch(c){r(this,a,b,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:a.headers[`${8===g?"sec-websocket-origin":"origin"}`],secure:!!(a.socket.authorized||a.socket.encrypted),req:a};if(2===this.options.verifyClient.length)return void this.options.verifyClient(f,(f,g,h,i)=>{if(!f)return q(b,g||401,h,i);this.completeUpgrade(o,e,l,a,b,c,d)});if(!this.options.verifyClient(f))return q(b,401)}this.completeUpgrade(o,e,l,a,b,c,d)}completeUpgrade(a,b,c,d,e,f,j){if(!e.readable||!e.writable)return e.destroy();if(e[m])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return q(e,503);let k=g("sha1").update(b+l).digest("base64"),n=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${k}`],r=new this.options.WebSocket(null,void 0,this.options);if(c.size){let a=this.options.handleProtocols?this.options.handleProtocols(c,d):c.values().next().value;a&&(n.push(`Sec-WebSocket-Protocol: ${a}`),r._protocol=a)}if(a[i.extensionName]){let b=a[i.extensionName].params,c=h.format({[i.extensionName]:[b]});n.push(`Sec-WebSocket-Extensions: ${c}`),r._extensions=a}this.emit("headers",n,d),e.write(n.concat("\r\n").join("\r\n")),e.removeListener("error",p),r.setSocket(e,f,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(r),r.on("close",()=>{this.clients.delete(r),this._shouldEmitClose&&!this.clients.size&&process.nextTick(o,this)})),j(r,d)}}},43970,(a,b,c)=>{b.exports=function(b){function c(a){let b,e,f,g=null;function h(...a){if(!h.enabled)return;let d=Number(new Date);h.diff=d-(b||d),h.prev=b,h.curr=d,b=d,a[0]=c.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");let e=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(b,d)=>{if("%%"===b)return"%";e++;let f=c.formatters[d];if("function"==typeof f){let c=a[e];b=f.call(h,c),a.splice(e,1),e--}return b}),c.formatArgs.call(h,a),(h.log||c.log).apply(h,a)}return h.namespace=a,h.useColors=c.useColors(),h.color=c.selectColor(a),h.extend=d,h.destroy=c.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==g?g:(e!==c.namespaces&&(e=c.namespaces,f=c.enabled(a)),f),set:a=>{g=a}}),"function"==typeof c.init&&c.init(h),h}function d(a,b){let d=c(this.namespace+(void 0===b?":":b)+a);return d.log=this.log,d}function e(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}return c.debug=c,c.default=c,c.coerce=function(a){return a instanceof Error?a.stack||a.message:a},c.disable=function(){let a=[...c.names.map(e),...c.skips.map(e).map(a=>"-"+a)].join(",");return c.enable(""),a},c.enable=function(a){let b;c.save(a),c.namespaces=a,c.names=[],c.skips=[];let d=("string"==typeof a?a:"").split(/[\s,]+/),e=d.length;for(b=0;b<e;b++)d[b]&&("-"===(a=d[b].replace(/\*/g,".*?"))[0]?c.skips.push(RegExp("^"+a.slice(1)+"$")):c.names.push(RegExp("^"+a+"$")))},c.enabled=function(a){let b,d;if("*"===a[a.length-1])return!0;for(b=0,d=c.skips.length;b<d;b++)if(c.skips[b].test(a))return!1;for(b=0,d=c.names.length;b<d;b++)if(c.names[b].test(a))return!0;return!1},c.humanize=a.r(60690),c.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(b).forEach(a=>{c[a]=b[a]}),c.names=[],c.skips=[],c.formatters={},c.selectColor=function(a){let b=0;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c)|0;return c.colors[Math.abs(b)%c.colors.length]},c.enable(c.load()),c}},683,(a,b,c)=>{let d=a.r(70722),e=a.r(24361);c.init=function(a){a.inspectOpts={};let b=Object.keys(c.inspectOpts);for(let d=0;d<b.length;d++)a.inspectOpts[b[d]]=c.inspectOpts[b[d]]},c.log=function(...a){return process.stderr.write(e.formatWithOptions(c.inspectOpts,...a)+"\n")},c.formatArgs=function(a){let{namespace:d,useColors:e}=this;if(e){let c=this.color,e="\x1b[3"+(c<8?c:"8;5;"+c),f=` ${e};1m${d} \u001B[0m`;a[0]=f+a[0].split("\n").join("\n"+f),a.push(e+"m+"+b.exports.humanize(this.diff)+"\x1b[0m")}else a[0]=(c.inspectOpts.hideDate?"":new Date().toISOString()+" ")+d+" "+a[0]},c.save=function(a){a?process.env.DEBUG=a:delete process.env.DEBUG},c.load=function(){return process.env.DEBUG},c.useColors=function(){return"colors"in c.inspectOpts?!!c.inspectOpts.colors:d.isatty(process.stderr.fd)},c.destroy=e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),c.colors=[6,2,3,4,5,1];try{let b=a.r(12914);b&&(b.stderr||b).level>=2&&(c.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(a){}c.inspectOpts=Object.keys(process.env).filter(a=>/^debug_/i.test(a)).reduce((a,b)=>{let c=b.substring(6).toLowerCase().replace(/_([a-z])/g,(a,b)=>b.toUpperCase()),d=process.env[b];return d=!!/^(yes|on|true|enabled)$/i.test(d)||!/^(no|off|false|disabled)$/i.test(d)&&("null"===d?null:Number(d)),a[c]=d,a},{}),b.exports=a.r(43970)(c);let{formatters:f}=b.exports;f.o=function(a){return this.inspectOpts.colors=this.useColors,e.inspect(a,this.inspectOpts).split("\n").map(a=>a.trim()).join(" ")},f.O=function(a){return this.inspectOpts.colors=this.useColors,e.inspect(a,this.inspectOpts)}},1372,(a,b,c)=>{let d;c.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+b.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;a.splice(1,0,c,"color: inherit");let d=0,e=0;a[0].replace(/%[a-zA-Z%]/g,a=>{"%%"!==a&&(d++,"%c"===a&&(e=d))}),a.splice(e,0,c)},c.save=function(a){try{a?c.storage.setItem("debug",a):c.storage.removeItem("debug")}catch(a){}},c.load=function(){let a;try{a=c.storage.getItem("debug")}catch(a){}return!a&&"undefined"!=typeof process&&"env"in process&&(a=process.env.DEBUG),a},c.useColors=function(){let a;return!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof navigator&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},c.storage=function(){try{return localStorage}catch(a){}}(),d=!1,c.destroy=()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},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.log=console.debug||console.log||(()=>{}),b.exports=a.r(43970)(c);let{formatters:e}=b.exports;e.j=function(a){try{return JSON.stringify(a)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}}},81855,(a,b,c)=>{"undefined"==typeof process||"renderer"===process.type||process.__nwjs?b.exports=a.r(1372):b.exports=a.r(683)},69431,14358,54049,a=>{"use strict";let b,c,d;var e,f,g=a.i(53213),h=a.i(66808),i=a.i(16084);let j=(0,i.createServerReference)("78771297828582a56297020d3b0622a57014c4c245",i.callServer,void 0,i.findSourceMapURL,"getTemplatesDirectoryMetadataAction");process.env.USER_PROJECT_LOCATION,process.env.PREVIEW_SERVER_LOCATION,process.env.TEMPLATES_DIR_ABSOLUTE_PATH;let k="true"===process.env.NEXT_PUBLIC_IS_BUILDING,l="true"===process.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT;a.s(["isBuilding",0,k,"isPreviewDevelopment",0,l],14358);var m=a.i(12416);let n=Object.create(null);n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";let o=Object.create(null);Object.keys(n).forEach(a=>{o[n[a]]=a});let p={type:"error",data:"parser error"},q=({type:a,data:b},c,d)=>d(b instanceof ArrayBuffer||ArrayBuffer.isView(b)?c?b:"b"+r(b,!0).toString("base64"):n[a]+(b||"")),r=(a,b)=>Buffer.isBuffer(a)||a instanceof Uint8Array&&!b?a:a instanceof ArrayBuffer?Buffer.from(a):Buffer.from(a.buffer,a.byteOffset,a.byteLength),s=(a,b)=>{if("string"!=typeof a)return{type:"message",data:t(a,b)};let c=a.charAt(0);return"b"===c?{type:"message",data:t(Buffer.from(a.substring(1),"base64"),b)}:o[c]?a.length>1?{type:o[c],data:a.substring(1)}:{type:o[c]}:p},t=(a,b)=>"arraybuffer"===b?a instanceof ArrayBuffer?a:Buffer.isBuffer(a)?a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength):a.buffer:Buffer.isBuffer(a)?a:Buffer.from(a);function u(a){return a.reduce((a,b)=>a+b.length,0)}function v(a,b){if(a[0].length===b)return a.shift();let c=new Uint8Array(b),d=0;for(let e=0;e<b;e++)c[e]=a[0][d++],d===a[0].length&&(a.shift(),d=0);return a.length&&d<a[0].length&&(a[0]=a[0].slice(d)),c}function w(a){if(a){var b=a;for(var c in w.prototype)b[c]=w.prototype[c];return b}}w.prototype.on=w.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(b),this},w.prototype.once=function(a,b){function c(){this.off(a,c),b.apply(this,arguments)}return c.fn=b,this.on(a,c),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c,d=this._callbacks["$"+a];if(!d)return this;if(1==arguments.length)return delete this._callbacks["$"+a],this;for(var e=0;e<d.length;e++)if((c=d[e])===b||c.fn===b){d.splice(e,1);break}return 0===d.length&&delete this._callbacks["$"+a],this},w.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var b=Array(arguments.length-1),c=this._callbacks["$"+a],d=1;d<arguments.length;d++)b[d-1]=arguments[d];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]},w.prototype.hasListeners=function(a){return!!this.listeners(a).length};let x=process.nextTick,y=a.g;class z{constructor(){this._cookies=new Map}parseCookies(a){a&&a.forEach(a=>{let b=function(a){let b=a.split("; "),c=b[0].indexOf("=");if(-1===c)return;let d=b[0].substring(0,c).trim();if(!d.length)return;let e=b[0].substring(c+1).trim();34===e.charCodeAt(0)&&(e=e.slice(1,-1));let f={name:d,value:e};for(let a=1;a<b.length;a++){let c=b[a].split("=");if(2!==c.length)continue;let d=c[0].trim(),e=c[1].trim();switch(d){case"Expires":f.expires=new Date(e);break;case"Max-Age":let g=new Date;g.setUTCSeconds(g.getUTCSeconds()+parseInt(e,10)),f.expires=g}}return f}(a);b&&this._cookies.set(b.name,b)})}get cookies(){let a=Date.now();return this._cookies.forEach((b,c)=>{var d;(null==(d=b.expires)?void 0:d.getTime())<a&&this._cookies.delete(c)}),this._cookies.entries()}addCookies(a){let b=[];for(let[a,c]of this.cookies)b.push(`${a}=${c.value}`);b.length&&(a.setDisableHeaderCheck(!0),a.setRequestHeader("cookie",b.join("; ")))}appendCookies(a){for(let[b,c]of this.cookies)a.append("cookie",`${b}=${c.value}`)}}function A(a,...b){return b.reduce((b,c)=>(a.hasOwnProperty(c)&&(b[c]=a[c]),b),{})}let B=y.setTimeout,C=y.clearTimeout;function D(a,b){b.useNativeTimers?(a.setTimeoutFn=B.bind(y),a.clearTimeoutFn=C.bind(y)):(a.setTimeoutFn=y.setTimeout.bind(y),a.clearTimeoutFn=y.clearTimeout.bind(y))}function E(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var F=a.i(35617);let G=(0,F.default)("engine.io-client:transport");class H extends Error{constructor(a,b,c){super(a),this.description=b,this.context=c,this.type="TransportError"}}class I extends w{constructor(a){super(),this.writable=!1,D(this,a),this.opts=a,this.query=a.query,this.socket=a.socket,this.supportsBinary=!a.forceBase64}onError(a,b,c){return super.emitReserved("error",new H(a,b,c)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(a){"open"===this.readyState?this.write(a):G("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(a){let b=s(a,this.socket.binaryType);this.onPacket(b)}onPacket(a){super.emitReserved("packet",a)}onClose(a){this.readyState="closed",super.emitReserved("close",a)}pause(a){}createUri(a,b={}){return a+"://"+this._hostname()+this._port()+this.opts.path+this._query(b)}_hostname(){let a=this.opts.hostname;return -1===a.indexOf(":")?a:"["+a+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(a){let b=function(a){let b="";for(let c in a)a.hasOwnProperty(c)&&(b.length&&(b+="&"),b+=encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b}(a);return b.length?"?"+b:""}}let J=(0,F.default)("engine.io-client:polling");class K extends I{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(a){this.readyState="pausing";let b=()=>{J("paused"),this.readyState="paused",a()};if(this._polling||!this.writable){let a=0;this._polling&&(J("we are currently polling - waiting to pause"),a++,this.once("pollComplete",function(){J("pre-pause polling complete"),--a||b()})),this.writable||(J("we are currently writing - waiting to pause"),a++,this.once("drain",function(){J("pre-pause writing complete"),--a||b()}))}else b()}_poll(){J("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(a){J("polling got data %s",a);let b=a=>{if("opening"===this.readyState&&"open"===a.type&&this.onOpen(),"close"===a.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};((a,b)=>{let c=a.split("\x1e"),d=[];for(let a=0;a<c.length;a++){let e=s(c[a],b);if(d.push(e),"error"===e.type)break}return d})(a,this.socket.binaryType).forEach(b),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this._poll():J('ignoring poll - transport state "%s"',this.readyState))}doClose(){let a=()=>{J("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(J("transport open - closing"),a()):(J("transport not open - deferring close"),this.once("open",a))}write(a){var b;let c,d,e;this.writable=!1,b=a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})},d=Array(c=a.length),e=0,a.forEach((a,f)=>{q(a,!1,a=>{d[f]=a,++e===c&&b(d.join("\x1e"))})})}uri(){let a=this.opts.secure?"https":"http",b=this.query||{};return!1!==this.opts.timestampRequests&&(b[this.opts.timestampParam]=E()),this.supportsBinary||b.sid||(b.b64=1),this.createUri(a,b)}}let L=!1;try{L="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(a){}let M=L,N=(0,F.default)("engine.io-client:polling");function O(){}class P extends K{constructor(a){if(super(a),"undefined"!=typeof location){const b="https:"===location.protocol;let c=location.port;c||(c=b?"443":"80"),this.xd="undefined"!=typeof location&&a.hostname!==location.hostname||c!==a.port}}doWrite(a,b){let c=this.request({method:"POST",data:a});c.on("success",b),c.on("error",(a,b)=>{this.onError("xhr post error",a,b)})}doPoll(){N("xhr poll");let a=this.request();a.on("data",this.onData.bind(this)),a.on("error",(a,b)=>{this.onError("xhr poll error",a,b)}),this.pollXhr=a}}class Q extends w{constructor(a,b,c){super(),this.createRequest=a,D(this,c),this._opts=c,this._method=c.method||"GET",this._uri=b,this._data=void 0!==c.data?c.data:null,this._create()}_create(){var a;let b=A(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");b.xdomain=!!this._opts.xd;let c=this._xhr=this.createRequest(b);try{N("xhr open %s: %s",this._method,this._uri),c.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let a in c.setDisableHeaderCheck&&c.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&c.setRequestHeader(a,this._opts.extraHeaders[a])}catch(a){}if("POST"===this._method)try{c.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(a){}try{c.setRequestHeader("Accept","*/*")}catch(a){}null==(a=this._opts.cookieJar)||a.addCookies(c),"withCredentials"in c&&(c.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(c.timeout=this._opts.requestTimeout),c.onreadystatechange=()=>{var a;3===c.readyState&&(null==(a=this._opts.cookieJar)||a.parseCookies(c.getResponseHeader("set-cookie"))),4===c.readyState&&(200===c.status||1223===c.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof c.status?c.status:0)},0))},N("xhr data %s",this._data),c.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}"undefined"!=typeof document&&(this._index=Q.requestsCount++,Q.requests[this._index]=this)}_onError(a){this.emitReserved("error",a,this._xhr),this._cleanup(!0)}_cleanup(a){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=O,a)try{this._xhr.abort()}catch(a){}"undefined"!=typeof document&&delete Q.requests[this._index],this._xhr=null}}_onLoad(){let a=this._xhr.responseText;null!==a&&(this.emitReserved("data",a),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function R(){for(let a in Q.requests)Q.requests.hasOwnProperty(a)&&Q.requests[a].abort()}Q.requestsCount=0,Q.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",R):"function"==typeof addEventListener&&addEventListener("onpagehide"in y?"pagehide":"unload",R,!1)),(d=function(a){let b=a.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!b||M))return new XMLHttpRequest}catch(a){}if(!b)try{return new y[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(a){}}({xdomain:!1}))&&d.responseType;let S=m.default||m;a.i(10578),a.i(71345),a.i(78583);var T=a.i(41649);a.i(4294),T.default;let U=(0,F.default)("engine.io-client:websocket"),V="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends I{get name(){return"websocket"}doOpen(){let a=this.uri(),b=this.opts.protocols,c=V?{}:A(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(c.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(a,b,c)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=a=>this.onClose({description:"websocket connection closed",context:a}),this.ws.onmessage=a=>this.onData(a.data),this.ws.onerror=a=>this.onError("websocket error",a)}write(a){this.writable=!1;for(let b=0;b<a.length;b++){let c=a[b],d=b===a.length-1;q(c,this.supportsBinary,a=>{try{this.doWrite(c,a)}catch(a){U("websocket closed before onclose event")}d&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let a=this.opts.secure?"wss":"ws",b=this.query||{};return this.opts.timestampRequests&&(b[this.opts.timestampParam]=E()),this.supportsBinary||(b.b64=1),this.createUri(a,b)}}y.WebSocket||y.MozWebSocket;let X=(0,F.default)("engine.io-client:webtransport"),Y={websocket:class extends W{createSocket(a,b,c){var d;if(null==(d=this.socket)?void 0:d._cookieJar)for(let[a,b]of(c.headers=c.headers||{},c.headers.cookie="string"==typeof c.headers.cookie?[c.headers.cookie]:c.headers.cookie||[],this.socket._cookieJar.cookies))c.headers.cookie.push(`${a}=${b.value}`);return new T.default(a,b,c)}doWrite(a,b){let c={};a.options&&(c.compress=a.options.compress),this.opts.perMessageDeflate&&("string"==typeof b?Buffer.byteLength(b):b.length)<this.opts.perMessageDeflate.threshold&&(c.compress=!1),this.ws.send(b,c)}},webtransport:class extends I{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(a){return this.emitReserved("error",a)}this._transport.closed.then(()=>{X("transport closed gracefully"),this.onClose()}).catch(a=>{X("transport closed due to %s",a),this.onError("webtransport error",a)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(a=>{var d,e;let f,g,h,i,j=(d=Number.MAX_SAFE_INTEGER,e=this.socket.binaryType,c||(c=new TextDecoder),f=[],g=0,h=-1,i=!1,new TransformStream({transform(a,b){for(f.push(a);;){if(0===g){if(1>u(f))break;let a=v(f,1);i=(128&a[0])==128,g=(h=127&a[0])<126?3:126===h?1:2}else if(1===g){if(2>u(f))break;let a=v(f,2);h=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),g=3}else if(2===g){if(8>u(f))break;let a=v(f,8),c=new DataView(a.buffer,a.byteOffset,a.length),d=c.getUint32(0);if(d>2097151){b.enqueue(p);break}h=0x100000000*d+c.getUint32(4),g=3}else{if(u(f)<h)break;let a=v(f,h);b.enqueue(s(i?a:c.decode(a),e)),g=0}if(0===h||h>d){b.enqueue(p);break}}}})),k=a.readable.pipeThrough(j).getReader(),l=new TransformStream({transform(a,c){!function(a,c){if(a.data instanceof ArrayBuffer||ArrayBuffer.isView(a.data))return c(r(a.data,!1));q(a,!0,a=>{b||(b=new TextEncoder),c(b.encode(a))})}(a,b=>{let d,e=b.length;if(e<126)new DataView((d=new Uint8Array(1)).buffer).setUint8(0,e);else if(e<65536){let a=new DataView((d=new Uint8Array(3)).buffer);a.setUint8(0,126),a.setUint16(1,e)}else{let a=new DataView((d=new Uint8Array(9)).buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(e))}a.data&&"string"!=typeof a.data&&(d[0]|=128),c.enqueue(d),c.enqueue(b)})}});l.readable.pipeTo(a.writable),this._writer=l.writable.getWriter();let m=()=>{k.read().then(({done:a,value:b})=>{a?X("session is closed"):(X("received chunk: %o",b),this.onPacket(b),m())}).catch(a=>{X("an error occurred while reading: %s",a)})};m();let n={type:"open"};this.query.sid&&(n.data=`{"sid":"${this.query.sid}"}`),this._writer.write(n).then(()=>this.onOpen())})})}write(a){this.writable=!1;for(let b=0;b<a.length;b++){let c=a[b],d=b===a.length-1;this._writer.write(c).then(()=>{d&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var a;null==(a=this._transport)||a.close()}},polling:class extends P{request(a={}){var b;return Object.assign(a,{xd:this.xd,cookieJar:null==(b=this.socket)?void 0:b._cookieJar},this.opts),new Q(a=>new S(a),this.uri(),a)}}},Z=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _(a){var b,c;let d,e;if(a.length>8e3)throw"URI too long";let f=a,g=a.indexOf("["),h=a.indexOf("]");-1!=g&&-1!=h&&(a=a.substring(0,g)+a.substring(g,h).replace(/:/g,";")+a.substring(h,a.length));let i=Z.exec(a||""),j={},k=14;for(;k--;)j[$[k]]=i[k]||"";return -1!=g&&-1!=h&&(j.source=f,j.host=j.host.substring(1,j.host.length-1).replace(/;/g,":"),j.authority=j.authority.replace("[","").replace("]","").replace(/;/g,":"),j.ipv6uri=!0),d=(b=j.path).replace(/\/{2,9}/g,"/").split("/"),("/"==b.slice(0,1)||0===b.length)&&d.splice(0,1),"/"==b.slice(-1)&&d.splice(d.length-1,1),j.pathNames=d,c=j.query,e={},c.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,b,c){b&&(e[b]=c)}),j.queryKey=e,j}let aa=(0,F.default)("engine.io-client:socket"),ab="function"==typeof addEventListener&&"function"==typeof removeEventListener,ac=[];ab&&addEventListener("offline",()=>{aa("closing %d connection(s) because the network was lost",ac.length),ac.forEach(a=>a())},!1);class ad extends w{constructor(a,b){if(super(),this.binaryType="nodebuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,a&&"object"==typeof a&&(b=a,a=null),a){const c=_(a);b.hostname=c.host,b.secure="https"===c.protocol||"wss"===c.protocol,b.port=c.port,c.query&&(b.query=c.query)}else b.host&&(b.hostname=_(b.host).host);D(this,b),this.secure=null!=b.secure?b.secure:"undefined"!=typeof location&&"https:"===location.protocol,b.hostname&&!b.port&&(b.port=this.secure?"443":"80"),this.hostname=b.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=b.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},b.transports.forEach(a=>{let b=a.prototype.name;this.transports.push(b),this._transportsByName[b]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},b),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(a){let b={},c=a.split("&");for(let a=0,d=c.length;a<d;a++){let d=c[a].split("=");b[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return b}(this.opts.query)),ab&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(aa("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ac.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=new z),this._open()}createTransport(a){aa('creating transport "%s"',a);let b=Object.assign({},this.opts.query);b.EIO=4,b.transport=a,this.id&&(b.sid=this.id);let c=Object.assign({},this.opts,{query:b,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[a]);return aa("options: %j",c),new this._transportsByName[a](c)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let a=this.opts.rememberUpgrade&&ad.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let b=this.createTransport(a);b.open(),this.setTransport(b)}setTransport(a){aa("setting transport %s",a.name),this.transport&&(aa("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=a,a.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){aa("socket open"),this.readyState="open",ad.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(a){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(aa('socket receive: type "%s", data "%s"',a.type,a.data),this.emitReserved("packet",a),this.emitReserved("heartbeat"),a.type){case"open":this.onHandshake(JSON.parse(a.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let b=Error("server error");b.code=a.data,this._onError(b);break;case"message":this.emitReserved("data",a.data),this.emitReserved("message",a.data)}else aa('packet received with socket readyState "%s"',this.readyState)}onHandshake(a){this.emitReserved("handshake",a),this.id=a.sid,this.transport.query.sid=a.sid,this._pingInterval=a.pingInterval,this._pingTimeout=a.pingTimeout,this._maxPayload=a.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let a=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+a,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},a),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let a=this._getWritablePackets();aa("flushing %d packets in socket",a.length),this.transport.send(a),this._prevBufferLen=a.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let b=0;b<this.writeBuffer.length;b++){let c=this.writeBuffer[b].data;if(c&&(a+="string"==typeof c?function(a){let b=0,c=0;for(let d=0,e=a.length;d<e;d++)(b=a.charCodeAt(d))<128?c+=1:b<2048?c+=2:b<55296||b>=57344?c+=3:(d++,c+=4);return c}(c):Math.ceil(1.33*(c.byteLength||c.size))),b>0&&a>this._maxPayload)return aa("only send %d out of %d packets",b,this.writeBuffer.length),this.writeBuffer.slice(0,b);a+=2}return aa("payload size is %d (max: %d)",a,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let a=Date.now()>this._pingTimeoutTime;return a&&(aa("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),a}write(a,b,c){return this._sendPacket("message",a,b,c),this}send(a,b,c){return this._sendPacket("message",a,b,c),this}_sendPacket(a,b,c,d){if("function"==typeof b&&(d=b,b=void 0),"function"==typeof c&&(d=c,c=null),"closing"===this.readyState||"closed"===this.readyState)return;(c=c||{}).compress=!1!==c.compress;let e={type:a,data:b,options:c};this.emitReserved("packetCreate",e),this.writeBuffer.push(e),d&&this.once("flush",d),this.flush()}close(){let a=()=>{this._onClose("forced close"),aa("socket closing - telling transport to close"),this.transport.close()},b=()=>{this.off("upgrade",b),this.off("upgradeError",b),a()},c=()=>{this.once("upgrade",b),this.once("upgradeError",b)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?c():a()}):this.upgrading?c():a()),this}_onError(a){if(aa("socket error %j",a),ad.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return aa("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",a),this._onClose("transport error",a)}_onClose(a,b){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(aa('socket close with reason: "%s"',a),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ab&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let a=ac.indexOf(this._offlineEventListener);-1!==a&&(aa("removing listener for the 'offline' event"),ac.splice(a,1))}this.readyState="closed",this.id=null,this.emitReserved("close",a,b),this.writeBuffer=[],this._prevBufferLen=0}}}ad.protocol=4;class ae extends ad{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade){aa("starting upgrade probes");for(let a=0;a<this._upgrades.length;a++)this._probe(this._upgrades[a])}}_probe(a){aa('probing transport "%s"',a);let b=this.createTransport(a),c=!1;ad.priorWebsocketSuccess=!1;let d=()=>{c||(aa('probe transport "%s" opened',a),b.send([{type:"ping",data:"probe"}]),b.once("packet",d=>{if(!c)if("pong"===d.type&&"probe"===d.data){if(aa('probe transport "%s" pong',a),this.upgrading=!0,this.emitReserved("upgrading",b),!b)return;ad.priorWebsocketSuccess="websocket"===b.name,aa('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{c||"closed"!==this.readyState&&(aa("changing transport and sending upgrade packet"),j(),this.setTransport(b),b.send([{type:"upgrade"}]),this.emitReserved("upgrade",b),b=null,this.upgrading=!1,this.flush())})}else{aa('probe transport "%s" failed',a);let c=Error("probe error");c.transport=b.name,this.emitReserved("upgradeError",c)}}))};function e(){c||(c=!0,j(),b.close(),b=null)}let f=c=>{let d=Error("probe error: "+c);d.transport=b.name,e(),aa('probe transport "%s" failed because of error: %s',a,c),this.emitReserved("upgradeError",d)};function g(){f("transport closed")}function h(){f("socket closed")}function i(a){b&&a.name!==b.name&&(aa('"%s" works - aborting "%s"',a.name,b.name),e())}let j=()=>{b.removeListener("open",d),b.removeListener("error",f),b.removeListener("close",g),this.off("close",h),this.off("upgrading",i)};b.once("open",d),b.once("error",f),b.once("close",g),this.once("close",h),this.once("upgrading",i),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==a?this.setTimeoutFn(()=>{c||b.open()},200):b.open()}onHandshake(a){this._upgrades=this._filterUpgrades(a.upgrades),super.onHandshake(a)}_filterUpgrades(a){let b=[];for(let c=0;c<a.length;c++)~this.transports.indexOf(a[c])&&b.push(a[c]);return b}}class af extends ae{constructor(a,b={}){const c="object"==typeof a?a:b;(!c.transports||c.transports&&"string"==typeof c.transports[0])&&(c.transports=(c.transports||["polling","websocket","webtransport"]).map(a=>Y[a]).filter(a=>!!a)),super(a,c)}}af.protocol;var ag=a.i(81855);let ah=(0,ag.default)("socket.io-client:url"),ai="function"==typeof ArrayBuffer,aj=Object.prototype.toString,ak="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===aj.call(Blob),al="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===aj.call(File);function am(a){return ai&&(a instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer))||ak&&a instanceof Blob||al&&a instanceof File}let an=(0,F.default)("socket.io-parser"),ao=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(e=f||(f={}))[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK";class ap{constructor(a){this.replacer=a}encode(a){return(an("encoding packet %j",a),(a.type===f.EVENT||a.type===f.ACK)&&function a(b,c){if(!b||"object"!=typeof b)return!1;if(Array.isArray(b)){for(let c=0,d=b.length;c<d;c++)if(a(b[c]))return!0;return!1}if(am(b))return!0;if(b.toJSON&&"function"==typeof b.toJSON&&1==arguments.length)return a(b.toJSON(),!0);for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&a(b[c]))return!0;return!1}(a))?this.encodeAsBinary({type:a.type===f.EVENT?f.BINARY_EVENT:f.BINARY_ACK,nsp:a.nsp,data:a.data,id:a.id}):[this.encodeAsString(a)]}encodeAsString(a){let b=""+a.type;return(a.type===f.BINARY_EVENT||a.type===f.BINARY_ACK)&&(b+=a.attachments+"-"),a.nsp&&"/"!==a.nsp&&(b+=a.nsp+","),null!=a.id&&(b+=a.id),null!=a.data&&(b+=JSON.stringify(a.data,this.replacer)),an("encoded %j as %s",a,b),b}encodeAsBinary(a){let b,c,d=(b=[],c=a.data,a.data=function a(b,c){if(!b)return b;if(am(b)){let a={_placeholder:!0,num:c.length};return c.push(b),a}if(Array.isArray(b)){let d=Array(b.length);for(let e=0;e<b.length;e++)d[e]=a(b[e],c);return d}if("object"==typeof b&&!(b instanceof Date)){let d={};for(let e in b)Object.prototype.hasOwnProperty.call(b,e)&&(d[e]=a(b[e],c));return d}return b}(c,b),a.attachments=b.length,{packet:a,buffers:b}),e=this.encodeAsString(d.packet),f=d.buffers;return f.unshift(e),f}}class aq extends w{constructor(a){super(),this.reviver=a}add(a){let b;if("string"==typeof a){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let c=(b=this.decodeString(a)).type===f.BINARY_EVENT;c||b.type===f.BINARY_ACK?(b.type=c?f.EVENT:f.ACK,this.reconstructor=new ar(b),0===b.attachments&&super.emitReserved("decoded",b)):super.emitReserved("decoded",b)}else if(am(a)||a.base64)if(this.reconstructor)(b=this.reconstructor.takeBinaryData(a))&&(this.reconstructor=null,super.emitReserved("decoded",b));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+a)}decodeString(a){let b=0,c={type:Number(a.charAt(0))};if(void 0===f[c.type])throw Error("unknown packet type "+c.type);if(c.type===f.BINARY_EVENT||c.type===f.BINARY_ACK){let d=b+1;for(;"-"!==a.charAt(++b)&&b!=a.length;);let e=a.substring(d,b);if(e!=Number(e)||"-"!==a.charAt(b))throw Error("Illegal attachments");c.attachments=Number(e)}if("/"===a.charAt(b+1)){let d=b+1;for(;++b&&","!==a.charAt(b)&&b!==a.length;);c.nsp=a.substring(d,b)}else c.nsp="/";let d=a.charAt(b+1);if(""!==d&&Number(d)==d){let d=b+1;for(;++b;){let c=a.charAt(b);if(null==c||Number(c)!=c){--b;break}if(b===a.length)break}c.id=Number(a.substring(d,b+1))}if(a.charAt(++b)){let d=this.tryParse(a.substr(b));if(aq.isPayloadValid(c.type,d))c.data=d;else throw Error("invalid payload")}return an("decoded %s as %j",a,c),c}tryParse(a){try{return JSON.parse(a,this.reviver)}catch(a){return!1}}static isPayloadValid(a,b){switch(a){case f.CONNECT:return at(b);case f.DISCONNECT:return void 0===b;case f.CONNECT_ERROR:return"string"==typeof b||at(b);case f.EVENT:case f.BINARY_EVENT:return Array.isArray(b)&&("number"==typeof b[0]||"string"==typeof b[0]&&-1===ao.indexOf(b[0]));case f.ACK:case f.BINARY_ACK:return Array.isArray(b)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ar{constructor(a){this.packet=a,this.buffers=[],this.reconPack=a}takeBinaryData(a){if(this.buffers.push(a),this.buffers.length===this.reconPack.attachments){var b,c;let a=(b=this.reconPack,c=this.buffers,b.data=function a(b,c){if(!b)return b;if(b&&!0===b._placeholder){if("number"==typeof b.num&&b.num>=0&&b.num<c.length)return c[b.num];throw Error("illegal attachments")}if(Array.isArray(b))for(let d=0;d<b.length;d++)b[d]=a(b[d],c);else if("object"==typeof b)for(let d in b)Object.prototype.hasOwnProperty.call(b,d)&&(b[d]=a(b[d],c));return b}(b.data,c),delete b.attachments,b);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let as=Number.isInteger||function(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a};function at(a){return"[object Object]"===Object.prototype.toString.call(a)}function au(a){var b;return"string"==typeof a.nsp&&(void 0===(b=a.id)||as(b))&&function(a,b){switch(a){case f.CONNECT:return void 0===b||at(b);case f.DISCONNECT:return void 0===b;case f.EVENT:return Array.isArray(b)&&("number"==typeof b[0]||"string"==typeof b[0]&&-1===ao.indexOf(b[0]));case f.ACK:return Array.isArray(b);case f.CONNECT_ERROR:return"string"==typeof b||at(b);default:return!1}}(a.type,a.data)}function av(a,b,c){return a.on(b,c),function(){a.off(b,c)}}a.s(["Decoder",()=>aq,"Encoder",()=>ap,"PacketType",()=>f,"isPacketValid",()=>au,"protocol",0,5],64889);let aw=(0,ag.default)("socket.io-client:socket"),ax=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ay extends w{constructor(a,b,c){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=a,this.nsp=b,c&&c.auth&&(this.auth=c.auth),this._opts=Object.assign({},c),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let a=this.io;this.subs=[av(a,"open",this.onopen.bind(this)),av(a,"packet",this.onpacket.bind(this)),av(a,"error",this.onerror.bind(this)),av(a,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...a){return a.unshift("message"),this.emit.apply(this,a),this}emit(a,...b){var c,d,e;if(ax.hasOwnProperty(a))throw Error('"'+a.toString()+'" is a reserved event name');if(b.unshift(a),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(b),this;let g={type:f.EVENT,data:b};if(g.options={},g.options.compress=!1!==this.flags.compress,"function"==typeof b[b.length-1]){let a=this.ids++;aw("emitting packet with ack id %d",a);let c=b.pop();this._registerAckCallback(a,c),g.id=a}let h=null==(d=null==(c=this.io.engine)?void 0:c.transport)?void 0:d.writable,i=this.connected&&!(null==(e=this.io.engine)?void 0:e._hasPingExpired());return this.flags.volatile&&!h?aw("discard packet as the transport is not currently writable"):i?(this.notifyOutgoingListeners(g),this.packet(g)):this.sendBuffer.push(g),this.flags={},this}_registerAckCallback(a,b){var c;let d=null!=(c=this.flags.timeout)?c:this._opts.ackTimeout;if(void 0===d){this.acks[a]=b;return}let e=this.io.setTimeoutFn(()=>{delete this.acks[a];for(let b=0;b<this.sendBuffer.length;b++)this.sendBuffer[b].id===a&&(aw("removing packet with ack id %d from the buffer",a),this.sendBuffer.splice(b,1));aw("event with ack id %d has timed out after %d ms",a,d),b.call(this,Error("operation has timed out"))},d),f=(...a)=>{this.io.clearTimeoutFn(e),b.apply(this,a)};f.withError=!0,this.acks[a]=f}emitWithAck(a,...b){return new Promise((c,d)=>{let e=(a,b)=>a?d(a):c(b);e.withError=!0,b.push(e),this.emit(a,...b)})}_addToQueue(a){let b;"function"==typeof a[a.length-1]&&(b=a.pop());let c={id:this._queueSeq++,tryCount:0,pending:!1,args:a,flags:Object.assign({fromQueue:!0},this.flags)};a.push((a,...d)=>{if(c===this._queue[0])return null!==a?c.tryCount>this._opts.retries&&(aw("packet [%d] is discarded after %d tries",c.id,c.tryCount),this._queue.shift(),b&&b(a)):(aw("packet [%d] was successfully sent",c.id),this._queue.shift(),b&&b(null,...d)),c.pending=!1,this._drainQueue()}),this._queue.push(c),this._drainQueue()}_drainQueue(a=!1){if(aw("draining queue"),!this.connected||0===this._queue.length)return;let b=this._queue[0];b.pending&&!a?aw("packet [%d] has already been sent and is waiting for an ack",b.id):(b.pending=!0,b.tryCount++,aw("sending packet [%d] (try n°%d)",b.id,b.tryCount),this.flags=b.flags,this.emit.apply(this,b.args))}packet(a){a.nsp=this.nsp,this.io._packet(a)}onopen(){aw("transport is open - connecting"),"function"==typeof this.auth?this.auth(a=>{this._sendConnectPacket(a)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(a){this.packet({type:f.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},a):a})}onerror(a){this.connected||this.emitReserved("connect_error",a)}onclose(a,b){aw("close (%s)",a),this.connected=!1,delete this.id,this.emitReserved("disconnect",a,b),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(a=>{if(!this.sendBuffer.some(b=>String(b.id)===a)){let b=this.acks[a];delete this.acks[a],b.withError&&b.call(this,Error("socket has been disconnected"))}})}onpacket(a){if(a.nsp===this.nsp)switch(a.type){case f.CONNECT:a.data&&a.data.sid?this.onconnect(a.data.sid,a.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case f.EVENT:case f.BINARY_EVENT:this.onevent(a);break;case f.ACK:case f.BINARY_ACK:this.onack(a);break;case f.DISCONNECT:this.ondisconnect();break;case f.CONNECT_ERROR:this.destroy();let b=Error(a.data.message);b.data=a.data.data,this.emitReserved("connect_error",b)}}onevent(a){let b=a.data||[];aw("emitting event %j",b),null!=a.id&&(aw("attaching ack callback to event"),b.push(this.ack(a.id))),this.connected?this.emitEvent(b):this.receiveBuffer.push(Object.freeze(b))}emitEvent(a){if(this._anyListeners&&this._anyListeners.length)for(let b of this._anyListeners.slice())b.apply(this,a);super.emit.apply(this,a),this._pid&&a.length&&"string"==typeof a[a.length-1]&&(this._lastOffset=a[a.length-1])}ack(a){let b=this,c=!1;return function(...d){c||(c=!0,aw("sending ack %j",d),b.packet({type:f.ACK,id:a,data:d}))}}onack(a){let b=this.acks[a.id];"function"!=typeof b?aw("bad ack %s",a.id):(delete this.acks[a.id],aw("calling ack %s with %j",a.id,a.data),b.withError&&a.data.unshift(null),b.apply(this,a.data))}onconnect(a,b){aw("socket connected with id %s",a),this.id=a,this.recovered=b&&this._pid===b,this._pid=b,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(a=>this.emitEvent(a)),this.receiveBuffer=[],this.sendBuffer.forEach(a=>{this.notifyOutgoingListeners(a),this.packet(a)}),this.sendBuffer=[]}ondisconnect(){aw("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(a=>a()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(aw("performing disconnect (%s)",this.nsp),this.packet({type:f.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(a){return this.flags.compress=a,this}get volatile(){return this.flags.volatile=!0,this}timeout(a){return this.flags.timeout=a,this}onAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(a),this}prependAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(a),this}offAny(a){if(!this._anyListeners)return this;if(a){let b=this._anyListeners;for(let c=0;c<b.length;c++)if(a===b[c]){b.splice(c,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(a),this}prependAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(a),this}offAnyOutgoing(a){if(!this._anyOutgoingListeners)return this;if(a){let b=this._anyOutgoingListeners;for(let c=0;c<b.length;c++)if(a===b[c]){b.splice(c,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(a){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let b of this._anyOutgoingListeners.slice())b.apply(this,a.data)}}var az=a.i(64889);function aA(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}aA.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var b=Math.random(),c=Math.floor(b*this.jitter*a);a=(1&Math.floor(10*b))==0?a-c:a+c}return 0|Math.min(a,this.max)},aA.prototype.reset=function(){this.attempts=0},aA.prototype.setMin=function(a){this.ms=a},aA.prototype.setMax=function(a){this.max=a},aA.prototype.setJitter=function(a){this.jitter=a};let aB=(0,ag.default)("socket.io-client:manager");class aC extends w{constructor(a,b){var c;super(),this.nsps={},this.subs=[],a&&"object"==typeof a&&(b=a,a=void 0),(b=b||{}).path=b.path||"/socket.io",this.opts=b,D(this,b),this.reconnection(!1!==b.reconnection),this.reconnectionAttempts(b.reconnectionAttempts||1/0),this.reconnectionDelay(b.reconnectionDelay||1e3),this.reconnectionDelayMax(b.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(c=b.randomizationFactor)?c:.5),this.backoff=new aA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==b.timeout?2e4:b.timeout),this._readyState="closed",this.uri=a;const d=b.parser||az;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=!1!==b.autoConnect,this._autoConnect&&this.open()}reconnection(a){return arguments.length?(this._reconnection=!!a,a||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(a){return void 0===a?this._reconnectionAttempts:(this._reconnectionAttempts=a,this)}reconnectionDelay(a){var b;return void 0===a?this._reconnectionDelay:(this._reconnectionDelay=a,null==(b=this.backoff)||b.setMin(a),this)}randomizationFactor(a){var b;return void 0===a?this._randomizationFactor:(this._randomizationFactor=a,null==(b=this.backoff)||b.setJitter(a),this)}reconnectionDelayMax(a){var b;return void 0===a?this._reconnectionDelayMax:(this._reconnectionDelayMax=a,null==(b=this.backoff)||b.setMax(a),this)}timeout(a){return arguments.length?(this._timeout=a,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(a){if(aB("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;aB("opening %s",this.uri),this.engine=new af(this.uri,this.opts);let b=this.engine,c=this;this._readyState="opening",this.skipReconnect=!1;let d=av(b,"open",function(){c.onopen(),a&&a()}),e=b=>{aB("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",b),a?a(b):this.maybeReconnectOnOpen()},f=av(b,"error",e);if(!1!==this._timeout){let a=this._timeout;aB("connect attempt will timeout after %d",a);let c=this.setTimeoutFn(()=>{aB("connect attempt timed out after %d",a),d(),e(Error("timeout")),b.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(d),this.subs.push(f),this}connect(a){return this.open(a)}onopen(){aB("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let a=this.engine;this.subs.push(av(a,"ping",this.onping.bind(this)),av(a,"data",this.ondata.bind(this)),av(a,"error",this.onerror.bind(this)),av(a,"close",this.onclose.bind(this)),av(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(a){try{this.decoder.add(a)}catch(a){this.onclose("parse error",a)}}ondecoded(a){x(()=>{this.emitReserved("packet",a)},this.setTimeoutFn)}onerror(a){aB("error",a),this.emitReserved("error",a)}socket(a,b){let c=this.nsps[a];return c?this._autoConnect&&!c.active&&c.connect():(c=new ay(this,a,b),this.nsps[a]=c),c}_destroy(a){for(let a of Object.keys(this.nsps))if(this.nsps[a].active)return void aB("socket %s is still active, skipping close",a);this._close()}_packet(a){aB("writing packet %j",a);let b=this.encoder.encode(a);for(let c=0;c<b.length;c++)this.engine.write(b[c],a.options)}cleanup(){aB("cleanup"),this.subs.forEach(a=>a()),this.subs.length=0,this.decoder.destroy()}_close(){aB("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(a,b){var c;aB("closed due to %s",a),this.cleanup(),null==(c=this.engine)||c.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",a,b),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let a=this;if(this.backoff.attempts>=this._reconnectionAttempts)aB("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let b=this.backoff.duration();aB("will wait %dms before reconnect attempt",b),this._reconnecting=!0;let c=this.setTimeoutFn(()=>{a.skipReconnect||(aB("attempting reconnect"),this.emitReserved("reconnect_attempt",a.backoff.attempts),a.skipReconnect||a.open(b=>{b?(aB("reconnect attempt error"),a._reconnecting=!1,a.reconnect(),this.emitReserved("reconnect_error",b)):(aB("reconnect success"),a.onreconnect())}))},b);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}}onreconnect(){let a=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",a)}}let aD=(0,ag.default)("socket.io-client"),aE={};function aF(a,b){let c;"object"==typeof a&&(b=a,a=void 0);let d=function(a,b="",c){let d=a;c=c||"undefined"!=typeof location&&location,null==a&&(a=c.protocol+"//"+c.host),"string"==typeof a&&("/"===a.charAt(0)&&(a="/"===a.charAt(1)?c.protocol+a:c.host+a),/^(https?|wss?):\/\//.test(a)||(ah("protocol-less url %s",a),a=void 0!==c?c.protocol+"//"+a:"https://"+a),ah("parse %s",a),d=_(a)),!d.port&&(/^(http|ws)$/.test(d.protocol)?d.port="80":/^(http|ws)s$/.test(d.protocol)&&(d.port="443")),d.path=d.path||"/";let e=-1!==d.host.indexOf(":")?"["+d.host+"]":d.host;return d.id=d.protocol+"://"+e+":"+d.port+b,d.href=d.protocol+"://"+e+(c&&c.port===d.port?"":":"+d.port),d}(a,(b=b||{}).path||"/socket.io"),e=d.source,f=d.id,g=d.path,h=aE[f]&&g in aE[f].nsps;return b.forceNew||b["force new connection"]||!1===b.multiplex||h?(aD("ignoring socket cache for %s",e),c=new aC(e,b)):(aE[f]||(aD("new io instance for %s",e),aE[f]=new aC(e,b)),c=aE[f]),d.query&&!b.query&&(b.query=d.queryKey),c.socket(d.path,b)}Object.assign(aF,{Manager:aC,Socket:ay,io:aF,connect:aF});let aG=a=>{let b=(0,h.useRef)(null);(0,h.useEffect)(()=>{b.current||(b.current=aF());let c=b.current;return c.on("reload",b=>{console.debug("Reloading..."),a(b)}),()=>{c.off()}},[a])};a.s(["useHotreload",0,aG],54049);let aH=(0,h.createContext)(void 0);a.s(["TemplatesProvider",0,a=>{let[b,c]=(0,h.useState)(a.initialTemplatesDirectoryMetadata);return k||l||aG(()=>{j(a.initialTemplatesDirectoryMetadata.absolutePath).then(a=>{if(a)c(a);else throw Error("Hot reloading: unable to find the templates directory to update the sidebar")})}),(0,g.jsx)(aH.Provider,{value:{templatesDirectoryMetadata:b},children:a.children})},"useTemplates",0,()=>{let a=(0,h.useContext)(aH);if(void 0===a)throw Error("Cannot call `useTemplates` outside of a `TemplatesContext` provider.");return a}],69431)}];
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=%5Broot-of-the-server%5D__1536282c._.js.map
|