/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;constescape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");constnormalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");constn=[];consts=newUint8Array([13,10]);A=0;leti=false;for(const[t,o]ofe){if(typeofo==="string"){conste=Q.encode(r+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(o)}\r\n`);n.push(e);A+=e.byteLength}else{conste=Q.encode(`${r}; name="${escape(normalizeLinefeeds(t))}"`+(o.name?`; filename="${escape(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r\n\r\n`);n.push(e,o,s);if(typeofo.size==="number"){A+=e.byteLength+o.size+s.byteLength}else{i=true}}}consto=Q.encode(`--${t}--\r\n`);n.push(o);A+=o.byteLength;if(i){A=null}l=e;c=asyncfunction*(){for(consteofn){if(e.stream){yield*e.stream()}else{yielde}}};u=`multipart/form-data; boundary=${t}`}elseif(i(e)){l=e;A=e.size;if(e.type){u=e.type}}elseif(typeofe[Symbol.asyncIterator]==="function"){if(t){thrownewTypeError("keepalive")}if(n.isDisturbed(e)||e.locked){thrownewTypeError("Response body object should not be disturbed or locked")}r=einstanceofReadableStream?e:s(e)}if(typeofl==="string"||n.isBuffer(l)){A=Buffer.byteLength(l)}if(c!=null){lett;r=newReadableStream({asyncstart(){t=c(e)[Symbol.asyncIterator]()},asyncpull(e){const{value:n,done:s}=awaitt.next();if(s){queueMicrotask((()=>{e.close();e.byobRequest?.respond(0)}))}else{if(!f(r)){constt=newUint8Array(n);if(t.byteLength){e.enqueue(t)}}}returne.desiredSize>0},asynccancel(e){awaitt.return()},type:"bytes"})}constd={stream:r,source:l,length:A};return[d,u]}functionsafelyExtractBody(e,t=false){if(einstanceofReadableStream){h(!n.isDisturbed(e),"The body has already been consumed.");h(!e.locked,"The stream is locked.")}returnextractBody(e,t)}functioncloneBody(e,t){const[r,n]=t.stream.tee();t.stream=r;return{stream:n,length:t.length,source:t.source}}functionthrowIfAborted(e){if(e.aborted){thrownewDOMException("The operation was aborted.","AbortError")}}functionbodyMixinMethods(e){constt={blob(){returnconsumeBody(this,(e=>{lett=bodyMimeType(this);if(t===null){t=""}elseif(t){t=E(t)}returnnewg([e],{type:t})}),e)},arrayBuffer(){returnconsumeBody(this,(e=>newUint8Array(e).buffer),e)},text(){returnconsumeBody(this,u,e)},json(){returnconsumeBody(this,parseJSONFromBytes,e)},formData(){returnconsumeBody(this,(e=>{constt=bodyMimeType(this);if(t!==null){switch(t.essence){case"multipart/form-data":{constr=I(e,t);if(r==="failure"){thrownewTypeError("Failed to parse body as FormData.")}constn=newd;n[m]=r;returnn}case"application/x-www-form-urlencoded":{constt=newURLSearchParams(e.toString());constr=newd;for(const[e,n]oft){r.append(e,n)}returnr}}}thrownewTypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),e)},bytes(){returnconsumeBody(this,(e=>newUint8Array(e)),e)}};returnt}functionmixinBody(e){Object.assign(e.prototype,bodyMixinMethods(e))}asyncfunctionconsumeBody(e,t,r){p.brandCheck(e,r);if(bodyUnusable(e)){thrownewTypeError("Body is unusable: Body has already been read")}throwIfAborted(e[m]);constn=c();consterrorSteps=e=>n.reject(e);constsuccessSteps=e=>{try{n.resolve(t(e))}catch(e){errorSteps(e)}};if(e[m].body==null){successSteps(Buffer.allocUnsafe(0));returnn.promise}awaitl(e[m].body,successSteps,errorSteps);returnn.promise}functionbodyUnusable(e){constt=e[m].body;returnt!=null&&(t.stream.locked||n.isDisturbed(t.stream))}functionparseJSONFromBytes(e){returnJSON.parse(u(e))}functionbodyMimeType(e){constt=e[m].headersList;constr=A(t);if(r==="failure"){returnnull}returnr}e.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:S,hasFinalizationRegistry:b,bodyUnusable:bodyUnusable}},4495:e=>{constt=["GET","HEAD","POST"];constr=newSet(t);constn=[101,204,205,304];consts=[301,302,303,307,308];consti=newSet(s);consto=["1","7","9","11","13","15","17","19","
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */a[o-4]=r[0];a[o-3]=r[1];a[o-2]=r[2];a[o-1]=r[3];a[1]=i;if(i===126){a.writeUInt16BE(s,2)}elseif(i===127){a[2]=a[3]=0;a.writeUIntBE(s,4,6)}a[1]|=128;for(lete=0;e<s;++e){a[o+e]=t[e]^r[e&3]}returna}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(e,t,r)=>{const{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:s}=r(8522);const{isValidClientWindowBits:i}=r(8625);consto=Buffer.from([0,0,255,255]);consta=Symbol("kBuffer");constc=Symbol("kLength");classPerMessageDeflate{#j;#m={};constructor(e){this.#m.serverNoContextTakeover=e.has("server_no_context_takeover");this.#m.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,t,r){if(!this.#j){lete=s;if(this.#m.serverMaxWindowBits){if(!i(this.#m.serverMaxWindowBits)){r(newError("Invalid server_max_window_bits"));return}e=Number.parseInt(this.#m.serverMaxWindowBits)}this.#j=n({windowBits:e});this.#j[a]=[];this.#j[c]=0;this.#j.on("data",(e=>{this.#j[a].push(e);this.#j[c]+=e.length}));this.#j.on("error",(e=>{this.#j=null;r(e)}))}this.#j.write(e);if(t){this.#j.write(o)}this.#j.flush((()=>{conste=Buffer.concat(this.#j[a],this.#j[c]);this.#j[a].length=0;this.#j[c]=0;r(null,e)}))}}e.exports={PerMessageDeflate:PerMessageDeflate}},1652:(e,t,r)=>{const{Writable:n}=r(7075);consts=r(4589);const{parserStates:i,opcodes:o,states:a,emptyBuffer:c,sentCloseFrameState:l}=r(736);const{kReadyState:A,kSentClose:u,kResponse:d,kReceivedClose:m}=r(1216);const{channels:p}=r(2414);const{isValidStatusCode:g,isValidOpcode:h,failWebsocketConnection:f,websocketMessageReceived:y,utf8Decode:C,isControlFrame:E,isTextBinaryFrame:I,isContinuationFrame:B}=r(8625);const{WebsocketFrameSend:Q}=r(3264);const{closeWebSocketConnection:b}=r(6897);const{PerMessageDeflate:S}=r(9469);classByteParserextendsn{#K=[];#X=0;#Z=false;#E=i.INFO;#ee={};#te=[];#re;constructor(e,t){super();this.ws=e;this.#re=t==null?newMap:t;if(this.#re.has("permessage-deflate")){this.#re.set("permessage-deflate",newS(t))}}_write(e,t,r){this.#K.push(e);this.#X+=e.length;this.#Z=true;this.run(r)}run(e){while(this.#Z){if(this.#E===i.INFO){if(this.#X<2){returne()}constt=this.consume(2);constr=(t[0]&128)!==0;constn=t[0]&15;consts=(t[1]&128)===128;consta=!r&&n!==o.CONTINUATION;constc=t[1]&127;constl=t[0]&64;constA=t[0]&32;constu=t[0]&16;if(!h(n)){f(this.ws,"Invalid opcode received");returne()}if(s){f(this.ws,"Frame cannot be masked");returne()}if(l!==0&&!this.#re.has("permessage-deflate")){f(this.ws,"Expected RSV1 to be clear.");return}if(A!==0||u!==0){f(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(a&&!I(n)){f(this.ws,"Invalid frame type was fragmented.");return}if(I(n)&&this.#te.length>0){f(this.ws,"Expected continuation frame");return}if(this.#ee.fragmented&&a){f(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((c>125||a)&&E(n)){f(this.ws,"Control frame either too large or fragmented");return}if(B(n)&&this.#te.length===0&&!this.#ee.compressed){f(this.ws,"Unexpected continuation frame");return}if(c<=125){this.#ee.payloadLength=c;this.#E=i.READ_DATA}elseif(c===126){this.#E=i.PAYLOADLENGTH_16}elseif(c===127){this.#E=i.PAYLOADLENGTH_64}if(I(n)){this.#ee.binaryType=n;this.#ee.compressed=l!==0}this.#ee.opcode=n;this.#ee.masked=s;this.#ee.fin=r;this.#ee.fragmented=a}elseif(this.#E===i.PAYLOADLENGTH_16){if(this.#X<2){returne()}constt=this.consume(2);this.#ee.payloadLength=t.readUInt16BE(0);this.#E=i.READ_DATA}elseif(this.#E===i.PAYLOADLENGTH_64){if(this.#X<8){returne()}constt=this.consume(8);constr=t.readUInt32BE(0);if(r>2**31-1){f(this.ws,"Received payload length > 2^31 bytes.");return}constn=t.readUInt32BE(4);this.#ee.payloadLength=(r<<8)+n;this.#E=i.READ_DATA}elseif(this.#E===i.READ_DATA){if(this.#X<this.#ee.payloadLength){returne()}constt=this.consume(this.#ee.payloadLength);if(E(this.#ee.opcode)){this.#Z=this.parseControlFrame(t);this.#E=i.INFO}else{if(!this.#ee.compressed){this.#te.push(t);if(!this.#ee.fragmented&&this.#ee.fin){conste=Buffer.concat(this.#te);y(this.ws,this.#ee.binaryType,e);this.#te.length=0}this.#E=i.INFO}else{this