From 59d4cef3d82587d2516196cf40bdec48e1644af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Tue, 2 Apr 2024 12:01:24 +0200 Subject: [PATCH] fix --- dist/setup/index.js | 2 +- src/action.ts | 2 -- src/index.ts | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 19c2dd8..1693c3b 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -197,7 +197,7 @@ ${c.toString(16)}\r ${r.count} ${r.noun} ${r.is} pending: ${e.format(t)} -`.trim())}};sle.exports=oF});var ple=E((boA,dle)=>{"use strict";var{kProxy:gze,kClose:hze,kDestroy:Eze,kInterceptors:Cze}=lt(),{URL:ale}=require("url"),ole=wm(),Qze=Sh(),mze=dm(),{InvalidArgumentError:Rm,RequestAbortedError:Bze}=WA(),cle=pm(),Dm=Symbol("proxy agent"),Hw=Symbol("proxy client"),Gw=Symbol("proxy headers"),cF=Symbol("request tls settings"),Ize=Symbol("proxy tls settings"),lle=Symbol("connect endpoint function");function fze(A){return A==="https:"?443:80}function yze(A){if(typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new Rm("Proxy opts.uri is mandatory");return{uri:A.uri,protocol:A.protocol||"https"}}function wze(A,e){return new Qze(A,e)}var lF=class extends mze{constructor(e){if(super(e),this[gze]=yze(e),this[Dm]=new ole(e),this[Cze]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new Rm("Proxy opts.uri is mandatory");let{clientFactory:t=wze}=e;if(typeof t!="function")throw new Rm("Proxy opts.clientFactory must be a function.");if(this[cF]=e.requestTls,this[Ize]=e.proxyTls,this[Gw]=e.headers||{},e.auth&&e.token)throw new Rm("opts.auth cannot be used in combination with opts.token");e.auth?this[Gw]["proxy-authorization"]=`Basic ${e.auth}`:e.token&&(this[Gw]["proxy-authorization"]=e.token);let r=new ale(e.uri),{origin:i,port:s,host:n}=r,a=cle({...e.proxyTls});this[lle]=cle({...e.requestTls}),this[Hw]=t(r,{connect:a}),this[Dm]=new ole({...e,connect:async(o,c)=>{let l=o.host;o.port||(l+=`:${fze(o.protocol)}`);try{let{socket:d,statusCode:p}=await this[Hw].connect({origin:i,port:s,path:l,signal:o.signal,headers:{...this[Gw],host:n}});if(p!==200&&(d.on("error",()=>{}).destroy(),c(new Bze("Proxy response !== 200 when HTTP Tunneling"))),o.protocol!=="https:"){c(null,d);return}let u;this[cF]?u=this[cF].servername:u=o.servername,this[lle]({...o,servername:u,httpSocket:d},c)}catch(d){c(d)}}})}dispatch(e,t){let{host:r}=new ale(e.origin),i=bze(e.headers);return Nze(i),this[Dm].dispatch({...e,headers:{...i,host:r}},t)}async[hze](){await this[Dm].close(),await this[Hw].close()}async[Eze](){await this[Dm].destroy(),await this[Hw].destroy()}};function bze(A){if(Array.isArray(A)){let e={};for(let t=0;tt.toLowerCase()==="proxy-authorization"))throw new Rm("Proxy-Authorization should be sent in ProxyAgent constructor")}dle.exports=lF});var qh=E((NoA,Ele)=>{"use strict";var ule=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Dze}=WA(),Rze=wm();hle()===void 0&&gle(new Rze);function gle(A){if(!A||typeof A.dispatch!="function")throw new Dze("Argument agent must implement Agent");Object.defineProperty(globalThis,ule,{value:A,writable:!0,enumerable:!1,configurable:!1})}function hle(){return globalThis[ule]}Ele.exports={setGlobalDispatcher:gle,getGlobalDispatcher:hle}});var Qle=E((RoA,Cle)=>{"use strict";Cle.exports=class{constructor(e){this.handler=e}onConnect(...e){return this.handler.onConnect(...e)}onError(...e){return this.handler.onError(...e)}onUpgrade(...e){return this.handler.onUpgrade(...e)}onHeaders(...e){return this.handler.onHeaders(...e)}onData(...e){return this.handler.onData(...e)}onComplete(...e){return this.handler.onComplete(...e)}onBodySent(...e){return this.handler.onBodySent(...e)}}});var pp=E((xoA,fle)=>{"use strict";var{kHeadersList:$i}=lt(),{kGuard:dp}=Xo(),{kEnumerableProperty:Xa}=aA(),{makeIterator:dF,isValidHeaderName:xm,isValidHeaderValue:mle}=In(),{webidl:Ve}=fi(),xze=require("assert"),es=Symbol("headers map"),As=Symbol("headers map sorted");function Ble(A){let e=A.length;for(;/[\r\n\t ]/.test(A.charAt(--e)););return A.slice(0,e+1).replace(/^[\r\n\t ]+/,"")}function Ile(A,e){if(Array.isArray(e))for(let t of e){if(t.length!==2)throw Ve.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${t.length}.`});A.append(t[0],t[1])}else if(typeof e=="object"&&e!==null)for(let[t,r]of Object.entries(e))A.append(t,r);else throw Ve.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})}var Jw=class A{cookies=null;constructor(e){e instanceof A?(this[es]=new Map(e[es]),this[As]=e[As],this.cookies=e.cookies):(this[es]=new Map(e),this[As]=null)}contains(e){return e=e.toLowerCase(),this[es].has(e)}clear(){this[es].clear(),this[As]=null,this.cookies=null}append(e,t){this[As]=null;let r=e.toLowerCase(),i=this[es].get(r);if(i){let s=r==="cookie"?"; ":", ";this[es].set(r,{name:i.name,value:`${i.value}${s}${t}`})}else this[es].set(r,{name:e,value:t});r==="set-cookie"&&(this.cookies??=[],this.cookies.push(t))}set(e,t){this[As]=null;let r=e.toLowerCase();return r==="set-cookie"&&(this.cookies=[t]),this[es].set(r,{name:e,value:t})}delete(e){return this[As]=null,e=e.toLowerCase(),e==="set-cookie"&&(this.cookies=null),this[es].delete(e)}get(e){return this.contains(e)?this[es].get(e.toLowerCase())?.value??null:null}*[Symbol.iterator](){for(let[e,{value:t}]of this[es])yield[e,t]}get entries(){let e={};if(this[es].size)for(let{name:t,value:r}of this[es].values())e[t]=r;return e}},Ph=class A{constructor(e=void 0){this[$i]=new Jw,this[dp]="none",e!==void 0&&(e=Ve.converters.HeadersInit(e),Ile(this,e))}append(e,t){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,2,{header:"Headers.append"}),e=Ve.converters.ByteString(e),t=Ve.converters.ByteString(t),t=Ble(t),xm(e)){if(!mle(t))throw Ve.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header value"})}else throw Ve.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(this[dp]==="immutable")throw new TypeError("immutable");return this[dp],this[$i].append(e,t)}delete(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.delete"}),e=Ve.converters.ByteString(e),!xm(e))throw Ve.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this[dp]==="immutable")throw new TypeError("immutable");if(this[dp],!!this[$i].contains(e))return this[$i].delete(e)}get(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.get"}),e=Ve.converters.ByteString(e),!xm(e))throw Ve.errors.invalidArgument({prefix:"Headers.get",value:e,type:"header name"});return this[$i].get(e)}has(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.has"}),e=Ve.converters.ByteString(e),!xm(e))throw Ve.errors.invalidArgument({prefix:"Headers.has",value:e,type:"header name"});return this[$i].contains(e)}set(e,t){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,2,{header:"Headers.set"}),e=Ve.converters.ByteString(e),t=Ve.converters.ByteString(t),t=Ble(t),xm(e)){if(!mle(t))throw Ve.errors.invalidArgument({prefix:"Headers.set",value:t,type:"header value"})}else throw Ve.errors.invalidArgument({prefix:"Headers.set",value:e,type:"header name"});if(this[dp]==="immutable")throw new TypeError("immutable");return this[dp],this[$i].set(e,t)}getSetCookie(){Ve.brandCheck(this,A);let e=this[$i].cookies;return e?[...e]:[]}get[As](){if(this[$i][As])return this[$i][As];let e=[],t=[...this[$i]].sort((i,s)=>i[0][...this[As].values()],"Headers","key")}values(){return Ve.brandCheck(this,A),dF(()=>[...this[As].values()],"Headers","value")}entries(){return Ve.brandCheck(this,A),dF(()=>[...this[As].values()],"Headers","key+value")}forEach(e,t=globalThis){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.forEach"}),typeof e!="function")throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(let[r,i]of this)e.apply(t,[i,r,this])}[Symbol.for("nodejs.util.inspect.custom")](){return Ve.brandCheck(this,A),this[$i]}};Ph.prototype[Symbol.iterator]=Ph.prototype.entries;Object.defineProperties(Ph.prototype,{append:Xa,delete:Xa,get:Xa,has:Xa,set:Xa,getSetCookie:Xa,keys:Xa,values:Xa,entries:Xa,forEach:Xa,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:"Headers",configurable:!0}});Ve.converters.HeadersInit=function(A){if(Ve.util.Type(A)==="Object")return A[Symbol.iterator]?Ve.converters["sequence>"](A):Ve.converters["record"](A);throw Ve.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};fle.exports={fill:Ile,Headers:Ph,HeadersList:Jw}});var zw=E((SoA,Sle)=>{"use strict";var{Headers:Sze,HeadersList:yle,fill:vze}=pp(),{extractBody:wle,cloneBody:kze,mixinBody:Fze}=om(),gF=aA(),{kEnumerableProperty:Ps}=gF,{isValidReasonPhrase:Lze,isCancelled:Uze,isAborted:Mze,isBlobLike:Tze,serializeJavascriptValueToJSONString:Oze,isErrorLike:Yze,isomorphicEncode:qze}=In(),{redirectStatus:Pze,nullBodyStatus:Hze,DOMException:ble}=yl(),{kState:dt,kHeaders:yr,kGuard:Hh,kRealm:qs}=Xo(),{webidl:Pe}=fi(),{FormData:Gze}=aw(),{getGlobalOrigin:Jze}=Eh(),{URLSerializer:Nle}=Kn(),{kHeadersList:pF}=lt(),hF=require("assert"),{types:uF}=require("util"),Rle=globalThis.ReadableStream||require("stream/web").ReadableStream,Gh=class A{static error(){let e={settingsObject:{}},t=new A;return t[dt]=Vw(),t[qs]=e,t[yr][pF]=t[dt].headersList,t[yr][Hh]="immutable",t[yr][qs]=e,t}static json(e,t={}){Pe.argumentLengthCheck(arguments,1,{header:"Response.json"}),t!==null&&(t=Pe.converters.ResponseInit(t));let r=new TextEncoder("utf-8").encode(Oze(e)),i=wle(r),s={settingsObject:{}},n=new A;return n[qs]=s,n[yr][Hh]="response",n[yr][qs]=s,Dle(n,t,{body:i[0],type:"application/json"}),n}static redirect(e,t=302){let r={settingsObject:{}};Pe.argumentLengthCheck(arguments,1,{header:"Response.redirect"}),e=Pe.converters.USVString(e),t=Pe.converters["unsigned short"](t);let i;try{i=new URL(e,Jze())}catch(a){throw Object.assign(new TypeError("Failed to parse URL from "+e),{cause:a})}if(!Pze.includes(t))throw new RangeError("Invalid status code "+t);let s=new A;s[qs]=r,s[yr][Hh]="immutable",s[yr][qs]=r,s[dt].status=t;let n=qze(Nle(i));return s[dt].headersList.append("location",n),s}constructor(e=null,t={}){e!==null&&(e=Pe.converters.BodyInit(e)),t=Pe.converters.ResponseInit(t),this[qs]={settingsObject:{}},this[dt]=Ww({}),this[yr]=new Sze,this[yr][Hh]="response",this[yr][pF]=this[dt].headersList,this[yr][qs]=this[qs];let r=null;if(e!=null){let[i,s]=wle(e);r={body:i,type:s}}Dle(this,t,r)}get type(){return Pe.brandCheck(this,A),this[dt].type}get url(){Pe.brandCheck(this,A);let e=this[dt].urlList,t=e[e.length-1]??null;return t===null?"":Nle(t,!0)}get redirected(){return Pe.brandCheck(this,A),this[dt].urlList.length>1}get status(){return Pe.brandCheck(this,A),this[dt].status}get ok(){return Pe.brandCheck(this,A),this[dt].status>=200&&this[dt].status<=299}get statusText(){return Pe.brandCheck(this,A),this[dt].statusText}get headers(){return Pe.brandCheck(this,A),this[yr]}get body(){return Pe.brandCheck(this,A),this[dt].body?this[dt].body.stream:null}get bodyUsed(){return Pe.brandCheck(this,A),!!this[dt].body&&gF.isDisturbed(this[dt].body.stream)}clone(){if(Pe.brandCheck(this,A),this.bodyUsed||this.body&&this.body.locked)throw Pe.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=EF(this[dt]),t=new A;return t[dt]=e,t[qs]=this[qs],t[yr][pF]=e.headersList,t[yr][Hh]=this[yr][Hh],t[yr][qs]=this[yr][qs],t}};Fze(Gh);Object.defineProperties(Gh.prototype,{type:Ps,url:Ps,status:Ps,ok:Ps,redirected:Ps,statusText:Ps,headers:Ps,clone:Ps,body:Ps,bodyUsed:Ps,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Gh,{json:Ps,redirect:Ps,error:Ps});function EF(A){if(A.internalResponse)return xle(EF(A.internalResponse),A.type);let e=Ww({...A,body:null});return A.body!=null&&(e.body=kze(A.body)),e}function Ww(A){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...A,headersList:A.headersList?new yle(A.headersList):new yle,urlList:A.urlList?[...A.urlList]:[]}}function Vw(A){let e=Yze(A);return Ww({type:"error",status:0,error:e?A:new Error(A&&String(A)),aborted:A&&A.name==="AbortError"})}function _w(A,e){return e={internalResponse:A,...e},new Proxy(A,{get(t,r){return r in e?e[r]:t[r]},set(t,r,i){return hF(!(r in e)),t[r]=i,!0}})}function xle(A,e){if(e==="basic")return _w(A,{type:"basic",headersList:A.headersList});if(e==="cors")return _w(A,{type:"cors",headersList:A.headersList});if(e==="opaque")return _w(A,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return _w(A,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});hF(!1)}function _ze(A,e=null){return hF(Uze(A)),Mze(A)?Vw(Object.assign(new ble("The operation was aborted.","AbortError"),{cause:e})):Vw(Object.assign(new ble("Request was cancelled."),{cause:e}))}function Dle(A,e,t){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Lze(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(A[dt].status=e.status),"statusText"in e&&e.statusText!=null&&(A[dt].statusText=e.statusText),"headers"in e&&e.headers!=null&&vze(A[yr],e.headers),t){if(Hze.includes(A.status))throw Pe.errors.exception({header:"Response constructor",message:"Invalid response status code "+A.status});A[dt].body=t.body,t.type!=null&&!A[dt].headersList.contains("Content-Type")&&A[dt].headersList.append("content-type",t.type)}}Pe.converters.ReadableStream=Pe.interfaceConverter(Rle);Pe.converters.FormData=Pe.interfaceConverter(Gze);Pe.converters.URLSearchParams=Pe.interfaceConverter(URLSearchParams);Pe.converters.XMLHttpRequestBodyInit=function(A){return typeof A=="string"?Pe.converters.USVString(A):Tze(A)?Pe.converters.Blob(A,{strict:!1}):uF.isAnyArrayBuffer(A)||uF.isTypedArray(A)||uF.isDataView(A)?Pe.converters.BufferSource(A):gF.isFormDataLike(A)?Pe.converters.FormData(A,{strict:!1}):A instanceof URLSearchParams?Pe.converters.URLSearchParams(A):Pe.converters.DOMString(A)};Pe.converters.BodyInit=function(A){return A instanceof Rle?Pe.converters.ReadableStream(A):A?.[Symbol.asyncIterator]?A:Pe.converters.XMLHttpRequestBodyInit(A)};Pe.converters.ResponseInit=Pe.dictionaryConverter([{key:"status",converter:Pe.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:Pe.converters.ByteString,defaultValue:""},{key:"headers",converter:Pe.converters.HeadersInit}]);Sle.exports={makeNetworkError:Vw,makeResponse:Ww,makeAppropriateNetworkError:_ze,filterResponse:xle,Response:Gh,cloneResponse:EF}});var km=E((voA,Tle)=>{"use strict";var{extractBody:Vze,mixinBody:Wze,cloneBody:zze}=om(),{Headers:CF,fill:jze,HeadersList:vle}=pp(),{FinalizationRegistry:Xze}=Dk()(),vm=aA(),{isValidHTTPToken:Zze,sameOrigin:kle,normalizeMethod:Kze,makePolicyContainer:$ze}=In(),{forbiddenMethods:eje,corsSafeListedMethods:Aje,referrerPolicy:tje,requestRedirect:rje,requestMode:ije,requestCredentials:sje,requestCache:nje,requestDuplex:aje}=yl(),{kEnumerableProperty:Kt}=vm,{kHeaders:wr,kSignal:Sm,kState:st,kGuard:jw,kRealm:Hs}=Xo(),{webidl:Re}=fi(),{getGlobalOrigin:oje}=Eh(),{URLSerializer:cje}=Kn(),{kHeadersList:Xw}=lt(),lje=require("assert"),{getMaxListeners:Fle,setMaxListeners:Lle,getEventListeners:dje,defaultMaxListeners:Ule}=require("events"),QF=globalThis.TransformStream,Mle=Symbol("init"),pje=Symbol("abortController"),uje=new Xze(({signal:A,abort:e})=>{A.removeEventListener("abort",e)}),up=class A{constructor(e,t={}){if(e===Mle)return;Re.argumentLengthCheck(arguments,1,{header:"Request constructor"}),e=Re.converters.RequestInfo(e),t=Re.converters.RequestInit(t),this[Hs]={settingsObject:{baseUrl:oje(),get origin(){return this.baseUrl?.origin},policyContainer:$ze()}};let r=null,i=null,s=this[Hs].settingsObject.baseUrl,n=null;if(typeof e=="string"){let h;try{h=new URL(e,s)}catch(Q){throw new TypeError("Failed to parse URL from "+e,{cause:Q})}if(h.username||h.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);r=Zw({urlList:[h]}),i="cors"}else lje(e instanceof A),r=e[st],n=e[Sm];let a=this[Hs].settingsObject.origin,o="client";if(r.window?.constructor?.name==="EnvironmentSettingsObject"&&kle(r.window,a)&&(o=r.window),t.window!=null)throw new TypeError(`'window' option '${o}' must be null`);if("window"in t&&(o="no-window"),r=Zw({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:this[Hs].settingsObject,window:o,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]}),Object.keys(t).length>0&&(r.mode==="navigate"&&(r.mode="same-origin"),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin="client",r.referrer="client",r.referrerPolicy="",r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),t.referrer!==void 0){let h=t.referrer;if(h==="")r.referrer="no-referrer";else{let Q;try{Q=new URL(h,s)}catch(B){throw new TypeError(`Referrer "${h}" is not a valid URL.`,{cause:B})}Q.protocol==="about:"&&Q.hostname==="client"||a&&!kle(Q,this[Hs].settingsObject.baseUrl)?r.referrer="client":r.referrer=Q}}t.referrerPolicy!==void 0&&(r.referrerPolicy=t.referrerPolicy);let c;if(t.mode!==void 0?c=t.mode:c=i,c==="navigate")throw Re.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(c!=null&&(r.mode=c),t.credentials!==void 0&&(r.credentials=t.credentials),t.cache!==void 0&&(r.cache=t.cache),r.cache==="only-if-cached"&&r.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(t.redirect!==void 0&&(r.redirect=t.redirect),t.integrity!==void 0&&t.integrity!=null&&(r.integrity=String(t.integrity)),t.keepalive!==void 0&&(r.keepalive=!!t.keepalive),t.method!==void 0){let h=t.method;if(!Zze(t.method))throw TypeError(`'${t.method}' is not a valid HTTP method.`);if(eje.indexOf(h.toUpperCase())!==-1)throw TypeError(`'${t.method}' HTTP method is unsupported.`);h=Kze(t.method),r.method=h}t.signal!==void 0&&(n=t.signal),this[st]=r;let l=new AbortController;if(this[Sm]=l.signal,this[Sm][Hs]=this[Hs],n!=null){if(!n||typeof n.aborted!="boolean"||typeof n.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(n.aborted)l.abort(n.reason);else{this[pje]=l;let h=new WeakRef(l),Q=function(){let B=h.deref();B!==void 0&&B.abort(this.reason)};try{(typeof Fle=="function"&&Fle(n)===Ule||dje(n,"abort").length>=Ule)&&Lle(100,n)}catch{}vm.addAbortListener(n,Q),uje.register(l,{signal:n,abort:Q})}}if(this[wr]=new CF,this[wr][Xw]=r.headersList,this[wr][jw]="request",this[wr][Hs]=this[Hs],c==="no-cors"){if(!Aje.includes(r.method))throw new TypeError(`'${r.method} is unsupported in no-cors mode.`);this[wr][jw]="request-no-cors"}if(Object.keys(t).length!==0){let h=new CF(this[wr]);if(t.headers!==void 0&&(h=t.headers),this[wr][Xw].clear(),h.constructor.name==="Headers")for(let[Q,B]of h)this[wr].append(Q,B);else jze(this[wr],h)}let d=e instanceof A?e[st].body:null;if((t.body!=null||d!=null)&&(r.method==="GET"||r.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let p=null;if(t.body!=null){let[h,Q]=Vze(t.body,r.keepalive);p=h,Q&&!this[wr][Xw].contains("content-type")&&this[wr].append("content-type",Q)}let u=p??d;if(u!=null&&u.source==null){if(p!=null&&t.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(r.mode!=="same-origin"&&r.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');r.useCORSPreflightFlag=!0}let g=u;if(p==null&&d!=null){if(vm.isDisturbed(d.stream)||d.stream.locked)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");QF||(QF=require("stream/web").TransformStream);let h=new QF;d.stream.pipeThrough(h),g={source:d.source,length:d.length,stream:h.readable}}this[st].body=g}get method(){return Re.brandCheck(this,A),this[st].method}get url(){return Re.brandCheck(this,A),cje(this[st].url)}get headers(){return Re.brandCheck(this,A),this[wr]}get destination(){return Re.brandCheck(this,A),this[st].destination}get referrer(){return Re.brandCheck(this,A),this[st].referrer==="no-referrer"?"":this[st].referrer==="client"?"about:client":this[st].referrer.toString()}get referrerPolicy(){return Re.brandCheck(this,A),this[st].referrerPolicy}get mode(){return Re.brandCheck(this,A),this[st].mode}get credentials(){return this[st].credentials}get cache(){return Re.brandCheck(this,A),this[st].cache}get redirect(){return Re.brandCheck(this,A),this[st].redirect}get integrity(){return Re.brandCheck(this,A),this[st].integrity}get keepalive(){return Re.brandCheck(this,A),this[st].keepalive}get isReloadNavigation(){return Re.brandCheck(this,A),this[st].reloadNavigation}get isHistoryNavigation(){return Re.brandCheck(this,A),this[st].historyNavigation}get signal(){return Re.brandCheck(this,A),this[Sm]}get body(){return Re.brandCheck(this,A),this[st].body?this[st].body.stream:null}get bodyUsed(){return Re.brandCheck(this,A),!!this[st].body&&vm.isDisturbed(this[st].body.stream)}get duplex(){return Re.brandCheck(this,A),"half"}clone(){if(Re.brandCheck(this,A),this.bodyUsed||this.body?.locked)throw new TypeError("unusable");let e=gje(this[st]),t=new A(Mle);t[st]=e,t[Hs]=this[Hs],t[wr]=new CF,t[wr][Xw]=e.headersList,t[wr][jw]=this[wr][jw],t[wr][Hs]=this[wr][Hs];let r=new AbortController;return this.signal.aborted?r.abort(this.signal.reason):vm.addAbortListener(this.signal,()=>{r.abort(this.signal.reason)}),t[Sm]=r.signal,t}};Wze(up);function Zw(A){let e={method:"GET",localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:!1,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:!1,credentials:"same-origin",useCredentials:!1,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...A,headersList:A.headersList?new vle(A.headersList):new vle};return e.url=e.urlList[0],e}function gje(A){let e=Zw({...A,body:null});return A.body!=null&&(e.body=zze(A.body)),e}Object.defineProperties(up.prototype,{method:Kt,url:Kt,headers:Kt,redirect:Kt,clone:Kt,signal:Kt,duplex:Kt,destination:Kt,body:Kt,bodyUsed:Kt,isHistoryNavigation:Kt,isReloadNavigation:Kt,keepalive:Kt,integrity:Kt,cache:Kt,credentials:Kt,attribute:Kt,referrerPolicy:Kt,referrer:Kt,mode:Kt,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Re.converters.Request=Re.interfaceConverter(up);Re.converters.RequestInfo=function(A){return typeof A=="string"?Re.converters.USVString(A):A instanceof up?Re.converters.Request(A):Re.converters.USVString(A)};Re.converters.AbortSignal=Re.interfaceConverter(AbortSignal);Re.converters.RequestInit=Re.dictionaryConverter([{key:"method",converter:Re.converters.ByteString},{key:"headers",converter:Re.converters.HeadersInit},{key:"body",converter:Re.nullableConverter(Re.converters.BodyInit)},{key:"referrer",converter:Re.converters.USVString},{key:"referrerPolicy",converter:Re.converters.DOMString,allowedValues:tje},{key:"mode",converter:Re.converters.DOMString,allowedValues:ije},{key:"credentials",converter:Re.converters.DOMString,allowedValues:sje},{key:"cache",converter:Re.converters.DOMString,allowedValues:nje},{key:"redirect",converter:Re.converters.DOMString,allowedValues:rje},{key:"integrity",converter:Re.converters.DOMString},{key:"keepalive",converter:Re.converters.boolean},{key:"signal",converter:Re.nullableConverter(A=>Re.converters.AbortSignal(A,{strict:!1}))},{key:"window",converter:Re.converters.any},{key:"duplex",converter:Re.converters.DOMString,allowedValues:aje}]);Tle.exports={Request:up,makeRequest:Zw}});var ib=E((koA,Zle)=>{"use strict";var{Response:hje,makeNetworkError:YA,makeAppropriateNetworkError:Kw,filterResponse:mF,makeResponse:$w}=zw(),{Headers:Ole}=pp(),{Request:Eje,makeRequest:Cje}=km(),Fm=require("zlib"),{bytesMatch:Qje,makePolicyContainer:mje,clonePolicyContainer:Bje,requestBadPort:Ije,TAOCheck:fje,appendRequestOriginHeader:yje,responseLocationURL:wje,requestCurrentURL:Za,setRequestReferrerPolicyOnRedirect:bje,tryUpgradeRequestToAPotentiallyTrustworthyURL:Nje,createOpaqueTimingInfo:xF,appendFetchMetadata:Dje,corsCheck:Rje,crossOriginResourcePolicyCheck:xje,determineRequestsReferrer:Sje,coarsenedSharedCurrentTime:SF,createDeferredPromise:vje,isBlobLike:kje,sameOrigin:bF,isCancelled:Jh,isAborted:Yle,isErrorLike:Fje,fullyReadBody:Gle,readableStreamClose:Lje,isomorphicEncode:NF,urlIsLocal:Uje,urlIsHttpHttpsScheme:vF,urlHasHttpsScheme:Mje}=In(),{kState:DF,kHeaders:BF,kGuard:Tje,kRealm:qle}=Xo(),_h=require("assert"),{safelyExtractBody:eb}=om(),{redirectStatus:Jle,nullBodyStatus:_le,safeMethods:Oje,requestBodyHeader:Yje,subresource:qje,DOMException:Ab}=yl(),{kHeadersList:RF}=lt(),Pje=require("events"),{Readable:Hje,pipeline:Gje}=require("stream"),{addAbortListener:Jje,isErrored:_je,isReadable:tb,nodeMajor:Ple,nodeMinor:Vje}=aA(),{dataURLProcessor:Wje,serializeAMimeType:zje}=Kn(),{TransformStream:jje}=require("stream/web"),{getGlobalDispatcher:Xje}=qh(),{webidl:Zje}=fi(),{STATUS_CODES:Kje}=require("http"),IF,fF=globalThis.ReadableStream,rb=class extends Pje{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing",this.setMaxListeners(21)}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new Ab("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function $je(A,e={}){Zje.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});let t=vje(),r;try{r=new Eje(A,e)}catch(p){return t.reject(p),t.promise}let i=r[DF];if(r.signal.aborted)return yF(t,i,null,r.signal.reason),t.promise;i.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(i.serviceWorkers="none");let n=null,a=null,o=!1,c=null;return Jje(r.signal,()=>{o=!0,_h(c!=null),c.abort(r.signal.reason),yF(t,i,n,r.signal.reason)}),c=Wle({request:i,processResponseEndOfBody:p=>Vle(p,"fetch"),processResponse:p=>{if(o)return Promise.resolve();if(p.aborted)return yF(t,i,n,c.serializedAbortReason),Promise.resolve();if(p.type==="error")return t.reject(Object.assign(new TypeError("fetch failed"),{cause:p.error})),Promise.resolve();n=new hje,n[DF]=p,n[qle]=a,n[BF][RF]=p.headersList,n[BF][Tje]="immutable",n[BF][qle]=a,t.resolve(n)},dispatcher:e.dispatcher??Xje()}),t.promise}function Vle(A,e="other"){if(A.type==="error"&&A.aborted||!A.urlList?.length)return;let t=A.urlList[0],r=A.timingInfo,i=A.cacheState;vF(t)&&r!==null&&(r.timingAllowPassed||(r=xF({startTime:r.startTime}),i=""),r.endTime=SF(),A.timingInfo=r,eXe(r,t,e,globalThis,i))}function eXe(A,e,t,r,i){(Ple>18||Ple===18&&Vje>=2)&&performance.markResourceTiming(A,e.href,t,r,i)}function yF(A,e,t,r){if(r||(r=new Ab("The operation was aborted.","AbortError")),A.reject(r),e.body!=null&&tb(e.body?.stream)&&e.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),t==null)return;let i=t[DF];i.body!=null&&tb(i.body?.stream)&&i.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}function Wle({request:A,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:s,useParallelQueue:n=!1,dispatcher:a}){let o=null,c=!1;A.client!=null&&(o=A.client.globalObject,c=A.client.crossOriginIsolatedCapability);let l=SF(c),d=xF({startTime:l}),p={controller:new rb(a),request:A,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:r,processResponseConsumeBody:s,processResponseEndOfBody:i,taskDestination:o,crossOriginIsolatedCapability:c};return _h(!A.body||A.body.stream),A.window==="client"&&(A.window=A.client?.globalObject?.constructor?.name==="Window"?A.client:"no-window"),A.origin==="client"&&(A.origin=A.client?.origin),A.policyContainer==="client"&&(A.client!=null?A.policyContainer=Bje(A.client.policyContainer):A.policyContainer=mje()),A.headersList.contains("accept")||A.headersList.append("accept","*/*"),A.headersList.contains("accept-language")||A.headersList.append("accept-language","*"),A.priority,qje.includes(A.destination),zle(p).catch(u=>{p.controller.terminate(u)}),p.controller}async function zle(A,e=!1){let t=A.request,r=null;if(t.localURLsOnly&&!Uje(Za(t))&&(r=YA("local URLs only")),Nje(t),Ije(t)==="blocked"&&(r=YA("bad port")),t.referrerPolicy===""&&(t.referrerPolicy=t.policyContainer.referrerPolicy),t.referrer!=="no-referrer"&&(t.referrer=Sje(t)),r===null&&(r=await(async()=>{let s=Za(t);return bF(s,t.url)&&t.responseTainting==="basic"||s.protocol==="data:"||t.mode==="navigate"||t.mode==="websocket"?(t.responseTainting="basic",await Hle(A)):t.mode==="same-origin"?YA('request mode cannot be "same-origin"'):t.mode==="no-cors"?t.redirect!=="follow"?YA('redirect mode cannot be "follow" for "no-cors" request'):(t.responseTainting="opaque",await Hle(A)):vF(Za(t))?(t.responseTainting="cors",await jle(A)):YA("URL scheme must be a HTTP(S) scheme")})()),e)return r;r.status!==0&&!r.internalResponse&&(t.responseTainting,t.responseTainting==="basic"?r=mF(r,"basic"):t.responseTainting==="cors"?r=mF(r,"cors"):t.responseTainting==="opaque"?r=mF(r,"opaque"):_h(!1));let i=r.status===0?r:r.internalResponse;if(i.urlList.length===0&&i.urlList.push(...t.urlList),t.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&i.status===206&&i.rangeRequested&&!t.headers.contains("range")&&(r=i=YA()),r.status!==0&&(t.method==="HEAD"||t.method==="CONNECT"||_le.includes(i.status))&&(i.body=null,A.controller.dump=!0),t.integrity){let s=a=>wF(A,YA(a));if(t.responseTainting==="opaque"||r.body==null){s(r.error);return}let n=a=>{if(!Qje(a,t.integrity)){s("integrity mismatch");return}r.body=eb(a)[0],wF(A,r)};await Gle(r.body,n,s)}else wF(A,r)}function Hle(A){if(Jh(A)&&A.request.redirectCount===0)return Promise.resolve(Kw(A));let{request:e}=A,{protocol:t}=Za(e);switch(t){case"about:":return Promise.resolve(YA("about scheme is not supported"));case"blob:":{IF||(IF=require("buffer").resolveObjectURL);let r=Za(e);if(r.search.length!==0)return Promise.resolve(YA("NetworkError when attempting to fetch resource."));let i=IF(r.toString());if(e.method!=="GET"||!kje(i))return Promise.resolve(YA("invalid method"));let s=eb(i),n=s[0],a=NF(`${n.length}`),o=s[1]??"",c=$w({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:a}],["content-type",{name:"Content-Type",value:o}]]});return c.body=n,Promise.resolve(c)}case"data:":{let r=Za(e),i=Wje(r);if(i==="failure")return Promise.resolve(YA("failed to fetch the data URL"));let s=zje(i.mimeType);return Promise.resolve($w({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:eb(i.body)[0]}))}case"file:":return Promise.resolve(YA("not implemented... yet..."));case"http:":case"https:":return jle(A).catch(r=>YA(r));default:return Promise.resolve(YA("unknown scheme"))}}function AXe(A,e){A.request.done=!0,A.processResponseDone!=null&&queueMicrotask(()=>A.processResponseDone(e))}function wF(A,e){e.type==="error"&&(e.urlList=[A.request.urlList[0]],e.timingInfo=xF({startTime:A.timingInfo.startTime}));let t=()=>{A.request.done=!0,A.processResponseEndOfBody!=null&&queueMicrotask(()=>A.processResponseEndOfBody(e))};if(A.processResponse!=null&&queueMicrotask(()=>A.processResponse(e)),e.body==null)t();else{let r=(s,n)=>{n.enqueue(s)},i=new jje({start(){},transform:r,flush:t},{size(){return 1}},{size(){return 1}});e.body={stream:e.body.stream.pipeThrough(i)}}if(A.processResponseConsumeBody!=null){let r=s=>A.processResponseConsumeBody(e,s),i=s=>A.processResponseConsumeBody(e,s);if(e.body==null)queueMicrotask(()=>r(null));else return Gle(e.body,r,i);return Promise.resolve()}}async function jle(A){let e=A.request,t=null,r=null,i=A.timingInfo;if(e.serviceWorkers,t===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),r=t=await Xle(A),e.responseTainting==="cors"&&Rje(e,t)==="failure")return YA("cors failure");fje(e,t)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||t.type==="opaque")&&xje(e.origin,e.client,e.destination,r)==="blocked"?YA("blocked"):(Jle.includes(r.status)&&(e.redirect!=="manual"&&A.controller.connection.destroy(),e.redirect==="error"?t=YA("unexpected redirect"):e.redirect==="manual"?t=r:e.redirect==="follow"?t=await tXe(A,t):_h(!1)),t.timingInfo=i,t)}function tXe(A,e){let t=A.request,r=e.internalResponse?e.internalResponse:e,i;try{if(i=wje(r,Za(t).hash),i==null)return e}catch(n){return Promise.resolve(YA(n))}if(!vF(i))return Promise.resolve(YA("URL scheme must be a HTTP(S) scheme"));if(t.redirectCount===20)return Promise.resolve(YA("redirect count exceeded"));if(t.redirectCount+=1,t.mode==="cors"&&(i.username||i.password)&&!bF(t,i))return Promise.resolve(YA('cross origin not allowed for request mode "cors"'));if(t.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(YA('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&t.body!=null&&t.body.source==null)return Promise.resolve(YA());if([301,302].includes(r.status)&&t.method==="POST"||r.status===303&&!["GET","HEAD"].includes(t.method)){t.method="GET",t.body=null;for(let n of Yje)t.headersList.delete(n)}bF(Za(t),i)||(t.headersList.delete("authorization"),t.headersList.delete("cookie"),t.headersList.delete("host")),t.body!=null&&(_h(t.body.source!=null),t.body=eb(t.body.source)[0]);let s=A.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=SF(A.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),t.urlList.push(i),bje(t,r),zle(A,!0)}async function Xle(A,e=!1,t=!1){let r=A.request,i=null,s=null,n=null,a=null,o=!1;r.window==="no-window"&&r.redirect==="error"?(i=A,s=r):(s=Cje(r),i={...A},i.request=s);let c=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",l=s.body?s.body.length:null,d=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(d="0"),l!=null&&(d=NF(`${l}`)),d!=null&&s.headersList.append("content-length",d),l!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",NF(s.referrer.href)),yje(s),Dje(s),s.headersList.contains("user-agent")||s.headersList.append("user-agent",typeof esbuildDetection>"u"?"undici":"node"),s.cache==="default"&&(s.headersList.contains("if-modified-since")||s.headersList.contains("if-none-match")||s.headersList.contains("if-unmodified-since")||s.headersList.contains("if-match")||s.headersList.contains("if-range"))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control")&&s.headersList.append("cache-control","max-age=0"),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma")||s.headersList.append("pragma","no-cache"),s.headersList.contains("cache-control")||s.headersList.append("cache-control","no-cache")),s.headersList.contains("range")&&s.headersList.append("accept-encoding","identity"),s.headersList.contains("accept-encoding")||(Mje(Za(s))?s.headersList.append("accept-encoding","br, gzip, deflate"):s.headersList.append("accept-encoding","gzip, deflate")),s.headersList.delete("host"),a==null&&(s.cache="no-store"),s.mode!=="no-store"&&s.mode,n==null){if(s.mode==="only-if-cached")return YA("only if cached");let p=await rXe(i,c,t);!Oje.includes(s.method)&&p.status>=200&&p.status<=399,o&&p.status,n==null&&(n=p)}if(n.urlList=[...s.urlList],s.headersList.contains("range")&&(n.rangeRequested=!0),n.requestIncludesCredentials=c,n.status===407)return r.window==="no-window"?YA():Jh(A)?Kw(A):YA("proxy authentication required");if(n.status===421&&!t&&(r.body==null||r.body.source!=null)){if(Jh(A))return Kw(A);A.controller.connection.destroy(),n=await Xle(A,e,!0)}return n}async function rXe(A,e=!1,t=!1){_h(!A.controller.connection||A.controller.connection.destroyed),A.controller.connection={abort:null,destroyed:!1,destroy(g){this.destroyed||(this.destroyed=!0,this.abort?.(g??new Ab("The operation was aborted.","AbortError")))}};let r=A.request,i=null,s=A.timingInfo;null==null&&(r.cache="no-store");let a=t?"yes":"no";r.mode;let o=null;if(r.body==null&&A.processRequestEndOfBody)queueMicrotask(()=>A.processRequestEndOfBody());else if(r.body!=null){let g=async function*(B){Jh(A)||(yield B,A.processRequestBodyChunkLength?.(B.byteLength))},h=()=>{Jh(A)||A.processRequestEndOfBody&&A.processRequestEndOfBody()},Q=B=>{Jh(A)||(B.name==="AbortError"?A.controller.abort():A.controller.terminate(B))};o=async function*(){try{for await(let B of r.body.stream)yield*g(B);h()}catch(B){Q(B)}}()}try{let{body:g,status:h,statusText:Q,headersList:B,socket:w}=await u({body:o});if(w)i=$w({status:h,statusText:Q,headersList:B,socket:w});else{let I=g[Symbol.asyncIterator]();A.controller.next=()=>I.next(),i=$w({status:h,statusText:Q,headersList:B})}}catch(g){return g.name==="AbortError"?(A.controller.connection.destroy(),Kw(A,g)):YA(g)}let c=()=>{A.controller.resume()},l=g=>{A.controller.abort(g)};fF||(fF=require("stream/web").ReadableStream);let d=new fF({async start(g){A.controller.controller=g},async pull(g){await c(g)},async cancel(g){await l(g)}},{highWaterMark:0,size(){return 1}});i.body={stream:d},A.controller.on("terminated",p),A.controller.resume=async()=>{for(;;){let g,h;try{let{done:Q,value:B}=await A.controller.next();if(Yle(A))break;g=Q?void 0:B}catch(Q){A.controller.ended&&!s.encodedBodySize?g=void 0:(g=Q,h=!0)}if(g===void 0){Lje(A.controller.controller),AXe(A,i);return}if(s.decodedBodySize+=g?.byteLength??0,h){A.controller.terminate(g);return}if(A.controller.controller.enqueue(new Uint8Array(g)),_je(d)){A.controller.terminate();return}if(!A.controller.controller.desiredSize)return}};function p(g){Yle(A)?(i.aborted=!0,tb(d)&&A.controller.controller.error(A.controller.serializedAbortReason)):tb(d)&&A.controller.controller.error(new TypeError("terminated",{cause:Fje(g)?g:void 0})),A.controller.connection.destroy()}return i;async function u({body:g}){let h=Za(r),Q=A.controller.dispatcher;return new Promise((B,w)=>Q.dispatch({path:h.pathname+h.search,origin:h.origin,method:r.method,body:A.controller.dispatcher.isMockActive?r.body&&r.body.source:g,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(I){let{connection:C}=A.controller;C.destroyed?I(new Ab("The operation was aborted.","AbortError")):(A.controller.on("terminated",I),this.abort=C.abort=I)},onHeaders(I,C,m,b){if(I<200)return;let R=[],y="",v=new Ole;if(Array.isArray(C))for(let x=0;xoe.trim()):F.toLowerCase()==="location"&&(y=q),v.append(F,q)}else{let x=Object.keys(C);for(let F of x){let q=C[F];F.toLowerCase()==="content-encoding"?R=q.toLowerCase().split(",").map(oe=>oe.trim()).reverse():F.toLowerCase()==="location"&&(y=q),v.append(F,q)}}this.body=new Hje({read:m});let D=[],S=r.redirect==="follow"&&y&&Jle.includes(I);if(r.method!=="HEAD"&&r.method!=="CONNECT"&&!_le.includes(I)&&!S)for(let x of R)if(x==="x-gzip"||x==="gzip")D.push(Fm.createGunzip({flush:Fm.constants.Z_SYNC_FLUSH,finishFlush:Fm.constants.Z_SYNC_FLUSH}));else if(x==="deflate")D.push(Fm.createInflate());else if(x==="br")D.push(Fm.createBrotliDecompress());else{D.length=0;break}return B({status:I,statusText:b,headersList:v[RF],body:D.length?Gje(this.body,...D,()=>{}):this.body.on("error",()=>{})}),!0},onData(I){if(A.controller.dump)return;let C=I;return s.encodedBodySize+=C.byteLength,this.body.push(C)},onComplete(){this.abort&&A.controller.off("terminated",this.abort),A.controller.ended=!0,this.body.push(null)},onError(I){this.abort&&A.controller.off("terminated",this.abort),this.body?.destroy(I),A.controller.terminate(I),w(I)},onUpgrade(I,C,m){if(I!==101)return;let b=new Ole;for(let R=0;R{"use strict";Kle.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var ede=E((LoA,$le)=>{"use strict";var{webidl:Gs}=fi(),sb=Symbol("ProgressEvent state"),FF=class A extends Event{constructor(e,t={}){e=Gs.converters.DOMString(e),t=Gs.converters.ProgressEventInit(t??{}),super(e,t),this[sb]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return Gs.brandCheck(this,A),this[sb].lengthComputable}get loaded(){return Gs.brandCheck(this,A),this[sb].loaded}get total(){return Gs.brandCheck(this,A),this[sb].total}};Gs.converters.ProgressEventInit=Gs.dictionaryConverter([{key:"lengthComputable",converter:Gs.converters.boolean,defaultValue:!1},{key:"loaded",converter:Gs.converters["unsigned long long"],defaultValue:0},{key:"total",converter:Gs.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:Gs.converters.boolean,defaultValue:!1},{key:"cancelable",converter:Gs.converters.boolean,defaultValue:!1},{key:"composed",converter:Gs.converters.boolean,defaultValue:!1}]);$le.exports={ProgressEvent:FF}});var tde=E((UoA,Ade)=>{"use strict";function iXe(A){if(!A)return"failure";switch(A.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}Ade.exports={getEncoding:iXe}});var lde=E((MoA,cde)=>{"use strict";var{kState:Vh,kError:LF,kResult:rde,kAborted:Lm,kLastProgressEventFired:UF}=kF(),{ProgressEvent:sXe}=ede(),{getEncoding:ide}=tde(),{DOMException:nXe}=yl(),{serializeAMimeType:aXe,parseMIMEType:sde}=Kn(),{types:oXe}=require("util"),{StringDecoder:nde}=require("string_decoder"),{btoa:ade}=require("buffer"),cXe={enumerable:!0,writable:!1,configurable:!1};function lXe(A,e,t,r){if(A[Vh]==="loading")throw new nXe("Invalid state","InvalidStateError");A[Vh]="loading",A[rde]=null,A[LF]=null;let s=e.stream().getReader(),n=[],a=s.read(),o=!0;(async()=>{for(;!A[Lm];)try{let{done:c,value:l}=await a;if(o&&!A[Lm]&&queueMicrotask(()=>{vl("loadstart",A)}),o=!1,!c&&oXe.isUint8Array(l))n.push(l),(A[UF]===void 0||Date.now()-A[UF]>=50)&&!A[Lm]&&(A[UF]=Date.now(),queueMicrotask(()=>{vl("progress",A)})),a=s.read();else if(c){queueMicrotask(()=>{A[Vh]="done";try{let d=dXe(n,t,e.type,r);if(A[Lm])return;A[rde]=d,vl("load",A)}catch(d){A[LF]=d,vl("error",A)}A[Vh]!=="loading"&&vl("loadend",A)});break}}catch(c){if(A[Lm])return;queueMicrotask(()=>{A[Vh]="done",A[LF]=c,vl("error",A),A[Vh]!=="loading"&&vl("loadend",A)});break}})()}function vl(A,e){let t=new sXe(A,{bubbles:!1,cancelable:!1});e.dispatchEvent(t)}function dXe(A,e,t,r){switch(e){case"DataURL":{let i="data:",s=sde(t||"application/octet-stream");s!=="failure"&&(i+=aXe(s)),i+=";base64,";let n=new nde("latin1");for(let a of A)i+=ade(n.write(a));return i+=ade(n.end()),i}case"Text":{let i="failure";if(r&&(i=ide(r)),i==="failure"&&t){let s=sde(t);s!=="failure"&&(i=ide(s.parameters.get("charset")))}return i==="failure"&&(i="UTF-8"),pXe(A,i)}case"ArrayBuffer":return ode(A).buffer;case"BinaryString":{let i="",s=new nde("latin1");for(let n of A)i+=s.write(n);return i+=s.end(),i}}}function pXe(A,e){let t=ode(A),r=uXe(t),i=0;r!==null&&(e=r,i=r==="UTF-8"?3:2);let s=t.slice(i);return new TextDecoder(e).decode(s)}function uXe(A){let[e,t,r]=A;return e===239&&t===187&&r===191?"UTF-8":e===254&&t===255?"UTF-16BE":e===255&&t===254?"UTF-16LE":null}function ode(A){let e=A.reduce((r,i)=>r+i.byteLength,0),t=0;return A.reduce((r,i)=>(r.set(i,t),t+=i.byteLength,r),new Uint8Array(e))}cde.exports={staticPropertyDescriptors:cXe,readOperation:lXe,fireAProgressEvent:vl}});var gde=E((ToA,ude)=>{"use strict";var{staticPropertyDescriptors:Wh,readOperation:nb,fireAProgressEvent:dde}=lde(),{kState:gp,kError:pde,kResult:ab,kEvents:gA,kAborted:gXe}=kF(),{webidl:FA}=fi(),{kEnumerableProperty:ts}=aA(),Aa=class A extends EventTarget{constructor(){super(),this[gp]="empty",this[ab]=null,this[pde]=null,this[gA]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"}),e=FA.converters.Blob(e,{strict:!1}),nb(this,e,"ArrayBuffer")}readAsBinaryString(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"}),e=FA.converters.Blob(e,{strict:!1}),nb(this,e,"BinaryString")}readAsText(e,t=void 0){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"}),e=FA.converters.Blob(e,{strict:!1}),t!==void 0&&(t=FA.converters.DOMString(t)),nb(this,e,"Text",t)}readAsDataURL(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"}),e=FA.converters.Blob(e,{strict:!1}),nb(this,e,"DataURL")}abort(){if(this[gp]==="empty"||this[gp]==="done"){this[ab]=null;return}this[gp]==="loading"&&(this[gp]="done",this[ab]=null),this[gXe]=!0,dde("abort",this),this[gp]!=="loading"&&dde("loadend",this)}get readyState(){switch(FA.brandCheck(this,A),this[gp]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return FA.brandCheck(this,A),this[ab]}get error(){return FA.brandCheck(this,A),this[pde]}get onloadend(){return FA.brandCheck(this,A),this[gA].loadend}set onloadend(e){FA.brandCheck(this,A),this[gA].loadend&&this.removeEventListener("loadend",this[gA].loadend),typeof e=="function"?(this[gA].loadend=e,this.addEventListener("loadend",e)):this[gA].loadend=null}get onerror(){return FA.brandCheck(this,A),this[gA].error}set onerror(e){FA.brandCheck(this,A),this[gA].error&&this.removeEventListener("error",this[gA].error),typeof e=="function"?(this[gA].error=e,this.addEventListener("error",e)):this[gA].error=null}get onloadstart(){return FA.brandCheck(this,A),this[gA].loadstart}set onloadstart(e){FA.brandCheck(this,A),this[gA].loadstart&&this.removeEventListener("loadstart",this[gA].loadstart),typeof e=="function"?(this[gA].loadstart=e,this.addEventListener("loadstart",e)):this[gA].loadstart=null}get onprogress(){return FA.brandCheck(this,A),this[gA].progress}set onprogress(e){FA.brandCheck(this,A),this[gA].progress&&this.removeEventListener("progress",this[gA].progress),typeof e=="function"?(this[gA].progress=e,this.addEventListener("progress",e)):this[gA].progress=null}get onload(){return FA.brandCheck(this,A),this[gA].load}set onload(e){FA.brandCheck(this,A),this[gA].load&&this.removeEventListener("load",this[gA].load),typeof e=="function"?(this[gA].load=e,this.addEventListener("load",e)):this[gA].load=null}get onabort(){return FA.brandCheck(this,A),this[gA].abort}set onabort(e){FA.brandCheck(this,A),this[gA].abort&&this.removeEventListener("abort",this[gA].abort),typeof e=="function"?(this[gA].abort=e,this.addEventListener("abort",e)):this[gA].abort=null}};Aa.EMPTY=Aa.prototype.EMPTY=0;Aa.LOADING=Aa.prototype.LOADING=1;Aa.DONE=Aa.prototype.DONE=2;Object.defineProperties(Aa.prototype,{EMPTY:Wh,LOADING:Wh,DONE:Wh,readAsArrayBuffer:ts,readAsBinaryString:ts,readAsText:ts,readAsDataURL:ts,abort:ts,readyState:ts,result:ts,error:ts,onloadstart:ts,onprogress:ts,onload:ts,onabort:ts,onerror:ts,onloadend:ts,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Aa,{EMPTY:Wh,LOADING:Wh,DONE:Wh});ude.exports={FileReader:Aa}});var ob=E((OoA,hde)=>{"use strict";hde.exports={kConstruct:Symbol("constructable")}});var Qde=E((YoA,Cde)=>{"use strict";var hXe=require("assert"),{URLSerializer:Ede}=Kn(),{isValidHeaderName:EXe}=In();function CXe(A,e,t=!1){let r=Ede(A,t),i=Ede(e,t);return r===i}function QXe(A){hXe(A!==null);let e=[];for(let t of A.split(",")){if(t=t.trim(),t.length){if(!EXe(t))continue}else continue;e.push(t)}return e}Cde.exports={urlEquals:CXe,fieldValues:QXe}});var wde=E((qoA,yde)=>{"use strict";var{kConstruct:mXe}=ob(),{urlEquals:BXe,fieldValues:MF}=Qde(),{kEnumerableProperty:hp,isDisturbed:IXe}=aA(),{kHeadersList:mde}=lt(),{webidl:ye}=fi(),{Response:Ide,cloneResponse:fXe}=zw(),{Request:Ka}=km(),{kState:Ni,kHeaders:cb,kGuard:Bde,kRealm:yXe}=Xo(),{fetching:wXe}=ib(),{urlIsHttpHttpsScheme:lb,createDeferredPromise:zh,readAllBytes:bXe}=In(),TF=require("assert"),{getGlobalDispatcher:NXe}=qh(),db=class A{#e;constructor(){arguments[0]!==mXe&&ye.illegalConstructor(),this.#e=arguments[1]}async match(e,t={}){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.match"}),e=ye.converters.RequestInfo(e),t=ye.converters.CacheQueryOptions(t);let r=await this.matchAll(e,t);if(r.length!==0)return r[0]}async matchAll(e=void 0,t={}){ye.brandCheck(this,A),e!==void 0&&(e=ye.converters.RequestInfo(e)),t=ye.converters.CacheQueryOptions(t);let r=null;if(e!==void 0)if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(r=new Ka(e)[Ni]);let i=[];if(e===void 0)for(let n of this.#e)i.push(n[1]);else{let n=this.#r(r,t);for(let a of n)i.push(a[1])}let s=[];for(let n of i){let a=new Ide(n.body?.source??null),o=a[Ni].body;a[Ni]=n,a[Ni].body=o,a[cb][mde]=n.headersList,a[cb][Bde]="immutable",s.push(a)}return Object.freeze(s)}async add(e){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.add"}),e=ye.converters.RequestInfo(e);let t=[e];return await this.addAll(t)}async addAll(e){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.addAll"}),e=ye.converters["sequence"](e);let t=[],r=[];for(let d of e){if(typeof d=="string")continue;let p=d[Ni];if(!lb(p.url)||p.method!=="GET")throw ye.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}let i=[];for(let d of e){let p=new Ka(d)[Ni];if(!lb(p.url))throw ye.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."});p.initiator="fetch",p.destination="subresource",r.push(p);let u=zh();i.push(wXe({request:p,dispatcher:NXe(),processResponse(g){if(g.type==="error"||g.status===206||g.status<200||g.status>299)u.reject(ye.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(g.headersList.contains("vary")){let h=MF(g.headersList.get("vary"));for(let Q of h)if(Q==="*"){u.reject(ye.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let B of i)B.abort();return}}},processResponseEndOfBody(g){if(g.aborted){u.reject(new DOMException("aborted","AbortError"));return}u.resolve(g)}})),t.push(u.promise)}let n=await Promise.all(t),a=[],o=0;for(let d of n){let p={type:"put",request:r[o],response:d};a.push(p),o++}let c=zh(),l=null;try{this.#t(a)}catch(d){l=d}return queueMicrotask(()=>{l===null?c.resolve(void 0):c.reject(l)}),c.promise}async put(e,t){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,2,{header:"Cache.put"}),e=ye.converters.RequestInfo(e),t=ye.converters.Response(t);let r=null;if(e instanceof Ka?r=e[Ni]:r=new Ka(e)[Ni],!lb(r.url)||r.method!=="GET")throw ye.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"});let i=t[Ni];if(i.status===206)throw ye.errors.exception({header:"Cache.put",message:"Got 206 status"});if(i.headersList.contains("vary")){let p=MF(i.headersList.get("vary"));for(let u of p)if(u==="*")throw ye.errors.exception({header:"Cache.put",message:"Got * vary field value"})}if(i.body&&(IXe(i.body.stream)||i.body.stream.locked))throw ye.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"});let s=fXe(i),n=zh();if(i.body!=null){let u=i.body.stream.getReader();bXe(u).then(n.resolve,n.reject)}else n.resolve(void 0);let a=[],o={type:"put",request:r,response:s};a.push(o);let c=await n.promise;s.body!=null&&(s.body.source=c);let l=zh(),d=null;try{this.#t(a)}catch(p){d=p}return queueMicrotask(()=>{d===null?l.resolve():l.reject(d)}),l.promise}async delete(e,t={}){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.delete"}),e=ye.converters.RequestInfo(e),t=ye.converters.CacheQueryOptions(t);let r=null;if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return!1}else TF(typeof e=="string"),r=new Ka(e)[Ni];let i=[],s={type:"delete",request:r,options:t};i.push(s);let n=zh(),a=null,o;try{o=this.#t(i)}catch(c){a=c}return queueMicrotask(()=>{a===null?n.resolve(!!o?.length):n.reject(a)}),n.promise}async keys(e=void 0,t={}){ye.brandCheck(this,A),e!==void 0&&(e=ye.converters.RequestInfo(e)),t=ye.converters.CacheQueryOptions(t);let r=null;if(e!==void 0)if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(r=new Ka(e)[Ni]);let i=zh(),s=[];if(e===void 0)for(let n of this.#e)s.push(n[0]);else{let n=this.#r(r,t);for(let a of n)s.push(a[0])}return queueMicrotask(()=>{let n=[];for(let a of s){let o=new Ka("https://a");o[Ni]=a,o[cb][mde]=a.headersList,o[cb][Bde]="immutable",o[yXe]=a.client,n.push(o)}i.resolve(Object.freeze(n))}),i.promise}#t(e){let t=this.#e,r=[...t],i=[],s=[];try{for(let n of e){if(n.type!=="delete"&&n.type!=="put")throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(n.type==="delete"&&n.response!=null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(n.request,n.options,i).length)throw new DOMException("???","InvalidStateError");let a;if(n.type==="delete"){if(a=this.#r(n.request,n.options),a.length===0)return[];for(let o of a){let c=t.indexOf(o);TF(c!==-1),t.splice(c,1)}}else if(n.type==="put"){if(n.response==null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let o=n.request;if(!lb(o.url))throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(o.method!=="GET")throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(n.options!=null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#r(n.request);for(let c of a){let l=t.indexOf(c);TF(l!==-1),t.splice(l,1)}t.push([n.request,n.response]),i.push([n.request,n.response])}s.push([n.request,n.response])}return s}catch(n){throw this.#e.length=0,this.#e=r,n}}#r(e,t,r){let i=[],s=r??this.#e;for(let n of s){let[a,o]=n;this.#A(e,a,o,t)&&i.push(n)}return i}#A(e,t,r=null,i){let s=new URL(e.url),n=new URL(t.url);if(i?.ignoreSearch&&(n.search="",s.search=""),!BXe(s,n,!0))return!1;if(r==null||i?.ignoreVary||!r.headersList.contains("vary"))return!0;let a=MF(r.headersList.get("vary"));for(let o of a){if(o==="*")return!1;let c=t.headersList.get(o),l=e.headersList.get(o);if(c!==l)return!1}return!0}};Object.defineProperties(db.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:hp,matchAll:hp,add:hp,addAll:hp,put:hp,delete:hp,keys:hp});var fde=[{key:"ignoreSearch",converter:ye.converters.boolean,defaultValue:!1},{key:"ignoreMethod",converter:ye.converters.boolean,defaultValue:!1},{key:"ignoreVary",converter:ye.converters.boolean,defaultValue:!1}];ye.converters.CacheQueryOptions=ye.dictionaryConverter(fde);ye.converters.MultiCacheQueryOptions=ye.dictionaryConverter([...fde,{key:"cacheName",converter:ye.converters.DOMString}]);ye.converters.Response=ye.interfaceConverter(Ide);ye.converters["sequence"]=ye.sequenceConverter(ye.converters.RequestInfo);yde.exports={Cache:db}});var Nde=E((PoA,bde)=>{"use strict";var{kConstruct:Um}=ob(),{Cache:pb}=wde(),{webidl:Di}=fi(),{kEnumerableProperty:Mm}=aA(),ub=class A{#e=new Map;constructor(){arguments[0]!==Um&&Di.illegalConstructor()}async match(e,t={}){if(Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"}),e=Di.converters.RequestInfo(e),t=Di.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let r=this.#e.get(t.cacheName);return await new pb(Um,r).match(e,t)}}else for(let r of this.#e.values()){let s=await new pb(Um,r).match(e,t);if(s!==void 0)return s}}async has(e){return Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"}),e=Di.converters.DOMString(e),this.#e.has(e)}async open(e){if(Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"}),e=Di.converters.DOMString(e),this.#e.has(e)){let r=this.#e.get(e);return new pb(Um,r)}let t=[];return this.#e.set(e,t),new pb(Um,t)}async delete(e){return Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"}),e=Di.converters.DOMString(e),this.#e.delete(e)}async keys(){return Di.brandCheck(this,A),[...this.#e.keys()]}};Object.defineProperties(ub.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Mm,has:Mm,open:Mm,delete:Mm,keys:Mm});bde.exports={CacheStorage:ub}});var Rde=E((HoA,Dde)=>{"use strict";Dde.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var OF=E((GoA,vde)=>{"use strict";var xde=require("assert"),{kHeadersList:Sde}=lt();function DXe(A){if(A.length===0)return!1;for(let e of A){let t=e.charCodeAt(0);if(t>=0||t<=8||t>=10||t<=31||t===127)return!1}}function RXe(A){for(let e of A){let t=e.charCodeAt(0);if(t<=32||t>127||e==="("||e===")"||e===">"||e==="<"||e==="@"||e===","||e===";"||e===":"||e==="\\"||e==='"'||e==="/"||e==="["||e==="]"||e==="?"||e==="="||e==="{"||e==="}")throw new Error("Invalid cookie name")}}function xXe(A){for(let e of A){let t=e.charCodeAt(0);if(t<33||t===34||t===44||t===59||t===92||t>126)throw new Error("Invalid header value")}}function SXe(A){for(let e of A)if(e.charCodeAt(0)<33||e===";")throw new Error("Invalid cookie path")}function vXe(A){if(A.startsWith("-")||A.endsWith(".")||A.endsWith("-"))throw new Error("Invalid cookie domain")}function kXe(A){typeof A=="number"&&(A=new Date(A));let e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=e[A.getUTCDay()],i=A.getUTCDate().toString().padStart(2,"0"),s=t[A.getUTCMonth()],n=A.getUTCFullYear(),a=A.getUTCHours().toString().padStart(2,"0"),o=A.getUTCMinutes().toString().padStart(2,"0"),c=A.getUTCSeconds().toString().padStart(2,"0");return`${r}, ${i} ${s} ${n} ${a}:${o}:${c} GMT`}function FXe(A){if(A<0)throw new Error("Invalid cookie max-age")}function LXe(A){if(A.name.length===0)return null;RXe(A.name),xXe(A.value);let e=[`${A.name}=${A.value}`];A.name.startsWith("__Secure-")&&(A.secure=!0),A.name.startsWith("__Host-")&&(A.secure=!0,A.domain=null,A.path="/"),A.secure&&e.push("Secure"),A.httpOnly&&e.push("HttpOnly"),typeof A.maxAge=="number"&&(FXe(A.maxAge),e.push(`Max-Age=${A.maxAge}`)),A.domain&&(vXe(A.domain),e.push(`Domain=${A.domain}`)),A.path&&(SXe(A.path),e.push(`Path=${A.path}`)),A.expires&&A.expires.toString()!=="Invalid Date"&&e.push(`Expires=${kXe(A.expires)}`),A.sameSite&&e.push(`SameSite=${A.sameSite}`);for(let t of A.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");let[r,...i]=t.split("=");e.push(`${r.trim()}=${i.join("=")}`)}return e.join("; ")}var gb;function UXe(A){if(A[Sde])return A[Sde];gb||(gb=Object.getOwnPropertySymbols(A).find(t=>t.description==="headers list"),xde(gb,"Headers cannot be parsed"));let e=A[gb];return xde(e),e}vde.exports={isCTLExcludingHtab:DXe,stringify:LXe,getHeadersList:UXe}});var Fde=E((JoA,kde)=>{"use strict";var{maxNameValuePairSize:MXe,maxAttributeValueSize:TXe}=Rde(),{isCTLExcludingHtab:OXe}=OF(),{collectASequenceOfCodePointsFast:hb}=Kn(),YXe=require("assert");function qXe(A){if(OXe(A))return null;let e="",t="",r="",i="";if(A.includes(";")){let s={position:0};e=hb(";",A,s),t=A.slice(s.position)}else e=A;if(!e.includes("="))i=e;else{let s={position:0};r=hb("=",e,s),i=e.slice(s.position+1)}return r=r.trim(),i=i.trim(),r.length+i.length>MXe?null:{name:r,value:i,...jh(t)}}function jh(A,e={}){if(A.length===0)return e;YXe(A[0]===";"),A=A.slice(1);let t="";A.includes(";")?(t=hb(";",A,{position:0}),A=A.slice(t.length)):(t=A,A="");let r="",i="";if(t.includes("=")){let n={position:0};r=hb("=",t,n),i=t.slice(n.position+1)}else r=t;if(r=r.trim(),i=i.trim(),i.length>TXe)return jh(A,e);let s=r.toLowerCase();if(s==="expires"){let n=new Date(i);e.expires=n}else if(s==="max-age"){let n=i.charCodeAt(0);if((n<48||n>57)&&i[0]!=="-"||!/^\d+$/.test(i))return jh(A,e);let a=Number(i);e.maxAge=a}else if(s==="domain"){let n=i;n[0]==="."&&(n=n.slice(1)),n=n.toLowerCase(),e.domain=n}else if(s==="path"){let n="";i.length===0||i[0]!=="/"?n="/":n=i,e.path=n}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let n="Default",a=i.toLowerCase();a.includes("none")&&(n="None"),a.includes("strict")&&(n="Strict"),a.includes("lax")&&(n="Lax"),e.sameSite=n}else e.unparsed??=[],e.unparsed.push(`${r}=${i}`);return jh(A,e)}kde.exports={parseSetCookie:qXe,parseUnparsedAttributes:jh}});var Tde=E((_oA,Mde)=>{"use strict";var{parseSetCookie:PXe}=Fde(),{stringify:Lde,getHeadersList:HXe}=OF(),{webidl:AA}=fi(),{Headers:Eb}=pp();function GXe(A){AA.argumentLengthCheck(arguments,1,{header:"getCookies"}),AA.brandCheck(A,Eb,{strict:!1});let e=A.get("cookie"),t={};if(!e)return t;for(let r of e.split(";")){let[i,...s]=r.split("=");t[i.trim()]=s.join("=")}return t}function JXe(A,e,t){AA.argumentLengthCheck(arguments,2,{header:"deleteCookie"}),AA.brandCheck(A,Eb,{strict:!1}),e=AA.converters.DOMString(e),t=AA.converters.DeleteCookieAttributes(t),Ude(A,{name:e,value:"",expires:new Date(0),...t})}function _Xe(A){AA.argumentLengthCheck(arguments,1,{header:"getSetCookies"}),AA.brandCheck(A,Eb,{strict:!1});let e=HXe(A).cookies;return e?e.map(t=>PXe(Array.isArray(t)?t[1]:t)):[]}function Ude(A,e){AA.argumentLengthCheck(arguments,2,{header:"setCookie"}),AA.brandCheck(A,Eb,{strict:!1}),e=AA.converters.Cookie(e),Lde(e)&&A.append("Set-Cookie",Lde(e))}AA.converters.DeleteCookieAttributes=AA.dictionaryConverter([{converter:AA.nullableConverter(AA.converters.DOMString),key:"path",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"domain",defaultValue:null}]);AA.converters.Cookie=AA.dictionaryConverter([{converter:AA.converters.DOMString,key:"name"},{converter:AA.converters.DOMString,key:"value"},{converter:AA.nullableConverter(A=>typeof A=="number"?AA.converters["unsigned long long"](A):new Date(A)),key:"expires",defaultValue:null},{converter:AA.nullableConverter(AA.converters["long long"]),key:"maxAge",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"domain",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"path",defaultValue:null},{converter:AA.nullableConverter(AA.converters.boolean),key:"secure",defaultValue:null},{converter:AA.nullableConverter(AA.converters.boolean),key:"httpOnly",defaultValue:null},{converter:AA.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:AA.sequenceConverter(AA.converters.DOMString),key:"unparsed",defaultValue:[]}]);Mde.exports={getCookies:GXe,deleteCookie:JXe,getSetCookies:_Xe,setCookie:Ude}});var Xh=E((VoA,Ode)=>{"use strict";var VXe="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",WXe={enumerable:!0,writable:!1,configurable:!1},zXe={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},jXe={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},XXe=2**16-1,ZXe={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},KXe=Buffer.allocUnsafe(0);Ode.exports={uid:VXe,staticPropertyDescriptors:WXe,states:zXe,opcodes:jXe,maxUnsigned16Bit:XXe,parserStates:ZXe,emptyBuffer:KXe}});var Tm=E((WoA,Yde)=>{"use strict";Yde.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var qF=E((zoA,qde)=>{"use strict";var{webidl:we}=fi(),{kEnumerableProperty:rs}=aA(),{MessagePort:$Xe}=require("worker_threads"),Cb=class A extends Event{#e;constructor(e,t={}){we.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"}),e=we.converters.DOMString(e),t=we.converters.MessageEventInit(t),super(e,t),this.#e=t}get data(){return we.brandCheck(this,A),this.#e.data}get origin(){return we.brandCheck(this,A),this.#e.origin}get lastEventId(){return we.brandCheck(this,A),this.#e.lastEventId}get source(){return we.brandCheck(this,A),this.#e.source}get ports(){return we.brandCheck(this,A),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,r=!1,i=null,s="",n="",a=null,o=[]){return we.brandCheck(this,A),we.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"}),new A(e,{bubbles:t,cancelable:r,data:i,origin:s,lastEventId:n,source:a,ports:o})}},Qb=class A extends Event{#e;constructor(e,t={}){we.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"}),e=we.converters.DOMString(e),t=we.converters.CloseEventInit(t),super(e,t),this.#e=t}get wasClean(){return we.brandCheck(this,A),this.#e.wasClean}get code(){return we.brandCheck(this,A),this.#e.code}get reason(){return we.brandCheck(this,A),this.#e.reason}},mb=class A extends Event{#e;constructor(e,t){we.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"}),super(e,t),e=we.converters.DOMString(e),t=we.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return we.brandCheck(this,A),this.#e.message}get filename(){return we.brandCheck(this,A),this.#e.filename}get lineno(){return we.brandCheck(this,A),this.#e.lineno}get colno(){return we.brandCheck(this,A),this.#e.colno}get error(){return we.brandCheck(this,A),this.#e.error}};Object.defineProperties(Cb.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:rs,origin:rs,lastEventId:rs,source:rs,ports:rs,initMessageEvent:rs});Object.defineProperties(Qb.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:rs,code:rs,wasClean:rs});Object.defineProperties(mb.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:rs,filename:rs,lineno:rs,colno:rs,error:rs});we.converters.MessagePort=we.interfaceConverter($Xe);we.converters["sequence"]=we.sequenceConverter(we.converters.MessagePort);var YF=[{key:"bubbles",converter:we.converters.boolean,defaultValue:!1},{key:"cancelable",converter:we.converters.boolean,defaultValue:!1},{key:"composed",converter:we.converters.boolean,defaultValue:!1}];we.converters.MessageEventInit=we.dictionaryConverter([...YF,{key:"data",converter:we.converters.any,defaultValue:null},{key:"origin",converter:we.converters.USVString,defaultValue:""},{key:"lastEventId",converter:we.converters.DOMString,defaultValue:""},{key:"source",converter:we.nullableConverter(we.converters.MessagePort),defaultValue:null},{key:"ports",converter:we.converters["sequence"],get defaultValue(){return[]}}]);we.converters.CloseEventInit=we.dictionaryConverter([...YF,{key:"wasClean",converter:we.converters.boolean,defaultValue:!1},{key:"code",converter:we.converters["unsigned short"],defaultValue:0},{key:"reason",converter:we.converters.USVString,defaultValue:""}]);we.converters.ErrorEventInit=we.dictionaryConverter([...YF,{key:"message",converter:we.converters.DOMString,defaultValue:""},{key:"filename",converter:we.converters.USVString,defaultValue:""},{key:"lineno",converter:we.converters["unsigned long"],defaultValue:0},{key:"colno",converter:we.converters["unsigned long"],defaultValue:0},{key:"error",converter:we.converters.any}]);qde.exports={MessageEvent:Cb,CloseEvent:Qb,ErrorEvent:mb}});var fb=E((joA,Gde)=>{"use strict";var{kReadyState:Bb,kController:eZe,kResponse:AZe,kBinaryType:tZe,kWebSocketURL:rZe}=Tm(),{states:Ib,opcodes:Pde}=Xh(),{MessageEvent:iZe,ErrorEvent:sZe}=qF();function nZe(A){return A[Bb]===Ib.OPEN}function aZe(A){return A[Bb]===Ib.CLOSING}function oZe(A){return A[Bb]===Ib.CLOSED}function PF(A,e,t=Event,r){let i=new t(A,r);e.dispatchEvent(i)}function cZe(A,e,t){if(A[Bb]!==Ib.OPEN)return;let r;if(e===Pde.TEXT)try{r=new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{Hde(A,"Received invalid UTF-8 in text frame.");return}else e===Pde.BINARY&&(A[tZe]==="blob"?r=new Blob([t]):r=new Uint8Array(t).buffer);PF("message",A,iZe,{origin:A[rZe].origin,data:r})}function lZe(A){if(A.length===0)return!1;for(let e of A){let t=e.charCodeAt(0);if(t<33||t>126||e==="("||e===")"||e==="<"||e===">"||e==="@"||e===","||e===";"||e===":"||e==="\\"||e==='"'||e==="/"||e==="["||e==="]"||e==="?"||e==="="||e==="{"||e==="}"||t===32||t===9)return!1}return!0}function dZe(A){return A>=1e3&&A<1015?A!==1004&&A!==1005&&A!==1006:A>=3e3&&A<=4999}function Hde(A,e){let{[eZe]:t,[AZe]:r}=A;t.abort(),r?.socket&&!r.socket.destroyed&&r.socket.destroy(),e&&PF("error",A,sZe,{error:new Error(e)})}Gde.exports={isEstablished:nZe,isClosing:aZe,isClosed:oZe,fireEvent:PF,isValidSubprotocol:lZe,isValidStatusCode:dZe,failWebsocketConnection:Hde,websocketMessageReceived:cZe}});var jde=E((XoA,zde)=>{"use strict";var GF=require("diagnostics_channel"),{uid:pZe,states:_de}=Xh(),{kReadyState:Vde,kSentClose:Jde,kByteParser:Wde,kReceivedClose:uZe}=Tm(),{fireEvent:gZe,failWebsocketConnection:Ep}=fb(),{CloseEvent:hZe}=qF(),{makeRequest:EZe}=km(),{fetching:CZe}=ib(),{Headers:QZe}=pp(),{getGlobalDispatcher:mZe}=qh(),{kHeadersList:BZe}=lt(),sc={};sc.open=GF.channel("undici:websocket:open");sc.close=GF.channel("undici:websocket:close");sc.socketError=GF.channel("undici:websocket:socket_error");var HF;try{HF=require("crypto")}catch{}function IZe(A,e,t,r,i){let s=A;s.protocol=A.protocol==="ws:"?"http:":"https:";let n=EZe({urlList:[s],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(i.headers){let l=new QZe(i.headers)[BZe];n.headersList=l}let a=HF.randomBytes(16).toString("base64");n.headersList.append("sec-websocket-key",a),n.headersList.append("sec-websocket-version","13");for(let l of e)n.headersList.append("sec-websocket-protocol",l);let o="";return CZe({request:n,useParallelQueue:!0,dispatcher:i.dispatcher??mZe(),processResponse(l){if(l.type==="error"||l.status!==101){Ep(t,"Received network error or non-101 status code.");return}if(e.length!==0&&!l.headersList.get("Sec-WebSocket-Protocol")){Ep(t,"Server did not respond with sent protocols.");return}if(l.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Ep(t,'Server did not set Upgrade header to "websocket".');return}if(l.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Ep(t,'Server did not set Connection header to "upgrade".');return}let d=l.headersList.get("Sec-WebSocket-Accept"),p=HF.createHash("sha1").update(a+pZe).digest("base64");if(d!==p){Ep(t,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let u=l.headersList.get("Sec-WebSocket-Extensions");if(u!==null&&u!==o){Ep(t,"Received different permessage-deflate than the one set.");return}let g=l.headersList.get("Sec-WebSocket-Protocol");if(g!==null&&g!==n.headersList.get("Sec-WebSocket-Protocol")){Ep(t,"Protocol was not set in the opening handshake.");return}l.socket.on("data",fZe),l.socket.on("close",yZe),l.socket.on("error",wZe),sc.open.hasSubscribers&&sc.open.publish({address:l.socket.address(),protocol:g,extensions:u}),r(l)}})}function fZe(A){this.ws[Wde].write(A)||this.pause()}function yZe(){let{ws:A}=this,e=A[Jde]&&A[uZe],t=1005,r="",i=A[Wde].closingInfo;i?(t=i.code??1005,r=i.reason):A[Jde]||(t=1006),A[Vde]=_de.CLOSED,gZe("close",A,hZe,{wasClean:e,code:t,reason:r}),sc.close.hasSubscribers&&sc.close.publish({websocket:A,code:t,reason:r})}function wZe(A){let{ws:e}=this;e[Vde]=_de.CLOSING,sc.socketError.hasSubscribers&&sc.socketError.publish(A),this.destroy()}zde.exports={establishWebSocketConnection:IZe}});var _F=E((ZoA,Zde)=>{"use strict";var{maxUnsigned16Bit:bZe}=Xh(),Xde;try{Xde=require("crypto")}catch{}var JF=class{constructor(e){this.frameData=e,this.maskKey=Xde.randomBytes(4)}createFrame(e){let t=this.frameData?.byteLength??0,r=t,i=6;t>bZe?(i+=8,r=127):t>125&&(i+=2,r=126);let s=Buffer.allocUnsafe(t+i);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e;s[i-4]=this.maskKey[0],s[i-3]=this.maskKey[1],s[i-2]=this.maskKey[2],s[i-1]=this.maskKey[3],s[1]=r,r===126?s.writeUInt16BE(t,2):r===127&&(s[2]=s[3]=0,s.writeUIntBE(t,4,6)),s[1]|=128;for(let n=0;n{"use strict";var{Writable:NZe}=require("stream"),rpe=require("diagnostics_channel"),{parserStates:wn,opcodes:bn,states:DZe,emptyBuffer:RZe}=Xh(),{kReadyState:xZe,kSentClose:Kde,kResponse:$de,kReceivedClose:epe}=Tm(),{isValidStatusCode:Ape,failWebsocketConnection:Om,websocketMessageReceived:SZe}=fb(),{WebsocketFrameSend:tpe}=_F(),Zh={};Zh.ping=rpe.channel("undici:websocket:ping");Zh.pong=rpe.channel("undici:websocket:pong");var VF=class extends NZe{#e=[];#t=0;#r=wn.INFO;#A={};#i=[];constructor(e){super(),this.ws=e}_write(e,t,r){this.#e.push(e),this.#t+=e.length,this.run(r)}run(e){for(;;){if(this.#r===wn.INFO){if(this.#t<2)return e();let t=this.consume(2);if(this.#A.fin=(t[0]&128)!==0,this.#A.opcode=t[0]&15,this.#A.originalOpcode??=this.#A.opcode,this.#A.fragmented=!this.#A.fin&&this.#A.opcode!==bn.CONTINUATION,this.#A.fragmented&&this.#A.opcode!==bn.BINARY&&this.#A.opcode!==bn.TEXT){Om(this.ws,"Invalid frame type was fragmented.");return}let r=t[1]&127;if(r<=125?(this.#A.payloadLength=r,this.#r=wn.READ_DATA):r===126?this.#r=wn.PAYLOADLENGTH_16:r===127&&(this.#r=wn.PAYLOADLENGTH_64),this.#A.fragmented&&r>125){Om(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#A.opcode===bn.PING||this.#A.opcode===bn.PONG||this.#A.opcode===bn.CLOSE)&&r>125){Om(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#A.opcode===bn.CLOSE){if(r===1){Om(this.ws,"Received close frame with a 1-byte body.");return}let i=this.consume(r);if(this.#A.closeInfo=this.parseCloseBody(!1,i),!this.ws[Kde]){let s=Buffer.allocUnsafe(2);s.writeUInt16BE(this.#A.closeInfo.code,0);let n=new tpe(s);this.ws[$de].socket.write(n.createFrame(bn.CLOSE),a=>{a||(this.ws[Kde]=!0)})}this.ws[xZe]=DZe.CLOSING,this.ws[epe]=!0,this.end();return}else if(this.#A.opcode===bn.PING){let i=this.consume(r);if(!this.ws[epe]){let s=new tpe(i);this.ws[$de].socket.write(s.createFrame(bn.PONG)),Zh.ping.hasSubscribers&&Zh.ping.publish({payload:i})}if(this.#r=wn.INFO,this.#t>0)continue;e();return}else if(this.#A.opcode===bn.PONG){let i=this.consume(r);if(Zh.pong.hasSubscribers&&Zh.pong.publish({payload:i}),this.#t>0)continue;e();return}}else if(this.#r===wn.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#A.payloadLength=t.readUInt16BE(0),this.#r=wn.READ_DATA}else if(this.#r===wn.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),r=t.readUInt32BE(0);if(r>2**31-1){Om(this.ws,"Received payload length > 2^31 bytes.");return}let i=t.readUInt32BE(4);this.#A.payloadLength=(r<<8)+i,this.#r=wn.READ_DATA}else if(this.#r===wn.READ_DATA){if(this.#t=this.#A.payloadLength){let t=this.consume(this.#A.payloadLength);if(this.#i.push(t),!this.#A.fragmented||this.#A.fin&&this.#A.opcode===bn.CONTINUATION){let r=Buffer.concat(this.#i);SZe(this.ws,this.#A.originalOpcode,r),this.#A={},this.#i.length=0}this.#r=wn.INFO}}if(!(this.#t>0)){e();break}}}consume(e){if(e>this.#t)return null;if(e===0)return RZe;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),r=0;for(;r!==e;){let i=this.#e[0],{length:s}=i;if(s+r===e){t.set(this.#e.shift(),r);break}else if(s+r>e){t.set(i.subarray(0,e-r),r),this.#e[0]=i.subarray(e-r);break}else t.set(this.#e.shift(),r),r+=i.length}return this.#t-=e,t}parseCloseBody(e,t){let r;if(t.length>=2&&(r=t.readUInt16BE(0)),e)return Ape(r)?{code:r}:null;let i=t.subarray(2);if(i[0]===239&&i[1]===187&&i[2]===191&&(i=i.subarray(3)),r!==void 0&&!Ape(r))return null;try{i=new TextDecoder("utf-8",{fatal:!0}).decode(i)}catch{return null}return{code:r,reason:i}}get closingInfo(){return this.#A.closeInfo}};ipe.exports={ByteParser:VF}});var upe=E(($oA,ppe)=>{"use strict";var{webidl:ke}=fi(),{DOMException:kl}=yl(),{URLSerializer:vZe}=Kn(),{getGlobalOrigin:kZe}=Eh(),{staticPropertyDescriptors:Fl,states:Kh,opcodes:Ym,emptyBuffer:FZe}=Xh(),{kWebSocketURL:npe,kReadyState:nc,kController:LZe,kBinaryType:yb,kResponse:wb,kSentClose:UZe,kByteParser:MZe}=Tm(),{isEstablished:ape,isClosing:ope,isValidSubprotocol:TZe,failWebsocketConnection:OZe,fireEvent:YZe}=fb(),{establishWebSocketConnection:qZe}=jde(),{WebsocketFrameSend:qm}=_F(),{ByteParser:PZe}=spe(),{kEnumerableProperty:Nn,isBlobLike:lpe}=aA(),{getGlobalDispatcher:HZe}=qh(),{types:dpe}=require("util"),cpe=!1,Js=class A extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#r="";#A="";constructor(e,t=[]){super(),ke.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"}),cpe||(cpe=!0,process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"}));let r=ke.converters["DOMString or sequence or WebSocketInit"](t);e=ke.converters.USVString(e),t=r.protocols;let i=kZe(),s;try{s=new URL(e,i)}catch(n){throw new kl(n,"SyntaxError")}if(s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),s.protocol!=="ws:"&&s.protocol!=="wss:")throw new kl(`Expected a ws: or wss: protocol, got ${s.protocol}`,"SyntaxError");if(s.hash||s.href.endsWith("#"))throw new kl("Got fragment","SyntaxError");if(typeof t=="string"&&(t=[t]),t.length!==new Set(t.map(n=>n.toLowerCase())).size)throw new kl("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every(n=>TZe(n)))throw new kl("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[npe]=new URL(s.href),this[LZe]=qZe(s,t,this,n=>this.#i(n),r),this[nc]=A.CONNECTING,this[yb]="blob"}close(e=void 0,t=void 0){if(ke.brandCheck(this,A),e!==void 0&&(e=ke.converters["unsigned short"](e,{clamp:!0})),t!==void 0&&(t=ke.converters.USVString(t)),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new kl("invalid code","InvalidAccessError");let r=0;if(t!==void 0&&(r=Buffer.byteLength(t),r>123))throw new kl(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError");if(!(this[nc]===A.CLOSING||this[nc]===A.CLOSED))if(!ape(this))OZe(this,"Connection was closed before it was established."),this[nc]=A.CLOSING;else if(ope(this))this[nc]=A.CLOSING;else{let i=new qm;e!==void 0&&t===void 0?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==void 0&&t!==void 0?(i.frameData=Buffer.allocUnsafe(2+r),i.frameData.writeUInt16BE(e,0),i.frameData.write(t,2,"utf-8")):i.frameData=FZe,this[wb].socket.write(i.createFrame(Ym.CLOSE),n=>{n||(this[UZe]=!0)}),this[nc]=Kh.CLOSING}}send(e){if(ke.brandCheck(this,A),ke.argumentLengthCheck(arguments,1,{header:"WebSocket.send"}),e=ke.converters.WebSocketSendData(e),this[nc]===A.CONNECTING)throw new kl("Sent before connected.","InvalidStateError");if(!ape(this)||ope(this))return;let t=this[wb].socket;if(typeof e=="string"){let r=Buffer.from(e),s=new qm(r).createFrame(Ym.TEXT);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(dpe.isArrayBuffer(e)){let r=Buffer.from(e),s=new qm(r).createFrame(Ym.BINARY);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(ArrayBuffer.isView(e)){let r=Buffer.from(e,e.byteOffset,e.byteLength),s=new qm(r).createFrame(Ym.BINARY);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(lpe(e)){let r=new qm;e.arrayBuffer().then(i=>{let s=Buffer.from(i);r.frameData=s;let n=r.createFrame(Ym.BINARY);this.#t+=s.byteLength,t.write(n,()=>{this.#t-=s.byteLength})})}}get readyState(){return ke.brandCheck(this,A),this[nc]}get bufferedAmount(){return ke.brandCheck(this,A),this.#t}get url(){return ke.brandCheck(this,A),vZe(this[npe])}get extensions(){return ke.brandCheck(this,A),this.#A}get protocol(){return ke.brandCheck(this,A),this.#r}get onopen(){return ke.brandCheck(this,A),this.#e.open}set onopen(e){ke.brandCheck(this,A),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return ke.brandCheck(this,A),this.#e.error}set onerror(e){ke.brandCheck(this,A),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return ke.brandCheck(this,A),this.#e.close}set onclose(e){ke.brandCheck(this,A),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return ke.brandCheck(this,A),this.#e.message}set onmessage(e){ke.brandCheck(this,A),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return ke.brandCheck(this,A),this[yb]}set binaryType(e){ke.brandCheck(this,A),e!=="blob"&&e!=="arraybuffer"?this[yb]="blob":this[yb]=e}#i(e){this[wb]=e;let t=new PZe(this);t.on("drain",function(){this.ws[wb].socket.resume()}),e.socket.ws=this,this[MZe]=t,this[nc]=Kh.OPEN;let r=e.headersList.get("sec-websocket-extensions");r!==null&&(this.#A=r);let i=e.headersList.get("sec-websocket-protocol");i!==null&&(this.#r=i),YZe("open",this)}};Js.CONNECTING=Js.prototype.CONNECTING=Kh.CONNECTING;Js.OPEN=Js.prototype.OPEN=Kh.OPEN;Js.CLOSING=Js.prototype.CLOSING=Kh.CLOSING;Js.CLOSED=Js.prototype.CLOSED=Kh.CLOSED;Object.defineProperties(Js.prototype,{CONNECTING:Fl,OPEN:Fl,CLOSING:Fl,CLOSED:Fl,url:Nn,readyState:Nn,bufferedAmount:Nn,onopen:Nn,onerror:Nn,onclose:Nn,close:Nn,onmessage:Nn,binaryType:Nn,send:Nn,extensions:Nn,protocol:Nn,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Js,{CONNECTING:Fl,OPEN:Fl,CLOSING:Fl,CLOSED:Fl});ke.converters["sequence"]=ke.sequenceConverter(ke.converters.DOMString);ke.converters["DOMString or sequence"]=function(A){return ke.util.Type(A)==="Object"&&Symbol.iterator in A?ke.converters["sequence"](A):ke.converters.DOMString(A)};ke.converters.WebSocketInit=ke.dictionaryConverter([{key:"protocols",converter:ke.converters["DOMString or sequence"],get defaultValue(){return[]}},{key:"dispatcher",converter:A=>A,get defaultValue(){return HZe()}},{key:"headers",converter:ke.nullableConverter(ke.converters.HeadersInit)}]);ke.converters["DOMString or sequence or WebSocketInit"]=function(A){return ke.util.Type(A)==="Object"&&!(Symbol.iterator in A)?ke.converters.WebSocketInit(A):{protocols:ke.converters["DOMString or sequence"](A)}};ke.converters.WebSocketSendData=function(A){if(ke.util.Type(A)==="Object"){if(lpe(A))return ke.converters.Blob(A,{strict:!1});if(ArrayBuffer.isView(A)||dpe.isAnyArrayBuffer(A))return ke.converters.BufferSource(A)}return ke.converters.USVString(A)};ppe.exports={WebSocket:Js}});var Cpe=E((ecA,He)=>{"use strict";var GZe=Bm(),gpe=cw(),hpe=WA(),JZe=Sh(),_Ze=Foe(),VZe=wm(),Cp=aA(),{InvalidArgumentError:bb}=hpe,$h=wce(),WZe=pm(),zZe=AF(),jZe=nle(),XZe=iF(),ZZe=Gk(),KZe=ple(),{getGlobalDispatcher:Epe,setGlobalDispatcher:$Ze}=qh(),eKe=Qle(),AKe=ek(),tKe=uw(),WF;try{require("crypto"),WF=!0}catch{WF=!1}Object.assign(gpe.prototype,$h);He.exports.Dispatcher=gpe;He.exports.Client=GZe;He.exports.Pool=JZe;He.exports.BalancedPool=_Ze;He.exports.Agent=VZe;He.exports.ProxyAgent=KZe;He.exports.DecoratorHandler=eKe;He.exports.RedirectHandler=AKe;He.exports.createRedirectInterceptor=tKe;He.exports.buildConnector=WZe;He.exports.errors=hpe;function Pm(A){return(e,t,r)=>{if(typeof t=="function"&&(r=t,t=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new bb("invalid url");if(t!=null&&typeof t!="object")throw new bb("invalid opts");if(t&&t.path!=null){if(typeof t.path!="string")throw new bb("invalid opts.path");let n=t.path;t.path.startsWith("/")||(n=`/${n}`),e=new URL(Cp.parseOrigin(e).origin+n)}else t||(t=typeof e=="object"?e:{}),e=Cp.parseURL(e);let{agent:i,dispatcher:s=Epe()}=t;if(i)throw new bb("unsupported opts.agent. Did you mean opts.client?");return A.call(s,{...t,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:t.method||(t.body?"PUT":"GET")},r)}}He.exports.setGlobalDispatcher=$Ze;He.exports.getGlobalDispatcher=Epe;if(Cp.nodeMajor>16||Cp.nodeMajor===16&&Cp.nodeMinor>=8){let A=null;He.exports.fetch=async function(n){A||(A=ib().fetch);try{return await A(...arguments)}catch(a){throw typeof a=="object"&&Error.captureStackTrace(a,this),a}},He.exports.Headers=pp().Headers,He.exports.Response=zw().Response,He.exports.Request=km().Request,He.exports.FormData=aw().FormData,He.exports.File=sw().File,He.exports.FileReader=gde().FileReader;let{setGlobalOrigin:e,getGlobalOrigin:t}=Eh();He.exports.setGlobalOrigin=e,He.exports.getGlobalOrigin=t;let{CacheStorage:r}=Nde(),{kConstruct:i}=ob();He.exports.caches=new r(i)}if(Cp.nodeMajor>=16){let{deleteCookie:A,getCookies:e,getSetCookies:t,setCookie:r}=Tde();He.exports.deleteCookie=A,He.exports.getCookies=e,He.exports.getSetCookies=t,He.exports.setCookie=r;let{parseMIMEType:i,serializeAMimeType:s}=Kn();He.exports.parseMIMEType=i,He.exports.serializeAMimeType=s}if(Cp.nodeMajor>=18&&WF){let{WebSocket:A}=upe();He.exports.WebSocket=A}He.exports.request=Pm($h.request);He.exports.stream=Pm($h.stream);He.exports.pipeline=Pm($h.pipeline);He.exports.connect=Pm($h.connect);He.exports.upgrade=Pm($h.upgrade);He.exports.MockClient=zZe;He.exports.MockPool=XZe;He.exports.MockAgent=jZe;He.exports.mockErrors=ZZe});var Qpe=E(jA=>{"use strict";var rKe=jA&&jA.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,i)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),iKe=jA&&jA.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),vb=jA&&jA.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&rKe(e,A,t);return iKe(e,A),e},Ht=jA&&jA.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})};Object.defineProperty(jA,"__esModule",{value:!0});jA.HttpClient=jA.isHttps=jA.HttpClientResponse=jA.HttpClientError=jA.getProxyUrl=jA.MediaTypes=jA.Headers=jA.HttpCodes=void 0;var Nb=vb(require("http")),zF=vb(require("https")),jF=vb(ene()),Db=vb(nE()),sKe=Cpe(),Dn;(function(A){A[A.OK=200]="OK",A[A.MultipleChoices=300]="MultipleChoices",A[A.MovedPermanently=301]="MovedPermanently",A[A.ResourceMoved=302]="ResourceMoved",A[A.SeeOther=303]="SeeOther",A[A.NotModified=304]="NotModified",A[A.UseProxy=305]="UseProxy",A[A.SwitchProxy=306]="SwitchProxy",A[A.TemporaryRedirect=307]="TemporaryRedirect",A[A.PermanentRedirect=308]="PermanentRedirect",A[A.BadRequest=400]="BadRequest",A[A.Unauthorized=401]="Unauthorized",A[A.PaymentRequired=402]="PaymentRequired",A[A.Forbidden=403]="Forbidden",A[A.NotFound=404]="NotFound",A[A.MethodNotAllowed=405]="MethodNotAllowed",A[A.NotAcceptable=406]="NotAcceptable",A[A.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",A[A.RequestTimeout=408]="RequestTimeout",A[A.Conflict=409]="Conflict",A[A.Gone=410]="Gone",A[A.TooManyRequests=429]="TooManyRequests",A[A.InternalServerError=500]="InternalServerError",A[A.NotImplemented=501]="NotImplemented",A[A.BadGateway=502]="BadGateway",A[A.ServiceUnavailable=503]="ServiceUnavailable",A[A.GatewayTimeout=504]="GatewayTimeout"})(Dn||(jA.HttpCodes=Dn={}));var ni;(function(A){A.Accept="accept",A.ContentType="content-type"})(ni||(jA.Headers=ni={}));var ac;(function(A){A.ApplicationJson="application/json"})(ac||(jA.MediaTypes=ac={}));function nKe(A){let e=jF.getProxyUrl(new URL(A));return e?e.href:""}jA.getProxyUrl=nKe;var aKe=[Dn.MovedPermanently,Dn.ResourceMoved,Dn.SeeOther,Dn.TemporaryRedirect,Dn.PermanentRedirect],oKe=[Dn.BadGateway,Dn.ServiceUnavailable,Dn.GatewayTimeout],cKe=["OPTIONS","GET","DELETE","HEAD"],lKe=10,dKe=5,xb=class A extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,A.prototype)}};jA.HttpClientError=xb;var Sb=class{constructor(e){this.message=e}readBody(){return Ht(this,void 0,void 0,function*(){return new Promise(e=>Ht(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",r=>{t=Buffer.concat([t,r])}),this.message.on("end",()=>{e(t.toString())})}))})}readBodyBuffer(){return Ht(this,void 0,void 0,function*(){return new Promise(e=>Ht(this,void 0,void 0,function*(){let t=[];this.message.on("data",r=>{t.push(r)}),this.message.on("end",()=>{e(Buffer.concat(t))})}))})}};jA.HttpClientResponse=Sb;function pKe(A){return new URL(A).protocol==="https:"}jA.isHttps=pKe;var XF=class{constructor(e,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(e,t){return Ht(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return Ht(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return Ht(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("POST",e,t,r||{})})}patch(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("PATCH",e,t,r||{})})}put(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("PUT",e,t,r||{})})}head(e,t){return Ht(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,r,i){return Ht(this,void 0,void 0,function*(){return this.request(e,t,r,i)})}getJson(e,t={}){return Ht(this,void 0,void 0,function*(){t[ni.Accept]=this._getExistingOrDefaultHeader(t,ni.Accept,ac.ApplicationJson);let r=yield this.get(e,t);return this._processResponse(r,this.requestOptions)})}postJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ni.Accept]=this._getExistingOrDefaultHeader(r,ni.Accept,ac.ApplicationJson),r[ni.ContentType]=this._getExistingOrDefaultHeader(r,ni.ContentType,ac.ApplicationJson);let s=yield this.post(e,i,r);return this._processResponse(s,this.requestOptions)})}putJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ni.Accept]=this._getExistingOrDefaultHeader(r,ni.Accept,ac.ApplicationJson),r[ni.ContentType]=this._getExistingOrDefaultHeader(r,ni.ContentType,ac.ApplicationJson);let s=yield this.put(e,i,r);return this._processResponse(s,this.requestOptions)})}patchJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ni.Accept]=this._getExistingOrDefaultHeader(r,ni.Accept,ac.ApplicationJson),r[ni.ContentType]=this._getExistingOrDefaultHeader(r,ni.ContentType,ac.ApplicationJson);let s=yield this.patch(e,i,r);return this._processResponse(s,this.requestOptions)})}request(e,t,r,i){return Ht(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let s=new URL(t),n=this._prepareRequest(e,s,i),a=this._allowRetries&&cKe.includes(e)?this._maxRetries+1:1,o=0,c;do{if(c=yield this.requestRaw(n,r),c&&c.message&&c.message.statusCode===Dn.Unauthorized){let d;for(let p of this.handlers)if(p.canHandleAuthentication(c)){d=p;break}return d?d.handleAuthentication(this,n,r):c}let l=this._maxRedirects;for(;c.message.statusCode&&aKe.includes(c.message.statusCode)&&this._allowRedirects&&l>0;){let d=c.message.headers.location;if(!d)break;let p=new URL(d);if(s.protocol==="https:"&&s.protocol!==p.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield c.readBody(),p.hostname!==s.hostname)for(let u in i)u.toLowerCase()==="authorization"&&delete i[u];n=this._prepareRequest(e,p,i),c=yield this.requestRaw(n,r),l--}if(!c.message.statusCode||!oKe.includes(c.message.statusCode))return c;o+=1,o{function s(n,a){n?i(n):a?r(a):i(new Error("Unknown error"))}this.requestRawWithCallback(e,t,s)})})}requestRawWithCallback(e,t,r){typeof t=="string"&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let i=!1;function s(o,c){i||(i=!0,r(o,c))}let n=e.httpModule.request(e.options,o=>{let c=new Sb(o);s(void 0,c)}),a;n.on("socket",o=>{a=o}),n.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),s(new Error(`Request timeout: ${e.options.path}`))}),n.on("error",function(o){s(o)}),t&&typeof t=="string"&&n.write(t,"utf8"),t&&typeof t!="string"?(t.on("close",function(){n.end()}),t.pipe(n)):n.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),r=jF.getProxyUrl(t);if(r&&r.hostname)return this._getProxyAgentDispatcher(t,r)}_prepareRequest(e,t,r){let i={};i.parsedUrl=t;let s=i.parsedUrl.protocol==="https:";i.httpModule=s?zF:Nb;let n=s?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):n,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=e,i.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(i.options);return i}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Rb(this.requestOptions.headers),Rb(e||{})):Rb(e||{})}_getExistingOrDefaultHeader(e,t,r){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Rb(this.requestOptions.headers)[t]),e[t]||i||r}_getAgent(e){let t,r=jF.getProxyUrl(e),i=r&&r.hostname;if(this._keepAlive&&i&&(t=this._proxyAgent),this._keepAlive&&!i&&(t=this._agent),t)return t;let s=e.protocol==="https:",n=100;if(this.requestOptions&&(n=this.requestOptions.maxSockets||Nb.globalAgent.maxSockets),r&&r.hostname){let a={maxSockets:n,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},o,c=r.protocol==="https:";s?o=c?Db.httpsOverHttps:Db.httpsOverHttp:o=c?Db.httpOverHttps:Db.httpOverHttp,t=o(a),this._proxyAgent=t}if(this._keepAlive&&!t){let a={keepAlive:this._keepAlive,maxSockets:n};t=s?new zF.Agent(a):new Nb.Agent(a),this._agent=t}return t||(t=s?zF.globalAgent:Nb.globalAgent),s&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;let i=e.protocol==="https:";return r=new sKe.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(t.username||t.password)&&{token:`${t.username}:${t.password}`})),this._proxyAgentDispatcher=r,i&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}_performExponentialBackoff(e){return Ht(this,void 0,void 0,function*(){e=Math.min(lKe,e);let t=dKe*Math.pow(2,e);return new Promise(r=>setTimeout(()=>r(),t))})}_processResponse(e,t){return Ht(this,void 0,void 0,function*(){return new Promise((r,i)=>Ht(this,void 0,void 0,function*(){let s=e.message.statusCode||0,n={statusCode:s,result:null,headers:{}};s===Dn.NotFound&&r(n);function a(l,d){if(typeof d=="string"){let p=new Date(d);if(!isNaN(p.valueOf()))return p}return d}let o,c;try{c=yield e.readBody(),c&&c.length>0&&(t&&t.deserializeDates?o=JSON.parse(c,a):o=JSON.parse(c),n.result=o),n.headers=e.message.headers}catch{}if(s>299){let l;o&&o.message?l=o.message:c&&c.length>0?l=c:l=`Failed request: (${s})`;let d=new xb(l,s);d.result=n.result,i(d)}else r(n)}))})}};jA.HttpClient=XF;var Rb=A=>Object.keys(A).reduce((e,t)=>(e[t.toLowerCase()]=A[t],e),{})});var Ipe=E(Rn=>{"use strict";var uKe=Rn&&Rn.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),gKe=Rn&&Rn.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),hKe=Rn&&Rn.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&uKe(e,A,t);return gKe(e,A),e},mpe=Rn&&Rn.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RetryHelper=void 0;var Bpe=hKe(vr()),ZF=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return mpe(this,void 0,void 0,function*(){let r=1;for(;rsetTimeout(t,e*1e3))})}};Rn.RetryHelper=ZF});var xpe=E(Ge=>{"use strict";var EKe=Ge&&Ge.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),CKe=Ge&&Ge.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),$a=Ge&&Ge.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&EKe(e,A,t);return CKe(e,A),e},Ri=Ge&&Ge.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})},QKe=Ge&&Ge.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.evaluateVersions=Ge.isExplicitVersion=Ge.findFromManifest=Ge.getManifestFromRepo=Ge.findAllVersions=Ge.find=Ge.cacheFile=Ge.cacheDir=Ge.extractZip=Ge.extractXar=Ge.extractTar=Ge.extract7z=Ge.downloadTool=Ge.HTTPError=void 0;var cA=$a(vr()),_s=$a(WE()),xn=$a(require("fs")),mKe=$a(Kse()),Gm=$a(require("os")),ta=$a(require("path")),fpe=$a(Qpe()),oc=$a(ef()),BKe=$a(require("stream")),IKe=$a(require("util")),eE=require("assert"),ype=QKe(FR()),Ll=zE(),fKe=Ipe(),Hm=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};Ge.HTTPError=Hm;var $F=process.platform==="win32",yKe=process.platform==="darwin",wKe="actions/tool-cache";function bKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){e=e||ta.join(Rpe(),ype.default()),yield _s.mkdirP(ta.dirname(e)),cA.debug(`Downloading ${A}`),cA.debug(`Destination ${e}`);let i=3,s=KF("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),n=KF("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new fKe.RetryHelper(i,s,n).execute(()=>Ri(this,void 0,void 0,function*(){return yield NKe(A,e||"",t,r)}),o=>!(o instanceof Hm&&o.httpStatusCode&&o.httpStatusCode<500&&o.httpStatusCode!==408&&o.httpStatusCode!==429))})}Ge.downloadTool=bKe;function NKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){if(xn.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let i=new fpe.HttpClient(wKe,[],{allowRetries:!1});t&&(cA.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let s=yield i.get(A,r);if(s.message.statusCode!==200){let l=new Hm(s.message.statusCode);throw cA.debug(`Failed to download from "${A}". Code(${s.message.statusCode}) Message(${s.message.statusMessage})`),l}let n=IKe.promisify(BKe.pipeline),o=KF("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>s.message)(),c=!1;try{return yield n(o,xn.createWriteStream(e)),cA.debug("download complete"),c=!0,e}finally{if(!c){cA.debug("download failed");try{yield _s.rmRF(e)}catch(l){cA.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function DKe(A,e,t){return Ri(this,void 0,void 0,function*(){eE.ok($F,"extract7z() not supported on current OS"),eE.ok(A,'parameter "file" is required'),e=yield kb(e);let r=process.cwd();if(process.chdir(e),t)try{let s=["x",cA.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",A],n={silent:!0};yield Ll.exec(`"${t}"`,s,n)}finally{process.chdir(r)}else{let i=ta.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),s=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),n=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${i}' -Source '${s}' -Target '${n}'`],c={silent:!0};try{let l=yield _s.which("powershell",!0);yield Ll.exec(`"${l}"`,o,c)}finally{process.chdir(r)}}return e})}Ge.extract7z=DKe;function RKe(A,e,t="xz"){return Ri(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");e=yield kb(e),cA.debug("Checking tar --version");let r="";yield Ll.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:o=>r+=o.toString(),stderr:o=>r+=o.toString()}}),cA.debug(r.trim());let i=r.toUpperCase().includes("GNU TAR"),s;t instanceof Array?s=t:s=[t],cA.isDebug()&&!t.includes("v")&&s.push("-v");let n=e,a=A;return $F&&i&&(s.push("--force-local"),n=e.replace(/\\/g,"/"),a=A.replace(/\\/g,"/")),i&&(s.push("--warning=no-unknown-keyword"),s.push("--overwrite")),s.push("-C",n,"-f",a),yield Ll.exec("tar",s),e})}Ge.extractTar=RKe;function xKe(A,e,t=[]){return Ri(this,void 0,void 0,function*(){eE.ok(yKe,"extractXar() not supported on current OS"),eE.ok(A,'parameter "file" is required'),e=yield kb(e);let r;t instanceof Array?r=t:r=[t],r.push("-x","-C",e,"-f",A),cA.isDebug()&&r.push("-v");let i=yield _s.which("xar",!0);return yield Ll.exec(`"${i}"`,OKe(r)),e})}Ge.extractXar=xKe;function SKe(A,e){return Ri(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");return e=yield kb(e),$F?yield vKe(A,e):yield kKe(A,e),e})}Ge.extractZip=SKe;function vKe(A,e){return Ri(this,void 0,void 0,function*(){let t=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=yield _s.which("pwsh",!1);if(i){let n=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ")];cA.debug(`Using pwsh at path: ${i}`),yield Ll.exec(`"${i}"`,n)}else{let n=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`].join(" ")],a=yield _s.which("powershell",!0);cA.debug(`Using powershell at path: ${a}`),yield Ll.exec(`"${a}"`,n)}})}function kKe(A,e){return Ri(this,void 0,void 0,function*(){let t=yield _s.which("unzip",!0),r=[A];cA.isDebug()||r.unshift("-q"),r.unshift("-o"),yield Ll.exec(`"${t}"`,r,{cwd:e})})}function FKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){if(t=oc.clean(t)||t,r=r||Gm.arch(),cA.debug(`Caching tool ${e} ${t} ${r}`),cA.debug(`source dir: ${A}`),!xn.statSync(A).isDirectory())throw new Error("sourceDir is not a directory");let i=yield bpe(e,t,r);for(let s of xn.readdirSync(A)){let n=ta.join(A,s);yield _s.cp(n,i,{recursive:!0})}return Npe(e,t,r),i})}Ge.cacheDir=FKe;function LKe(A,e,t,r,i){return Ri(this,void 0,void 0,function*(){if(r=oc.clean(r)||r,i=i||Gm.arch(),cA.debug(`Caching tool ${t} ${r} ${i}`),cA.debug(`source file: ${A}`),!xn.statSync(A).isFile())throw new Error("sourceFile is not a file");let s=yield bpe(t,r,i),n=ta.join(s,e);return cA.debug(`destination file ${n}`),yield _s.cp(A,n),Npe(t,r,i),s})}Ge.cacheFile=LKe;function UKe(A,e,t){if(!A)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(t=t||Gm.arch(),!e7(e)){let i=wpe(A,t);e=Dpe(i,e)}let r="";if(e){e=oc.clean(e)||"";let i=ta.join(Fb(),A,e,t);cA.debug(`checking cache: ${i}`),xn.existsSync(i)&&xn.existsSync(`${i}.complete`)?(cA.debug(`Found tool in cache ${A} ${e} ${t}`),r=i):cA.debug("not found")}return r}Ge.find=UKe;function wpe(A,e){let t=[];e=e||Gm.arch();let r=ta.join(Fb(),A);if(xn.existsSync(r)){let i=xn.readdirSync(r);for(let s of i)if(e7(s)){let n=ta.join(r,s,e||"");xn.existsSync(n)&&xn.existsSync(`${n}.complete`)&&t.push(s)}}return t}Ge.findAllVersions=wpe;function MKe(A,e,t,r="master"){return Ri(this,void 0,void 0,function*(){let i=[],s=`https://api.github.com/repos/${A}/${e}/git/trees/${r}`,n=new fpe.HttpClient("tool-cache"),a={};t&&(cA.debug("set auth"),a.authorization=t);let o=yield n.getJson(s,a);if(!o.result)return i;let c="";for(let d of o.result.tree)if(d.path==="versions-manifest.json"){c=d.url;break}a.accept="application/vnd.github.VERSION.raw";let l=yield(yield n.get(c,a)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{i=JSON.parse(l)}catch{cA.debug("Invalid json")}}return i})}Ge.getManifestFromRepo=MKe;function TKe(A,e,t,r=Gm.arch()){return Ri(this,void 0,void 0,function*(){return yield mKe._findMatch(A,e,t,r)})}Ge.findFromManifest=TKe;function kb(A){return Ri(this,void 0,void 0,function*(){return A||(A=ta.join(Rpe(),ype.default())),yield _s.mkdirP(A),A})}function bpe(A,e,t){return Ri(this,void 0,void 0,function*(){let r=ta.join(Fb(),A,oc.clean(e)||e,t||"");cA.debug(`destination ${r}`);let i=`${r}.complete`;return yield _s.rmRF(r),yield _s.rmRF(i),yield _s.mkdirP(r),r})}function Npe(A,e,t){let i=`${ta.join(Fb(),A,oc.clean(e)||e,t||"")}.complete`;xn.writeFileSync(i,""),cA.debug("finished caching tool")}function e7(A){let e=oc.clean(A)||"";cA.debug(`isExplicit: ${e}`);let t=oc.valid(e)!=null;return cA.debug(`explicit? ${t}`),t}Ge.isExplicitVersion=e7;function Dpe(A,e){let t="";cA.debug(`evaluating ${A.length} versions`),A=A.sort((r,i)=>oc.gt(r,i)?1:-1);for(let r=A.length-1;r>=0;r--){let i=A[r];if(oc.satisfies(i,e)){t=i;break}}return t?cA.debug(`matched: ${t}`):cA.debug("match not found"),t}Ge.evaluateVersions=Dpe;function Fb(){let A=process.env.RUNNER_TOOL_CACHE||"";return eE.ok(A,"Expected RUNNER_TOOL_CACHE to be defined"),A}function Rpe(){let A=process.env.RUNNER_TEMP||"";return eE.ok(A,"Expected RUNNER_TEMP to be defined"),A}function KF(A,e){let t=global[A];return t!==void 0?t:e}function OKe(A){return Array.from(new Set(A))}});var Tpe=require("node:os"),i7=require("node:path"),tE=require("node:fs"),ai=is(vr());var Fpe=require("node:os"),AE=require("node:path"),eo=require("node:fs"),Qp=is(vr()),Lb=is(jse()),_m=is(xpe()),t7=is(zE());var Jm=require("node:os"),Spe=require("node:fs"),vpe=is(vr());function YKe(A){let{registryUrl:e,scope:t}=A,r;if(e)try{r=new URL(e)}catch{throw new Error(`Invalid registry-url: ${e}`)}let i;return t&&(i=t.startsWith("@")?t.toLocaleLowerCase():`@${t.toLocaleLowerCase()}`),r&&i?`[install.scopes]${Jm.EOL}'${i}' = { token = "$BUN_AUTH_TOKEN", url = "${r}"}${Jm.EOL}`:r&&!i?`[install]${Jm.EOL}registry = "${r}"${Jm.EOL}`:null}function kpe(A,e){let t=YKe(e);t&&((0,vpe.info)(`Writing bunfig.toml to '${A}'.`),(0,Spe.appendFileSync)(A,t,{encoding:"utf8"}))}var Lpe=is(vr());function A7(A,e){return A().catch(t=>{if(console.log(`Remaining retries ${e}`),console.log("Current error:"),console.log(t),e<=0)throw t;return A7(A,e-1)})}var Upe=async A=>{let e=(0,AE.join)(process.cwd(),"bunfig.toml");kpe(e,A);let t=HKe(A),r=PKe(A),i=(0,AE.join)((0,Fpe.homedir)(),".bun","bin");try{(0,eo.mkdirSync)(i,{recursive:!0})}catch(d){if(d.code!=="EEXIST")throw d}(0,Qp.addPath)(i);let s=d=>process.platform==="win32"?`${d}.exe`:d,n=(0,AE.join)(i,s("bun"));try{(0,eo.symlinkSync)(n,(0,AE.join)(i,s("bunx")))}catch(d){if(d.code!=="EEXIST")throw d}let a,o=!1;if(r&&await(0,Lb.restoreCache)([n],t)&&(a=await Mpe(n),a?(o=!0,(0,Qp.info)(`Using a cached version of Bun: ${a}`)):(0,Qp.warning)(`Found a cached version of Bun: ${a} (but it appears to be corrupted?)`)),o||((0,Qp.info)(`Downloading a new version of Bun: ${t}`),a=await A7(async()=>await qKe(t,n),3),console.log("Downloaded Bun revision: "+a)),!a)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[c]=a.split("+"),l={cacheEnabled:r,cacheHit:o,bunPath:n,url:t};return console.log("Saving cache state: "+JSON.stringify(l)),(0,Lpe.saveState)("cache",JSON.stringify(l)),console.log("Saved cache state: "+JSON.stringify(l)),{version:c,revision:a,cacheHit:o}};async function qKe(A,e){let t=await(0,_m.downloadTool)(A),r=await(0,_m.extractZip)(t),i=await r7(r);try{(0,eo.renameSync)(i,e)}catch{(0,eo.copyFileSync)(i,e)}return await Mpe(e)}function PKe(A){let{customUrl:e,version:t,noCache:r}=A;return r||e||!t||/latest|canary|action/i.test(t)?!1:(0,Lb.isFeatureAvailable)()}function HKe(A){let{customUrl:e}=A;if(e)return e;let{version:t,os:r,arch:i,avx2:s,profile:n}=A,a=encodeURIComponent(t??"latest"),o=encodeURIComponent(r??process.platform),c=encodeURIComponent(i??process.arch),l=encodeURIComponent(s??!0),d=encodeURIComponent(n??!1),{href:p}=new URL(`${a}/${o}/${c}?avx2=${l}&profile=${d}`,"https://bun.sh/download/");return p}async function r7(A){for(let e of(0,eo.readdirSync)(A,{withFileTypes:!0})){let{name:t}=e,r=(0,AE.join)(A,t);if(e.isFile()){if(t==="bun"||t==="bun.exe")return r;if(/^bun.*\.zip/.test(t)){let i=await(0,_m.extractZip)(r);return r7(i)}}if(/^bun/.test(t)&&e.isDirectory())return r7(r)}throw new Error("Could not find executable: bun")}async function Mpe(A){let e=await(0,t7.getExecOutput)(A,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let t=await(0,t7.getExecOutput)(A,["--version"],{ignoreReturnCode:!0});if(t.exitCode===0&&/^\d+\.\d+\.\d+/.test(t.stdout))return t.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,Tpe.tmpdir)());function GKe(){let A=process.env.GITHUB_WORKSPACE;if(!A)return;let e=(0,i7.join)(A,"package.json");try{if(!(0,tE.existsSync)(e))return;let{packageManager:t}=JSON.parse((0,tE.readFileSync)(e,"utf8"));if(!t?.includes("bun@"))return;let[r,i]=t.split("bun@");return i}catch(t){let{message:r}=t;(0,ai.warning)(`Failed to read package.json: ${r}`)}}function JKe(){let A=process.env.GITHUB_WORKSPACE;if(!A)return;let e=(0,i7.join)(A,".tool-versions");try{return(0,tE.existsSync)(e)?(0,tE.readFileSync)(e,"utf8").match(/^bun\s(?.*?)$/m)?.groups?.version:void 0}catch(t){let{message:r}=t;(0,ai.warning)(`Failed to read .tool-versions: ${r}`)}}Upe({version:(0,ai.getInput)("bun-version")||GKe()||JKe()||void 0,customUrl:(0,ai.getInput)("bun-download-url")||void 0,registryUrl:(0,ai.getInput)("registry-url")||void 0,scope:(0,ai.getInput)("scope")||void 0,noCache:(0,ai.getBooleanInput)("no-cache")||!1}).then(({version:A,revision:e,cacheHit:t})=>{(0,ai.setOutput)("bun-version",A),(0,ai.setOutput)("bun-revision",e),(0,ai.setOutput)("cache-hit",t)}).catch(A=>{(0,ai.setFailed)(A)}); +`.trim())}};sle.exports=oF});var ple=E((boA,dle)=>{"use strict";var{kProxy:gze,kClose:hze,kDestroy:Eze,kInterceptors:Cze}=lt(),{URL:ale}=require("url"),ole=wm(),Qze=Sh(),mze=dm(),{InvalidArgumentError:Rm,RequestAbortedError:Bze}=WA(),cle=pm(),Dm=Symbol("proxy agent"),Hw=Symbol("proxy client"),Gw=Symbol("proxy headers"),cF=Symbol("request tls settings"),Ize=Symbol("proxy tls settings"),lle=Symbol("connect endpoint function");function fze(A){return A==="https:"?443:80}function yze(A){if(typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new Rm("Proxy opts.uri is mandatory");return{uri:A.uri,protocol:A.protocol||"https"}}function wze(A,e){return new Qze(A,e)}var lF=class extends mze{constructor(e){if(super(e),this[gze]=yze(e),this[Dm]=new ole(e),this[Cze]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new Rm("Proxy opts.uri is mandatory");let{clientFactory:t=wze}=e;if(typeof t!="function")throw new Rm("Proxy opts.clientFactory must be a function.");if(this[cF]=e.requestTls,this[Ize]=e.proxyTls,this[Gw]=e.headers||{},e.auth&&e.token)throw new Rm("opts.auth cannot be used in combination with opts.token");e.auth?this[Gw]["proxy-authorization"]=`Basic ${e.auth}`:e.token&&(this[Gw]["proxy-authorization"]=e.token);let r=new ale(e.uri),{origin:i,port:s,host:n}=r,a=cle({...e.proxyTls});this[lle]=cle({...e.requestTls}),this[Hw]=t(r,{connect:a}),this[Dm]=new ole({...e,connect:async(o,c)=>{let l=o.host;o.port||(l+=`:${fze(o.protocol)}`);try{let{socket:d,statusCode:p}=await this[Hw].connect({origin:i,port:s,path:l,signal:o.signal,headers:{...this[Gw],host:n}});if(p!==200&&(d.on("error",()=>{}).destroy(),c(new Bze("Proxy response !== 200 when HTTP Tunneling"))),o.protocol!=="https:"){c(null,d);return}let u;this[cF]?u=this[cF].servername:u=o.servername,this[lle]({...o,servername:u,httpSocket:d},c)}catch(d){c(d)}}})}dispatch(e,t){let{host:r}=new ale(e.origin),i=bze(e.headers);return Nze(i),this[Dm].dispatch({...e,headers:{...i,host:r}},t)}async[hze](){await this[Dm].close(),await this[Hw].close()}async[Eze](){await this[Dm].destroy(),await this[Hw].destroy()}};function bze(A){if(Array.isArray(A)){let e={};for(let t=0;tt.toLowerCase()==="proxy-authorization"))throw new Rm("Proxy-Authorization should be sent in ProxyAgent constructor")}dle.exports=lF});var qh=E((NoA,Ele)=>{"use strict";var ule=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Dze}=WA(),Rze=wm();hle()===void 0&&gle(new Rze);function gle(A){if(!A||typeof A.dispatch!="function")throw new Dze("Argument agent must implement Agent");Object.defineProperty(globalThis,ule,{value:A,writable:!0,enumerable:!1,configurable:!1})}function hle(){return globalThis[ule]}Ele.exports={setGlobalDispatcher:gle,getGlobalDispatcher:hle}});var Qle=E((RoA,Cle)=>{"use strict";Cle.exports=class{constructor(e){this.handler=e}onConnect(...e){return this.handler.onConnect(...e)}onError(...e){return this.handler.onError(...e)}onUpgrade(...e){return this.handler.onUpgrade(...e)}onHeaders(...e){return this.handler.onHeaders(...e)}onData(...e){return this.handler.onData(...e)}onComplete(...e){return this.handler.onComplete(...e)}onBodySent(...e){return this.handler.onBodySent(...e)}}});var pp=E((xoA,fle)=>{"use strict";var{kHeadersList:$i}=lt(),{kGuard:dp}=Xo(),{kEnumerableProperty:Xa}=aA(),{makeIterator:dF,isValidHeaderName:xm,isValidHeaderValue:mle}=In(),{webidl:Ve}=fi(),xze=require("assert"),es=Symbol("headers map"),As=Symbol("headers map sorted");function Ble(A){let e=A.length;for(;/[\r\n\t ]/.test(A.charAt(--e)););return A.slice(0,e+1).replace(/^[\r\n\t ]+/,"")}function Ile(A,e){if(Array.isArray(e))for(let t of e){if(t.length!==2)throw Ve.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${t.length}.`});A.append(t[0],t[1])}else if(typeof e=="object"&&e!==null)for(let[t,r]of Object.entries(e))A.append(t,r);else throw Ve.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})}var Jw=class A{cookies=null;constructor(e){e instanceof A?(this[es]=new Map(e[es]),this[As]=e[As],this.cookies=e.cookies):(this[es]=new Map(e),this[As]=null)}contains(e){return e=e.toLowerCase(),this[es].has(e)}clear(){this[es].clear(),this[As]=null,this.cookies=null}append(e,t){this[As]=null;let r=e.toLowerCase(),i=this[es].get(r);if(i){let s=r==="cookie"?"; ":", ";this[es].set(r,{name:i.name,value:`${i.value}${s}${t}`})}else this[es].set(r,{name:e,value:t});r==="set-cookie"&&(this.cookies??=[],this.cookies.push(t))}set(e,t){this[As]=null;let r=e.toLowerCase();return r==="set-cookie"&&(this.cookies=[t]),this[es].set(r,{name:e,value:t})}delete(e){return this[As]=null,e=e.toLowerCase(),e==="set-cookie"&&(this.cookies=null),this[es].delete(e)}get(e){return this.contains(e)?this[es].get(e.toLowerCase())?.value??null:null}*[Symbol.iterator](){for(let[e,{value:t}]of this[es])yield[e,t]}get entries(){let e={};if(this[es].size)for(let{name:t,value:r}of this[es].values())e[t]=r;return e}},Ph=class A{constructor(e=void 0){this[$i]=new Jw,this[dp]="none",e!==void 0&&(e=Ve.converters.HeadersInit(e),Ile(this,e))}append(e,t){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,2,{header:"Headers.append"}),e=Ve.converters.ByteString(e),t=Ve.converters.ByteString(t),t=Ble(t),xm(e)){if(!mle(t))throw Ve.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header value"})}else throw Ve.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(this[dp]==="immutable")throw new TypeError("immutable");return this[dp],this[$i].append(e,t)}delete(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.delete"}),e=Ve.converters.ByteString(e),!xm(e))throw Ve.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this[dp]==="immutable")throw new TypeError("immutable");if(this[dp],!!this[$i].contains(e))return this[$i].delete(e)}get(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.get"}),e=Ve.converters.ByteString(e),!xm(e))throw Ve.errors.invalidArgument({prefix:"Headers.get",value:e,type:"header name"});return this[$i].get(e)}has(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.has"}),e=Ve.converters.ByteString(e),!xm(e))throw Ve.errors.invalidArgument({prefix:"Headers.has",value:e,type:"header name"});return this[$i].contains(e)}set(e,t){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,2,{header:"Headers.set"}),e=Ve.converters.ByteString(e),t=Ve.converters.ByteString(t),t=Ble(t),xm(e)){if(!mle(t))throw Ve.errors.invalidArgument({prefix:"Headers.set",value:t,type:"header value"})}else throw Ve.errors.invalidArgument({prefix:"Headers.set",value:e,type:"header name"});if(this[dp]==="immutable")throw new TypeError("immutable");return this[dp],this[$i].set(e,t)}getSetCookie(){Ve.brandCheck(this,A);let e=this[$i].cookies;return e?[...e]:[]}get[As](){if(this[$i][As])return this[$i][As];let e=[],t=[...this[$i]].sort((i,s)=>i[0][...this[As].values()],"Headers","key")}values(){return Ve.brandCheck(this,A),dF(()=>[...this[As].values()],"Headers","value")}entries(){return Ve.brandCheck(this,A),dF(()=>[...this[As].values()],"Headers","key+value")}forEach(e,t=globalThis){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.forEach"}),typeof e!="function")throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(let[r,i]of this)e.apply(t,[i,r,this])}[Symbol.for("nodejs.util.inspect.custom")](){return Ve.brandCheck(this,A),this[$i]}};Ph.prototype[Symbol.iterator]=Ph.prototype.entries;Object.defineProperties(Ph.prototype,{append:Xa,delete:Xa,get:Xa,has:Xa,set:Xa,getSetCookie:Xa,keys:Xa,values:Xa,entries:Xa,forEach:Xa,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:"Headers",configurable:!0}});Ve.converters.HeadersInit=function(A){if(Ve.util.Type(A)==="Object")return A[Symbol.iterator]?Ve.converters["sequence>"](A):Ve.converters["record"](A);throw Ve.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};fle.exports={fill:Ile,Headers:Ph,HeadersList:Jw}});var zw=E((SoA,Sle)=>{"use strict";var{Headers:Sze,HeadersList:yle,fill:vze}=pp(),{extractBody:wle,cloneBody:kze,mixinBody:Fze}=om(),gF=aA(),{kEnumerableProperty:Ps}=gF,{isValidReasonPhrase:Lze,isCancelled:Uze,isAborted:Mze,isBlobLike:Tze,serializeJavascriptValueToJSONString:Oze,isErrorLike:Yze,isomorphicEncode:qze}=In(),{redirectStatus:Pze,nullBodyStatus:Hze,DOMException:ble}=yl(),{kState:dt,kHeaders:yr,kGuard:Hh,kRealm:qs}=Xo(),{webidl:Pe}=fi(),{FormData:Gze}=aw(),{getGlobalOrigin:Jze}=Eh(),{URLSerializer:Nle}=Kn(),{kHeadersList:pF}=lt(),hF=require("assert"),{types:uF}=require("util"),Rle=globalThis.ReadableStream||require("stream/web").ReadableStream,Gh=class A{static error(){let e={settingsObject:{}},t=new A;return t[dt]=Vw(),t[qs]=e,t[yr][pF]=t[dt].headersList,t[yr][Hh]="immutable",t[yr][qs]=e,t}static json(e,t={}){Pe.argumentLengthCheck(arguments,1,{header:"Response.json"}),t!==null&&(t=Pe.converters.ResponseInit(t));let r=new TextEncoder("utf-8").encode(Oze(e)),i=wle(r),s={settingsObject:{}},n=new A;return n[qs]=s,n[yr][Hh]="response",n[yr][qs]=s,Dle(n,t,{body:i[0],type:"application/json"}),n}static redirect(e,t=302){let r={settingsObject:{}};Pe.argumentLengthCheck(arguments,1,{header:"Response.redirect"}),e=Pe.converters.USVString(e),t=Pe.converters["unsigned short"](t);let i;try{i=new URL(e,Jze())}catch(a){throw Object.assign(new TypeError("Failed to parse URL from "+e),{cause:a})}if(!Pze.includes(t))throw new RangeError("Invalid status code "+t);let s=new A;s[qs]=r,s[yr][Hh]="immutable",s[yr][qs]=r,s[dt].status=t;let n=qze(Nle(i));return s[dt].headersList.append("location",n),s}constructor(e=null,t={}){e!==null&&(e=Pe.converters.BodyInit(e)),t=Pe.converters.ResponseInit(t),this[qs]={settingsObject:{}},this[dt]=Ww({}),this[yr]=new Sze,this[yr][Hh]="response",this[yr][pF]=this[dt].headersList,this[yr][qs]=this[qs];let r=null;if(e!=null){let[i,s]=wle(e);r={body:i,type:s}}Dle(this,t,r)}get type(){return Pe.brandCheck(this,A),this[dt].type}get url(){Pe.brandCheck(this,A);let e=this[dt].urlList,t=e[e.length-1]??null;return t===null?"":Nle(t,!0)}get redirected(){return Pe.brandCheck(this,A),this[dt].urlList.length>1}get status(){return Pe.brandCheck(this,A),this[dt].status}get ok(){return Pe.brandCheck(this,A),this[dt].status>=200&&this[dt].status<=299}get statusText(){return Pe.brandCheck(this,A),this[dt].statusText}get headers(){return Pe.brandCheck(this,A),this[yr]}get body(){return Pe.brandCheck(this,A),this[dt].body?this[dt].body.stream:null}get bodyUsed(){return Pe.brandCheck(this,A),!!this[dt].body&&gF.isDisturbed(this[dt].body.stream)}clone(){if(Pe.brandCheck(this,A),this.bodyUsed||this.body&&this.body.locked)throw Pe.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=EF(this[dt]),t=new A;return t[dt]=e,t[qs]=this[qs],t[yr][pF]=e.headersList,t[yr][Hh]=this[yr][Hh],t[yr][qs]=this[yr][qs],t}};Fze(Gh);Object.defineProperties(Gh.prototype,{type:Ps,url:Ps,status:Ps,ok:Ps,redirected:Ps,statusText:Ps,headers:Ps,clone:Ps,body:Ps,bodyUsed:Ps,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Gh,{json:Ps,redirect:Ps,error:Ps});function EF(A){if(A.internalResponse)return xle(EF(A.internalResponse),A.type);let e=Ww({...A,body:null});return A.body!=null&&(e.body=kze(A.body)),e}function Ww(A){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...A,headersList:A.headersList?new yle(A.headersList):new yle,urlList:A.urlList?[...A.urlList]:[]}}function Vw(A){let e=Yze(A);return Ww({type:"error",status:0,error:e?A:new Error(A&&String(A)),aborted:A&&A.name==="AbortError"})}function _w(A,e){return e={internalResponse:A,...e},new Proxy(A,{get(t,r){return r in e?e[r]:t[r]},set(t,r,i){return hF(!(r in e)),t[r]=i,!0}})}function xle(A,e){if(e==="basic")return _w(A,{type:"basic",headersList:A.headersList});if(e==="cors")return _w(A,{type:"cors",headersList:A.headersList});if(e==="opaque")return _w(A,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return _w(A,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});hF(!1)}function _ze(A,e=null){return hF(Uze(A)),Mze(A)?Vw(Object.assign(new ble("The operation was aborted.","AbortError"),{cause:e})):Vw(Object.assign(new ble("Request was cancelled."),{cause:e}))}function Dle(A,e,t){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Lze(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(A[dt].status=e.status),"statusText"in e&&e.statusText!=null&&(A[dt].statusText=e.statusText),"headers"in e&&e.headers!=null&&vze(A[yr],e.headers),t){if(Hze.includes(A.status))throw Pe.errors.exception({header:"Response constructor",message:"Invalid response status code "+A.status});A[dt].body=t.body,t.type!=null&&!A[dt].headersList.contains("Content-Type")&&A[dt].headersList.append("content-type",t.type)}}Pe.converters.ReadableStream=Pe.interfaceConverter(Rle);Pe.converters.FormData=Pe.interfaceConverter(Gze);Pe.converters.URLSearchParams=Pe.interfaceConverter(URLSearchParams);Pe.converters.XMLHttpRequestBodyInit=function(A){return typeof A=="string"?Pe.converters.USVString(A):Tze(A)?Pe.converters.Blob(A,{strict:!1}):uF.isAnyArrayBuffer(A)||uF.isTypedArray(A)||uF.isDataView(A)?Pe.converters.BufferSource(A):gF.isFormDataLike(A)?Pe.converters.FormData(A,{strict:!1}):A instanceof URLSearchParams?Pe.converters.URLSearchParams(A):Pe.converters.DOMString(A)};Pe.converters.BodyInit=function(A){return A instanceof Rle?Pe.converters.ReadableStream(A):A?.[Symbol.asyncIterator]?A:Pe.converters.XMLHttpRequestBodyInit(A)};Pe.converters.ResponseInit=Pe.dictionaryConverter([{key:"status",converter:Pe.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:Pe.converters.ByteString,defaultValue:""},{key:"headers",converter:Pe.converters.HeadersInit}]);Sle.exports={makeNetworkError:Vw,makeResponse:Ww,makeAppropriateNetworkError:_ze,filterResponse:xle,Response:Gh,cloneResponse:EF}});var km=E((voA,Tle)=>{"use strict";var{extractBody:Vze,mixinBody:Wze,cloneBody:zze}=om(),{Headers:CF,fill:jze,HeadersList:vle}=pp(),{FinalizationRegistry:Xze}=Dk()(),vm=aA(),{isValidHTTPToken:Zze,sameOrigin:kle,normalizeMethod:Kze,makePolicyContainer:$ze}=In(),{forbiddenMethods:eje,corsSafeListedMethods:Aje,referrerPolicy:tje,requestRedirect:rje,requestMode:ije,requestCredentials:sje,requestCache:nje,requestDuplex:aje}=yl(),{kEnumerableProperty:Kt}=vm,{kHeaders:wr,kSignal:Sm,kState:st,kGuard:jw,kRealm:Hs}=Xo(),{webidl:Re}=fi(),{getGlobalOrigin:oje}=Eh(),{URLSerializer:cje}=Kn(),{kHeadersList:Xw}=lt(),lje=require("assert"),{getMaxListeners:Fle,setMaxListeners:Lle,getEventListeners:dje,defaultMaxListeners:Ule}=require("events"),QF=globalThis.TransformStream,Mle=Symbol("init"),pje=Symbol("abortController"),uje=new Xze(({signal:A,abort:e})=>{A.removeEventListener("abort",e)}),up=class A{constructor(e,t={}){if(e===Mle)return;Re.argumentLengthCheck(arguments,1,{header:"Request constructor"}),e=Re.converters.RequestInfo(e),t=Re.converters.RequestInit(t),this[Hs]={settingsObject:{baseUrl:oje(),get origin(){return this.baseUrl?.origin},policyContainer:$ze()}};let r=null,i=null,s=this[Hs].settingsObject.baseUrl,n=null;if(typeof e=="string"){let h;try{h=new URL(e,s)}catch(Q){throw new TypeError("Failed to parse URL from "+e,{cause:Q})}if(h.username||h.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);r=Zw({urlList:[h]}),i="cors"}else lje(e instanceof A),r=e[st],n=e[Sm];let a=this[Hs].settingsObject.origin,o="client";if(r.window?.constructor?.name==="EnvironmentSettingsObject"&&kle(r.window,a)&&(o=r.window),t.window!=null)throw new TypeError(`'window' option '${o}' must be null`);if("window"in t&&(o="no-window"),r=Zw({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:this[Hs].settingsObject,window:o,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]}),Object.keys(t).length>0&&(r.mode==="navigate"&&(r.mode="same-origin"),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin="client",r.referrer="client",r.referrerPolicy="",r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),t.referrer!==void 0){let h=t.referrer;if(h==="")r.referrer="no-referrer";else{let Q;try{Q=new URL(h,s)}catch(B){throw new TypeError(`Referrer "${h}" is not a valid URL.`,{cause:B})}Q.protocol==="about:"&&Q.hostname==="client"||a&&!kle(Q,this[Hs].settingsObject.baseUrl)?r.referrer="client":r.referrer=Q}}t.referrerPolicy!==void 0&&(r.referrerPolicy=t.referrerPolicy);let c;if(t.mode!==void 0?c=t.mode:c=i,c==="navigate")throw Re.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(c!=null&&(r.mode=c),t.credentials!==void 0&&(r.credentials=t.credentials),t.cache!==void 0&&(r.cache=t.cache),r.cache==="only-if-cached"&&r.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(t.redirect!==void 0&&(r.redirect=t.redirect),t.integrity!==void 0&&t.integrity!=null&&(r.integrity=String(t.integrity)),t.keepalive!==void 0&&(r.keepalive=!!t.keepalive),t.method!==void 0){let h=t.method;if(!Zze(t.method))throw TypeError(`'${t.method}' is not a valid HTTP method.`);if(eje.indexOf(h.toUpperCase())!==-1)throw TypeError(`'${t.method}' HTTP method is unsupported.`);h=Kze(t.method),r.method=h}t.signal!==void 0&&(n=t.signal),this[st]=r;let l=new AbortController;if(this[Sm]=l.signal,this[Sm][Hs]=this[Hs],n!=null){if(!n||typeof n.aborted!="boolean"||typeof n.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(n.aborted)l.abort(n.reason);else{this[pje]=l;let h=new WeakRef(l),Q=function(){let B=h.deref();B!==void 0&&B.abort(this.reason)};try{(typeof Fle=="function"&&Fle(n)===Ule||dje(n,"abort").length>=Ule)&&Lle(100,n)}catch{}vm.addAbortListener(n,Q),uje.register(l,{signal:n,abort:Q})}}if(this[wr]=new CF,this[wr][Xw]=r.headersList,this[wr][jw]="request",this[wr][Hs]=this[Hs],c==="no-cors"){if(!Aje.includes(r.method))throw new TypeError(`'${r.method} is unsupported in no-cors mode.`);this[wr][jw]="request-no-cors"}if(Object.keys(t).length!==0){let h=new CF(this[wr]);if(t.headers!==void 0&&(h=t.headers),this[wr][Xw].clear(),h.constructor.name==="Headers")for(let[Q,B]of h)this[wr].append(Q,B);else jze(this[wr],h)}let d=e instanceof A?e[st].body:null;if((t.body!=null||d!=null)&&(r.method==="GET"||r.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let p=null;if(t.body!=null){let[h,Q]=Vze(t.body,r.keepalive);p=h,Q&&!this[wr][Xw].contains("content-type")&&this[wr].append("content-type",Q)}let u=p??d;if(u!=null&&u.source==null){if(p!=null&&t.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(r.mode!=="same-origin"&&r.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');r.useCORSPreflightFlag=!0}let g=u;if(p==null&&d!=null){if(vm.isDisturbed(d.stream)||d.stream.locked)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");QF||(QF=require("stream/web").TransformStream);let h=new QF;d.stream.pipeThrough(h),g={source:d.source,length:d.length,stream:h.readable}}this[st].body=g}get method(){return Re.brandCheck(this,A),this[st].method}get url(){return Re.brandCheck(this,A),cje(this[st].url)}get headers(){return Re.brandCheck(this,A),this[wr]}get destination(){return Re.brandCheck(this,A),this[st].destination}get referrer(){return Re.brandCheck(this,A),this[st].referrer==="no-referrer"?"":this[st].referrer==="client"?"about:client":this[st].referrer.toString()}get referrerPolicy(){return Re.brandCheck(this,A),this[st].referrerPolicy}get mode(){return Re.brandCheck(this,A),this[st].mode}get credentials(){return this[st].credentials}get cache(){return Re.brandCheck(this,A),this[st].cache}get redirect(){return Re.brandCheck(this,A),this[st].redirect}get integrity(){return Re.brandCheck(this,A),this[st].integrity}get keepalive(){return Re.brandCheck(this,A),this[st].keepalive}get isReloadNavigation(){return Re.brandCheck(this,A),this[st].reloadNavigation}get isHistoryNavigation(){return Re.brandCheck(this,A),this[st].historyNavigation}get signal(){return Re.brandCheck(this,A),this[Sm]}get body(){return Re.brandCheck(this,A),this[st].body?this[st].body.stream:null}get bodyUsed(){return Re.brandCheck(this,A),!!this[st].body&&vm.isDisturbed(this[st].body.stream)}get duplex(){return Re.brandCheck(this,A),"half"}clone(){if(Re.brandCheck(this,A),this.bodyUsed||this.body?.locked)throw new TypeError("unusable");let e=gje(this[st]),t=new A(Mle);t[st]=e,t[Hs]=this[Hs],t[wr]=new CF,t[wr][Xw]=e.headersList,t[wr][jw]=this[wr][jw],t[wr][Hs]=this[wr][Hs];let r=new AbortController;return this.signal.aborted?r.abort(this.signal.reason):vm.addAbortListener(this.signal,()=>{r.abort(this.signal.reason)}),t[Sm]=r.signal,t}};Wze(up);function Zw(A){let e={method:"GET",localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:!1,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:!1,credentials:"same-origin",useCredentials:!1,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...A,headersList:A.headersList?new vle(A.headersList):new vle};return e.url=e.urlList[0],e}function gje(A){let e=Zw({...A,body:null});return A.body!=null&&(e.body=zze(A.body)),e}Object.defineProperties(up.prototype,{method:Kt,url:Kt,headers:Kt,redirect:Kt,clone:Kt,signal:Kt,duplex:Kt,destination:Kt,body:Kt,bodyUsed:Kt,isHistoryNavigation:Kt,isReloadNavigation:Kt,keepalive:Kt,integrity:Kt,cache:Kt,credentials:Kt,attribute:Kt,referrerPolicy:Kt,referrer:Kt,mode:Kt,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Re.converters.Request=Re.interfaceConverter(up);Re.converters.RequestInfo=function(A){return typeof A=="string"?Re.converters.USVString(A):A instanceof up?Re.converters.Request(A):Re.converters.USVString(A)};Re.converters.AbortSignal=Re.interfaceConverter(AbortSignal);Re.converters.RequestInit=Re.dictionaryConverter([{key:"method",converter:Re.converters.ByteString},{key:"headers",converter:Re.converters.HeadersInit},{key:"body",converter:Re.nullableConverter(Re.converters.BodyInit)},{key:"referrer",converter:Re.converters.USVString},{key:"referrerPolicy",converter:Re.converters.DOMString,allowedValues:tje},{key:"mode",converter:Re.converters.DOMString,allowedValues:ije},{key:"credentials",converter:Re.converters.DOMString,allowedValues:sje},{key:"cache",converter:Re.converters.DOMString,allowedValues:nje},{key:"redirect",converter:Re.converters.DOMString,allowedValues:rje},{key:"integrity",converter:Re.converters.DOMString},{key:"keepalive",converter:Re.converters.boolean},{key:"signal",converter:Re.nullableConverter(A=>Re.converters.AbortSignal(A,{strict:!1}))},{key:"window",converter:Re.converters.any},{key:"duplex",converter:Re.converters.DOMString,allowedValues:aje}]);Tle.exports={Request:up,makeRequest:Zw}});var ib=E((koA,Zle)=>{"use strict";var{Response:hje,makeNetworkError:YA,makeAppropriateNetworkError:Kw,filterResponse:mF,makeResponse:$w}=zw(),{Headers:Ole}=pp(),{Request:Eje,makeRequest:Cje}=km(),Fm=require("zlib"),{bytesMatch:Qje,makePolicyContainer:mje,clonePolicyContainer:Bje,requestBadPort:Ije,TAOCheck:fje,appendRequestOriginHeader:yje,responseLocationURL:wje,requestCurrentURL:Za,setRequestReferrerPolicyOnRedirect:bje,tryUpgradeRequestToAPotentiallyTrustworthyURL:Nje,createOpaqueTimingInfo:xF,appendFetchMetadata:Dje,corsCheck:Rje,crossOriginResourcePolicyCheck:xje,determineRequestsReferrer:Sje,coarsenedSharedCurrentTime:SF,createDeferredPromise:vje,isBlobLike:kje,sameOrigin:bF,isCancelled:Jh,isAborted:Yle,isErrorLike:Fje,fullyReadBody:Gle,readableStreamClose:Lje,isomorphicEncode:NF,urlIsLocal:Uje,urlIsHttpHttpsScheme:vF,urlHasHttpsScheme:Mje}=In(),{kState:DF,kHeaders:BF,kGuard:Tje,kRealm:qle}=Xo(),_h=require("assert"),{safelyExtractBody:eb}=om(),{redirectStatus:Jle,nullBodyStatus:_le,safeMethods:Oje,requestBodyHeader:Yje,subresource:qje,DOMException:Ab}=yl(),{kHeadersList:RF}=lt(),Pje=require("events"),{Readable:Hje,pipeline:Gje}=require("stream"),{addAbortListener:Jje,isErrored:_je,isReadable:tb,nodeMajor:Ple,nodeMinor:Vje}=aA(),{dataURLProcessor:Wje,serializeAMimeType:zje}=Kn(),{TransformStream:jje}=require("stream/web"),{getGlobalDispatcher:Xje}=qh(),{webidl:Zje}=fi(),{STATUS_CODES:Kje}=require("http"),IF,fF=globalThis.ReadableStream,rb=class extends Pje{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing",this.setMaxListeners(21)}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new Ab("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function $je(A,e={}){Zje.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});let t=vje(),r;try{r=new Eje(A,e)}catch(p){return t.reject(p),t.promise}let i=r[DF];if(r.signal.aborted)return yF(t,i,null,r.signal.reason),t.promise;i.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(i.serviceWorkers="none");let n=null,a=null,o=!1,c=null;return Jje(r.signal,()=>{o=!0,_h(c!=null),c.abort(r.signal.reason),yF(t,i,n,r.signal.reason)}),c=Wle({request:i,processResponseEndOfBody:p=>Vle(p,"fetch"),processResponse:p=>{if(o)return Promise.resolve();if(p.aborted)return yF(t,i,n,c.serializedAbortReason),Promise.resolve();if(p.type==="error")return t.reject(Object.assign(new TypeError("fetch failed"),{cause:p.error})),Promise.resolve();n=new hje,n[DF]=p,n[qle]=a,n[BF][RF]=p.headersList,n[BF][Tje]="immutable",n[BF][qle]=a,t.resolve(n)},dispatcher:e.dispatcher??Xje()}),t.promise}function Vle(A,e="other"){if(A.type==="error"&&A.aborted||!A.urlList?.length)return;let t=A.urlList[0],r=A.timingInfo,i=A.cacheState;vF(t)&&r!==null&&(r.timingAllowPassed||(r=xF({startTime:r.startTime}),i=""),r.endTime=SF(),A.timingInfo=r,eXe(r,t,e,globalThis,i))}function eXe(A,e,t,r,i){(Ple>18||Ple===18&&Vje>=2)&&performance.markResourceTiming(A,e.href,t,r,i)}function yF(A,e,t,r){if(r||(r=new Ab("The operation was aborted.","AbortError")),A.reject(r),e.body!=null&&tb(e.body?.stream)&&e.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),t==null)return;let i=t[DF];i.body!=null&&tb(i.body?.stream)&&i.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}function Wle({request:A,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:s,useParallelQueue:n=!1,dispatcher:a}){let o=null,c=!1;A.client!=null&&(o=A.client.globalObject,c=A.client.crossOriginIsolatedCapability);let l=SF(c),d=xF({startTime:l}),p={controller:new rb(a),request:A,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:r,processResponseConsumeBody:s,processResponseEndOfBody:i,taskDestination:o,crossOriginIsolatedCapability:c};return _h(!A.body||A.body.stream),A.window==="client"&&(A.window=A.client?.globalObject?.constructor?.name==="Window"?A.client:"no-window"),A.origin==="client"&&(A.origin=A.client?.origin),A.policyContainer==="client"&&(A.client!=null?A.policyContainer=Bje(A.client.policyContainer):A.policyContainer=mje()),A.headersList.contains("accept")||A.headersList.append("accept","*/*"),A.headersList.contains("accept-language")||A.headersList.append("accept-language","*"),A.priority,qje.includes(A.destination),zle(p).catch(u=>{p.controller.terminate(u)}),p.controller}async function zle(A,e=!1){let t=A.request,r=null;if(t.localURLsOnly&&!Uje(Za(t))&&(r=YA("local URLs only")),Nje(t),Ije(t)==="blocked"&&(r=YA("bad port")),t.referrerPolicy===""&&(t.referrerPolicy=t.policyContainer.referrerPolicy),t.referrer!=="no-referrer"&&(t.referrer=Sje(t)),r===null&&(r=await(async()=>{let s=Za(t);return bF(s,t.url)&&t.responseTainting==="basic"||s.protocol==="data:"||t.mode==="navigate"||t.mode==="websocket"?(t.responseTainting="basic",await Hle(A)):t.mode==="same-origin"?YA('request mode cannot be "same-origin"'):t.mode==="no-cors"?t.redirect!=="follow"?YA('redirect mode cannot be "follow" for "no-cors" request'):(t.responseTainting="opaque",await Hle(A)):vF(Za(t))?(t.responseTainting="cors",await jle(A)):YA("URL scheme must be a HTTP(S) scheme")})()),e)return r;r.status!==0&&!r.internalResponse&&(t.responseTainting,t.responseTainting==="basic"?r=mF(r,"basic"):t.responseTainting==="cors"?r=mF(r,"cors"):t.responseTainting==="opaque"?r=mF(r,"opaque"):_h(!1));let i=r.status===0?r:r.internalResponse;if(i.urlList.length===0&&i.urlList.push(...t.urlList),t.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&i.status===206&&i.rangeRequested&&!t.headers.contains("range")&&(r=i=YA()),r.status!==0&&(t.method==="HEAD"||t.method==="CONNECT"||_le.includes(i.status))&&(i.body=null,A.controller.dump=!0),t.integrity){let s=a=>wF(A,YA(a));if(t.responseTainting==="opaque"||r.body==null){s(r.error);return}let n=a=>{if(!Qje(a,t.integrity)){s("integrity mismatch");return}r.body=eb(a)[0],wF(A,r)};await Gle(r.body,n,s)}else wF(A,r)}function Hle(A){if(Jh(A)&&A.request.redirectCount===0)return Promise.resolve(Kw(A));let{request:e}=A,{protocol:t}=Za(e);switch(t){case"about:":return Promise.resolve(YA("about scheme is not supported"));case"blob:":{IF||(IF=require("buffer").resolveObjectURL);let r=Za(e);if(r.search.length!==0)return Promise.resolve(YA("NetworkError when attempting to fetch resource."));let i=IF(r.toString());if(e.method!=="GET"||!kje(i))return Promise.resolve(YA("invalid method"));let s=eb(i),n=s[0],a=NF(`${n.length}`),o=s[1]??"",c=$w({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:a}],["content-type",{name:"Content-Type",value:o}]]});return c.body=n,Promise.resolve(c)}case"data:":{let r=Za(e),i=Wje(r);if(i==="failure")return Promise.resolve(YA("failed to fetch the data URL"));let s=zje(i.mimeType);return Promise.resolve($w({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:eb(i.body)[0]}))}case"file:":return Promise.resolve(YA("not implemented... yet..."));case"http:":case"https:":return jle(A).catch(r=>YA(r));default:return Promise.resolve(YA("unknown scheme"))}}function AXe(A,e){A.request.done=!0,A.processResponseDone!=null&&queueMicrotask(()=>A.processResponseDone(e))}function wF(A,e){e.type==="error"&&(e.urlList=[A.request.urlList[0]],e.timingInfo=xF({startTime:A.timingInfo.startTime}));let t=()=>{A.request.done=!0,A.processResponseEndOfBody!=null&&queueMicrotask(()=>A.processResponseEndOfBody(e))};if(A.processResponse!=null&&queueMicrotask(()=>A.processResponse(e)),e.body==null)t();else{let r=(s,n)=>{n.enqueue(s)},i=new jje({start(){},transform:r,flush:t},{size(){return 1}},{size(){return 1}});e.body={stream:e.body.stream.pipeThrough(i)}}if(A.processResponseConsumeBody!=null){let r=s=>A.processResponseConsumeBody(e,s),i=s=>A.processResponseConsumeBody(e,s);if(e.body==null)queueMicrotask(()=>r(null));else return Gle(e.body,r,i);return Promise.resolve()}}async function jle(A){let e=A.request,t=null,r=null,i=A.timingInfo;if(e.serviceWorkers,t===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),r=t=await Xle(A),e.responseTainting==="cors"&&Rje(e,t)==="failure")return YA("cors failure");fje(e,t)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||t.type==="opaque")&&xje(e.origin,e.client,e.destination,r)==="blocked"?YA("blocked"):(Jle.includes(r.status)&&(e.redirect!=="manual"&&A.controller.connection.destroy(),e.redirect==="error"?t=YA("unexpected redirect"):e.redirect==="manual"?t=r:e.redirect==="follow"?t=await tXe(A,t):_h(!1)),t.timingInfo=i,t)}function tXe(A,e){let t=A.request,r=e.internalResponse?e.internalResponse:e,i;try{if(i=wje(r,Za(t).hash),i==null)return e}catch(n){return Promise.resolve(YA(n))}if(!vF(i))return Promise.resolve(YA("URL scheme must be a HTTP(S) scheme"));if(t.redirectCount===20)return Promise.resolve(YA("redirect count exceeded"));if(t.redirectCount+=1,t.mode==="cors"&&(i.username||i.password)&&!bF(t,i))return Promise.resolve(YA('cross origin not allowed for request mode "cors"'));if(t.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(YA('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&t.body!=null&&t.body.source==null)return Promise.resolve(YA());if([301,302].includes(r.status)&&t.method==="POST"||r.status===303&&!["GET","HEAD"].includes(t.method)){t.method="GET",t.body=null;for(let n of Yje)t.headersList.delete(n)}bF(Za(t),i)||(t.headersList.delete("authorization"),t.headersList.delete("cookie"),t.headersList.delete("host")),t.body!=null&&(_h(t.body.source!=null),t.body=eb(t.body.source)[0]);let s=A.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=SF(A.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),t.urlList.push(i),bje(t,r),zle(A,!0)}async function Xle(A,e=!1,t=!1){let r=A.request,i=null,s=null,n=null,a=null,o=!1;r.window==="no-window"&&r.redirect==="error"?(i=A,s=r):(s=Cje(r),i={...A},i.request=s);let c=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",l=s.body?s.body.length:null,d=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(d="0"),l!=null&&(d=NF(`${l}`)),d!=null&&s.headersList.append("content-length",d),l!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",NF(s.referrer.href)),yje(s),Dje(s),s.headersList.contains("user-agent")||s.headersList.append("user-agent",typeof esbuildDetection>"u"?"undici":"node"),s.cache==="default"&&(s.headersList.contains("if-modified-since")||s.headersList.contains("if-none-match")||s.headersList.contains("if-unmodified-since")||s.headersList.contains("if-match")||s.headersList.contains("if-range"))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control")&&s.headersList.append("cache-control","max-age=0"),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma")||s.headersList.append("pragma","no-cache"),s.headersList.contains("cache-control")||s.headersList.append("cache-control","no-cache")),s.headersList.contains("range")&&s.headersList.append("accept-encoding","identity"),s.headersList.contains("accept-encoding")||(Mje(Za(s))?s.headersList.append("accept-encoding","br, gzip, deflate"):s.headersList.append("accept-encoding","gzip, deflate")),s.headersList.delete("host"),a==null&&(s.cache="no-store"),s.mode!=="no-store"&&s.mode,n==null){if(s.mode==="only-if-cached")return YA("only if cached");let p=await rXe(i,c,t);!Oje.includes(s.method)&&p.status>=200&&p.status<=399,o&&p.status,n==null&&(n=p)}if(n.urlList=[...s.urlList],s.headersList.contains("range")&&(n.rangeRequested=!0),n.requestIncludesCredentials=c,n.status===407)return r.window==="no-window"?YA():Jh(A)?Kw(A):YA("proxy authentication required");if(n.status===421&&!t&&(r.body==null||r.body.source!=null)){if(Jh(A))return Kw(A);A.controller.connection.destroy(),n=await Xle(A,e,!0)}return n}async function rXe(A,e=!1,t=!1){_h(!A.controller.connection||A.controller.connection.destroyed),A.controller.connection={abort:null,destroyed:!1,destroy(g){this.destroyed||(this.destroyed=!0,this.abort?.(g??new Ab("The operation was aborted.","AbortError")))}};let r=A.request,i=null,s=A.timingInfo;null==null&&(r.cache="no-store");let a=t?"yes":"no";r.mode;let o=null;if(r.body==null&&A.processRequestEndOfBody)queueMicrotask(()=>A.processRequestEndOfBody());else if(r.body!=null){let g=async function*(B){Jh(A)||(yield B,A.processRequestBodyChunkLength?.(B.byteLength))},h=()=>{Jh(A)||A.processRequestEndOfBody&&A.processRequestEndOfBody()},Q=B=>{Jh(A)||(B.name==="AbortError"?A.controller.abort():A.controller.terminate(B))};o=async function*(){try{for await(let B of r.body.stream)yield*g(B);h()}catch(B){Q(B)}}()}try{let{body:g,status:h,statusText:Q,headersList:B,socket:w}=await u({body:o});if(w)i=$w({status:h,statusText:Q,headersList:B,socket:w});else{let I=g[Symbol.asyncIterator]();A.controller.next=()=>I.next(),i=$w({status:h,statusText:Q,headersList:B})}}catch(g){return g.name==="AbortError"?(A.controller.connection.destroy(),Kw(A,g)):YA(g)}let c=()=>{A.controller.resume()},l=g=>{A.controller.abort(g)};fF||(fF=require("stream/web").ReadableStream);let d=new fF({async start(g){A.controller.controller=g},async pull(g){await c(g)},async cancel(g){await l(g)}},{highWaterMark:0,size(){return 1}});i.body={stream:d},A.controller.on("terminated",p),A.controller.resume=async()=>{for(;;){let g,h;try{let{done:Q,value:B}=await A.controller.next();if(Yle(A))break;g=Q?void 0:B}catch(Q){A.controller.ended&&!s.encodedBodySize?g=void 0:(g=Q,h=!0)}if(g===void 0){Lje(A.controller.controller),AXe(A,i);return}if(s.decodedBodySize+=g?.byteLength??0,h){A.controller.terminate(g);return}if(A.controller.controller.enqueue(new Uint8Array(g)),_je(d)){A.controller.terminate();return}if(!A.controller.controller.desiredSize)return}};function p(g){Yle(A)?(i.aborted=!0,tb(d)&&A.controller.controller.error(A.controller.serializedAbortReason)):tb(d)&&A.controller.controller.error(new TypeError("terminated",{cause:Fje(g)?g:void 0})),A.controller.connection.destroy()}return i;async function u({body:g}){let h=Za(r),Q=A.controller.dispatcher;return new Promise((B,w)=>Q.dispatch({path:h.pathname+h.search,origin:h.origin,method:r.method,body:A.controller.dispatcher.isMockActive?r.body&&r.body.source:g,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(I){let{connection:C}=A.controller;C.destroyed?I(new Ab("The operation was aborted.","AbortError")):(A.controller.on("terminated",I),this.abort=C.abort=I)},onHeaders(I,C,m,b){if(I<200)return;let R=[],y="",v=new Ole;if(Array.isArray(C))for(let x=0;xoe.trim()):F.toLowerCase()==="location"&&(y=q),v.append(F,q)}else{let x=Object.keys(C);for(let F of x){let q=C[F];F.toLowerCase()==="content-encoding"?R=q.toLowerCase().split(",").map(oe=>oe.trim()).reverse():F.toLowerCase()==="location"&&(y=q),v.append(F,q)}}this.body=new Hje({read:m});let D=[],S=r.redirect==="follow"&&y&&Jle.includes(I);if(r.method!=="HEAD"&&r.method!=="CONNECT"&&!_le.includes(I)&&!S)for(let x of R)if(x==="x-gzip"||x==="gzip")D.push(Fm.createGunzip({flush:Fm.constants.Z_SYNC_FLUSH,finishFlush:Fm.constants.Z_SYNC_FLUSH}));else if(x==="deflate")D.push(Fm.createInflate());else if(x==="br")D.push(Fm.createBrotliDecompress());else{D.length=0;break}return B({status:I,statusText:b,headersList:v[RF],body:D.length?Gje(this.body,...D,()=>{}):this.body.on("error",()=>{})}),!0},onData(I){if(A.controller.dump)return;let C=I;return s.encodedBodySize+=C.byteLength,this.body.push(C)},onComplete(){this.abort&&A.controller.off("terminated",this.abort),A.controller.ended=!0,this.body.push(null)},onError(I){this.abort&&A.controller.off("terminated",this.abort),this.body?.destroy(I),A.controller.terminate(I),w(I)},onUpgrade(I,C,m){if(I!==101)return;let b=new Ole;for(let R=0;R{"use strict";Kle.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var ede=E((LoA,$le)=>{"use strict";var{webidl:Gs}=fi(),sb=Symbol("ProgressEvent state"),FF=class A extends Event{constructor(e,t={}){e=Gs.converters.DOMString(e),t=Gs.converters.ProgressEventInit(t??{}),super(e,t),this[sb]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return Gs.brandCheck(this,A),this[sb].lengthComputable}get loaded(){return Gs.brandCheck(this,A),this[sb].loaded}get total(){return Gs.brandCheck(this,A),this[sb].total}};Gs.converters.ProgressEventInit=Gs.dictionaryConverter([{key:"lengthComputable",converter:Gs.converters.boolean,defaultValue:!1},{key:"loaded",converter:Gs.converters["unsigned long long"],defaultValue:0},{key:"total",converter:Gs.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:Gs.converters.boolean,defaultValue:!1},{key:"cancelable",converter:Gs.converters.boolean,defaultValue:!1},{key:"composed",converter:Gs.converters.boolean,defaultValue:!1}]);$le.exports={ProgressEvent:FF}});var tde=E((UoA,Ade)=>{"use strict";function iXe(A){if(!A)return"failure";switch(A.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}Ade.exports={getEncoding:iXe}});var lde=E((MoA,cde)=>{"use strict";var{kState:Vh,kError:LF,kResult:rde,kAborted:Lm,kLastProgressEventFired:UF}=kF(),{ProgressEvent:sXe}=ede(),{getEncoding:ide}=tde(),{DOMException:nXe}=yl(),{serializeAMimeType:aXe,parseMIMEType:sde}=Kn(),{types:oXe}=require("util"),{StringDecoder:nde}=require("string_decoder"),{btoa:ade}=require("buffer"),cXe={enumerable:!0,writable:!1,configurable:!1};function lXe(A,e,t,r){if(A[Vh]==="loading")throw new nXe("Invalid state","InvalidStateError");A[Vh]="loading",A[rde]=null,A[LF]=null;let s=e.stream().getReader(),n=[],a=s.read(),o=!0;(async()=>{for(;!A[Lm];)try{let{done:c,value:l}=await a;if(o&&!A[Lm]&&queueMicrotask(()=>{vl("loadstart",A)}),o=!1,!c&&oXe.isUint8Array(l))n.push(l),(A[UF]===void 0||Date.now()-A[UF]>=50)&&!A[Lm]&&(A[UF]=Date.now(),queueMicrotask(()=>{vl("progress",A)})),a=s.read();else if(c){queueMicrotask(()=>{A[Vh]="done";try{let d=dXe(n,t,e.type,r);if(A[Lm])return;A[rde]=d,vl("load",A)}catch(d){A[LF]=d,vl("error",A)}A[Vh]!=="loading"&&vl("loadend",A)});break}}catch(c){if(A[Lm])return;queueMicrotask(()=>{A[Vh]="done",A[LF]=c,vl("error",A),A[Vh]!=="loading"&&vl("loadend",A)});break}})()}function vl(A,e){let t=new sXe(A,{bubbles:!1,cancelable:!1});e.dispatchEvent(t)}function dXe(A,e,t,r){switch(e){case"DataURL":{let i="data:",s=sde(t||"application/octet-stream");s!=="failure"&&(i+=aXe(s)),i+=";base64,";let n=new nde("latin1");for(let a of A)i+=ade(n.write(a));return i+=ade(n.end()),i}case"Text":{let i="failure";if(r&&(i=ide(r)),i==="failure"&&t){let s=sde(t);s!=="failure"&&(i=ide(s.parameters.get("charset")))}return i==="failure"&&(i="UTF-8"),pXe(A,i)}case"ArrayBuffer":return ode(A).buffer;case"BinaryString":{let i="",s=new nde("latin1");for(let n of A)i+=s.write(n);return i+=s.end(),i}}}function pXe(A,e){let t=ode(A),r=uXe(t),i=0;r!==null&&(e=r,i=r==="UTF-8"?3:2);let s=t.slice(i);return new TextDecoder(e).decode(s)}function uXe(A){let[e,t,r]=A;return e===239&&t===187&&r===191?"UTF-8":e===254&&t===255?"UTF-16BE":e===255&&t===254?"UTF-16LE":null}function ode(A){let e=A.reduce((r,i)=>r+i.byteLength,0),t=0;return A.reduce((r,i)=>(r.set(i,t),t+=i.byteLength,r),new Uint8Array(e))}cde.exports={staticPropertyDescriptors:cXe,readOperation:lXe,fireAProgressEvent:vl}});var gde=E((ToA,ude)=>{"use strict";var{staticPropertyDescriptors:Wh,readOperation:nb,fireAProgressEvent:dde}=lde(),{kState:gp,kError:pde,kResult:ab,kEvents:gA,kAborted:gXe}=kF(),{webidl:FA}=fi(),{kEnumerableProperty:ts}=aA(),Aa=class A extends EventTarget{constructor(){super(),this[gp]="empty",this[ab]=null,this[pde]=null,this[gA]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"}),e=FA.converters.Blob(e,{strict:!1}),nb(this,e,"ArrayBuffer")}readAsBinaryString(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"}),e=FA.converters.Blob(e,{strict:!1}),nb(this,e,"BinaryString")}readAsText(e,t=void 0){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"}),e=FA.converters.Blob(e,{strict:!1}),t!==void 0&&(t=FA.converters.DOMString(t)),nb(this,e,"Text",t)}readAsDataURL(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"}),e=FA.converters.Blob(e,{strict:!1}),nb(this,e,"DataURL")}abort(){if(this[gp]==="empty"||this[gp]==="done"){this[ab]=null;return}this[gp]==="loading"&&(this[gp]="done",this[ab]=null),this[gXe]=!0,dde("abort",this),this[gp]!=="loading"&&dde("loadend",this)}get readyState(){switch(FA.brandCheck(this,A),this[gp]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return FA.brandCheck(this,A),this[ab]}get error(){return FA.brandCheck(this,A),this[pde]}get onloadend(){return FA.brandCheck(this,A),this[gA].loadend}set onloadend(e){FA.brandCheck(this,A),this[gA].loadend&&this.removeEventListener("loadend",this[gA].loadend),typeof e=="function"?(this[gA].loadend=e,this.addEventListener("loadend",e)):this[gA].loadend=null}get onerror(){return FA.brandCheck(this,A),this[gA].error}set onerror(e){FA.brandCheck(this,A),this[gA].error&&this.removeEventListener("error",this[gA].error),typeof e=="function"?(this[gA].error=e,this.addEventListener("error",e)):this[gA].error=null}get onloadstart(){return FA.brandCheck(this,A),this[gA].loadstart}set onloadstart(e){FA.brandCheck(this,A),this[gA].loadstart&&this.removeEventListener("loadstart",this[gA].loadstart),typeof e=="function"?(this[gA].loadstart=e,this.addEventListener("loadstart",e)):this[gA].loadstart=null}get onprogress(){return FA.brandCheck(this,A),this[gA].progress}set onprogress(e){FA.brandCheck(this,A),this[gA].progress&&this.removeEventListener("progress",this[gA].progress),typeof e=="function"?(this[gA].progress=e,this.addEventListener("progress",e)):this[gA].progress=null}get onload(){return FA.brandCheck(this,A),this[gA].load}set onload(e){FA.brandCheck(this,A),this[gA].load&&this.removeEventListener("load",this[gA].load),typeof e=="function"?(this[gA].load=e,this.addEventListener("load",e)):this[gA].load=null}get onabort(){return FA.brandCheck(this,A),this[gA].abort}set onabort(e){FA.brandCheck(this,A),this[gA].abort&&this.removeEventListener("abort",this[gA].abort),typeof e=="function"?(this[gA].abort=e,this.addEventListener("abort",e)):this[gA].abort=null}};Aa.EMPTY=Aa.prototype.EMPTY=0;Aa.LOADING=Aa.prototype.LOADING=1;Aa.DONE=Aa.prototype.DONE=2;Object.defineProperties(Aa.prototype,{EMPTY:Wh,LOADING:Wh,DONE:Wh,readAsArrayBuffer:ts,readAsBinaryString:ts,readAsText:ts,readAsDataURL:ts,abort:ts,readyState:ts,result:ts,error:ts,onloadstart:ts,onprogress:ts,onload:ts,onabort:ts,onerror:ts,onloadend:ts,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Aa,{EMPTY:Wh,LOADING:Wh,DONE:Wh});ude.exports={FileReader:Aa}});var ob=E((OoA,hde)=>{"use strict";hde.exports={kConstruct:Symbol("constructable")}});var Qde=E((YoA,Cde)=>{"use strict";var hXe=require("assert"),{URLSerializer:Ede}=Kn(),{isValidHeaderName:EXe}=In();function CXe(A,e,t=!1){let r=Ede(A,t),i=Ede(e,t);return r===i}function QXe(A){hXe(A!==null);let e=[];for(let t of A.split(",")){if(t=t.trim(),t.length){if(!EXe(t))continue}else continue;e.push(t)}return e}Cde.exports={urlEquals:CXe,fieldValues:QXe}});var wde=E((qoA,yde)=>{"use strict";var{kConstruct:mXe}=ob(),{urlEquals:BXe,fieldValues:MF}=Qde(),{kEnumerableProperty:hp,isDisturbed:IXe}=aA(),{kHeadersList:mde}=lt(),{webidl:ye}=fi(),{Response:Ide,cloneResponse:fXe}=zw(),{Request:Ka}=km(),{kState:Ni,kHeaders:cb,kGuard:Bde,kRealm:yXe}=Xo(),{fetching:wXe}=ib(),{urlIsHttpHttpsScheme:lb,createDeferredPromise:zh,readAllBytes:bXe}=In(),TF=require("assert"),{getGlobalDispatcher:NXe}=qh(),db=class A{#e;constructor(){arguments[0]!==mXe&&ye.illegalConstructor(),this.#e=arguments[1]}async match(e,t={}){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.match"}),e=ye.converters.RequestInfo(e),t=ye.converters.CacheQueryOptions(t);let r=await this.matchAll(e,t);if(r.length!==0)return r[0]}async matchAll(e=void 0,t={}){ye.brandCheck(this,A),e!==void 0&&(e=ye.converters.RequestInfo(e)),t=ye.converters.CacheQueryOptions(t);let r=null;if(e!==void 0)if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(r=new Ka(e)[Ni]);let i=[];if(e===void 0)for(let n of this.#e)i.push(n[1]);else{let n=this.#r(r,t);for(let a of n)i.push(a[1])}let s=[];for(let n of i){let a=new Ide(n.body?.source??null),o=a[Ni].body;a[Ni]=n,a[Ni].body=o,a[cb][mde]=n.headersList,a[cb][Bde]="immutable",s.push(a)}return Object.freeze(s)}async add(e){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.add"}),e=ye.converters.RequestInfo(e);let t=[e];return await this.addAll(t)}async addAll(e){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.addAll"}),e=ye.converters["sequence"](e);let t=[],r=[];for(let d of e){if(typeof d=="string")continue;let p=d[Ni];if(!lb(p.url)||p.method!=="GET")throw ye.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}let i=[];for(let d of e){let p=new Ka(d)[Ni];if(!lb(p.url))throw ye.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."});p.initiator="fetch",p.destination="subresource",r.push(p);let u=zh();i.push(wXe({request:p,dispatcher:NXe(),processResponse(g){if(g.type==="error"||g.status===206||g.status<200||g.status>299)u.reject(ye.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(g.headersList.contains("vary")){let h=MF(g.headersList.get("vary"));for(let Q of h)if(Q==="*"){u.reject(ye.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let B of i)B.abort();return}}},processResponseEndOfBody(g){if(g.aborted){u.reject(new DOMException("aborted","AbortError"));return}u.resolve(g)}})),t.push(u.promise)}let n=await Promise.all(t),a=[],o=0;for(let d of n){let p={type:"put",request:r[o],response:d};a.push(p),o++}let c=zh(),l=null;try{this.#t(a)}catch(d){l=d}return queueMicrotask(()=>{l===null?c.resolve(void 0):c.reject(l)}),c.promise}async put(e,t){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,2,{header:"Cache.put"}),e=ye.converters.RequestInfo(e),t=ye.converters.Response(t);let r=null;if(e instanceof Ka?r=e[Ni]:r=new Ka(e)[Ni],!lb(r.url)||r.method!=="GET")throw ye.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"});let i=t[Ni];if(i.status===206)throw ye.errors.exception({header:"Cache.put",message:"Got 206 status"});if(i.headersList.contains("vary")){let p=MF(i.headersList.get("vary"));for(let u of p)if(u==="*")throw ye.errors.exception({header:"Cache.put",message:"Got * vary field value"})}if(i.body&&(IXe(i.body.stream)||i.body.stream.locked))throw ye.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"});let s=fXe(i),n=zh();if(i.body!=null){let u=i.body.stream.getReader();bXe(u).then(n.resolve,n.reject)}else n.resolve(void 0);let a=[],o={type:"put",request:r,response:s};a.push(o);let c=await n.promise;s.body!=null&&(s.body.source=c);let l=zh(),d=null;try{this.#t(a)}catch(p){d=p}return queueMicrotask(()=>{d===null?l.resolve():l.reject(d)}),l.promise}async delete(e,t={}){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.delete"}),e=ye.converters.RequestInfo(e),t=ye.converters.CacheQueryOptions(t);let r=null;if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return!1}else TF(typeof e=="string"),r=new Ka(e)[Ni];let i=[],s={type:"delete",request:r,options:t};i.push(s);let n=zh(),a=null,o;try{o=this.#t(i)}catch(c){a=c}return queueMicrotask(()=>{a===null?n.resolve(!!o?.length):n.reject(a)}),n.promise}async keys(e=void 0,t={}){ye.brandCheck(this,A),e!==void 0&&(e=ye.converters.RequestInfo(e)),t=ye.converters.CacheQueryOptions(t);let r=null;if(e!==void 0)if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(r=new Ka(e)[Ni]);let i=zh(),s=[];if(e===void 0)for(let n of this.#e)s.push(n[0]);else{let n=this.#r(r,t);for(let a of n)s.push(a[0])}return queueMicrotask(()=>{let n=[];for(let a of s){let o=new Ka("https://a");o[Ni]=a,o[cb][mde]=a.headersList,o[cb][Bde]="immutable",o[yXe]=a.client,n.push(o)}i.resolve(Object.freeze(n))}),i.promise}#t(e){let t=this.#e,r=[...t],i=[],s=[];try{for(let n of e){if(n.type!=="delete"&&n.type!=="put")throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(n.type==="delete"&&n.response!=null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(n.request,n.options,i).length)throw new DOMException("???","InvalidStateError");let a;if(n.type==="delete"){if(a=this.#r(n.request,n.options),a.length===0)return[];for(let o of a){let c=t.indexOf(o);TF(c!==-1),t.splice(c,1)}}else if(n.type==="put"){if(n.response==null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let o=n.request;if(!lb(o.url))throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(o.method!=="GET")throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(n.options!=null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#r(n.request);for(let c of a){let l=t.indexOf(c);TF(l!==-1),t.splice(l,1)}t.push([n.request,n.response]),i.push([n.request,n.response])}s.push([n.request,n.response])}return s}catch(n){throw this.#e.length=0,this.#e=r,n}}#r(e,t,r){let i=[],s=r??this.#e;for(let n of s){let[a,o]=n;this.#A(e,a,o,t)&&i.push(n)}return i}#A(e,t,r=null,i){let s=new URL(e.url),n=new URL(t.url);if(i?.ignoreSearch&&(n.search="",s.search=""),!BXe(s,n,!0))return!1;if(r==null||i?.ignoreVary||!r.headersList.contains("vary"))return!0;let a=MF(r.headersList.get("vary"));for(let o of a){if(o==="*")return!1;let c=t.headersList.get(o),l=e.headersList.get(o);if(c!==l)return!1}return!0}};Object.defineProperties(db.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:hp,matchAll:hp,add:hp,addAll:hp,put:hp,delete:hp,keys:hp});var fde=[{key:"ignoreSearch",converter:ye.converters.boolean,defaultValue:!1},{key:"ignoreMethod",converter:ye.converters.boolean,defaultValue:!1},{key:"ignoreVary",converter:ye.converters.boolean,defaultValue:!1}];ye.converters.CacheQueryOptions=ye.dictionaryConverter(fde);ye.converters.MultiCacheQueryOptions=ye.dictionaryConverter([...fde,{key:"cacheName",converter:ye.converters.DOMString}]);ye.converters.Response=ye.interfaceConverter(Ide);ye.converters["sequence"]=ye.sequenceConverter(ye.converters.RequestInfo);yde.exports={Cache:db}});var Nde=E((PoA,bde)=>{"use strict";var{kConstruct:Um}=ob(),{Cache:pb}=wde(),{webidl:Di}=fi(),{kEnumerableProperty:Mm}=aA(),ub=class A{#e=new Map;constructor(){arguments[0]!==Um&&Di.illegalConstructor()}async match(e,t={}){if(Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"}),e=Di.converters.RequestInfo(e),t=Di.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let r=this.#e.get(t.cacheName);return await new pb(Um,r).match(e,t)}}else for(let r of this.#e.values()){let s=await new pb(Um,r).match(e,t);if(s!==void 0)return s}}async has(e){return Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"}),e=Di.converters.DOMString(e),this.#e.has(e)}async open(e){if(Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"}),e=Di.converters.DOMString(e),this.#e.has(e)){let r=this.#e.get(e);return new pb(Um,r)}let t=[];return this.#e.set(e,t),new pb(Um,t)}async delete(e){return Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"}),e=Di.converters.DOMString(e),this.#e.delete(e)}async keys(){return Di.brandCheck(this,A),[...this.#e.keys()]}};Object.defineProperties(ub.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Mm,has:Mm,open:Mm,delete:Mm,keys:Mm});bde.exports={CacheStorage:ub}});var Rde=E((HoA,Dde)=>{"use strict";Dde.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var OF=E((GoA,vde)=>{"use strict";var xde=require("assert"),{kHeadersList:Sde}=lt();function DXe(A){if(A.length===0)return!1;for(let e of A){let t=e.charCodeAt(0);if(t>=0||t<=8||t>=10||t<=31||t===127)return!1}}function RXe(A){for(let e of A){let t=e.charCodeAt(0);if(t<=32||t>127||e==="("||e===")"||e===">"||e==="<"||e==="@"||e===","||e===";"||e===":"||e==="\\"||e==='"'||e==="/"||e==="["||e==="]"||e==="?"||e==="="||e==="{"||e==="}")throw new Error("Invalid cookie name")}}function xXe(A){for(let e of A){let t=e.charCodeAt(0);if(t<33||t===34||t===44||t===59||t===92||t>126)throw new Error("Invalid header value")}}function SXe(A){for(let e of A)if(e.charCodeAt(0)<33||e===";")throw new Error("Invalid cookie path")}function vXe(A){if(A.startsWith("-")||A.endsWith(".")||A.endsWith("-"))throw new Error("Invalid cookie domain")}function kXe(A){typeof A=="number"&&(A=new Date(A));let e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=e[A.getUTCDay()],i=A.getUTCDate().toString().padStart(2,"0"),s=t[A.getUTCMonth()],n=A.getUTCFullYear(),a=A.getUTCHours().toString().padStart(2,"0"),o=A.getUTCMinutes().toString().padStart(2,"0"),c=A.getUTCSeconds().toString().padStart(2,"0");return`${r}, ${i} ${s} ${n} ${a}:${o}:${c} GMT`}function FXe(A){if(A<0)throw new Error("Invalid cookie max-age")}function LXe(A){if(A.name.length===0)return null;RXe(A.name),xXe(A.value);let e=[`${A.name}=${A.value}`];A.name.startsWith("__Secure-")&&(A.secure=!0),A.name.startsWith("__Host-")&&(A.secure=!0,A.domain=null,A.path="/"),A.secure&&e.push("Secure"),A.httpOnly&&e.push("HttpOnly"),typeof A.maxAge=="number"&&(FXe(A.maxAge),e.push(`Max-Age=${A.maxAge}`)),A.domain&&(vXe(A.domain),e.push(`Domain=${A.domain}`)),A.path&&(SXe(A.path),e.push(`Path=${A.path}`)),A.expires&&A.expires.toString()!=="Invalid Date"&&e.push(`Expires=${kXe(A.expires)}`),A.sameSite&&e.push(`SameSite=${A.sameSite}`);for(let t of A.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");let[r,...i]=t.split("=");e.push(`${r.trim()}=${i.join("=")}`)}return e.join("; ")}var gb;function UXe(A){if(A[Sde])return A[Sde];gb||(gb=Object.getOwnPropertySymbols(A).find(t=>t.description==="headers list"),xde(gb,"Headers cannot be parsed"));let e=A[gb];return xde(e),e}vde.exports={isCTLExcludingHtab:DXe,stringify:LXe,getHeadersList:UXe}});var Fde=E((JoA,kde)=>{"use strict";var{maxNameValuePairSize:MXe,maxAttributeValueSize:TXe}=Rde(),{isCTLExcludingHtab:OXe}=OF(),{collectASequenceOfCodePointsFast:hb}=Kn(),YXe=require("assert");function qXe(A){if(OXe(A))return null;let e="",t="",r="",i="";if(A.includes(";")){let s={position:0};e=hb(";",A,s),t=A.slice(s.position)}else e=A;if(!e.includes("="))i=e;else{let s={position:0};r=hb("=",e,s),i=e.slice(s.position+1)}return r=r.trim(),i=i.trim(),r.length+i.length>MXe?null:{name:r,value:i,...jh(t)}}function jh(A,e={}){if(A.length===0)return e;YXe(A[0]===";"),A=A.slice(1);let t="";A.includes(";")?(t=hb(";",A,{position:0}),A=A.slice(t.length)):(t=A,A="");let r="",i="";if(t.includes("=")){let n={position:0};r=hb("=",t,n),i=t.slice(n.position+1)}else r=t;if(r=r.trim(),i=i.trim(),i.length>TXe)return jh(A,e);let s=r.toLowerCase();if(s==="expires"){let n=new Date(i);e.expires=n}else if(s==="max-age"){let n=i.charCodeAt(0);if((n<48||n>57)&&i[0]!=="-"||!/^\d+$/.test(i))return jh(A,e);let a=Number(i);e.maxAge=a}else if(s==="domain"){let n=i;n[0]==="."&&(n=n.slice(1)),n=n.toLowerCase(),e.domain=n}else if(s==="path"){let n="";i.length===0||i[0]!=="/"?n="/":n=i,e.path=n}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let n="Default",a=i.toLowerCase();a.includes("none")&&(n="None"),a.includes("strict")&&(n="Strict"),a.includes("lax")&&(n="Lax"),e.sameSite=n}else e.unparsed??=[],e.unparsed.push(`${r}=${i}`);return jh(A,e)}kde.exports={parseSetCookie:qXe,parseUnparsedAttributes:jh}});var Tde=E((_oA,Mde)=>{"use strict";var{parseSetCookie:PXe}=Fde(),{stringify:Lde,getHeadersList:HXe}=OF(),{webidl:AA}=fi(),{Headers:Eb}=pp();function GXe(A){AA.argumentLengthCheck(arguments,1,{header:"getCookies"}),AA.brandCheck(A,Eb,{strict:!1});let e=A.get("cookie"),t={};if(!e)return t;for(let r of e.split(";")){let[i,...s]=r.split("=");t[i.trim()]=s.join("=")}return t}function JXe(A,e,t){AA.argumentLengthCheck(arguments,2,{header:"deleteCookie"}),AA.brandCheck(A,Eb,{strict:!1}),e=AA.converters.DOMString(e),t=AA.converters.DeleteCookieAttributes(t),Ude(A,{name:e,value:"",expires:new Date(0),...t})}function _Xe(A){AA.argumentLengthCheck(arguments,1,{header:"getSetCookies"}),AA.brandCheck(A,Eb,{strict:!1});let e=HXe(A).cookies;return e?e.map(t=>PXe(Array.isArray(t)?t[1]:t)):[]}function Ude(A,e){AA.argumentLengthCheck(arguments,2,{header:"setCookie"}),AA.brandCheck(A,Eb,{strict:!1}),e=AA.converters.Cookie(e),Lde(e)&&A.append("Set-Cookie",Lde(e))}AA.converters.DeleteCookieAttributes=AA.dictionaryConverter([{converter:AA.nullableConverter(AA.converters.DOMString),key:"path",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"domain",defaultValue:null}]);AA.converters.Cookie=AA.dictionaryConverter([{converter:AA.converters.DOMString,key:"name"},{converter:AA.converters.DOMString,key:"value"},{converter:AA.nullableConverter(A=>typeof A=="number"?AA.converters["unsigned long long"](A):new Date(A)),key:"expires",defaultValue:null},{converter:AA.nullableConverter(AA.converters["long long"]),key:"maxAge",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"domain",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"path",defaultValue:null},{converter:AA.nullableConverter(AA.converters.boolean),key:"secure",defaultValue:null},{converter:AA.nullableConverter(AA.converters.boolean),key:"httpOnly",defaultValue:null},{converter:AA.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:AA.sequenceConverter(AA.converters.DOMString),key:"unparsed",defaultValue:[]}]);Mde.exports={getCookies:GXe,deleteCookie:JXe,getSetCookies:_Xe,setCookie:Ude}});var Xh=E((VoA,Ode)=>{"use strict";var VXe="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",WXe={enumerable:!0,writable:!1,configurable:!1},zXe={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},jXe={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},XXe=2**16-1,ZXe={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},KXe=Buffer.allocUnsafe(0);Ode.exports={uid:VXe,staticPropertyDescriptors:WXe,states:zXe,opcodes:jXe,maxUnsigned16Bit:XXe,parserStates:ZXe,emptyBuffer:KXe}});var Tm=E((WoA,Yde)=>{"use strict";Yde.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var qF=E((zoA,qde)=>{"use strict";var{webidl:we}=fi(),{kEnumerableProperty:rs}=aA(),{MessagePort:$Xe}=require("worker_threads"),Cb=class A extends Event{#e;constructor(e,t={}){we.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"}),e=we.converters.DOMString(e),t=we.converters.MessageEventInit(t),super(e,t),this.#e=t}get data(){return we.brandCheck(this,A),this.#e.data}get origin(){return we.brandCheck(this,A),this.#e.origin}get lastEventId(){return we.brandCheck(this,A),this.#e.lastEventId}get source(){return we.brandCheck(this,A),this.#e.source}get ports(){return we.brandCheck(this,A),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,r=!1,i=null,s="",n="",a=null,o=[]){return we.brandCheck(this,A),we.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"}),new A(e,{bubbles:t,cancelable:r,data:i,origin:s,lastEventId:n,source:a,ports:o})}},Qb=class A extends Event{#e;constructor(e,t={}){we.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"}),e=we.converters.DOMString(e),t=we.converters.CloseEventInit(t),super(e,t),this.#e=t}get wasClean(){return we.brandCheck(this,A),this.#e.wasClean}get code(){return we.brandCheck(this,A),this.#e.code}get reason(){return we.brandCheck(this,A),this.#e.reason}},mb=class A extends Event{#e;constructor(e,t){we.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"}),super(e,t),e=we.converters.DOMString(e),t=we.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return we.brandCheck(this,A),this.#e.message}get filename(){return we.brandCheck(this,A),this.#e.filename}get lineno(){return we.brandCheck(this,A),this.#e.lineno}get colno(){return we.brandCheck(this,A),this.#e.colno}get error(){return we.brandCheck(this,A),this.#e.error}};Object.defineProperties(Cb.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:rs,origin:rs,lastEventId:rs,source:rs,ports:rs,initMessageEvent:rs});Object.defineProperties(Qb.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:rs,code:rs,wasClean:rs});Object.defineProperties(mb.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:rs,filename:rs,lineno:rs,colno:rs,error:rs});we.converters.MessagePort=we.interfaceConverter($Xe);we.converters["sequence"]=we.sequenceConverter(we.converters.MessagePort);var YF=[{key:"bubbles",converter:we.converters.boolean,defaultValue:!1},{key:"cancelable",converter:we.converters.boolean,defaultValue:!1},{key:"composed",converter:we.converters.boolean,defaultValue:!1}];we.converters.MessageEventInit=we.dictionaryConverter([...YF,{key:"data",converter:we.converters.any,defaultValue:null},{key:"origin",converter:we.converters.USVString,defaultValue:""},{key:"lastEventId",converter:we.converters.DOMString,defaultValue:""},{key:"source",converter:we.nullableConverter(we.converters.MessagePort),defaultValue:null},{key:"ports",converter:we.converters["sequence"],get defaultValue(){return[]}}]);we.converters.CloseEventInit=we.dictionaryConverter([...YF,{key:"wasClean",converter:we.converters.boolean,defaultValue:!1},{key:"code",converter:we.converters["unsigned short"],defaultValue:0},{key:"reason",converter:we.converters.USVString,defaultValue:""}]);we.converters.ErrorEventInit=we.dictionaryConverter([...YF,{key:"message",converter:we.converters.DOMString,defaultValue:""},{key:"filename",converter:we.converters.USVString,defaultValue:""},{key:"lineno",converter:we.converters["unsigned long"],defaultValue:0},{key:"colno",converter:we.converters["unsigned long"],defaultValue:0},{key:"error",converter:we.converters.any}]);qde.exports={MessageEvent:Cb,CloseEvent:Qb,ErrorEvent:mb}});var fb=E((joA,Gde)=>{"use strict";var{kReadyState:Bb,kController:eZe,kResponse:AZe,kBinaryType:tZe,kWebSocketURL:rZe}=Tm(),{states:Ib,opcodes:Pde}=Xh(),{MessageEvent:iZe,ErrorEvent:sZe}=qF();function nZe(A){return A[Bb]===Ib.OPEN}function aZe(A){return A[Bb]===Ib.CLOSING}function oZe(A){return A[Bb]===Ib.CLOSED}function PF(A,e,t=Event,r){let i=new t(A,r);e.dispatchEvent(i)}function cZe(A,e,t){if(A[Bb]!==Ib.OPEN)return;let r;if(e===Pde.TEXT)try{r=new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{Hde(A,"Received invalid UTF-8 in text frame.");return}else e===Pde.BINARY&&(A[tZe]==="blob"?r=new Blob([t]):r=new Uint8Array(t).buffer);PF("message",A,iZe,{origin:A[rZe].origin,data:r})}function lZe(A){if(A.length===0)return!1;for(let e of A){let t=e.charCodeAt(0);if(t<33||t>126||e==="("||e===")"||e==="<"||e===">"||e==="@"||e===","||e===";"||e===":"||e==="\\"||e==='"'||e==="/"||e==="["||e==="]"||e==="?"||e==="="||e==="{"||e==="}"||t===32||t===9)return!1}return!0}function dZe(A){return A>=1e3&&A<1015?A!==1004&&A!==1005&&A!==1006:A>=3e3&&A<=4999}function Hde(A,e){let{[eZe]:t,[AZe]:r}=A;t.abort(),r?.socket&&!r.socket.destroyed&&r.socket.destroy(),e&&PF("error",A,sZe,{error:new Error(e)})}Gde.exports={isEstablished:nZe,isClosing:aZe,isClosed:oZe,fireEvent:PF,isValidSubprotocol:lZe,isValidStatusCode:dZe,failWebsocketConnection:Hde,websocketMessageReceived:cZe}});var jde=E((XoA,zde)=>{"use strict";var GF=require("diagnostics_channel"),{uid:pZe,states:_de}=Xh(),{kReadyState:Vde,kSentClose:Jde,kByteParser:Wde,kReceivedClose:uZe}=Tm(),{fireEvent:gZe,failWebsocketConnection:Ep}=fb(),{CloseEvent:hZe}=qF(),{makeRequest:EZe}=km(),{fetching:CZe}=ib(),{Headers:QZe}=pp(),{getGlobalDispatcher:mZe}=qh(),{kHeadersList:BZe}=lt(),sc={};sc.open=GF.channel("undici:websocket:open");sc.close=GF.channel("undici:websocket:close");sc.socketError=GF.channel("undici:websocket:socket_error");var HF;try{HF=require("crypto")}catch{}function IZe(A,e,t,r,i){let s=A;s.protocol=A.protocol==="ws:"?"http:":"https:";let n=EZe({urlList:[s],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(i.headers){let l=new QZe(i.headers)[BZe];n.headersList=l}let a=HF.randomBytes(16).toString("base64");n.headersList.append("sec-websocket-key",a),n.headersList.append("sec-websocket-version","13");for(let l of e)n.headersList.append("sec-websocket-protocol",l);let o="";return CZe({request:n,useParallelQueue:!0,dispatcher:i.dispatcher??mZe(),processResponse(l){if(l.type==="error"||l.status!==101){Ep(t,"Received network error or non-101 status code.");return}if(e.length!==0&&!l.headersList.get("Sec-WebSocket-Protocol")){Ep(t,"Server did not respond with sent protocols.");return}if(l.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Ep(t,'Server did not set Upgrade header to "websocket".');return}if(l.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Ep(t,'Server did not set Connection header to "upgrade".');return}let d=l.headersList.get("Sec-WebSocket-Accept"),p=HF.createHash("sha1").update(a+pZe).digest("base64");if(d!==p){Ep(t,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let u=l.headersList.get("Sec-WebSocket-Extensions");if(u!==null&&u!==o){Ep(t,"Received different permessage-deflate than the one set.");return}let g=l.headersList.get("Sec-WebSocket-Protocol");if(g!==null&&g!==n.headersList.get("Sec-WebSocket-Protocol")){Ep(t,"Protocol was not set in the opening handshake.");return}l.socket.on("data",fZe),l.socket.on("close",yZe),l.socket.on("error",wZe),sc.open.hasSubscribers&&sc.open.publish({address:l.socket.address(),protocol:g,extensions:u}),r(l)}})}function fZe(A){this.ws[Wde].write(A)||this.pause()}function yZe(){let{ws:A}=this,e=A[Jde]&&A[uZe],t=1005,r="",i=A[Wde].closingInfo;i?(t=i.code??1005,r=i.reason):A[Jde]||(t=1006),A[Vde]=_de.CLOSED,gZe("close",A,hZe,{wasClean:e,code:t,reason:r}),sc.close.hasSubscribers&&sc.close.publish({websocket:A,code:t,reason:r})}function wZe(A){let{ws:e}=this;e[Vde]=_de.CLOSING,sc.socketError.hasSubscribers&&sc.socketError.publish(A),this.destroy()}zde.exports={establishWebSocketConnection:IZe}});var _F=E((ZoA,Zde)=>{"use strict";var{maxUnsigned16Bit:bZe}=Xh(),Xde;try{Xde=require("crypto")}catch{}var JF=class{constructor(e){this.frameData=e,this.maskKey=Xde.randomBytes(4)}createFrame(e){let t=this.frameData?.byteLength??0,r=t,i=6;t>bZe?(i+=8,r=127):t>125&&(i+=2,r=126);let s=Buffer.allocUnsafe(t+i);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e;s[i-4]=this.maskKey[0],s[i-3]=this.maskKey[1],s[i-2]=this.maskKey[2],s[i-1]=this.maskKey[3],s[1]=r,r===126?s.writeUInt16BE(t,2):r===127&&(s[2]=s[3]=0,s.writeUIntBE(t,4,6)),s[1]|=128;for(let n=0;n{"use strict";var{Writable:NZe}=require("stream"),rpe=require("diagnostics_channel"),{parserStates:wn,opcodes:bn,states:DZe,emptyBuffer:RZe}=Xh(),{kReadyState:xZe,kSentClose:Kde,kResponse:$de,kReceivedClose:epe}=Tm(),{isValidStatusCode:Ape,failWebsocketConnection:Om,websocketMessageReceived:SZe}=fb(),{WebsocketFrameSend:tpe}=_F(),Zh={};Zh.ping=rpe.channel("undici:websocket:ping");Zh.pong=rpe.channel("undici:websocket:pong");var VF=class extends NZe{#e=[];#t=0;#r=wn.INFO;#A={};#i=[];constructor(e){super(),this.ws=e}_write(e,t,r){this.#e.push(e),this.#t+=e.length,this.run(r)}run(e){for(;;){if(this.#r===wn.INFO){if(this.#t<2)return e();let t=this.consume(2);if(this.#A.fin=(t[0]&128)!==0,this.#A.opcode=t[0]&15,this.#A.originalOpcode??=this.#A.opcode,this.#A.fragmented=!this.#A.fin&&this.#A.opcode!==bn.CONTINUATION,this.#A.fragmented&&this.#A.opcode!==bn.BINARY&&this.#A.opcode!==bn.TEXT){Om(this.ws,"Invalid frame type was fragmented.");return}let r=t[1]&127;if(r<=125?(this.#A.payloadLength=r,this.#r=wn.READ_DATA):r===126?this.#r=wn.PAYLOADLENGTH_16:r===127&&(this.#r=wn.PAYLOADLENGTH_64),this.#A.fragmented&&r>125){Om(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#A.opcode===bn.PING||this.#A.opcode===bn.PONG||this.#A.opcode===bn.CLOSE)&&r>125){Om(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#A.opcode===bn.CLOSE){if(r===1){Om(this.ws,"Received close frame with a 1-byte body.");return}let i=this.consume(r);if(this.#A.closeInfo=this.parseCloseBody(!1,i),!this.ws[Kde]){let s=Buffer.allocUnsafe(2);s.writeUInt16BE(this.#A.closeInfo.code,0);let n=new tpe(s);this.ws[$de].socket.write(n.createFrame(bn.CLOSE),a=>{a||(this.ws[Kde]=!0)})}this.ws[xZe]=DZe.CLOSING,this.ws[epe]=!0,this.end();return}else if(this.#A.opcode===bn.PING){let i=this.consume(r);if(!this.ws[epe]){let s=new tpe(i);this.ws[$de].socket.write(s.createFrame(bn.PONG)),Zh.ping.hasSubscribers&&Zh.ping.publish({payload:i})}if(this.#r=wn.INFO,this.#t>0)continue;e();return}else if(this.#A.opcode===bn.PONG){let i=this.consume(r);if(Zh.pong.hasSubscribers&&Zh.pong.publish({payload:i}),this.#t>0)continue;e();return}}else if(this.#r===wn.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#A.payloadLength=t.readUInt16BE(0),this.#r=wn.READ_DATA}else if(this.#r===wn.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),r=t.readUInt32BE(0);if(r>2**31-1){Om(this.ws,"Received payload length > 2^31 bytes.");return}let i=t.readUInt32BE(4);this.#A.payloadLength=(r<<8)+i,this.#r=wn.READ_DATA}else if(this.#r===wn.READ_DATA){if(this.#t=this.#A.payloadLength){let t=this.consume(this.#A.payloadLength);if(this.#i.push(t),!this.#A.fragmented||this.#A.fin&&this.#A.opcode===bn.CONTINUATION){let r=Buffer.concat(this.#i);SZe(this.ws,this.#A.originalOpcode,r),this.#A={},this.#i.length=0}this.#r=wn.INFO}}if(!(this.#t>0)){e();break}}}consume(e){if(e>this.#t)return null;if(e===0)return RZe;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),r=0;for(;r!==e;){let i=this.#e[0],{length:s}=i;if(s+r===e){t.set(this.#e.shift(),r);break}else if(s+r>e){t.set(i.subarray(0,e-r),r),this.#e[0]=i.subarray(e-r);break}else t.set(this.#e.shift(),r),r+=i.length}return this.#t-=e,t}parseCloseBody(e,t){let r;if(t.length>=2&&(r=t.readUInt16BE(0)),e)return Ape(r)?{code:r}:null;let i=t.subarray(2);if(i[0]===239&&i[1]===187&&i[2]===191&&(i=i.subarray(3)),r!==void 0&&!Ape(r))return null;try{i=new TextDecoder("utf-8",{fatal:!0}).decode(i)}catch{return null}return{code:r,reason:i}}get closingInfo(){return this.#A.closeInfo}};ipe.exports={ByteParser:VF}});var upe=E(($oA,ppe)=>{"use strict";var{webidl:ke}=fi(),{DOMException:kl}=yl(),{URLSerializer:vZe}=Kn(),{getGlobalOrigin:kZe}=Eh(),{staticPropertyDescriptors:Fl,states:Kh,opcodes:Ym,emptyBuffer:FZe}=Xh(),{kWebSocketURL:npe,kReadyState:nc,kController:LZe,kBinaryType:yb,kResponse:wb,kSentClose:UZe,kByteParser:MZe}=Tm(),{isEstablished:ape,isClosing:ope,isValidSubprotocol:TZe,failWebsocketConnection:OZe,fireEvent:YZe}=fb(),{establishWebSocketConnection:qZe}=jde(),{WebsocketFrameSend:qm}=_F(),{ByteParser:PZe}=spe(),{kEnumerableProperty:Nn,isBlobLike:lpe}=aA(),{getGlobalDispatcher:HZe}=qh(),{types:dpe}=require("util"),cpe=!1,Js=class A extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#r="";#A="";constructor(e,t=[]){super(),ke.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"}),cpe||(cpe=!0,process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"}));let r=ke.converters["DOMString or sequence or WebSocketInit"](t);e=ke.converters.USVString(e),t=r.protocols;let i=kZe(),s;try{s=new URL(e,i)}catch(n){throw new kl(n,"SyntaxError")}if(s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),s.protocol!=="ws:"&&s.protocol!=="wss:")throw new kl(`Expected a ws: or wss: protocol, got ${s.protocol}`,"SyntaxError");if(s.hash||s.href.endsWith("#"))throw new kl("Got fragment","SyntaxError");if(typeof t=="string"&&(t=[t]),t.length!==new Set(t.map(n=>n.toLowerCase())).size)throw new kl("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every(n=>TZe(n)))throw new kl("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[npe]=new URL(s.href),this[LZe]=qZe(s,t,this,n=>this.#i(n),r),this[nc]=A.CONNECTING,this[yb]="blob"}close(e=void 0,t=void 0){if(ke.brandCheck(this,A),e!==void 0&&(e=ke.converters["unsigned short"](e,{clamp:!0})),t!==void 0&&(t=ke.converters.USVString(t)),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new kl("invalid code","InvalidAccessError");let r=0;if(t!==void 0&&(r=Buffer.byteLength(t),r>123))throw new kl(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError");if(!(this[nc]===A.CLOSING||this[nc]===A.CLOSED))if(!ape(this))OZe(this,"Connection was closed before it was established."),this[nc]=A.CLOSING;else if(ope(this))this[nc]=A.CLOSING;else{let i=new qm;e!==void 0&&t===void 0?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==void 0&&t!==void 0?(i.frameData=Buffer.allocUnsafe(2+r),i.frameData.writeUInt16BE(e,0),i.frameData.write(t,2,"utf-8")):i.frameData=FZe,this[wb].socket.write(i.createFrame(Ym.CLOSE),n=>{n||(this[UZe]=!0)}),this[nc]=Kh.CLOSING}}send(e){if(ke.brandCheck(this,A),ke.argumentLengthCheck(arguments,1,{header:"WebSocket.send"}),e=ke.converters.WebSocketSendData(e),this[nc]===A.CONNECTING)throw new kl("Sent before connected.","InvalidStateError");if(!ape(this)||ope(this))return;let t=this[wb].socket;if(typeof e=="string"){let r=Buffer.from(e),s=new qm(r).createFrame(Ym.TEXT);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(dpe.isArrayBuffer(e)){let r=Buffer.from(e),s=new qm(r).createFrame(Ym.BINARY);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(ArrayBuffer.isView(e)){let r=Buffer.from(e,e.byteOffset,e.byteLength),s=new qm(r).createFrame(Ym.BINARY);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(lpe(e)){let r=new qm;e.arrayBuffer().then(i=>{let s=Buffer.from(i);r.frameData=s;let n=r.createFrame(Ym.BINARY);this.#t+=s.byteLength,t.write(n,()=>{this.#t-=s.byteLength})})}}get readyState(){return ke.brandCheck(this,A),this[nc]}get bufferedAmount(){return ke.brandCheck(this,A),this.#t}get url(){return ke.brandCheck(this,A),vZe(this[npe])}get extensions(){return ke.brandCheck(this,A),this.#A}get protocol(){return ke.brandCheck(this,A),this.#r}get onopen(){return ke.brandCheck(this,A),this.#e.open}set onopen(e){ke.brandCheck(this,A),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return ke.brandCheck(this,A),this.#e.error}set onerror(e){ke.brandCheck(this,A),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return ke.brandCheck(this,A),this.#e.close}set onclose(e){ke.brandCheck(this,A),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return ke.brandCheck(this,A),this.#e.message}set onmessage(e){ke.brandCheck(this,A),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return ke.brandCheck(this,A),this[yb]}set binaryType(e){ke.brandCheck(this,A),e!=="blob"&&e!=="arraybuffer"?this[yb]="blob":this[yb]=e}#i(e){this[wb]=e;let t=new PZe(this);t.on("drain",function(){this.ws[wb].socket.resume()}),e.socket.ws=this,this[MZe]=t,this[nc]=Kh.OPEN;let r=e.headersList.get("sec-websocket-extensions");r!==null&&(this.#A=r);let i=e.headersList.get("sec-websocket-protocol");i!==null&&(this.#r=i),YZe("open",this)}};Js.CONNECTING=Js.prototype.CONNECTING=Kh.CONNECTING;Js.OPEN=Js.prototype.OPEN=Kh.OPEN;Js.CLOSING=Js.prototype.CLOSING=Kh.CLOSING;Js.CLOSED=Js.prototype.CLOSED=Kh.CLOSED;Object.defineProperties(Js.prototype,{CONNECTING:Fl,OPEN:Fl,CLOSING:Fl,CLOSED:Fl,url:Nn,readyState:Nn,bufferedAmount:Nn,onopen:Nn,onerror:Nn,onclose:Nn,close:Nn,onmessage:Nn,binaryType:Nn,send:Nn,extensions:Nn,protocol:Nn,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Js,{CONNECTING:Fl,OPEN:Fl,CLOSING:Fl,CLOSED:Fl});ke.converters["sequence"]=ke.sequenceConverter(ke.converters.DOMString);ke.converters["DOMString or sequence"]=function(A){return ke.util.Type(A)==="Object"&&Symbol.iterator in A?ke.converters["sequence"](A):ke.converters.DOMString(A)};ke.converters.WebSocketInit=ke.dictionaryConverter([{key:"protocols",converter:ke.converters["DOMString or sequence"],get defaultValue(){return[]}},{key:"dispatcher",converter:A=>A,get defaultValue(){return HZe()}},{key:"headers",converter:ke.nullableConverter(ke.converters.HeadersInit)}]);ke.converters["DOMString or sequence or WebSocketInit"]=function(A){return ke.util.Type(A)==="Object"&&!(Symbol.iterator in A)?ke.converters.WebSocketInit(A):{protocols:ke.converters["DOMString or sequence"](A)}};ke.converters.WebSocketSendData=function(A){if(ke.util.Type(A)==="Object"){if(lpe(A))return ke.converters.Blob(A,{strict:!1});if(ArrayBuffer.isView(A)||dpe.isAnyArrayBuffer(A))return ke.converters.BufferSource(A)}return ke.converters.USVString(A)};ppe.exports={WebSocket:Js}});var Cpe=E((ecA,He)=>{"use strict";var GZe=Bm(),gpe=cw(),hpe=WA(),JZe=Sh(),_Ze=Foe(),VZe=wm(),Cp=aA(),{InvalidArgumentError:bb}=hpe,$h=wce(),WZe=pm(),zZe=AF(),jZe=nle(),XZe=iF(),ZZe=Gk(),KZe=ple(),{getGlobalDispatcher:Epe,setGlobalDispatcher:$Ze}=qh(),eKe=Qle(),AKe=ek(),tKe=uw(),WF;try{require("crypto"),WF=!0}catch{WF=!1}Object.assign(gpe.prototype,$h);He.exports.Dispatcher=gpe;He.exports.Client=GZe;He.exports.Pool=JZe;He.exports.BalancedPool=_Ze;He.exports.Agent=VZe;He.exports.ProxyAgent=KZe;He.exports.DecoratorHandler=eKe;He.exports.RedirectHandler=AKe;He.exports.createRedirectInterceptor=tKe;He.exports.buildConnector=WZe;He.exports.errors=hpe;function Pm(A){return(e,t,r)=>{if(typeof t=="function"&&(r=t,t=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new bb("invalid url");if(t!=null&&typeof t!="object")throw new bb("invalid opts");if(t&&t.path!=null){if(typeof t.path!="string")throw new bb("invalid opts.path");let n=t.path;t.path.startsWith("/")||(n=`/${n}`),e=new URL(Cp.parseOrigin(e).origin+n)}else t||(t=typeof e=="object"?e:{}),e=Cp.parseURL(e);let{agent:i,dispatcher:s=Epe()}=t;if(i)throw new bb("unsupported opts.agent. Did you mean opts.client?");return A.call(s,{...t,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:t.method||(t.body?"PUT":"GET")},r)}}He.exports.setGlobalDispatcher=$Ze;He.exports.getGlobalDispatcher=Epe;if(Cp.nodeMajor>16||Cp.nodeMajor===16&&Cp.nodeMinor>=8){let A=null;He.exports.fetch=async function(n){A||(A=ib().fetch);try{return await A(...arguments)}catch(a){throw typeof a=="object"&&Error.captureStackTrace(a,this),a}},He.exports.Headers=pp().Headers,He.exports.Response=zw().Response,He.exports.Request=km().Request,He.exports.FormData=aw().FormData,He.exports.File=sw().File,He.exports.FileReader=gde().FileReader;let{setGlobalOrigin:e,getGlobalOrigin:t}=Eh();He.exports.setGlobalOrigin=e,He.exports.getGlobalOrigin=t;let{CacheStorage:r}=Nde(),{kConstruct:i}=ob();He.exports.caches=new r(i)}if(Cp.nodeMajor>=16){let{deleteCookie:A,getCookies:e,getSetCookies:t,setCookie:r}=Tde();He.exports.deleteCookie=A,He.exports.getCookies=e,He.exports.getSetCookies=t,He.exports.setCookie=r;let{parseMIMEType:i,serializeAMimeType:s}=Kn();He.exports.parseMIMEType=i,He.exports.serializeAMimeType=s}if(Cp.nodeMajor>=18&&WF){let{WebSocket:A}=upe();He.exports.WebSocket=A}He.exports.request=Pm($h.request);He.exports.stream=Pm($h.stream);He.exports.pipeline=Pm($h.pipeline);He.exports.connect=Pm($h.connect);He.exports.upgrade=Pm($h.upgrade);He.exports.MockClient=zZe;He.exports.MockPool=XZe;He.exports.MockAgent=jZe;He.exports.mockErrors=ZZe});var Qpe=E(jA=>{"use strict";var rKe=jA&&jA.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,i)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),iKe=jA&&jA.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),vb=jA&&jA.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&rKe(e,A,t);return iKe(e,A),e},Ht=jA&&jA.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})};Object.defineProperty(jA,"__esModule",{value:!0});jA.HttpClient=jA.isHttps=jA.HttpClientResponse=jA.HttpClientError=jA.getProxyUrl=jA.MediaTypes=jA.Headers=jA.HttpCodes=void 0;var Nb=vb(require("http")),zF=vb(require("https")),jF=vb(ene()),Db=vb(nE()),sKe=Cpe(),Dn;(function(A){A[A.OK=200]="OK",A[A.MultipleChoices=300]="MultipleChoices",A[A.MovedPermanently=301]="MovedPermanently",A[A.ResourceMoved=302]="ResourceMoved",A[A.SeeOther=303]="SeeOther",A[A.NotModified=304]="NotModified",A[A.UseProxy=305]="UseProxy",A[A.SwitchProxy=306]="SwitchProxy",A[A.TemporaryRedirect=307]="TemporaryRedirect",A[A.PermanentRedirect=308]="PermanentRedirect",A[A.BadRequest=400]="BadRequest",A[A.Unauthorized=401]="Unauthorized",A[A.PaymentRequired=402]="PaymentRequired",A[A.Forbidden=403]="Forbidden",A[A.NotFound=404]="NotFound",A[A.MethodNotAllowed=405]="MethodNotAllowed",A[A.NotAcceptable=406]="NotAcceptable",A[A.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",A[A.RequestTimeout=408]="RequestTimeout",A[A.Conflict=409]="Conflict",A[A.Gone=410]="Gone",A[A.TooManyRequests=429]="TooManyRequests",A[A.InternalServerError=500]="InternalServerError",A[A.NotImplemented=501]="NotImplemented",A[A.BadGateway=502]="BadGateway",A[A.ServiceUnavailable=503]="ServiceUnavailable",A[A.GatewayTimeout=504]="GatewayTimeout"})(Dn||(jA.HttpCodes=Dn={}));var ni;(function(A){A.Accept="accept",A.ContentType="content-type"})(ni||(jA.Headers=ni={}));var ac;(function(A){A.ApplicationJson="application/json"})(ac||(jA.MediaTypes=ac={}));function nKe(A){let e=jF.getProxyUrl(new URL(A));return e?e.href:""}jA.getProxyUrl=nKe;var aKe=[Dn.MovedPermanently,Dn.ResourceMoved,Dn.SeeOther,Dn.TemporaryRedirect,Dn.PermanentRedirect],oKe=[Dn.BadGateway,Dn.ServiceUnavailable,Dn.GatewayTimeout],cKe=["OPTIONS","GET","DELETE","HEAD"],lKe=10,dKe=5,xb=class A extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,A.prototype)}};jA.HttpClientError=xb;var Sb=class{constructor(e){this.message=e}readBody(){return Ht(this,void 0,void 0,function*(){return new Promise(e=>Ht(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",r=>{t=Buffer.concat([t,r])}),this.message.on("end",()=>{e(t.toString())})}))})}readBodyBuffer(){return Ht(this,void 0,void 0,function*(){return new Promise(e=>Ht(this,void 0,void 0,function*(){let t=[];this.message.on("data",r=>{t.push(r)}),this.message.on("end",()=>{e(Buffer.concat(t))})}))})}};jA.HttpClientResponse=Sb;function pKe(A){return new URL(A).protocol==="https:"}jA.isHttps=pKe;var XF=class{constructor(e,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(e,t){return Ht(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return Ht(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return Ht(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("POST",e,t,r||{})})}patch(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("PATCH",e,t,r||{})})}put(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("PUT",e,t,r||{})})}head(e,t){return Ht(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,r,i){return Ht(this,void 0,void 0,function*(){return this.request(e,t,r,i)})}getJson(e,t={}){return Ht(this,void 0,void 0,function*(){t[ni.Accept]=this._getExistingOrDefaultHeader(t,ni.Accept,ac.ApplicationJson);let r=yield this.get(e,t);return this._processResponse(r,this.requestOptions)})}postJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ni.Accept]=this._getExistingOrDefaultHeader(r,ni.Accept,ac.ApplicationJson),r[ni.ContentType]=this._getExistingOrDefaultHeader(r,ni.ContentType,ac.ApplicationJson);let s=yield this.post(e,i,r);return this._processResponse(s,this.requestOptions)})}putJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ni.Accept]=this._getExistingOrDefaultHeader(r,ni.Accept,ac.ApplicationJson),r[ni.ContentType]=this._getExistingOrDefaultHeader(r,ni.ContentType,ac.ApplicationJson);let s=yield this.put(e,i,r);return this._processResponse(s,this.requestOptions)})}patchJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ni.Accept]=this._getExistingOrDefaultHeader(r,ni.Accept,ac.ApplicationJson),r[ni.ContentType]=this._getExistingOrDefaultHeader(r,ni.ContentType,ac.ApplicationJson);let s=yield this.patch(e,i,r);return this._processResponse(s,this.requestOptions)})}request(e,t,r,i){return Ht(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let s=new URL(t),n=this._prepareRequest(e,s,i),a=this._allowRetries&&cKe.includes(e)?this._maxRetries+1:1,o=0,c;do{if(c=yield this.requestRaw(n,r),c&&c.message&&c.message.statusCode===Dn.Unauthorized){let d;for(let p of this.handlers)if(p.canHandleAuthentication(c)){d=p;break}return d?d.handleAuthentication(this,n,r):c}let l=this._maxRedirects;for(;c.message.statusCode&&aKe.includes(c.message.statusCode)&&this._allowRedirects&&l>0;){let d=c.message.headers.location;if(!d)break;let p=new URL(d);if(s.protocol==="https:"&&s.protocol!==p.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield c.readBody(),p.hostname!==s.hostname)for(let u in i)u.toLowerCase()==="authorization"&&delete i[u];n=this._prepareRequest(e,p,i),c=yield this.requestRaw(n,r),l--}if(!c.message.statusCode||!oKe.includes(c.message.statusCode))return c;o+=1,o{function s(n,a){n?i(n):a?r(a):i(new Error("Unknown error"))}this.requestRawWithCallback(e,t,s)})})}requestRawWithCallback(e,t,r){typeof t=="string"&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let i=!1;function s(o,c){i||(i=!0,r(o,c))}let n=e.httpModule.request(e.options,o=>{let c=new Sb(o);s(void 0,c)}),a;n.on("socket",o=>{a=o}),n.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),s(new Error(`Request timeout: ${e.options.path}`))}),n.on("error",function(o){s(o)}),t&&typeof t=="string"&&n.write(t,"utf8"),t&&typeof t!="string"?(t.on("close",function(){n.end()}),t.pipe(n)):n.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),r=jF.getProxyUrl(t);if(r&&r.hostname)return this._getProxyAgentDispatcher(t,r)}_prepareRequest(e,t,r){let i={};i.parsedUrl=t;let s=i.parsedUrl.protocol==="https:";i.httpModule=s?zF:Nb;let n=s?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):n,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=e,i.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(i.options);return i}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Rb(this.requestOptions.headers),Rb(e||{})):Rb(e||{})}_getExistingOrDefaultHeader(e,t,r){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Rb(this.requestOptions.headers)[t]),e[t]||i||r}_getAgent(e){let t,r=jF.getProxyUrl(e),i=r&&r.hostname;if(this._keepAlive&&i&&(t=this._proxyAgent),this._keepAlive&&!i&&(t=this._agent),t)return t;let s=e.protocol==="https:",n=100;if(this.requestOptions&&(n=this.requestOptions.maxSockets||Nb.globalAgent.maxSockets),r&&r.hostname){let a={maxSockets:n,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},o,c=r.protocol==="https:";s?o=c?Db.httpsOverHttps:Db.httpsOverHttp:o=c?Db.httpOverHttps:Db.httpOverHttp,t=o(a),this._proxyAgent=t}if(this._keepAlive&&!t){let a={keepAlive:this._keepAlive,maxSockets:n};t=s?new zF.Agent(a):new Nb.Agent(a),this._agent=t}return t||(t=s?zF.globalAgent:Nb.globalAgent),s&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;let i=e.protocol==="https:";return r=new sKe.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(t.username||t.password)&&{token:`${t.username}:${t.password}`})),this._proxyAgentDispatcher=r,i&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}_performExponentialBackoff(e){return Ht(this,void 0,void 0,function*(){e=Math.min(lKe,e);let t=dKe*Math.pow(2,e);return new Promise(r=>setTimeout(()=>r(),t))})}_processResponse(e,t){return Ht(this,void 0,void 0,function*(){return new Promise((r,i)=>Ht(this,void 0,void 0,function*(){let s=e.message.statusCode||0,n={statusCode:s,result:null,headers:{}};s===Dn.NotFound&&r(n);function a(l,d){if(typeof d=="string"){let p=new Date(d);if(!isNaN(p.valueOf()))return p}return d}let o,c;try{c=yield e.readBody(),c&&c.length>0&&(t&&t.deserializeDates?o=JSON.parse(c,a):o=JSON.parse(c),n.result=o),n.headers=e.message.headers}catch{}if(s>299){let l;o&&o.message?l=o.message:c&&c.length>0?l=c:l=`Failed request: (${s})`;let d=new xb(l,s);d.result=n.result,i(d)}else r(n)}))})}};jA.HttpClient=XF;var Rb=A=>Object.keys(A).reduce((e,t)=>(e[t.toLowerCase()]=A[t],e),{})});var Ipe=E(Rn=>{"use strict";var uKe=Rn&&Rn.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),gKe=Rn&&Rn.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),hKe=Rn&&Rn.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&uKe(e,A,t);return gKe(e,A),e},mpe=Rn&&Rn.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RetryHelper=void 0;var Bpe=hKe(vr()),ZF=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return mpe(this,void 0,void 0,function*(){let r=1;for(;rsetTimeout(t,e*1e3))})}};Rn.RetryHelper=ZF});var xpe=E(Ge=>{"use strict";var EKe=Ge&&Ge.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),CKe=Ge&&Ge.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),$a=Ge&&Ge.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&EKe(e,A,t);return CKe(e,A),e},Ri=Ge&&Ge.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})},QKe=Ge&&Ge.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.evaluateVersions=Ge.isExplicitVersion=Ge.findFromManifest=Ge.getManifestFromRepo=Ge.findAllVersions=Ge.find=Ge.cacheFile=Ge.cacheDir=Ge.extractZip=Ge.extractXar=Ge.extractTar=Ge.extract7z=Ge.downloadTool=Ge.HTTPError=void 0;var cA=$a(vr()),_s=$a(WE()),xn=$a(require("fs")),mKe=$a(Kse()),Gm=$a(require("os")),ta=$a(require("path")),fpe=$a(Qpe()),oc=$a(ef()),BKe=$a(require("stream")),IKe=$a(require("util")),eE=require("assert"),ype=QKe(FR()),Ll=zE(),fKe=Ipe(),Hm=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};Ge.HTTPError=Hm;var $F=process.platform==="win32",yKe=process.platform==="darwin",wKe="actions/tool-cache";function bKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){e=e||ta.join(Rpe(),ype.default()),yield _s.mkdirP(ta.dirname(e)),cA.debug(`Downloading ${A}`),cA.debug(`Destination ${e}`);let i=3,s=KF("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),n=KF("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new fKe.RetryHelper(i,s,n).execute(()=>Ri(this,void 0,void 0,function*(){return yield NKe(A,e||"",t,r)}),o=>!(o instanceof Hm&&o.httpStatusCode&&o.httpStatusCode<500&&o.httpStatusCode!==408&&o.httpStatusCode!==429))})}Ge.downloadTool=bKe;function NKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){if(xn.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let i=new fpe.HttpClient(wKe,[],{allowRetries:!1});t&&(cA.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let s=yield i.get(A,r);if(s.message.statusCode!==200){let l=new Hm(s.message.statusCode);throw cA.debug(`Failed to download from "${A}". Code(${s.message.statusCode}) Message(${s.message.statusMessage})`),l}let n=IKe.promisify(BKe.pipeline),o=KF("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>s.message)(),c=!1;try{return yield n(o,xn.createWriteStream(e)),cA.debug("download complete"),c=!0,e}finally{if(!c){cA.debug("download failed");try{yield _s.rmRF(e)}catch(l){cA.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function DKe(A,e,t){return Ri(this,void 0,void 0,function*(){eE.ok($F,"extract7z() not supported on current OS"),eE.ok(A,'parameter "file" is required'),e=yield kb(e);let r=process.cwd();if(process.chdir(e),t)try{let s=["x",cA.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",A],n={silent:!0};yield Ll.exec(`"${t}"`,s,n)}finally{process.chdir(r)}else{let i=ta.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),s=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),n=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${i}' -Source '${s}' -Target '${n}'`],c={silent:!0};try{let l=yield _s.which("powershell",!0);yield Ll.exec(`"${l}"`,o,c)}finally{process.chdir(r)}}return e})}Ge.extract7z=DKe;function RKe(A,e,t="xz"){return Ri(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");e=yield kb(e),cA.debug("Checking tar --version");let r="";yield Ll.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:o=>r+=o.toString(),stderr:o=>r+=o.toString()}}),cA.debug(r.trim());let i=r.toUpperCase().includes("GNU TAR"),s;t instanceof Array?s=t:s=[t],cA.isDebug()&&!t.includes("v")&&s.push("-v");let n=e,a=A;return $F&&i&&(s.push("--force-local"),n=e.replace(/\\/g,"/"),a=A.replace(/\\/g,"/")),i&&(s.push("--warning=no-unknown-keyword"),s.push("--overwrite")),s.push("-C",n,"-f",a),yield Ll.exec("tar",s),e})}Ge.extractTar=RKe;function xKe(A,e,t=[]){return Ri(this,void 0,void 0,function*(){eE.ok(yKe,"extractXar() not supported on current OS"),eE.ok(A,'parameter "file" is required'),e=yield kb(e);let r;t instanceof Array?r=t:r=[t],r.push("-x","-C",e,"-f",A),cA.isDebug()&&r.push("-v");let i=yield _s.which("xar",!0);return yield Ll.exec(`"${i}"`,OKe(r)),e})}Ge.extractXar=xKe;function SKe(A,e){return Ri(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");return e=yield kb(e),$F?yield vKe(A,e):yield kKe(A,e),e})}Ge.extractZip=SKe;function vKe(A,e){return Ri(this,void 0,void 0,function*(){let t=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=yield _s.which("pwsh",!1);if(i){let n=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ")];cA.debug(`Using pwsh at path: ${i}`),yield Ll.exec(`"${i}"`,n)}else{let n=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`].join(" ")],a=yield _s.which("powershell",!0);cA.debug(`Using powershell at path: ${a}`),yield Ll.exec(`"${a}"`,n)}})}function kKe(A,e){return Ri(this,void 0,void 0,function*(){let t=yield _s.which("unzip",!0),r=[A];cA.isDebug()||r.unshift("-q"),r.unshift("-o"),yield Ll.exec(`"${t}"`,r,{cwd:e})})}function FKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){if(t=oc.clean(t)||t,r=r||Gm.arch(),cA.debug(`Caching tool ${e} ${t} ${r}`),cA.debug(`source dir: ${A}`),!xn.statSync(A).isDirectory())throw new Error("sourceDir is not a directory");let i=yield bpe(e,t,r);for(let s of xn.readdirSync(A)){let n=ta.join(A,s);yield _s.cp(n,i,{recursive:!0})}return Npe(e,t,r),i})}Ge.cacheDir=FKe;function LKe(A,e,t,r,i){return Ri(this,void 0,void 0,function*(){if(r=oc.clean(r)||r,i=i||Gm.arch(),cA.debug(`Caching tool ${t} ${r} ${i}`),cA.debug(`source file: ${A}`),!xn.statSync(A).isFile())throw new Error("sourceFile is not a file");let s=yield bpe(t,r,i),n=ta.join(s,e);return cA.debug(`destination file ${n}`),yield _s.cp(A,n),Npe(t,r,i),s})}Ge.cacheFile=LKe;function UKe(A,e,t){if(!A)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(t=t||Gm.arch(),!e7(e)){let i=wpe(A,t);e=Dpe(i,e)}let r="";if(e){e=oc.clean(e)||"";let i=ta.join(Fb(),A,e,t);cA.debug(`checking cache: ${i}`),xn.existsSync(i)&&xn.existsSync(`${i}.complete`)?(cA.debug(`Found tool in cache ${A} ${e} ${t}`),r=i):cA.debug("not found")}return r}Ge.find=UKe;function wpe(A,e){let t=[];e=e||Gm.arch();let r=ta.join(Fb(),A);if(xn.existsSync(r)){let i=xn.readdirSync(r);for(let s of i)if(e7(s)){let n=ta.join(r,s,e||"");xn.existsSync(n)&&xn.existsSync(`${n}.complete`)&&t.push(s)}}return t}Ge.findAllVersions=wpe;function MKe(A,e,t,r="master"){return Ri(this,void 0,void 0,function*(){let i=[],s=`https://api.github.com/repos/${A}/${e}/git/trees/${r}`,n=new fpe.HttpClient("tool-cache"),a={};t&&(cA.debug("set auth"),a.authorization=t);let o=yield n.getJson(s,a);if(!o.result)return i;let c="";for(let d of o.result.tree)if(d.path==="versions-manifest.json"){c=d.url;break}a.accept="application/vnd.github.VERSION.raw";let l=yield(yield n.get(c,a)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{i=JSON.parse(l)}catch{cA.debug("Invalid json")}}return i})}Ge.getManifestFromRepo=MKe;function TKe(A,e,t,r=Gm.arch()){return Ri(this,void 0,void 0,function*(){return yield mKe._findMatch(A,e,t,r)})}Ge.findFromManifest=TKe;function kb(A){return Ri(this,void 0,void 0,function*(){return A||(A=ta.join(Rpe(),ype.default())),yield _s.mkdirP(A),A})}function bpe(A,e,t){return Ri(this,void 0,void 0,function*(){let r=ta.join(Fb(),A,oc.clean(e)||e,t||"");cA.debug(`destination ${r}`);let i=`${r}.complete`;return yield _s.rmRF(r),yield _s.rmRF(i),yield _s.mkdirP(r),r})}function Npe(A,e,t){let i=`${ta.join(Fb(),A,oc.clean(e)||e,t||"")}.complete`;xn.writeFileSync(i,""),cA.debug("finished caching tool")}function e7(A){let e=oc.clean(A)||"";cA.debug(`isExplicit: ${e}`);let t=oc.valid(e)!=null;return cA.debug(`explicit? ${t}`),t}Ge.isExplicitVersion=e7;function Dpe(A,e){let t="";cA.debug(`evaluating ${A.length} versions`),A=A.sort((r,i)=>oc.gt(r,i)?1:-1);for(let r=A.length-1;r>=0;r--){let i=A[r];if(oc.satisfies(i,e)){t=i;break}}return t?cA.debug(`matched: ${t}`):cA.debug("match not found"),t}Ge.evaluateVersions=Dpe;function Fb(){let A=process.env.RUNNER_TOOL_CACHE||"";return eE.ok(A,"Expected RUNNER_TOOL_CACHE to be defined"),A}function Rpe(){let A=process.env.RUNNER_TEMP||"";return eE.ok(A,"Expected RUNNER_TEMP to be defined"),A}function KF(A,e){let t=global[A];return t!==void 0?t:e}function OKe(A){return Array.from(new Set(A))}});var Tpe=require("node:os"),i7=require("node:path"),tE=require("node:fs"),ai=is(vr());var Fpe=require("node:os"),AE=require("node:path"),eo=require("node:fs"),Qp=is(vr()),Lb=is(jse()),_m=is(xpe()),t7=is(zE());var Jm=require("node:os"),Spe=require("node:fs"),vpe=is(vr());function YKe(A){let{registryUrl:e,scope:t}=A,r;if(e)try{r=new URL(e)}catch{throw new Error(`Invalid registry-url: ${e}`)}let i;return t&&(i=t.startsWith("@")?t.toLocaleLowerCase():`@${t.toLocaleLowerCase()}`),r&&i?`[install.scopes]${Jm.EOL}'${i}' = { token = "$BUN_AUTH_TOKEN", url = "${r}"}${Jm.EOL}`:r&&!i?`[install]${Jm.EOL}registry = "${r}"${Jm.EOL}`:null}function kpe(A,e){let t=YKe(e);t&&((0,vpe.info)(`Writing bunfig.toml to '${A}'.`),(0,Spe.appendFileSync)(A,t,{encoding:"utf8"}))}var Lpe=is(vr());function A7(A,e){return A().catch(t=>{if(console.log(`Remaining retries ${e}`),console.log("Current error:"),console.log(t),e<=0)throw t;return A7(A,e-1)})}var Upe=async A=>{let e=(0,AE.join)(process.cwd(),"bunfig.toml");kpe(e,A);let t=HKe(A),r=PKe(A),i=(0,AE.join)((0,Fpe.homedir)(),".bun","bin");try{(0,eo.mkdirSync)(i,{recursive:!0})}catch(d){if(d.code!=="EEXIST")throw d}(0,Qp.addPath)(i);let s=d=>process.platform==="win32"?`${d}.exe`:d,n=(0,AE.join)(i,s("bun"));try{(0,eo.symlinkSync)(n,(0,AE.join)(i,s("bunx")))}catch(d){if(d.code!=="EEXIST")throw d}let a,o=!1;if(r&&await(0,Lb.restoreCache)([n],t)&&(a=await Mpe(n),a?(o=!0,(0,Qp.info)(`Using a cached version of Bun: ${a}`)):(0,Qp.warning)(`Found a cached version of Bun: ${a} (but it appears to be corrupted?)`)),o||((0,Qp.info)(`Downloading a new version of Bun: ${t}`),a=await A7(async()=>await qKe(t,n),3),console.log("Downloaded Bun revision: "+a)),!a)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[c]=a.split("+");return(0,Lpe.saveState)("cache",JSON.stringify({cacheEnabled:r,cacheHit:o,bunPath:n,url:t})),{version:c,revision:a,cacheHit:o}};async function qKe(A,e){let t=await(0,_m.downloadTool)(A),r=await(0,_m.extractZip)(t),i=await r7(r);try{(0,eo.renameSync)(i,e)}catch{(0,eo.copyFileSync)(i,e)}return await Mpe(e)}function PKe(A){let{customUrl:e,version:t,noCache:r}=A;return r||e||!t||/latest|canary|action/i.test(t)?!1:(0,Lb.isFeatureAvailable)()}function HKe(A){let{customUrl:e}=A;if(e)return e;let{version:t,os:r,arch:i,avx2:s,profile:n}=A,a=encodeURIComponent(t??"latest"),o=encodeURIComponent(r??process.platform),c=encodeURIComponent(i??process.arch),l=encodeURIComponent(s??!0),d=encodeURIComponent(n??!1),{href:p}=new URL(`${a}/${o}/${c}?avx2=${l}&profile=${d}`,"https://bun.sh/download/");return p}async function r7(A){for(let e of(0,eo.readdirSync)(A,{withFileTypes:!0})){let{name:t}=e,r=(0,AE.join)(A,t);if(e.isFile()){if(t==="bun"||t==="bun.exe")return r;if(/^bun.*\.zip/.test(t)){let i=await(0,_m.extractZip)(r);return r7(i)}}if(/^bun/.test(t)&&e.isDirectory())return r7(r)}throw new Error("Could not find executable: bun")}async function Mpe(A){let e=await(0,t7.getExecOutput)(A,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let t=await(0,t7.getExecOutput)(A,["--version"],{ignoreReturnCode:!0});if(t.exitCode===0&&/^\d+\.\d+\.\d+/.test(t.stdout))return t.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,Tpe.tmpdir)());function GKe(){let A=process.env.GITHUB_WORKSPACE;if(!A)return;let e=(0,i7.join)(A,"package.json");try{if(!(0,tE.existsSync)(e))return;let{packageManager:t}=JSON.parse((0,tE.readFileSync)(e,"utf8"));if(!t?.includes("bun@"))return;let[r,i]=t.split("bun@");return i}catch(t){let{message:r}=t;(0,ai.warning)(`Failed to read package.json: ${r}`)}}function JKe(){let A=process.env.GITHUB_WORKSPACE;if(!A)return;let e=(0,i7.join)(A,".tool-versions");try{return(0,tE.existsSync)(e)?(0,tE.readFileSync)(e,"utf8").match(/^bun\s(?.*?)$/m)?.groups?.version:void 0}catch(t){let{message:r}=t;(0,ai.warning)(`Failed to read .tool-versions: ${r}`)}}Upe({version:(0,ai.getInput)("bun-version")||GKe()||JKe()||void 0,customUrl:(0,ai.getInput)("bun-download-url")||void 0,registryUrl:(0,ai.getInput)("registry-url")||void 0,scope:(0,ai.getInput)("scope")||void 0,noCache:(0,ai.getBooleanInput)("no-cache")||!1}).then(({version:A,revision:e,cacheHit:t})=>{console.log("Setting output"),(0,ai.setOutput)("bun-version",A),(0,ai.setOutput)("bun-revision",e),(0,ai.setOutput)("cache-hit",t),console.log("Done"),process.exit(0)}).catch(A=>{(0,ai.setFailed)(A)}); /*! Bundled license information: undici/lib/fetch/body.js: diff --git a/src/action.ts b/src/action.ts index f01729e..4ca7b11 100644 --- a/src/action.ts +++ b/src/action.ts @@ -107,9 +107,7 @@ export default async (options: Input): Promise => { url, }; - console.log("Saving cache state: " + JSON.stringify(cacheState)); saveState("cache", JSON.stringify(cacheState)); - console.log("Saved cache state: " + JSON.stringify(cacheState)); return { version, diff --git a/src/index.ts b/src/index.ts index 61c0ad5..1c996e0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,9 +68,12 @@ runAction({ noCache: getBooleanInput("no-cache") || false, }) .then(({ version, revision, cacheHit }) => { + console.log("Setting output"); setOutput("bun-version", version); setOutput("bun-revision", revision); setOutput("cache-hit", cacheHit); + console.log("Done"); + process.exit(0); }) .catch((error) => { setFailed(error);