Complete Email Sortierer implementation with Appwrite and Stripe integration

This commit is contained in:
knso committed 2026-01-14 20:02:16 +01:00
commit 95349af50b
3355 files changed
+644802

No files matched your search

@@ -0,0 +1 @@
var t=Object.defineProperty;var o=(e,l)=>t(e,"name",{value:l,configurable:!0});var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(f,"getDefaultExportFromCjs");export{n as c,f as g};
@@ -0,0 +1,41 @@
var Ui=Object.defineProperty;var Zg=(e,A,t)=>A in e?Ui(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var o=(e,A)=>Ui(e,"name",{value:A,configurable:!0});var WA=(e,A,t)=>(Zg(e,typeof A!="symbol"?A+"":A,t),t),Os=(e,A,t)=>{if(!A.has(e))throw TypeError("Cannot "+t)},bi=(e,A)=>{if(Object(A)!==A)throw TypeError('Cannot use the "in" operator on this value');return e.has(A)},p=(e,A,t)=>(Os(e,A,"read from private field"),t?t.call(e):A.get(e)),hA=(e,A,t)=>{if(A.has(e))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(e):A.set(e,t)},BA=(e,A,t,s)=>(Os(e,A,"write to private field"),s?s.call(e,t):A.set(e,t),t);var HA=(e,A,t)=>(Os(e,A,"access private method"),t);var or,ir,Qr,Er,gr,Br,Cr,Ir,ar,cr,hr,lr,ur,dr,fr,Dr,yr,Rr,wr,kr,Nr,Fr,Lt,pr,Sr,Ur,br,mr,Lr,Mr,Yr,Jr,Gr,Tr,Vs,Wg,Hr,Mt,Vr;import RA from"node:assert";import Ps from"node:net";import Pr from"node:http";import ue from"node:stream";import de from"node:buffer";import PA from"node:util";import Xg from"node:querystring";import Kg from"node:diagnostics_channel";import Zr from"node:events";import{c as mi}from"./node-fetch-native-with-agent.1a4a356d.mjs";import zg from"node:tls";import Li from"node:zlib";import jg from"node:perf_hooks";import Mi from"node:util/types";import $g from"node:os";import _g from"node:url";import Tt from"node:async_hooks";import"node:console";import AB from"string_decoder";import eB from"node:worker_threads";var LA={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams")};let MA=(or=class extends Error{constructor(A){super(A),this.name="UndiciError",this.code="UND_ERR"}},o(or,"UndiciError"),or),tB=(ir=class extends MA{constructor(A){super(A),this.name="ConnectTimeoutError",this.message=A||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}},o(ir,"ConnectTimeoutError"),ir),rB=(Qr=class extends MA{constructor(A){super(A),this.name="HeadersTimeoutError",this.message=A||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}},o(Qr,"HeadersTimeoutError"),Qr),sB=(Er=class extends MA{constructor(A){super(A),this.name="HeadersOverflowError",this.message=A||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}},o(Er,"HeadersOverflowError"),Er),nB=(gr=class extends MA{constructor(A){super(A),this.name="BodyTimeoutError",this.message=A||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}},o(gr,"BodyTimeoutError"),gr),oB=(Br=class extends MA{constructor(A,t,s,r){super(A),this.name="ResponseStatusCodeError",this.message=A||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=r,this.status=t,this.statusCode=t,this.headers=s}},o(Br,"ResponseStatusCodeError"),Br),iB=(Cr=class extends MA{constructor(A){super(A),this.name="InvalidArgumentError",this.message=A||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}},o(Cr,"InvalidArgumentError"),Cr),QB=(Ir=class extends MA{constructor(A){super(A),this.name="InLine truncated
`))}o(N,"isValidHeaderValue");function u(y,Y){const{headersList:W}=Y,j=(W.get("referrer-policy",!0)??"").split(",");let sA="";if(j.length>0)for(let R=j.length;R!==0;R--){const O=j[R-1].trim();if(s.has(O)){sA=O;break}}sA!==""&&(y.referrerPolicy=sA)}o(u,"setRequestReferrerPolicyOnRedirect");function b(){return"allowed"}o(b,"crossOriginResourcePolicyCheck");function m(){return"success"}o(m,"corsCheck");function T(){return"success"}o(T,"TAOCheck");function v(y){let Y=null;Y=y.mode,y.headersList.set("sec-fetch-mode",Y,!0)}o(v,"appendFetchMetadata");function Z(y){let Y=y.origin;if(y.responseTainting==="cors"||y.mode==="websocket")Y&&y.headersList.append("origin",Y,!0);else if(y.method!=="GET"&&y.method!=="HEAD"){switch(y.referrerPolicy){case"no-referrer":Y=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":y.origin&&Yt(y.origin)&&!Yt(D(y))&&(Y=null);break;case"same-origin":YA(y,D(y))||(Y=null);break}Y&&y.headersList.append("origin",Y,!0)}}o(Z,"appendRequestOriginHeader");function P(y,Y){return y}o(P,"coarsenTime");function AA(y,Y,W){return!y?.startTime||y.startTime<Y?{domainLookupStartTime:Y,domainLookupEndTime:Y,connectionStartTime:Y,connectionEndTime:Y,secureConnectionStartTime:Y,ALPNNegotiatedProtocol:y?.ALPNNegotiatedProtocol}:{domainLookupStartTime:P(y.domainLookupStartTime),domainLookupEndTime:P(y.domainLookupEndTime),connectionStartTime:P(y.connectionStartTime),connectionEndTime:P(y.connectionEndTime),secureConnectionStartTime:P(y.secureConnectionStartTime),ALPNNegotiatedProtocol:y.ALPNNegotiatedProtocol}}o(AA,"clampAndCoarsenConnectionTimingInfo");function K(y){return P(I.now())}o(K,"coarsenedSharedCurrentTime");function tA(y){return{startTime:y.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:y.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}o(tA,"createOpaqueTimingInfo");function uA(){return{referrerPolicy:"strict-origin-when-cross-origin"}}o(uA,"makePolicyContainer");function X(y){return{referrerPolicy:y.referrerPolicy}}o(X,"clonePolicyContainer");function $(y){const Y=y.referrerPolicy;L(Y);let W=null;if(y.referrer==="client"){const H=n();if(!H||H.origin==="null")return"no-referrer";W=new URL(H)}else y.referrer instanceof URL&&(W=y.referrer);let j=V(W);const sA=V(W,!0);j.toString().length>4096&&(j=sA);const R=YA(y,j),O=q(j)&&!q(y.url);switch(Y){case"origin":return sA??V(W,!0);case"unsafe-url":return j;case"same-origin":return R?sA:"no-referrer";case"origin-when-cross-origin":return R?j:sA;case"strict-origin-when-cross-origin":{const H=D(y);return YA(j,H)?j:q(j)&&!q(H)?"no-referrer":sA}case"strict-origin":case"no-referrer-when-downgrade":default:return O?"no-referrer":sA}}o($,"determineRequestsReferrer");function V(y,Y){return L(y instanceof URL),y=new URL(y),y.protocol==="file:"||y.protocol==="about:"||y.protocol==="blank:"?"no-referrer":(y.username="",y.password="",y.hash="",Y&&(y.pathname="",y.search=""),y)}o(V,"stripURLForReferrer");function q(y){if(!(y instanceof URL))return!1;if(y.href==="about:blank"||y.href==="about:srcdoc"||y.protocol==="data:"||y.protocol==="file:")return!0;return Y(y.origin);function Y(W){if(W==null||W==="null")return!1;const j=new URL(W);return!!(j.protocol==="https:"||j.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(j.hostname)||j.hostname==="localhost"||j.hostname.includes("localhost.")||j.hostname.endsWith(".localhost"))}}o(q,"isURLPotentiallyTrustworthy");function z(y,Y){if(k===void 0)return!0;const W=QA(Y);if(W==="no metadata"||W.length===0)return!0;const j=CA(W),sA=IA(W,j);for(const R of sA){const O=R.algo,H=R.hash;let J=k.createHash(O).update(y).digest("base64");if(J[J.length-1]==="="&&(J[J.length-2]==="="?J=J.slice(0,-2):J=J.slice(0,-1)),nA(J,H))return!0}return!1}o(z,"bytesMatch");const rA=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function QA(y){const Y=[];let W=!0;for(const j of y.split(" ")){W=!1;const sA=rA.exec(j);if(sA===null||sA.groups===void 0||sA.groups.algo===void 0)continue;const R=sA.groups.algo.toLowerCase();S.includes(R)&&Y.push(sA.groups)}return W===!0?"no metadata":Y}o(QA,"parseMetadata");function CA(y){let Y=y[0].algo;if(Y[3]==="5")return Y;for(let W=1;W<y.length;++W){const j=y[W];if(j.algo[3]==="5"){Y="sha512";break}else{if(Y[3]==="3")continue;j.algo[3]==="3"&&(Y="sha384")}}return Y}o(CA,"getStrongestMetadata");function IA(y,Y){if(y.length===1)return y;let W=0;for(let j=0;j<y.length;++j)y[j].algo===Y&&(y[W++]=y[j]);return y.length=W,y}o(IA,"filterMetadataListByAlgorithm");function nA(y,Y){if(y.length!==Y.length)return!1;for(let W=0;W<y.length;++W)if(y[W]!==Y[W]){if(y[W]==="+"&&Y[W]==="-"||y[W]==="/"&&Y[W]==="_")continue;return!1}return!0}o(nA,"compareBase64Mixed");function eA(y){}o(eA,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function YA(y,Y){retur Line truncated
`);function l(g){for(let d=0;d<g.length;++d)if(g.charCodeAt(d)&-128)return!1;return!0}o(l,"isAsciiString");function S(g){const d=g.length;if(d<27||d>70)return!1;for(let F=0;F<d;++F){const N=g.charCodeAt(F);if(!(N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||N===39||N===45||N===95))return!1}return!0}o(S,"validateBoundary");function k(g,d="utf-8",F=!1){return F?g=e(g):(C(A(g)),g=g.replace(/\r\n?|\r?\n/g,`\r
`)),C(Buffer.isEncoding(d)),g=g.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Buffer.from(g,d)}o(k,"escapeFormDataName");function w(g,d){C(d!=="failure"&&d.essence==="multipart/form-data");const F=d.parameters.get("boundary");if(F===void 0)return"failure";const N=Buffer.from(`--${F}`,"utf8"),u=[],b={position:0};for(g[0]===13&&g[1]===10&&(b.position+=2);;){if(g.subarray(b.position,b.position+N.length).equals(N))b.position+=N.length;else return"failure";if(b.position===g.length-2&&G(g,L,b)||b.position===g.length-4&&G(g,c,b))return u;if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;const m=U(g,b);if(m==="failure")return"failure";let{name:T,filename:v,contentType:Z,encoding:P}=m;b.position+=2;let AA;{const tA=g.indexOf(N.subarray(2),b.position);if(tA===-1)return"failure";AA=g.subarray(b.position,tA-4),b.position+=AA.length,P==="base64"&&(AA=Buffer.from(AA.toString(),"base64"))}if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;let K;v!==null?(Z??(Z="text/plain"),l(Z)||(Z=""),K=new a([AA],v,{type:Z})):K=s(Buffer.from(AA)),C(A(T)),C(typeof K=="string"&&A(K)||i(K)),u.push(Q(T,K,v))}}o(w,"multipartFormDataParser");function U(g,d){let F=null,N=null,u=null,b=null;for(;;){if(g[d.position]===13&&g[d.position+1]===10)return F===null?"failure":{name:F,filename:N,contentType:u,encoding:b};let m=B(T=>T!==10&&T!==13&&T!==58,g,d);if(m=D(m,!0,!0,T=>T===9||T===32),!r.test(m.toString())||g[d.position]!==58)return"failure";switch(d.position++,B(T=>T===32||T===9,g,d),t(m)){case"content-disposition":{if(F=N=null,!G(g,f,d)||(d.position+=17,F=M(g,d),F===null))return"failure";if(G(g,h,d)){let T=d.position+h.length;if(g[T]===42&&(d.position+=1,T+=1),g[T]!==61||g[T+1]!==34||(d.position+=12,N=M(g,d),N===null))return"failure"}break}case"content-type":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),u=n(T);break}case"content-transfer-encoding":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),b=n(T);break}default:B(T=>T!==10&&T!==13,g,d)}if(g[d.position]!==13&&g[d.position+1]!==10)return"failure";d.position+=2}}o(U,"parseMultipartFormDataHeaders");function M(g,d){C(g[d.position-1]===34);let F=B(N=>N!==10&&N!==13&&N!==34,g,d);return g[d.position]!==34?null:(d.position++,F=new TextDecoder().decode(F).replace(/%0A/ig,`
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),F)}o(M,"parseMultipartFormDataName");function B(g,d,F){let N=F.position;for(;N<d.length&&g(d[N]);)++N;return d.subarray(F.position,F.position=N)}o(B,"collectASequenceOfBytes");function D(g,d,F,N){let u=0,b=g.length-1;if(d)for(;u<g.length&&N(g[u]);)u++;if(F)for(;b>0&&N(g[b]);)b--;return u===0&&b===g.length-1?g:g.subarray(u,b+1)}o(D,"removeChars");function G(g,d,F){if(g.length<d.length)return!1;for(let N=0;N<d.length;N++)if(d[N]!==g[F.position+N])return!1;return!0}return o(G,"bufferStartsWith"),Rn={multipartFormDataParser:w,validateBoundary:S,escapeFormDataName:k},Rn}o(HC,"requireFormdataParser");var wn,hQ;function ns(){if(hQ)return wn;hQ=1;const e=aA,{ReadableStreamFrom:A,isBlobLike:t,isReadableStreamLike:s,readableStreamClose:r,createDeferredPromise:n,fullyReadBody:i,extractMimeType:E,utf8DecodeBytes:Q}=Ee(),{FormData:C}=ss(),{kState:I}=Te(),{webidl:a}=vA(),{Blob:f}=de,h=RA,{isErrored:L}=aA,{isArrayBuffer:c}=Mi,{serializeAMimeType:l}=_A(),{multipartFormDataParser:S}=HC(),k=new TextEncoder;function w(u,b=!1){let m=null;u instanceof ReadableStream?m=u:t(u)?m=u.stream():m=new ReadableStream({async pull(K){const tA=typeof v=="string"?k.encode(v):v;tA.byteLength&&K.enqueue(tA),queueMicrotask(()=>r(K))},start(){},type:"bytes"}),h(s(m));let T=null,v=null,Z=null,P=null;if(typeof u=="string")v=u,P="text/plain;charset=UTF-8";else if(u instanceof URLSearchParams)v=u.toString(),P="application/x-www-form-urlencoded;charset=UTF-8";else if(c(u))v=new Uint8Array(u.slice());else if(ArrayBuffer.isView(u))v=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength));else if(e.isFormDataLike(u)){const K=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`,tA=`--${K}\r
Content-Disposition: form-data`;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const uA=o(rA=>rA.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),X=o(rA=>rA.replace(/\r?\n|\r/g,`\r
`),"normalizeLinefeeds"),$=[],V=new Uint8Array([13,10]);Z=0;let q=!1;for(const[rA,QA]of u)if(typeof QA=="string"){const CA=k.encode(tA+`; name="${uA(X(rA))}"\r
\r
${X(QA)}\r
`);$.push(CA),Z+=CA.byteLength}else{const CA=k.encode(`${tA}; name="${uA(X(rA))}"`+(QA.name?`; filename="${uA(QA.name)}"`:"")+`\r
Content-Type: ${QA.type||"application/octet-stream"}\r
\r
`);$.push(CA,QA,V),typeof QA.size=="number"?Z+=CA.byteLength+QA.size+V.byteLength:q=!0}const z=k.encode(`--${K}--`);$.push(z),Z+=z.byteLength,q&&(Z=null),v=u,T=o(async function*(){for(const rA of $)rA.stream?yield*rA.stream():yield rA},"action"),P=`multipart/form-data; boundary=${K}`}else if(t(u))v=u,Z=u.size,u.type&&(P=u.type);else if(typeof u[Symbol.asyncIterator]=="function"){if(b)throw new TypeError("keepalive");if(e.isDisturbed(u)||u.locked)throw new TypeError("Response body object should not be disturbed or locked");m=u instanceof ReadableStream?u:A(u)}if((typeof v=="string"||e.isBuffer(v))&&(Z=Buffer.byteLength(v)),T!=null){let K;m=new ReadableStream({async start(){K=T(u)[Symbol.asyncIterator]()},async pull(tA){const{value:uA,done:X}=await K.next();if(X)queueMicrotask(()=>{tA.close(),tA.byobRequest?.respond(0)});else if(!L(m)){const $=new Uint8Array(uA);$.byteLength&&tA.enqueue($)}return tA.desiredSize>0},async cancel(tA){await K.return()},type:"bytes"})}return[{stream:m,source:v,length:Z},P]}o(w,"extractBody");function U(u,b=!1){return u instanceof ReadableStream&&(h(!e.isDisturbed(u),"The body has already been consumed."),h(!u.locked,"The stream is locked.")),w(u,b)}o(U,"safelyExtractBody");function M(u){const[b,m]=u.stream.tee();return u.stream=b,{stream:m,length:u.length,source:u.source}}o(M,"cloneBody");function B(u){if(u.aborted)throw new DOMException("The operation was aborted.","AbortError")}o(B,"throwIfAborted");function D(u){return{blob(){return g(this,m=>{let T=N(this);return T===null?T="":T&&(T=l(T)),new f([m],{type:T})},u)},arrayBuffer(){return g(this,m=>new Uint8Array(m).buffer,u)},text(){return g(this,Q,u)},json(){return g(this,F,u)},formData(){return g(this,m=>{const T=N(this);if(T!==null)switch(T.essence){case"multipart/form-data":{const v=S(m,T);if(v==="failure")throw new TypeError("Failed to parse body as FormData.");const Z=new C;return Z[I]=v,Z}case"application/x-www-form-urlencoded":{const v=new URLSearchParams(m.toString()),Z=new C;for(const[P,AA]of v)Z.append(P,AA);return Z}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},u)}}}o(D,"bodyMixinMethods");function G(u){Object.assign(u.prototype,D(u))}o(G,"mixinBody");async function g(u,b,m){if(a.brandCheck(u,m),B(u[I]),d(u[I].body))throw new TypeError("Body is unusable");const T=n(),v=o(P=>T.reject(P),"errorSteps"),Z=o(P=>{try{T.resolve(b(P))}catch(AA){v(AA)}},"successSteps");return u[I].body==null?(Z(new Uint8Array),T.promise):(await i(u[I].body,Z,v),T.promise)}o(g,"consumeBody");function d(u){return u!=null&&(u.stream.locked||e.isDisturbed(u.stream))}o(d,"bodyUnusable");function F(u){return JSON.parse(Q(u))}o(F,"parseJSONFromBytes");function N(u){const b=u[I].headersList,m=E(b);return m==="failure"?null:m}return o(N,"bodyMimeType"),wn={extractBody:w,safelyExtractBody:U,cloneBody:M,mixinBody:G},wn}o(ns,"requireBody");const iA=RA,EA=aA,{channels:lQ}=Vt,kn=JC,{RequestContentLengthMismatchError:At,ResponseContentLengthMismatchError:VC,RequestAbortedError:uQ,HeadersTimeoutError:vC,HeadersOverflowError:xC,SocketError:os,InformationalError:ut,BodyTimeoutError:WC,HTTPParserError:qC,ResponseExceededMaxSizeError:OC}=kA,{kUrl:dQ,kReset:ZA,kClient:Nn,kParser:FA,kBlocking:xt,kRunning:xA,kPending:PC,kSize:fQ,kWriting:He,kQueue:ge,kNoRef:Wt,kKeepAliveDefaultTimeout:ZC,kHostHeader:XC,kPendingIdx:KC,kRunningIdx:se,kError:ne,kPipelining:is,kSocket:dt,kKeepAliveTimeoutValue:Qs,kMaxHeadersSize:Fn,kKeepAliveMaxTimeout:zC,kKeepAliveTimeoutThreshold:jC,kHeadersTimeout:$C,kBodyTimeout:_C,kStrictContentLength:pn,kMaxRequests:DQ,kCounter:AI,kMaxResponseSize:eI,kOnError:tI,kResume:Ve,kHTTPContext:yQ}=LA,De=rQ,rI=Buffer.alloc(0),Es=Buffer[Symbol.species],gs=EA.addListener,sI=EA.removeAllListeners;let Sn;async function nI(){const e=process.env.JEST_WORKER_ID?nQ():void 0;let A;try{A=await WebAssembly.compile(TC())}catch{A=await WebAssembly.compile(e||nQ())}return await WebAssembly.instantiate(A,{env:{wasm_on_url:(t,s,r)=>0,wasm_on_status:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onStatus(new Es(ye.buffer,n,r))||0},wasm_on_message_begin:t=>(iA.strictEqual(GA.ptr,t),GA.onMessageBegin()||0),wasm_on_header_field:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onHeaderField(new Es(ye.buffer,n,r))||0},wasm_on_header_value:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onHeaderValue(new Es(ye.buffer,n,r))||0},wasm_on_headers_complete:(t,s,r,n)=>(iA.strictEqual(GA.ptr,t),GA.onHeadersComplete(s,!!r,!!n)||0),wasm_on_body:(t,s,r)=>{iA.strictEqual(GA.ptr,t);const n=s-Re+ye.byteOffset;return GA.onBody(new Es(ye.buffer,n,r))||0},wasm_on_message_complete:t=>(iA.strictEqual(GA.ptr,t),GA.onMessageComplete()||0)}})}o(nI,"lazyllhttp");let Un=null,bn=nI();bn.catch();let GA=null,ye=null,Bs=0,Re=null;const ft=1,Cs=2,mn=3,ai=class ai{constructor(A,t,{exports:s}){iA(Number.isFinite(A[Fn])&&A[Fn]>0),this.llhttp=s,this.ptr=this.llhttp.llhttp Line truncated
`;if(typeof r=="string"?c+=`host: ${r}\r
`:c+=e[XC],n?c+=`connection: upgrade\r
upgrade: ${n}\r
`:e[is]&&!h[ZA]?c+=`connection: keep-alive\r
`:c+=`connection: close\r
`,Array.isArray(C))for(let l=0;l<C.length;l+=2){const S=C[l+0],k=C[l+1];if(Array.isArray(k))for(let w=0;w<k.length;w++)c+=`${S}: ${k[w]}\r
`;else c+=`${S}: ${k}\r
`}return lQ.sendHeaders.hasSubscribers&&lQ.sendHeaders.publish({request:A,headers:c,socket:h}),!Q||f===0?RQ({abort:L,body:null,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isBuffer(Q)?RQ({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isBlobLike(Q)?typeof Q.stream=="function"?wQ({abort:L,body:Q.stream(),client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):CI({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isStream(Q)?BI({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):EA.isIterable(Q)?wQ({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):iA(!1),!0}o(gI,"writeH1");function BI({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){iA(n!==0||t[xA]===0,"stream body cannot be pipelined");let Q=!1;const C=new Is({abort:e,socket:r,request:s,contentLength:n,client:t,expectsPayload:E,header:i}),I=o(function(L){if(!Q)try{!C.write(L)&&this.pause&&this.pause()}catch(c){EA.destroy(this,c)}},"onData"),a=o(function(){Q||A.resume&&A.resume()},"onDrain"),f=o(function(){if(queueMicrotask(()=>{A.removeListener("error",h)}),!Q){const L=new uQ;queueMicrotask(()=>h(L))}},"onClose"),h=o(function(L){if(!Q){if(Q=!0,iA(r.destroyed||r[He]&&t[xA]<=1),r.off("drain",a).off("error",h),A.removeListener("data",I).removeListener("end",h).removeListener("close",f),!L)try{C.end()}catch(c){L=c}C.destroy(L),L&&(L.code!=="UND_ERR_INFO"||L.message!=="reset")?EA.destroy(A,L):EA.destroy(A)}},"onFinished");A.on("data",I).on("end",h).on("error",h).on("close",f),A.resume&&A.resume(),r.on("drain",a).on("error",h),A.errorEmitted??A.errored?setImmediate(()=>h(A.errored)):(A.endEmitted??A.readableEnded)&&setImmediate(()=>h(null)),(A.closeEmitted??A.closed)&&setImmediate(f)}o(BI,"writeStream$1");async function RQ({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){try{A?EA.isBuffer(A)&&(iA(n===A.byteLength,"buffer body must have content length"),r.cork(),r.write(`${i}content-length: ${n}\r
\r
`,"latin1"),r.write(A),r.uncork(),s.onBodySent(A),E||(r[ZA]=!0)):n===0?r.write(`${i}content-length: 0\r
\r
`,"latin1"):(iA(n===null,"no body must not have content length"),r.write(`${i}\r
`,"latin1")),s.onRequestSent(),t[Ve]()}catch(Q){e(Q)}}o(RQ,"writeBuffer");async function CI({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){iA(n===A.size,"blob body must have content length");try{if(n!=null&&n!==A.size)throw new At;const Q=Buffer.from(await A.arrayBuffer());r.cork(),r.write(`${i}content-length: ${n}\r
\r
`,"latin1"),r.write(Q),r.uncork(),s.onBodySent(Q),s.onRequestSent(),E||(r[ZA]=!0),t[Ve]()}catch(Q){e(Q)}}o(CI,"writeBlob$1");async function wQ({abort:e,body:A,client:t,request:s,socket:r,contentLength:n,header:i,expectsPayload:E}){iA(n!==0||t[xA]===0,"iterator body cannot be pipelined");let Q=null;function C(){if(Q){const f=Q;Q=null,f()}}o(C,"onDrain");const I=o(()=>new Promise((f,h)=>{iA(Q===null),r[ne]?h(r[ne]):Q=f}),"waitForDrain");r.on("close",C).on("drain",C);const a=new Is({abort:e,socket:r,request:s,contentLength:n,client:t,expectsPayload:E,header:i});try{for await(const f of A){if(r[ne])throw r[ne];a.write(f)||await I()}a.end()}catch(f){a.destroy(f)}finally{r.off("close",C).off("drain",C)}}o(wQ,"writeIterable$1");const ci=class ci{constructor({abort:A,socket:t,request:s,contentLength:r,client:n,expectsPayload:i,header:E}){this.socket=t,this.request=s,this.contentLength=r,this.client=n,this.bytesWritten=0,this.expectsPayload=i,this.header=E,this.abort=A,t[He]=!0}write(A){const{socket:t,request:s,contentLength:r,client:n,bytesWritten:i,expectsPayload:E,header:Q}=this;if(t[ne])throw t[ne];if(t.destroyed)return!1;const C=Buffer.byteLength(A);if(!C)return!0;if(r!==null&&i+C>r){if(n[pn])throw new At;process.emitWarning(new At)}t.cork(),i===0&&(E||(t[ZA]=!0),r===null?t.write(`${Q}transfer-encoding: chunked\r
`,"latin1"):t.write(`${Q}content-length: ${r}\r
\r
`,"latin1")),r===null&&t.write(`\r
${C.toString(16)}\r
`,"latin1"),this.bytesWritten+=C;const I=t.write(A);return t.uncork(),s.onBodySent(A),I||t[FA].timeout&&t[FA].timeoutType===ft&&t[FA].timeout.refresh&&t[FA].timeout.refresh(),I}end(){const{socket:A,contentLength:t,client:s,bytesWritten:r,expectsPayload:n,header:i,request:E}=this;if(E.onRequestSent(),A[He]=!1,A[ne])throw A[ne];if(!A.destroyed){if(r===0?n?A.write(`${i}content-length: 0\r
\r
`,"latin1"):A.write(`${i}\r
`,"latin1"):t===null&&A.write(`\r
0\r
\r
`,"latin1"),t!==null&&r!==t){if(s[pn])throw new At;process.emitWarning(new At)}A[FA].timeout&&A[FA].timeoutType===ft&&A[FA].timeout.refresh&&A[FA].timeout.refresh(),s[Ve]()}}destroy(A){const{socket:t,client:s,abort:r}=this;t[He]=!1,A&&(iA(s[xA]<=1,"pipeline should only contain this request"),r(A))}};o(ci,"AsyncWriter");let Is=ci;var II=iI;const Be=RA,{pipeline:aI}=ue,cA=aA,{RequestContentLengthMismatchError:Mn,RequestAbortedError:kQ,SocketError:Yn,InformationalError:as}=kA,{kUrl:Jn,kReset:cI,kClient:Dt,kRunning:Gn,kPending:hI,kQueue:lI,kPendingIdx:uI,kRunningIdx:NQ,kError:be,kSocket:XA,kStrictContentLength:dI,kOnError:cs,kMaxConcurrentStreams:fI,kHTTP2Session:ve,kResume:FQ}=LA,KA=Symbol("open streams");let pQ=!1,hs;try{hs=require("node:http2")}catch{hs={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY:DI,HTTP2_HEADER_METHOD:yI,HTTP2_HEADER_PATH:RI,HTTP2_HEADER_SCHEME:wI,HTTP2_HEADER_CONTENT_LENGTH:kI,HTTP2_HEADER_EXPECT:NI,HTTP2_HEADER_STATUS:FI}}=hs;function pI(e){const A=[];for(const[t,s]of Object.entries(e))if(Array.isArray(s))for(const r of s)A.push(Buffer.from(t),Buffer.from(r));else A.push(Buffer.from(t),Buffer.from(s));return A}o(pI,"parseH2Headers");async function SI(e,A){e[XA]=A,pQ||(pQ=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));const t=hs.connect(e[Jn],{createConnection:()=>A,peerMaxConcurrentStreams:e[fI]});t[KA]=0,t[Dt]=e,t[XA]=A,cA.addListener(t,"error",UI),cA.addListener(t,"frameError",bI),cA.addListener(t,"end",mI),cA.addListener(t,"goaway",LI),cA.addListener(t,"close",function(){const{[Dt]:r}=this,n=this[XA][be]||new Yn("closed",cA.getSocketInfo(this));r[XA]=null,r[ve]=null,Be(r[hI]===0);const i=r[lI].splice(r[NQ]);for(let E=0;E<i.length;E++){const Q=i[E];cA.errorRequest(r,Q,n)}r[uI]=r[NQ],Be(r[Gn]===0),r.emit("disconnect",r[Jn],[r],n),r[FQ]()}),t.unref(),e[ve]=t,A[ve]=t,cA.addListener(A,"error",function(r){Be(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[be]=r,this[Dt][cs](r)}),cA.addListener(A,"end",function(){cA.destroy(this,new Yn("other side closed",cA.getSocketInfo(this)))});let s=!1;return A.on("close",()=>{s=!0}),{version:"h2",defaultPipelining:1/0,write(...r){YI(e,...r)},resume(){},destroy(r,n){t.destroy(r),s?queueMicrotask(n):A.destroy(r).on("close",n)},get destroyed(){return A.destroyed},busy(){return!1}}}o(SI,"connectH2$1");function UI(e){Be(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[XA][be]=e,this[Dt][cs](e)}o(UI,"onHttp2SessionError");function bI(e,A,t){if(t===0){const s=new as(`HTTP/2: "frameError" received - type ${e}, code ${A}`);this[XA][be]=s,this[Dt][cs](s)}}o(bI,"onHttp2FrameError");function mI(){const e=new Yn("other side closed",cA.getSocketInfo(this[XA]));this.destroy(e),cA.destroy(this[XA],e)}o(mI,"onHttp2SessionEnd");function LI(e){const A=new as(`HTTP/2: "GOAWAY" frame received with code ${e}`);this[XA][be]=A,this[Dt][cs](A),this.unref(),this.destroy(),cA.destroy(this[XA],A)}o(LI,"onHTTP2GoAway");function MI(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}o(MI,"shouldSendContentLength");function YI(e,A){const t=e[ve],{body:s,method:r,path:n,host:i,upgrade:E,expectContinue:Q,signal:C,headers:I}=A;if(E)return cA.errorRequest(e,A,new Error("Upgrade not supported for H2")),!1;if(A.aborted)return!1;const a={};for(let w=0;w<I.length;w+=2){const U=I[w+0],M=I[w+1];if(Array.isArray(M))for(let B=0;B<M.length;B++)a[U]?a[U]+=`,${M[B]}`:a[U]=M[B];else a[U]=M}let f;const{hostname:h,port:L}=e[Jn];a[DI]=i||`${h}${L?`:${L}`:""}`,a[yI]=r;try{A.onConnect(w=>{A.aborted||A.completed||(w=w||new kQ,f!=null&&(cA.destroy(f,w),t[KA]-=1,t[KA]===0&&t.unref()),cA.errorRequest(e,A,w))})}catch(w){cA.errorRequest(e,A,w)}if(r==="CONNECT")return t.ref(),f=t.request(a,{endStream:!1,signal:C}),f.id&&!f.pending?(A.onUpgrade(null,null,f),++t[KA]):f.once("ready",()=>{A.onUpgrade(null,null,f),++t[KA]}),f.once("close",()=>{t[KA]-=1,t[KA]===0&&t.unref()}),!0;a[RI]=n,a[wI]="https";const c=r==="PUT"||r==="POST"||r==="PATCH";s&&typeof s.read=="function"&&s.read(0);let l=cA.bodyLength(s);if(l==null&&(l=A.contentLength),(l===0||!c)&&(l=null),MI(r)&&l>0&&A.contentLength!=null&&A.contentLength!==l){if(e[dI])return cA.errorRequest(e,A,new Mn),!1;process.emitWarning(new Mn)}l!=null&&(Be(s,"no body must not have content length"),a[kI]=`${l}`),t.ref();const S=r==="GET"||r==="HEAD"||s===null;return Q?(a[NI]="100-continue",f=t.request(a,{endStream:S,signal:C}),f.once("continue",k)):(f=t.request(a,{endStream:S,signal:C}),k()),++t[KA],f.once("response",w=>{const{[FI]:U,...M}=w;if(A.onResponseStarted(),A.aborted||A.completed){const B=new kQ;cA.errorRequest(e,A,B),cA.destroy(f,B);return}A.onHeaders(Number(U),pI(M),f.resume.bind(f),"")===!1&&f.pause(),f.on("data",B=>{A.onData(B)===!1&&f.pause()})}),f.once("end",()=>{if(f.state?.state==null||f.state.state<6){A.onComplete([]);return}t[KA]-=1,t[KA]===0&&t.unref();const w=new as("HTTP/2: stream half-closed (remote)");cA.errorRequest(e,A,w),cA.destroy(f,w)}),f.once("close",()=>{ Line truncated
`,this[ga]=Q??3e5,this[Ea]=r??3e5,this[Ba]=k??!0,this[Ca]=U,this[Vn]=B,this[Oe]=null,this[la]=G>-1?G:-1,this[da]=F??100,this[UA]=null,this[Ce]=[],this[Le]=0,this[Ie]=0,this[zt]=u=>vn(this,u),this[ua]=u=>TQ(this,u)}get pipelining(){return this[us]}set pipelining(A){this[us]=A,this[zt](!0)}get[Pt](){return this[Ce].length-this[Ie]}get[Ot](){return this[Ie]-this[Le]}get[Zt](){return this[Ce].length-this[Le]}get[ta](){return!!this[UA]&&!this[Rt]&&!this[UA].destroyed}get[Hn](){return!!(this[UA]?.busy(null)||this[Zt]>=(GQ(this)||1)||this[Pt]>0)}[ea](A){HQ(this),this.once("connect",A)}[ha](A,t){const s=A.origin||this[ke].origin,r=new KI(s,A,t);return this[Ce].push(r),this[et]||(xe.bodyLength(r.body)==null&&xe.isIterable(r.body)?(this[et]=1,queueMicrotask(()=>vn(this))):this[zt](!0)),this[et]&&this[qe]!==2&&this[Hn]&&(this[qe]=2),this[qe]<2}async[aa](){return new Promise(A=>{this[Zt]?this[Oe]=A:A(null)})}async[ca](A){return new Promise(t=>{const s=this[Ce].splice(this[Ie]);for(let n=0;n<s.length;n++){const i=s[n];xe.errorRequest(this,i,A)}const r=o(()=>{this[Oe]&&(this[Oe](),this[Oe]=null),t(null)},"callback");this[UA]?(this[UA].destroy(A,r),this[UA]=null):queueMicrotask(r),this[zt]()})}},o(Lr,"Client"),Lr);const Ra=mQ;function TQ(e,A){if(e[Ot]===0&&A.code!=="UND_ERR_INFO"&&A.code!=="UND_ERR_SOCKET"){me(e[Ie]===e[Le]);const t=e[Ce].splice(e[Le]);for(let s=0;s<t.length;s++){const r=t[s];xe.errorRequest(e,r,A)}me(e[Zt]===0)}}o(TQ,"onError");async function HQ(e){me(!e[Rt]),me(!e[UA]);let{host:A,hostname:t,protocol:s,port:r}=e[ke];if(t[0]==="["){const n=t.indexOf("]");me(n!==-1);const i=t.substring(1,n);me(LQ.isIP(i)),t=i}e[Rt]=!0,yt.beforeConnect.hasSubscribers&&yt.beforeConnect.publish({connectParams:{host:A,hostname:t,protocol:s,port:r,version:e[UA]?.version,servername:e[We],localAddress:e[Kt]},connector:e[Xt]});try{const n=await new Promise((i,E)=>{e[Xt]({host:A,hostname:t,protocol:s,port:r,servername:e[We],localAddress:e[Kt]},(Q,C)=>{Q?E(Q):i(C)})});if(e.destroyed){xe.destroy(n.on("error",()=>{}),new $I);return}me(n);try{e[UA]=n.alpnProtocol==="h2"?await Da(e,n):await fa(e,n)}catch(i){throw n.destroy().on("error",()=>{}),i}e[Rt]=!1,n[Ia]=0,n[Vn]=e[Vn],n[Aa]=e,n[sa]=null,yt.connected.hasSubscribers&&yt.connected.publish({connectParams:{host:A,hostname:t,protocol:s,port:r,version:e[UA]?.version,servername:e[We],localAddress:e[Kt]},connector:e[Xt],socket:n}),e.emit("connect",e[ke],[e])}catch(n){if(e.destroyed)return;if(e[Rt]=!1,yt.connectError.hasSubscribers&&yt.connectError.publish({connectParams:{host:A,hostname:t,protocol:s,port:r,version:e[UA]?.version,servername:e[We],localAddress:e[Kt]},connector:e[Xt],error:n}),n.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(me(e[Ot]===0);e[Pt]>0&&e[Ce][e[Ie]].servername===e[We];){const i=e[Ce][e[Ie]++];xe.errorRequest(e,i,n)}else TQ(e,n);e.emit("connectionError",e[ke],[e],n)}e[zt]()}o(HQ,"connect$1");function VQ(e){e[qe]=0,e.emit("drain",e[ke],[e])}o(VQ,"emitDrain");function vn(e,A){e[et]!==2&&(e[et]=2,wa(e,A),e[et]=0,e[Le]>256&&(e[Ce].splice(0,e[Le]),e[Ie]-=e[Le],e[Le]=0))}o(vn,"resume");function wa(e,A){for(;;){if(e.destroyed){me(e[Pt]===0);return}if(e[Oe]&&!e[Zt]){e[Oe](),e[Oe]=null;return}if(e[UA]&&e[UA].resume(),e[Hn])e[qe]=2;else if(e[qe]===2){A?(e[qe]=1,queueMicrotask(()=>VQ(e))):VQ(e);continue}if(e[Pt]===0||e[Ot]>=(GQ(e)||1))return;const t=e[Ce][e[Ie]];if(e[ke].protocol==="https:"&&e[We]!==t.servername){if(e[Ot]>0)return;e[We]=t.servername,e[UA]?.destroy(new jI("servername changed"),()=>{e[UA]=null,vn(e)})}if(e[Rt])return;if(!e[UA]){HQ(e);return}if(e[UA].destroyed||e[UA].busy(t))return;!t.aborted&&e[UA].write(t)?e[Ie]++:e[Ce].splice(e[Ie],1)}}o(wa,"_resume");var xn=ya;const vQ=2048,Wn=vQ-1,li=class li{constructor(){this.bottom=0,this.top=0,this.list=new Array(vQ),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&Wn)===this.bottom}push(A){this.list[this.top]=A,this.top=this.top+1&Wn}shift(){const A=this.list[this.bottom];return A===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&Wn,A)}};o(li,"FixedCircularBuffer");let ds=li;var ka=(Mr=class{constructor(){this.head=this.tail=new ds}isEmpty(){return this.head.isEmpty()}push(A){this.head.isFull()&&(this.head=this.head.next=new ds),this.head.push(A)}shift(){const A=this.tail,t=A.shift();return A.isEmpty()&&A.next!==null&&(this.tail=A.next),t}},o(Mr,"FixedQueue"),Mr);const{kFree:Na,kConnected:Fa,kPending:pa,kQueued:Sa,kRunning:Ua,kSize:ba}=LA,tt=Symbol("pool");let ma=(Yr=class{constructor(A){this[tt]=A}get connected(){return this[tt][Fa]}get free(){return this[tt][Na]}get pending(){return this[tt][pa]}get queued(){return this[tt][Sa]}get running(){return this[tt][Ua]}get size(){return this[tt][ba]}},o(Yr,"PoolStats"),Yr);var La=ma;const Ma=As,Ya=ka,{kConnected:qn,kSize:xQ,kRunning:WQ,kPending:qQ,kQueued:jt,kBusy:Ja,kFree:Ga,kUrl:Ta,kClose:Ha,kDestroy:Va,kDispatch:va}=LA,xa=La,zA=Symbol("clients"),qA=Symbol("needDrain"),$t=Symbol("queue"),On=Symbol("closed resolve"),Pn=Symbol Line truncated
${l}`;break;case"retry":A(l)&&(h[c]=l);break;case"id":t(l)&&(h[c]=l);break;case"event":l.length>0&&(h[c]=l);break}}processEvent(f){f.retry&&A(f.retry)&&(this.state.reconnectionTime=parseInt(f.retry,10)),f.id&&t(f.id)&&(this.state.lastEventId=f.id),f.data!==void 0&&this.push({type:f.event||"message",options:{data:f.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};o(C,"EventSourceStream");let Q=C;return si={EventSourceStream:Q},si}o(Bl,"requireEventsourceStream");var ni,xg;function Cl(){var U,M,B,D,G,g,d,F,ii,u,Qi;if(xg)return ni;xg=1;const{pipeline:e}=ue,{fetching:A}=Ms(),{makeRequest:t}=rr(),{getGlobalOrigin:s}=lt(),{webidl:r}=vA(),{EventSourceStream:n}=Bl(),{parseMIMEType:i}=_A(),{MessageEvent:E}=Ys(),{isNetworkError:Q}=Ls(),{delay:C}=Vg(),{kEnumerableProperty:I}=aA;let a=!1;const f=3e3,h=0,L=1,c=2,l="anonymous",S="use-credentials",m=class m extends EventTarget{constructor(Z,P={}){super();hA(this,F);hA(this,u);hA(this,U,{open:null,error:null,message:null});hA(this,M,null);hA(this,B,!1);hA(this,D,h);hA(this,G,null);hA(this,g,null);hA(this,d,null);r.argumentLengthCheck(arguments,1,{header:"EventSource constructor"}),a||(a=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),Z=r.converters.USVString(Z),P=r.converters.EventSourceInitDict(P),BA(this,d,{origin:s(),policyContainer:{referrerPolicy:"no-referrer"},lastEventId:"",reconnectionTime:f});let AA;try{AA=new URL(Z,p(this,d).origin),p(this,d).origin=AA.origin}catch(uA){throw new DOMException(uA,"SyntaxError")}BA(this,M,AA.href);let K=l;P.withCredentials&&(K=S,BA(this,B,!0));const tA={redirect:"follow",keepalive:!0,mode:"cors",credentials:K==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};tA.client=p(this,d),tA.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],tA.cache="no-store",tA.initiator="other",tA.urlList=[new URL(p(this,M))],BA(this,G,t(tA)),HA(this,F,ii).call(this)}get readyState(){return p(this,D)}get url(){return p(this,M)}get withCredentials(){return p(this,B)}close(){r.brandCheck(this,m),p(this,D)!==c&&(BA(this,D,c),clearTimeout(p(this,d).reconnectionTimer),p(this,g).abort(),p(this,G)&&BA(this,G,null))}get onopen(){return p(this,U).open}set onopen(Z){p(this,U).open&&this.removeEventListener("open",p(this,U).open),typeof Z=="function"?(p(this,U).open=Z,this.addEventListener("open",Z)):p(this,U).open=null}get onmessage(){return p(this,U).message}set onmessage(Z){p(this,U).message&&this.removeEventListener("message",p(this,U).message),typeof Z=="function"?(p(this,U).message=Z,this.addEventListener("message",Z)):p(this,U).message=null}get onerror(){return p(this,U).error}set onerror(Z){p(this,U).error&&this.removeEventListener("error",p(this,U).error),typeof Z=="function"?(p(this,U).error=Z,this.addEventListener("error",Z)):p(this,U).error=null}};U=new WeakMap,M=new WeakMap,B=new WeakMap,D=new WeakMap,G=new WeakMap,g=new WeakMap,d=new WeakMap,F=new WeakSet,ii=o(function(){if(p(this,D)===c)return;BA(this,D,h);const Z={request:p(this,G)},P=o(AA=>{Q(AA)&&(this.dispatchEvent(new Event("error")),this.close()),HA(this,u,Qi).call(this)},"processEventSourceEndOfBody");Z.processResponseEndOfBody=P,Z.processResponse=AA=>{if(Q(AA))if(AA.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{HA(this,u,Qi).call(this);return}const K=AA.headersList.get("content-type",!0),tA=K!==null?i(K):"failure",uA=tA!=="failure"&&tA.essence==="text/event-stream";if(AA.status!==200||uA===!1){this.close(),this.dispatchEvent(new Event("error"));return}BA(this,D,L),this.dispatchEvent(new Event("open")),p(this,d).origin=AA.urlList[AA.urlList.length-1].origin;const X=new n({eventSourceSettings:p(this,d),push:$=>{this.dispatchEvent(new E($.type,$.options))}});e(AA.body.stream,X,$=>{$?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},BA(this,g,A(Z))},"#connect"),u=new WeakSet,Qi=o(async function(){p(this,D)!==c&&(BA(this,D,h),this.dispatchEvent(new Event("error")),await C(p(this,d).reconnectionTime),p(this,D)===h&&(p(this,d).lastEventId!==""&&p(this,G).headersList.set("last-event-id",p(this,d).lastEventId,!0),HA(this,F,ii).call(this)))},"#reconnect"),o(m,"EventSource");let k=m;const w={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:L,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:c,writable:!1}};return Object.defineProperties(k,w),Object.defineProperties(k.prototype,w),Object.defineProperties(k.prototype,{close:I,onerror:I,onmessage:I,onopen:I,readyState:I,url:I,withCredentials:I}),r.converters.EventSourceInitDict=r.dictionaryConverter([{key:"withCredentials",converter:r.converters.boolean,defaultValue:!1}]),ni={EventSource:k,defaultReconnectionTime:f},ni}o(Cl,"requireEventsource");const Il=_i,al=Ao,cl=Nc,hl=kA,Gs=aA,{InvalidArgumentError:Ts}=hl,bt=wt,{getGloba Line truncated
@@ -0,0 +1 @@
"use strict";var l=Object.defineProperty;var o=(e,t)=>l(e,"name",{value:t,configurable:!0});var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(getDefaultExportFromCjs,"getDefaultExportFromCjs"),exports.commonjsGlobal=commonjsGlobal,exports.getDefaultExportFromCjs=getDefaultExportFromCjs;
@@ -0,0 +1,41 @@
"use strict";var Dt=Object.defineProperty;var Ft=(e,A,t)=>A in e?Dt(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var o=(e,A)=>Dt(e,"name",{value:A,configurable:!0});var NA=(e,A,t)=>(Ft(e,typeof A!="symbol"?A+"":A,t),t),ze=(e,A,t)=>{if(!A.has(e))throw TypeError("Cannot "+t)},yt=(e,A)=>{if(Object(A)!==A)throw TypeError('Cannot use the "in" operator on this value');return e.has(A)},p=(e,A,t)=>(ze(e,A,"read from private field"),t?t.call(e):A.get(e)),CA=(e,A,t)=>{if(A.has(e))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(e):A.set(e,t)},EA=(e,A,t,n)=>(ze(e,A,"write to private field"),n?n.call(e,t):A.set(e,t),t);var kA=(e,A,t)=>(ze(e,A,"access private method"),t);var ne,se,oe,ie,Qe,Ee,ge,Be,Ce,Ie,ae,ce,he,le,ue,de,fe,De,ye,Re,we,ke,_A,Ne,Fe,pe,Se,Ue,be,me,Le,Me,Ye,Je,Oe,Rt,Ge,Ae,Te;const require$$0=require("node:assert"),require$$4=require("node:net"),http$1=require("node:http"),Stream=require("node:stream"),require$$6=require("node:buffer"),require$$0$1=require("node:util"),require$$8=require("node:querystring"),require$$0$2=require("node:diagnostics_channel"),require$$0$3=require("node:events"),_commonjsHelpers=require("./node-fetch-native-with-agent.61758d11.cjs"),require$$4$1=require("node:tls"),zlib=require("node:zlib"),require$$5=require("node:perf_hooks"),require$$8$1=require("node:util/types"),require$$0$4=require("node:os"),require$$1=require("node:url"),require$$5$1=require("node:async_hooks");require("node:console");const require$$5$2=require("string_decoder"),require$$2=require("node:worker_threads");function _interopDefaultCompat(e){return e&&typeof e=="object"&&"default"in e?e.default:e}o(_interopDefaultCompat,"_interopDefaultCompat");const require$$0__default=_interopDefaultCompat(require$$0),require$$4__default=_interopDefaultCompat(require$$4),http__default=_interopDefaultCompat(http$1),Stream__default=_interopDefaultCompat(Stream),require$$6__default=_interopDefaultCompat(require$$6),require$$0__default$1=_interopDefaultCompat(require$$0$1),require$$8__default=_interopDefaultCompat(require$$8),require$$0__default$2=_interopDefaultCompat(require$$0$2),require$$0__default$3=_interopDefaultCompat(require$$0$3),require$$4__default$1=_interopDefaultCompat(require$$4$1),zlib__default=_interopDefaultCompat(zlib),require$$5__default=_interopDefaultCompat(require$$5),require$$8__default$1=_interopDefaultCompat(require$$8$1),require$$0__default$4=_interopDefaultCompat(require$$0$4),require$$1__default=_interopDefaultCompat(require$$1),require$$5__default$1=_interopDefaultCompat(require$$5$1),require$$5__default$2=_interopDefaultCompat(require$$5$2),require$$2__default=_interopDefaultCompat(require$$2);var symbols$4={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams")};let UndiciError$1=(ne=class extends Error{constructor(A){super(A),this.name="UndiciError",this.code="UND_ERR"}},o(ne,"UndiciErrorLine truncated
`))}o(N,"isValidHeaderValue");function u(y,Y){const{headersList:W}=Y,j=(W.get("referrer-policy",!0)??"").split(",");let nA="";if(j.length>0)for(let R=j.length;R!==0;R--){const O=j[R-1].trim();if(n.has(O)){nA=O;break}}nA!==""&&(y.referrerPolicy=nA)}o(u,"setRequestReferrerPolicyOnRedirect");function b(){return"allowed"}o(b,"crossOriginResourcePolicyCheck");function m(){return"success"}o(m,"corsCheck");function T(){return"success"}o(T,"TAOCheck");function v(y){let Y=null;Y=y.mode,y.headersList.set("sec-fetch-mode",Y,!0)}o(v,"appendFetchMetadata");function Z(y){let Y=y.origin;if(y.responseTainting==="cors"||y.mode==="websocket")Y&&y.headersList.append("origin",Y,!0);else if(y.method!=="GET"&&y.method!=="HEAD"){switch(y.referrerPolicy){case"no-referrer":Y=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":y.origin&&ee(y.origin)&&!ee(D(y))&&(Y=null);break;case"same-origin":yA(y,D(y))||(Y=null);break}Y&&y.headersList.append("origin",Y,!0)}}o(Z,"appendRequestOriginHeader");function P(y,Y){return y}o(P,"coarsenTime");function AA(y,Y,W){return!y?.startTime||y.startTime<Y?{domainLookupStartTime:Y,domainLookupEndTime:Y,connectionStartTime:Y,connectionEndTime:Y,secureConnectionStartTime:Y,ALPNNegotiatedProtocol:y?.ALPNNegotiatedProtocol}:{domainLookupStartTime:P(y.domainLookupStartTime),domainLookupEndTime:P(y.domainLookupEndTime),connectionStartTime:P(y.connectionStartTime),connectionEndTime:P(y.connectionEndTime),secureConnectionStartTime:P(y.secureConnectionStartTime),ALPNNegotiatedProtocol:y.ALPNNegotiatedProtocol}}o(AA,"clampAndCoarsenConnectionTimingInfo");function K(y){return P(I.now())}o(K,"coarsenedSharedCurrentTime");function tA(y){return{startTime:y.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:y.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}o(tA,"createOpaqueTimingInfo");function aA(){return{referrerPolicy:"strict-origin-when-cross-origin"}}o(aA,"makePolicyContainer");function X(y){return{referrerPolicy:y.referrerPolicy}}o(X,"clonePolicyContainer");function $(y){const Y=y.referrerPolicy;L(Y);let W=null;if(y.referrer==="client"){const H=s();if(!H||H.origin==="null")return"no-referrer";W=new URL(H)}else y.referrer instanceof URL&&(W=y.referrer);let j=V(W);const nA=V(W,!0);j.toString().length>4096&&(j=nA);const R=yA(y,j),O=q(j)&&!q(y.url);switch(Y){case"origin":return nA??V(W,!0);case"unsafe-url":return j;case"same-origin":return R?nA:"no-referrer";case"origin-when-cross-origin":return R?j:nA;case"strict-origin-when-cross-origin":{const H=D(y);return yA(j,H)?j:q(j)&&!q(H)?"no-referrer":nA}case"strict-origin":case"no-referrer-when-downgrade":default:return O?"no-referrer":nA}}o($,"determineRequestsReferrer");function V(y,Y){return L(y instanceof URL),y=new URL(y),y.protocol==="file:"||y.protocol==="about:"||y.protocol==="blank:"?"no-referrer":(y.username="",y.password="",y.hash="",Y&&(y.pathname="",y.search=""),y)}o(V,"stripURLForReferrer");function q(y){if(!(y instanceof URL))return!1;if(y.href==="about:blank"||y.href==="about:srcdoc"||y.protocol==="data:"||y.protocol==="file:")return!0;return Y(y.origin);function Y(W){if(W==null||W==="null")return!1;const j=new URL(W);return!!(j.protocol==="https:"||j.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(j.hostname)||j.hostname==="localhost"||j.hostname.includes("localhost.")||j.hostname.endsWith(".localhost"))}}o(q,"isURLPotentiallyTrustworthy");function z(y,Y){if(k===void 0)return!0;const W=iA(Y);if(W==="no metadata"||W.length===0)return!0;const j=gA(W),nA=BA(W,j);for(const R of nA){const O=R.algo,H=R.hash;let J=k.createHash(O).update(y).digest("base64");if(J[J.length-1]==="="&&(J[J.length-2]==="="?J=J.slice(0,-2):J=J.slice(0,-1)),sA(J,H))return!0}return!1}o(z,"bytesMatch");const rA=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function iA(y){const Y=[];let W=!0;for(const j of y.split(" ")){W=!1;const nA=rA.exec(j);if(nA===null||nA.groups===void 0||nA.groups.algo===void 0)continue;const R=nA.groups.algo.toLowerCase();S.includes(R)&&Y.push(nA.groups)}return W===!0?"no metadata":Y}o(iA,"parseMetadata");function gA(y){let Y=y[0].algo;if(Y[3]==="5")return Y;for(let W=1;W<y.length;++W){const j=y[W];if(j.algo[3]==="5"){Y="sha512";break}else{if(Y[3]==="3")continue;j.algo[3]==="3"&&(Y="sha384")}}return Y}o(gA,"getStrongestMetadata");function BA(y,Y){if(y.length===1)return y;let W=0;for(let j=0;j<y.length;++j)y[j].algo===Y&&(y[W++]=y[j]);return y.length=W,y}o(BA,"filterMetadataListByAlgorithm");function sA(y,Y){if(y.length!==Y.length)return!1;for(let W=0;W<y.length;++W)if(y[W]!==Y[W]){if(y[W]==="+"&&Y[W]==="-"||y[W]==="/"&&Y[W]==="_")continue;return!1}return!0}o(sA,"compareBase64Mixed");function eA(y){}o(eA,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function yA(y,Y){retur Line truncated
`);function l(g){for(let d=0;d<g.length;++d)if(g.charCodeAt(d)&-128)return!1;return!0}o(l,"isAsciiString");function S(g){const d=g.length;if(d<27||d>70)return!1;for(let F=0;F<d;++F){const N=g.charCodeAt(F);if(!(N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||N===39||N===45||N===95))return!1}return!0}o(S,"validateBoundary");function k(g,d="utf-8",F=!1){return F?g=e(g):(C(A(g)),g=g.replace(/\r\n?|\r?\n/g,`\r
`)),C(Buffer.isEncoding(d)),g=g.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Buffer.from(g,d)}o(k,"escapeFormDataName");function w(g,d){C(d!=="failure"&&d.essence==="multipart/form-data");const F=d.parameters.get("boundary");if(F===void 0)return"failure";const N=Buffer.from(`--${F}`,"utf8"),u=[],b={position:0};for(g[0]===13&&g[1]===10&&(b.position+=2);;){if(g.subarray(b.position,b.position+N.length).equals(N))b.position+=N.length;else return"failure";if(b.position===g.length-2&&G(g,L,b)||b.position===g.length-4&&G(g,c,b))return u;if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;const m=U(g,b);if(m==="failure")return"failure";let{name:T,filename:v,contentType:Z,encoding:P}=m;b.position+=2;let AA;{const tA=g.indexOf(N.subarray(2),b.position);if(tA===-1)return"failure";AA=g.subarray(b.position,tA-4),b.position+=AA.length,P==="base64"&&(AA=Buffer.from(AA.toString(),"base64"))}if(g[b.position]!==13||g[b.position+1]!==10)return"failure";b.position+=2;let K;v!==null?(Z??(Z="text/plain"),l(Z)||(Z=""),K=new a([AA],v,{type:Z})):K=n(Buffer.from(AA)),C(A(T)),C(typeof K=="string"&&A(K)||i(K)),u.push(Q(T,K,v))}}o(w,"multipartFormDataParser");function U(g,d){let F=null,N=null,u=null,b=null;for(;;){if(g[d.position]===13&&g[d.position+1]===10)return F===null?"failure":{name:F,filename:N,contentType:u,encoding:b};let m=B(T=>T!==10&&T!==13&&T!==58,g,d);if(m=D(m,!0,!0,T=>T===9||T===32),!r.test(m.toString())||g[d.position]!==58)return"failure";switch(d.position++,B(T=>T===32||T===9,g,d),t(m)){case"content-disposition":{if(F=N=null,!G(g,f,d)||(d.position+=17,F=M(g,d),F===null))return"failure";if(G(g,h,d)){let T=d.position+h.length;if(g[T]===42&&(d.position+=1,T+=1),g[T]!==61||g[T+1]!==34||(d.position+=12,N=M(g,d),N===null))return"failure"}break}case"content-type":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),u=s(T);break}case"content-transfer-encoding":{let T=B(v=>v!==10&&v!==13,g,d);T=D(T,!1,!0,v=>v===9||v===32),b=s(T);break}default:B(T=>T!==10&&T!==13,g,d)}if(g[d.position]!==13&&g[d.position+1]!==10)return"failure";d.position+=2}}o(U,"parseMultipartFormDataHeaders");function M(g,d){C(g[d.position-1]===34);let F=B(N=>N!==10&&N!==13&&N!==34,g,d);return g[d.position]!==34?null:(d.position++,F=new TextDecoder().decode(F).replace(/%0A/ig,`
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),F)}o(M,"parseMultipartFormDataName");function B(g,d,F){let N=F.position;for(;N<d.length&&g(d[N]);)++N;return d.subarray(F.position,F.position=N)}o(B,"collectASequenceOfBytes");function D(g,d,F,N){let u=0,b=g.length-1;if(d)for(;u<g.length&&N(g[u]);)u++;if(F)for(;b>0&&N(g[b]);)b--;return u===0&&b===g.length-1?g:g.subarray(u,b+1)}o(D,"removeChars");function G(g,d,F){if(g.length<d.length)return!1;for(let N=0;N<d.length;N++)if(d[N]!==g[F.position+N])return!1;return!0}return o(G,"bufferStartsWith"),formdataParser={multipartFormDataParser:w,validateBoundary:S,escapeFormDataName:k},formdataParser}o(requireFormdataParser,"requireFormdataParser");var body,hasRequiredBody;function requireBody(){if(hasRequiredBody)return body;hasRequiredBody=1;const e=util$m,{ReadableStreamFrom:A,isBlobLike:t,isReadableStreamLike:n,readableStreamClose:r,createDeferredPromise:s,fullyReadBody:i,extractMimeType:E,utf8DecodeBytes:Q}=requireUtil$5(),{FormData:C}=requireFormdata(),{kState:I}=requireSymbols$3(),{webidl:a}=requireWebidl(),{Blob:f}=require$$6__default,h=require$$0__default,{isErrored:L}=util$m,{isArrayBuffer:c}=require$$8__default$1,{serializeAMimeType:l}=requireDataUrl(),{multipartFormDataParser:S}=requireFormdataParser(),k=new TextEncoder;function w(u,b=!1){let m=null;u instanceof ReadableStream?m=u:t(u)?m=u.stream():m=new ReadableStream({async pull(K){const tA=typeof v=="string"?k.encode(v):v;tA.byteLength&&K.enqueue(tA),queueMicrotask(()=>r(K))},start(){},type:"bytes"}),h(n(m));let T=null,v=null,Z=null,P=null;if(typeof u=="string")v=u,P="text/plain;charset=UTF-8";else if(u instanceof URLSearchParams)v=u.toString(),P="application/x-www-form-urlencoded;charset=UTF-8";else if(c(u))v=new Uint8Array(u.slice());else if(ArrayBuffer.isView(u))v=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength));else if(e.isFormDataLike(u)){const K=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`,tA=`--${K}\r
Content-Disposition: form-data`;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const aA=o(rA=>rA.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),X=o(rA=>rA.replace(/\r?\n|\r/g,`\r
`),"normalizeLinefeeds"),$=[],V=new Uint8Array([13,10]);Z=0;let q=!1;for(const[rA,iA]of u)if(typeof iA=="string"){const gA=k.encode(tA+`; name="${aA(X(rA))}"\r
\r
${X(iA)}\r
`);$.push(gA),Z+=gA.byteLength}else{const gA=k.encode(`${tA}; name="${aA(X(rA))}"`+(iA.name?`; filename="${aA(iA.name)}"`:"")+`\r
Content-Type: ${iA.type||"application/octet-stream"}\r
\r
`);$.push(gA,iA,V),typeof iA.size=="number"?Z+=gA.byteLength+iA.size+V.byteLength:q=!0}const z=k.encode(`--${K}--`);$.push(z),Z+=z.byteLength,q&&(Z=null),v=u,T=o(async function*(){for(const rA of $)rA.stream?yield*rA.stream():yield rA},"action"),P=`multipart/form-data; boundary=${K}`}else if(t(u))v=u,Z=u.size,u.type&&(P=u.type);else if(typeof u[Symbol.asyncIterator]=="function"){if(b)throw new TypeError("keepalive");if(e.isDisturbed(u)||u.locked)throw new TypeError("Response body object should not be disturbed or locked");m=u instanceof ReadableStream?u:A(u)}if((typeof v=="string"||e.isBuffer(v))&&(Z=Buffer.byteLength(v)),T!=null){let K;m=new ReadableStream({async start(){K=T(u)[Symbol.asyncIterator]()},async pull(tA){const{value:aA,done:X}=await K.next();if(X)queueMicrotask(()=>{tA.close(),tA.byobRequest?.respond(0)});else if(!L(m)){const $=new Uint8Array(aA);$.byteLength&&tA.enqueue($)}return tA.desiredSize>0},async cancel(tA){await K.return()},type:"bytes"})}return[{stream:m,source:v,length:Z},P]}o(w,"extractBody");function U(u,b=!1){return u instanceof ReadableStream&&(h(!e.isDisturbed(u),"The body has already been consumed."),h(!u.locked,"The stream is locked.")),w(u,b)}o(U,"safelyExtractBody");function M(u){const[b,m]=u.stream.tee();return u.stream=b,{stream:m,length:u.length,source:u.source}}o(M,"cloneBody");function B(u){if(u.aborted)throw new DOMException("The operation was aborted.","AbortError")}o(B,"throwIfAborted");function D(u){return{blob(){return g(this,m=>{let T=N(this);return T===null?T="":T&&(T=l(T)),new f([m],{type:T})},u)},arrayBuffer(){return g(this,m=>new Uint8Array(m).buffer,u)},text(){return g(this,Q,u)},json(){return g(this,F,u)},formData(){return g(this,m=>{const T=N(this);if(T!==null)switch(T.essence){case"multipart/form-data":{const v=S(m,T);if(v==="failure")throw new TypeError("Failed to parse body as FormData.");const Z=new C;return Z[I]=v,Z}case"application/x-www-form-urlencoded":{const v=new URLSearchParams(m.toString()),Z=new C;for(const[P,AA]of v)Z.append(P,AA);return Z}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},u)}}}o(D,"bodyMixinMethods");function G(u){Object.assign(u.prototype,D(u))}o(G,"mixinBody");async function g(u,b,m){if(a.brandCheck(u,m),B(u[I]),d(u[I].body))throw new TypeError("Body is unusable");const T=s(),v=o(P=>T.reject(P),"errorSteps"),Z=o(P=>{try{T.resolve(b(P))}catch(AA){v(AA)}},"successSteps");return u[I].body==null?(Z(new Uint8Array),T.promise):(await i(u[I].body,Z,v),T.promise)}o(g,"consumeBody");function d(u){return u!=null&&(u.stream.locked||e.isDisturbed(u.stream))}o(d,"bodyUnusable");function F(u){return JSON.parse(Q(u))}o(F,"parseJSONFromBytes");function N(u){const b=u[I].headersList,m=E(b);return m==="failure"?null:m}return o(N,"bodyMimeType"),body={extractBody:w,safelyExtractBody:U,cloneBody:M,mixinBody:G},body}o(requireBody,"requireBody");const assert$a=require$$0__default,util$i=util$m,{channels:channels$1}=diagnostics,timers=timers$1,{RequestContentLengthMismatchError:RequestContentLengthMismatchError$1,ResponseContentLengthMismatchError,RequestAbortedError:RequestAbortedError$5,HeadersTimeoutError,HeadersOverflowError,SocketError:SocketError$3,InformationalError:InformationalError$2,BodyTimeoutError,HTTPParserError,ResponseExceededMaxSizeError}=errors$1,{kUrl:kUrl$4,kReset:kReset$1,kClient:kClient$3,kParser,kBlocking,kRunning:kRunning$5,kPending:kPending$4,kSize:kSize$4,kWriting,kQueue:kQueue$3,kNoRef,kKeepAliveDefaultTimeout:kKeepAliveDefaultTimeout$1,kHostHeader:kHostHeader$1,kPendingIdx:kPendingIdx$2,kRunningIdx:kRunningIdx$2,kError:kError$2,kPipelining:kPipelining$1,kSocket:kSocket$1,kKeepAliveTimeoutValue:kKeepAliveTimeoutValue$1,kMaxHeadersSize:kMaxHeadersSize$1,kKeepAliveMaxTimeout:kKeepAliveMaxTimeout$1,kKeepAliveTimeoutThreshold:kKeepAliveTimeoutThreshold$1,kHeadersTimeout:kHeadersTimeout$1,kBodyTimeout:kBodyTimeout$1,kStrictContentLength:kStrictContentLength$2,kMaxRequests:kMaxRequests$1,kCounter:kCounter$1,kMaxResponseSize:kMaxResponseSize$1,kOnError:kOnError$2,kResume:kResume$3,kHTTPContext:kHTTPContext$1}=symbols$4,constants$2=constants$4,EMPTY_BUF=Buffer.alloc(0),FastBuffer=Buffer[Symbol.species],addListener=util$i.addListener,removeAllListeners=util$i.removeAllListeners;let extractBody;async function lazyllhttp(){const e=process.env.JEST_WORKER_ID?requireLlhttpWasm():void 0;let A;try{A=await WebAssembly.compile(requireLlhttp_simdWasm())}catch{A=await WebAssembly.compile(e||requireLlhttpWasm())}return await WebAssembly.instantiate(A,{env:{wasm_on_url:(t,n,r)=>0,wasm_on_status:(t,n,r)=>{assert$a.strictEqual(currentParser.ptr,t);const s=n-currentBufferPtr+currentBufferRef.byteOffset;return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer,s,r))||0},wasm_on_message_begin:t=>(assert$a.strictEqual(currentParser.ptr,t),currentParser.onMessageBegin()||0),wasm_on_header_field:(t,n,r)=>{assert$a.strictEqual(currentParser.ptr,t);const s=n-currentBufferPtr Line truncated
`;if(typeof r=="string"?c+=`host: ${r}\r
`:c+=e[kHostHeader$1],s?c+=`connection: upgrade\r
upgrade: ${s}\r
`:e[kPipelining$1]&&!h[kReset$1]?c+=`connection: keep-alive\r
`:c+=`connection: close\r
`,Array.isArray(C))for(let l=0;l<C.length;l+=2){const S=C[l+0],k=C[l+1];if(Array.isArray(k))for(let w=0;w<k.length;w++)c+=`${S}: ${k[w]}\r
`;else c+=`${S}: ${k}\r
`}return channels$1.sendHeaders.hasSubscribers&&channels$1.sendHeaders.publish({request:A,headers:c,socket:h}),!Q||f===0?writeBuffer({abort:L,body:null,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isBuffer(Q)?writeBuffer({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isBlobLike(Q)?typeof Q.stream=="function"?writeIterable$1({abort:L,body:Q.stream(),client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):writeBlob$1({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isStream(Q)?writeStream$1({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):util$i.isIterable(Q)?writeIterable$1({abort:L,body:Q,client:e,request:A,socket:h,contentLength:I,header:c,expectsPayload:a}):assert$a(!1),!0}o(writeH1,"writeH1");function writeStream$1({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){assert$a(s!==0||t[kRunning$5]===0,"stream body cannot be pipelined");let Q=!1;const C=new AsyncWriter({abort:e,socket:r,request:n,contentLength:s,client:t,expectsPayload:E,header:i}),I=o(function(L){if(!Q)try{!C.write(L)&&this.pause&&this.pause()}catch(c){util$i.destroy(this,c)}},"onData"),a=o(function(){Q||A.resume&&A.resume()},"onDrain"),f=o(function(){if(queueMicrotask(()=>{A.removeListener("error",h)}),!Q){const L=new RequestAbortedError$5;queueMicrotask(()=>h(L))}},"onClose"),h=o(function(L){if(!Q){if(Q=!0,assert$a(r.destroyed||r[kWriting]&&t[kRunning$5]<=1),r.off("drain",a).off("error",h),A.removeListener("data",I).removeListener("end",h).removeListener("close",f),!L)try{C.end()}catch(c){L=c}C.destroy(L),L&&(L.code!=="UND_ERR_INFO"||L.message!=="reset")?util$i.destroy(A,L):util$i.destroy(A)}},"onFinished");A.on("data",I).on("end",h).on("error",h).on("close",f),A.resume&&A.resume(),r.on("drain",a).on("error",h),A.errorEmitted??A.errored?setImmediate(()=>h(A.errored)):(A.endEmitted??A.readableEnded)&&setImmediate(()=>h(null)),(A.closeEmitted??A.closed)&&setImmediate(f)}o(writeStream$1,"writeStream$1");async function writeBuffer({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){try{A?util$i.isBuffer(A)&&(assert$a(s===A.byteLength,"buffer body must have content length"),r.cork(),r.write(`${i}content-length: ${s}\r
\r
`,"latin1"),r.write(A),r.uncork(),n.onBodySent(A),E||(r[kReset$1]=!0)):s===0?r.write(`${i}content-length: 0\r
\r
`,"latin1"):(assert$a(s===null,"no body must not have content length"),r.write(`${i}\r
`,"latin1")),n.onRequestSent(),t[kResume$3]()}catch(Q){e(Q)}}o(writeBuffer,"writeBuffer");async function writeBlob$1({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){assert$a(s===A.size,"blob body must have content length");try{if(s!=null&&s!==A.size)throw new RequestContentLengthMismatchError$1;const Q=Buffer.from(await A.arrayBuffer());r.cork(),r.write(`${i}content-length: ${s}\r
\r
`,"latin1"),r.write(Q),r.uncork(),n.onBodySent(Q),n.onRequestSent(),E||(r[kReset$1]=!0),t[kResume$3]()}catch(Q){e(Q)}}o(writeBlob$1,"writeBlob$1");async function writeIterable$1({abort:e,body:A,client:t,request:n,socket:r,contentLength:s,header:i,expectsPayload:E}){assert$a(s!==0||t[kRunning$5]===0,"iterator body cannot be pipelined");let Q=null;function C(){if(Q){const f=Q;Q=null,f()}}o(C,"onDrain");const I=o(()=>new Promise((f,h)=>{assert$a(Q===null),r[kError$2]?h(r[kError$2]):Q=f}),"waitForDrain");r.on("close",C).on("drain",C);const a=new AsyncWriter({abort:e,socket:r,request:n,contentLength:s,client:t,expectsPayload:E,header:i});try{for await(const f of A){if(r[kError$2])throw r[kError$2];a.write(f)||await I()}a.end()}catch(f){a.destroy(f)}finally{r.off("close",C).off("drain",C)}}o(writeIterable$1,"writeIterable$1");const ot=class ot{constructor({abort:A,socket:t,request:n,contentLength:r,client:s,expectsPayload:i,header:E}){this.socket=t,this.request=n,this.contentLength=r,this.client=s,this.bytesWritten=0,this.expectsPayload=i,this.header=E,this.abort=A,t[kWriting]=!0}write(A){const{socket:t,request:n,contentLength:r,client:s,bytesWritten:i,expectsPayload:E,header:Q}=this;if(t[kError$2])throw t[kError$2];if(t.destroyed)return!1;const C=Buffer.byteLength(A);if(!C)return!0;if(r!==null&&i+C>r){if(s[kStrictContentLength$2])throw new RequestContentLengthMismatchError$1;process.emitWarning(new RequestContentLengthMismatchError$1)}t.cork(),i===0&&(E||(t[kReset$1]=!0),r===null?t.write(`${Q}transfer-encoding: chunked\r
`,"latin1"):t.write(`${Q}content-length: ${r}\r
\r
`,"latin1")),r===null&&t.write(`\r
${C.toString(16)}\r
`,"latin1"),this.bytesWritten+=C;const I=t.write(A);return t.uncork(),n.onBodySent(A),I||t[kParser].timeout&&t[kParser].timeoutType===TIMEOUT_HEADERS&&t[kParser].timeout.refresh&&t[kParser].timeout.refresh(),I}end(){const{socket:A,contentLength:t,client:n,bytesWritten:r,expectsPayload:s,header:i,request:E}=this;if(E.onRequestSent(),A[kWriting]=!1,A[kError$2])throw A[kError$2];if(!A.destroyed){if(r===0?s?A.write(`${i}content-length: 0\r
\r
`,"latin1"):A.write(`${i}\r
`,"latin1"):t===null&&A.write(`\r
0\r
\r
`,"latin1"),t!==null&&r!==t){if(n[kStrictContentLength$2])throw new RequestContentLengthMismatchError$1;process.emitWarning(new RequestContentLengthMismatchError$1)}A[kParser].timeout&&A[kParser].timeoutType===TIMEOUT_HEADERS&&A[kParser].timeout.refresh&&A[kParser].timeout.refresh(),n[kResume$3]()}}destroy(A){const{socket:t,client:n,abort:r}=this;t[kWriting]=!1,A&&(assert$a(n[kRunning$5]<=1,"pipeline should only contain this request"),r(A))}};o(ot,"AsyncWriter");let AsyncWriter=ot;var clientH1=connectH1$1;const assert$9=require$$0__default,{pipeline:pipeline$1}=Stream__default,util$h=util$m,{RequestContentLengthMismatchError,RequestAbortedError:RequestAbortedError$4,SocketError:SocketError$2,InformationalError:InformationalError$1}=errors$1,{kUrl:kUrl$3,kReset,kClient:kClient$2,kRunning:kRunning$4,kPending:kPending$3,kQueue:kQueue$2,kPendingIdx:kPendingIdx$1,kRunningIdx:kRunningIdx$1,kError:kError$1,kSocket,kStrictContentLength:kStrictContentLength$1,kOnError:kOnError$1,kMaxConcurrentStreams:kMaxConcurrentStreams$1,kHTTP2Session,kResume:kResume$2}=symbols$4,kOpenStreams=Symbol("open streams");let h2ExperimentalWarned=!1,http2;try{http2=require("node:http2")}catch{http2={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY,HTTP2_HEADER_METHOD,HTTP2_HEADER_PATH,HTTP2_HEADER_SCHEME,HTTP2_HEADER_CONTENT_LENGTH,HTTP2_HEADER_EXPECT,HTTP2_HEADER_STATUS}}=http2;function parseH2Headers(e){const A=[];for(const[t,n]of Object.entries(e))if(Array.isArray(n))for(const r of n)A.push(Buffer.from(t),Buffer.from(r));else A.push(Buffer.from(t),Buffer.from(n));return A}o(parseH2Headers,"parseH2Headers");async function connectH2$1(e,A){e[kSocket]=A,h2ExperimentalWarned||(h2ExperimentalWarned=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));const t=http2.connect(e[kUrl$3],{createConnection:()=>A,peerMaxConcurrentStreams:e[kMaxConcurrentStreams$1]});t[kOpenStreams]=0,t[kClient$2]=e,t[kSocket]=A,util$h.addListener(t,"error",onHttp2SessionError),util$h.addListener(t,"frameError",onHttp2FrameError),util$h.addListener(t,"end",onHttp2SessionEnd),util$h.addListener(t,"goaway",onHTTP2GoAway),util$h.addListener(t,"close",function(){const{[kClient$2]:r}=this,s=this[kSocket][kError$1]||new SocketError$2("closed",util$h.getSocketInfo(this));r[kSocket]=null,r[kHTTP2Session]=null,assert$9(r[kPending$3]===0);const i=r[kQueue$2].splice(r[kRunningIdx$1]);for(let E=0;E<i.length;E++){const Q=i[E];util$h.errorRequest(r,Q,s)}r[kPendingIdx$1]=r[kRunningIdx$1],assert$9(r[kRunning$4]===0),r.emit("disconnect",r[kUrl$3],[r],s),r[kResume$2]()}),t.unref(),e[kHTTP2Session]=t,A[kHTTP2Session]=t,util$h.addListener(A,"error",function(r){assert$9(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[kError$1]=r,this[kClient$2][kOnError$1](r)}),util$h.addListener(A,"end",function(){util$h.destroy(this,new SocketError$2("other side closed",util$h.getSocketInfo(this)))});let n=!1;return A.on("close",()=>{n=!0}),{version:"h2",defaultPipelining:1/0,write(...r){writeH2(e,...r)},resume(){},destroy(r,s){t.destroy(r),n?queueMicrotask(s):A.destroy(r).on("close",s)},get destroyed(){return A.destroyed},busy(){return!1}}}o(connectH2$1,"connectH2$1");function onHttp2SessionError(e){assert$9(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[kSocket][kError$1]=e,this[kClient$2][kOnError$1](e)}o(onHttp2SessionError,"onHttp2SessionError");function onHttp2FrameError(e,A,t){if(t===0){const n=new InformationalError$1(`HTTP/2: "frameError" received - type ${e}, code ${A}`);this[kSocket][kError$1]=n,this[kClient$2][kOnError$1](n)}}o(onHttp2FrameError,"onHttp2FrameError");function onHttp2SessionEnd(){const e=new SocketError$2("other side closed",util$h.getSocketInfo(this[kSocket]));this.destroy(e),util$h.destroy(this[kSocket],e)}o(onHttp2SessionEnd,"onHttp2SessionEnd");function onHTTP2GoAway(e){const A=new InformationalError$1(`HTTP/2: "GOAWAY" frame received with code ${e}`);this[kSocket][kError$1]=A,this[kClient$2][kOnError$1](A),this.unref(),this.destroy(),util$h.destroy(this[kSocket],A)}o(onHTTP2GoAway,"onHTTP2GoAway");function shouldSendContentLength(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}o(shouldSendContentLength,"shouldSendContentLength");function writeH2(e,A){const t=e[kHTTP2Session],{body:n,method:r,path:s,host:i,upgrade:E,expectContinue:Q,signal:C,headers:I}=A;if(E)return util$h.errorRequest(e,A,new Error("Upgrade not supported for H2")),!1;if(A.aborted)return!1;const a={};for(let w=0;w<I.length;w+=2){const U=I[w+0],M=I[w+1];if(Array.isArray(M))for(let B=0;B<M.length;B++)a[U]?a[U]+=`,${M[B]}`:a[U]=M[B];else a[U]=M}let f;const{hostname:h,port:L}=e[kUrl$3];a[HTTP2_HEADER_AUTHORITY]=i||`${h}${L?`:${L}`:""}`,a[HTTP2_HEADER_METHOD]=r;try{A.onConnect(w=>{A.aborted||A.completed||(w=w||new RequestAbortedError$4,f!=null&&(util$h.destroy(f,w),t[kOpenStreams]-=1,t[kOpenStreams]===0&&t.unref()),util$h.errorRequest(e,A,w))})}catch(w){util$h.errorRequest(e,A,w)}if(r==="CONNECT")return t.ref(),f=t.request Line truncated
`,this[kBodyTimeout]=Q??3e5,this[kHeadersTimeout]=r??3e5,this[kStrictContentLength]=k??!0,this[kMaxRedirections$1]=U,this[kMaxRequests]=B,this[kClosedResolve$1]=null,this[kMaxResponseSize]=G>-1?G:-1,this[kMaxConcurrentStreams]=F??100,this[kHTTPContext]=null,this[kQueue$1]=[],this[kRunningIdx]=0,this[kPendingIdx]=0,this[kResume$1]=u=>resume(this,u),this[kOnError]=u=>onError(this,u)}get pipelining(){return this[kPipelining]}set pipelining(A){this[kPipelining]=A,this[kResume$1](!0)}get[kPending$2](){return this[kQueue$1].length-this[kPendingIdx]}get[kRunning$3](){return this[kPendingIdx]-this[kRunningIdx]}get[kSize$3](){return this[kQueue$1].length-this[kRunningIdx]}get[kConnected$4](){return!!this[kHTTPContext]&&!this[kConnecting]&&!this[kHTTPContext].destroyed}get[kBusy$1](){return!!(this[kHTTPContext]?.busy(null)||this[kSize$3]>=(getPipelining(this)||1)||this[kPending$2]>0)}[kConnect](A){connect$1(this),this.once("connect",A)}[kDispatch$2](A,t){const n=A.origin||this[kUrl$2].origin,r=new Request(n,A,t);return this[kQueue$1].push(r),this[kResuming]||(util$f.bodyLength(r.body)==null&&util$f.isIterable(r.body)?(this[kResuming]=1,queueMicrotask(()=>resume(this))):this[kResume$1](!0)),this[kResuming]&&this[kNeedDrain$2]!==2&&this[kBusy$1]&&(this[kNeedDrain$2]=2),this[kNeedDrain$2]<2}async[kClose$5](){return new Promise(A=>{this[kSize$3]?this[kClosedResolve$1]=A:A(null)})}async[kDestroy$3](A){return new Promise(t=>{const n=this[kQueue$1].splice(this[kPendingIdx]);for(let s=0;s<n.length;s++){const i=n[s];util$f.errorRequest(this,i,A)}const r=o(()=>{this[kClosedResolve$1]&&(this[kClosedResolve$1](),this[kClosedResolve$1]=null),t(null)},"callback");this[kHTTPContext]?(this[kHTTPContext].destroy(A,r),this[kHTTPContext]=null):queueMicrotask(r),this[kResume$1]()})}},o(be,"Client"),be);const createRedirectInterceptor$1=redirectInterceptor;function onError(e,A){if(e[kRunning$3]===0&&A.code!=="UND_ERR_INFO"&&A.code!=="UND_ERR_SOCKET"){assert$7(e[kPendingIdx]===e[kRunningIdx]);const t=e[kQueue$1].splice(e[kRunningIdx]);for(let n=0;n<t.length;n++){const r=t[n];util$f.errorRequest(e,r,A)}assert$7(e[kSize$3]===0)}}o(onError,"onError");async function connect$1(e){assert$7(!e[kConnecting]),assert$7(!e[kHTTPContext]);let{host:A,hostname:t,protocol:n,port:r}=e[kUrl$2];if(t[0]==="["){const s=t.indexOf("]");assert$7(s!==-1);const i=t.substring(1,s);assert$7(net.isIP(i)),t=i}e[kConnecting]=!0,channels.beforeConnect.hasSubscribers&&channels.beforeConnect.publish({connectParams:{host:A,hostname:t,protocol:n,port:r,version:e[kHTTPContext]?.version,servername:e[kServerName],localAddress:e[kLocalAddress]},connector:e[kConnector]});try{const s=await new Promise((i,E)=>{e[kConnector]({host:A,hostname:t,protocol:n,port:r,servername:e[kServerName],localAddress:e[kLocalAddress]},(Q,C)=>{Q?E(Q):i(C)})});if(e.destroyed){util$f.destroy(s.on("error",()=>{}),new ClientDestroyedError);return}assert$7(s);try{e[kHTTPContext]=s.alpnProtocol==="h2"?await connectH2(e,s):await connectH1(e,s)}catch(i){throw s.destroy().on("error",()=>{}),i}e[kConnecting]=!1,s[kCounter]=0,s[kMaxRequests]=e[kMaxRequests],s[kClient$1]=e,s[kError]=null,channels.connected.hasSubscribers&&channels.connected.publish({connectParams:{host:A,hostname:t,protocol:n,port:r,version:e[kHTTPContext]?.version,servername:e[kServerName],localAddress:e[kLocalAddress]},connector:e[kConnector],socket:s}),e.emit("connect",e[kUrl$2],[e])}catch(s){if(e.destroyed)return;if(e[kConnecting]=!1,channels.connectError.hasSubscribers&&channels.connectError.publish({connectParams:{host:A,hostname:t,protocol:n,port:r,version:e[kHTTPContext]?.version,servername:e[kServerName],localAddress:e[kLocalAddress]},connector:e[kConnector],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(assert$7(e[kRunning$3]===0);e[kPending$2]>0&&e[kQueue$1][e[kPendingIdx]].servername===e[kServerName];){const i=e[kQueue$1][e[kPendingIdx]++];util$f.errorRequest(e,i,s)}else onError(e,s);e.emit("connectionError",e[kUrl$2],[e],s)}e[kResume$1]()}o(connect$1,"connect$1");function emitDrain(e){e[kNeedDrain$2]=0,e.emit("drain",e[kUrl$2],[e])}o(emitDrain,"emitDrain");function resume(e,A){e[kResuming]!==2&&(e[kResuming]=2,_resume(e,A),e[kResuming]=0,e[kRunningIdx]>256&&(e[kQueue$1].splice(0,e[kRunningIdx]),e[kPendingIdx]-=e[kRunningIdx],e[kRunningIdx]=0))}o(resume,"resume");function _resume(e,A){for(;;){if(e.destroyed){assert$7(e[kPending$2]===0);return}if(e[kClosedResolve$1]&&!e[kSize$3]){e[kClosedResolve$1](),e[kClosedResolve$1]=null;return}if(e[kHTTPContext]&&e[kHTTPContext].resume(),e[kBusy$1])e[kNeedDrain$2]=2;else if(e[kNeedDrain$2]===2){A?(e[kNeedDrain$2]=1,queueMicrotask(()=>emitDrain(e))):emitDrain(e);continue}if(e[kPending$2]===0||e[kRunning$3]>=(getPipelining(e)||1))return;const t=e[kQueue$1][e[kPendingIdx]];if(e[kUrl$2].protocol==="https:"&&e[kServerName]!==t.servername){if(e[kRunning$3]>0)return;e[kServerName]=t.servername,e[kHTTPContext]?.destroy(new InformationalError("servername changed"),()=>{e[kHTTPContext]=null,resum Line truncated
${l}`;break;case"retry":A(l)&&(h[c]=l);break;case"id":t(l)&&(h[c]=l);break;case"event":l.length>0&&(h[c]=l);break}}processEvent(f){f.retry&&A(f.retry)&&(this.state.reconnectionTime=parseInt(f.retry,10)),f.id&&t(f.id)&&(this.state.lastEventId=f.id),f.data!==void 0&&this.push({type:f.event||"message",options:{data:f.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};o(C,"EventSourceStream");let Q=C;return eventsourceStream={EventSourceStream:Q},eventsourceStream}o(requireEventsourceStream,"requireEventsourceStream");var eventsource,hasRequiredEventsource;function requireEventsource(){var U,M,B,D,G,g,d,F,$e,u,_e;if(hasRequiredEventsource)return eventsource;hasRequiredEventsource=1;const{pipeline:e}=Stream__default,{fetching:A}=requireFetch(),{makeRequest:t}=requireRequest(),{getGlobalOrigin:n}=requireGlobal(),{webidl:r}=requireWebidl(),{EventSourceStream:s}=requireEventsourceStream(),{parseMIMEType:i}=requireDataUrl(),{MessageEvent:E}=requireEvents(),{isNetworkError:Q}=requireResponse(),{delay:C}=requireUtil(),{kEnumerableProperty:I}=util$m;let a=!1;const f=3e3,h=0,L=1,c=2,l="anonymous",S="use-credentials",m=class m extends EventTarget{constructor(Z,P={}){super();CA(this,F);CA(this,u);CA(this,U,{open:null,error:null,message:null});CA(this,M,null);CA(this,B,!1);CA(this,D,h);CA(this,G,null);CA(this,g,null);CA(this,d,null);r.argumentLengthCheck(arguments,1,{header:"EventSource constructor"}),a||(a=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),Z=r.converters.USVString(Z),P=r.converters.EventSourceInitDict(P),EA(this,d,{origin:n(),policyContainer:{referrerPolicy:"no-referrer"},lastEventId:"",reconnectionTime:f});let AA;try{AA=new URL(Z,p(this,d).origin),p(this,d).origin=AA.origin}catch(aA){throw new DOMException(aA,"SyntaxError")}EA(this,M,AA.href);let K=l;P.withCredentials&&(K=S,EA(this,B,!0));const tA={redirect:"follow",keepalive:!0,mode:"cors",credentials:K==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};tA.client=p(this,d),tA.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],tA.cache="no-store",tA.initiator="other",tA.urlList=[new URL(p(this,M))],EA(this,G,t(tA)),kA(this,F,$e).call(this)}get readyState(){return p(this,D)}get url(){return p(this,M)}get withCredentials(){return p(this,B)}close(){r.brandCheck(this,m),p(this,D)!==c&&(EA(this,D,c),clearTimeout(p(this,d).reconnectionTimer),p(this,g).abort(),p(this,G)&&EA(this,G,null))}get onopen(){return p(this,U).open}set onopen(Z){p(this,U).open&&this.removeEventListener("open",p(this,U).open),typeof Z=="function"?(p(this,U).open=Z,this.addEventListener("open",Z)):p(this,U).open=null}get onmessage(){return p(this,U).message}set onmessage(Z){p(this,U).message&&this.removeEventListener("message",p(this,U).message),typeof Z=="function"?(p(this,U).message=Z,this.addEventListener("message",Z)):p(this,U).message=null}get onerror(){return p(this,U).error}set onerror(Z){p(this,U).error&&this.removeEventListener("error",p(this,U).error),typeof Z=="function"?(p(this,U).error=Z,this.addEventListener("error",Z)):p(this,U).error=null}};U=new WeakMap,M=new WeakMap,B=new WeakMap,D=new WeakMap,G=new WeakMap,g=new WeakMap,d=new WeakMap,F=new WeakSet,$e=o(function(){if(p(this,D)===c)return;EA(this,D,h);const Z={request:p(this,G)},P=o(AA=>{Q(AA)&&(this.dispatchEvent(new Event("error")),this.close()),kA(this,u,_e).call(this)},"processEventSourceEndOfBody");Z.processResponseEndOfBody=P,Z.processResponse=AA=>{if(Q(AA))if(AA.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{kA(this,u,_e).call(this);return}const K=AA.headersList.get("content-type",!0),tA=K!==null?i(K):"failure",aA=tA!=="failure"&&tA.essence==="text/event-stream";if(AA.status!==200||aA===!1){this.close(),this.dispatchEvent(new Event("error"));return}EA(this,D,L),this.dispatchEvent(new Event("open")),p(this,d).origin=AA.urlList[AA.urlList.length-1].origin;const X=new s({eventSourceSettings:p(this,d),push:$=>{this.dispatchEvent(new E($.type,$.options))}});e(AA.body.stream,X,$=>{$?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},EA(this,g,A(Z))},"#connect"),u=new WeakSet,_e=o(async function(){p(this,D)!==c&&(EA(this,D,h),this.dispatchEvent(new Event("error")),await C(p(this,d).reconnectionTime),p(this,D)===h&&(p(this,d).lastEventId!==""&&p(this,G).headersList.set("last-event-id",p(this,d).lastEventId,!0),kA(this,F,$e).call(this)))},"#reconnect"),o(m,"EventSource");let k=m;const w={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:L,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:c,writable:!1}};return Object.defineProperties(k,w),Object.defineProperties(k.prototype,w),Object.defineProperties(k.prototype,{close:I,onerror:I,onmessage:I,onopen:I,readyState:I,url:I,withCredentials:I}),r.converte Line truncated