diff --git a/README.md b/README.md index 6e328e0..713969e 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,12 @@ # Browser Platform Publisher -A GitHub action from [Plasmo](https://www.plasmo.com/) to publish your browser extension to every web store/add-ons marketplace. This action and its dependencies are MIT licensed. The core modules are: +A GitHub action from [Plasmo](https://www.plasmo.com/) to publish your browser extension to every web store/add-ons marketplace. This action and its dependencies are open-sourced under the MIT license. The core modules are: - [Browser Market Submit](https://github.com/PlasmoHQ/bms) - [Chrome Webstore API](https://github.com/PlasmoHQ/chrome-webstore-api) - [Mozilla Addons API](https://github.com/PlasmoHQ/mozilla-addons-api) - [Edge Addons API](https://github.com/PlasmoHQ/edge-addons-api) -- [Itero TestBed API](https://github.com/PlasmoHQ/itero-testbed-api) ## Usage diff --git a/index.js b/index.js index de80247..9464754 100644 --- a/index.js +++ b/index.js @@ -1,54 +1,26 @@ -"use strict";var kg=Object.create;var Gc=Object.defineProperty;var Pg=Object.getOwnPropertyDescriptor;var Ng=Object.getOwnPropertyNames;var Og=Object.getPrototypeOf,Lg=Object.prototype.hasOwnProperty;var lt=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var Ug=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ng(n))!Lg.call(e,i)&&i!==r&&Gc(e,i,{get:()=>n[i],enumerable:!(t=Pg(n,i))||t.enumerable});return e};var Qc=(e,n,r)=>(r=e!=null?kg(Og(e)):{},Ug(n||!e||!e.__esModule?Gc(r,"default",{value:e,enumerable:!0}):r,e));var Xc=(e,n,r)=>new Promise((t,i)=>{var o=s=>{try{u(r.next(s))}catch(a){i(a)}},l=s=>{try{u(r.throw(s))}catch(a){i(a)}},u=s=>s.done?t(s.value):Promise.resolve(s.value).then(o,l);u((r=r.apply(e,n)).next())});var uo=lt(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.toCommandProperties=Ci.toCommandValue=void 0;function Dg(e){return e==null?"":typeof e=="string"||e instanceof String?e:JSON.stringify(e)}Ci.toCommandValue=Dg;function xg(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}Ci.toCommandProperties=xg});var eh=lt(Ir=>{"use strict";var qg=Ir&&Ir.__createBinding||(Object.create?function(e,n,r,t){t===void 0&&(t=r),Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,t){t===void 0&&(t=r),e[t]=n[r]}),jg=Ir&&Ir.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Mg=Ir&&Ir.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&qg(n,e,r);return jg(n,e),n};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.issue=Ir.issueCommand=void 0;var Vg=Mg(require("os")),Zc=uo();function Jc(e,n,r){let t=new eu(e,n,r);process.stdout.write(t.toString()+Vg.EOL)}Ir.issueCommand=Jc;function Fg(e,n=""){Jc(e,{},n)}Ir.issue=Fg;var Yc="::",eu=class{constructor(n,r,t){n||(n="missing.command"),this.command=n,this.properties=r,this.message=t}toString(){let n=Yc+this.command;if(this.properties&&Object.keys(this.properties).length>0){n+=" ";let r=!0;for(let t in this.properties)if(this.properties.hasOwnProperty(t)){let i=this.properties[t];i&&(r?r=!1:n+=",",n+=`${t}=${$g(i)}`)}}return n+=`${Yc}${Kg(this.message)}`,n}};function Kg(e){return Zc.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function $g(e){return Zc.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});var ru=lt(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.default=Wg;var Hg=zg(require("crypto"));function zg(e){return e&&e.__esModule?e:{default:e}}var co=new Uint8Array(256),lo=co.length;function Wg(){return lo>co.length-16&&(Hg.default.randomFillSync(co),lo=0),co.slice(lo,lo+=16)}});var th=lt(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var Gg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;ho.default=Gg});var ra=lt(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var Qg=Xg(th());function Xg(e){return e&&e.__esModule?e:{default:e}}function Yg(e){return typeof e=="string"&&Qg.default.test(e)}var Zg=Yg;fo.default=Zg});var na=lt(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.default=void 0;var Jg=e0(ra());function e0(e){return e&&e.__esModule?e:{default:e}}var Yt=[];for(let e=0;e<256;++e)Yt.push((e+256).toString(16).substr(1));function t0(e,n=0){let r=(Yt[e[n+0]]+Yt[e[n+1]]+Yt[e[n+2]]+Yt[e[n+3]]+"-"+Yt[e[n+4]]+Yt[e[n+5]]+"-"+Yt[e[n+6]]+Yt[e[n+7]]+"-"+Yt[e[n+8]]+Yt[e[n+9]]+"-"+Yt[e[n+10]]+Yt[e[n+11]]+Yt[e[n+12]]+Yt[e[n+13]]+Yt[e[n+14]]+Yt[e[n+15]]).toLowerCase();if(!(0,Jg.default)(r))throw TypeError("Stringified UUID is invalid");return r}var r0=t0;po.default=r0});var ih=lt(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.default=void 0;var n0=nh(ru()),i0=nh(na());function nh(e){return e&&e.__esModule?e:{default:e}}var rh,nu,iu=0,au=0;function a0(e,n,r){let t=n&&r||0,i=n||new Array(16);e=e||{};let o=e.node||rh,l=e.clockseq!==void 0?e.clockseq:nu;if(o==null||l==null){let g=e.random||(e.rng||n0.default)();o==null&&(o=rh=[g[0]|1,g[1],g[2],g[3],g[4],g[5]]),l==null&&(l=nu=(g[6]<<8|g[7])&16383)}let u=e.msecs!==void 0?e.msecs:Date.now(),s=e.nsecs!==void 0?e.nsecs:au+1,a=u-iu+(s-au)/1e4;if(a<0&&e.clockseq===void 0&&(l=l+1&16383),(a<0||u>iu)&&e.nsecs===void 0&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");iu=u,au=s,nu=l,u+=122192928e5;let y=((u&268435455)*1e4+s)%4294967296;i[t++]=y>>>24&255,i[t++]=y>>>16&255,i[t++]=y>>>8&255,i[t++]=y&255;let c=u/4294967296*1e4&268435455;i[t++]=c>>>8&255,i[t++]=c&255,i[t++]=c>>>24&15|16,i[t++]=c>>>16&255,i[t++]=l>>>8|128,i[t++]=l&255;for(let g=0;g<6;++g)i[t+g]=o[g];return n||(0,i0.default)(i)}var o0=a0;yo.default=o0});var ou=lt(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var s0=u0(ra());function u0(e){return e&&e.__esModule?e:{default:e}}function l0(e){if(!(0,s0.default)(e))throw TypeError("Invalid UUID");let n,r=new Uint8Array(16);return r[0]=(n=parseInt(e.slice(0,8),16))>>>24,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=n&255,r[4]=(n=parseInt(e.slice(9,13),16))>>>8,r[5]=n&255,r[6]=(n=parseInt(e.slice(14,18),16))>>>8,r[7]=n&255,r[8]=(n=parseInt(e.slice(19,23),16))>>>8,r[9]=n&255,r[10]=(n=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=n/4294967296&255,r[12]=n>>>24&255,r[13]=n>>>16&255,r[14]=n>>>8&255,r[15]=n&255,r}var c0=l0;go.default=c0});var su=lt(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.default=p0;Mn.URL=Mn.DNS=void 0;var h0=ah(na()),f0=ah(ou());function ah(e){return e&&e.__esModule?e:{default:e}}function d0(e){e=unescape(encodeURIComponent(e));let n=[];for(let r=0;r{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.default=void 0;var y0=g0(require("crypto"));function g0(e){return e&&e.__esModule?e:{default:e}}function m0(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),y0.default.createHash("md5").update(e).digest()}var v0=m0;mo.default=v0});var ch=lt(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.default=void 0;var b0=lh(su()),_0=lh(uh());function lh(e){return e&&e.__esModule?e:{default:e}}var w0=(0,b0.default)("v3",48,_0.default),S0=w0;vo.default=S0});var fh=lt(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.default=void 0;var E0=hh(ru()),C0=hh(na());function hh(e){return e&&e.__esModule?e:{default:e}}function T0(e,n,r){e=e||{};let t=e.random||(e.rng||E0.default)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,n){r=r||0;for(let i=0;i<16;++i)n[r+i]=t[i];return n}return(0,C0.default)(t)}var I0=T0;bo.default=I0});var dh=lt(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.default=void 0;var R0=A0(require("crypto"));function A0(e){return e&&e.__esModule?e:{default:e}}function B0(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),R0.default.createHash("sha1").update(e).digest()}var k0=B0;_o.default=k0});var yh=lt(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.default=void 0;var P0=ph(su()),N0=ph(dh());function ph(e){return e&&e.__esModule?e:{default:e}}var O0=(0,P0.default)("v5",80,N0.default),L0=O0;wo.default=L0});var gh=lt(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.default=void 0;var U0="00000000-0000-0000-0000-000000000000";So.default=U0});var mh=lt(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.default=void 0;var D0=x0(ra());function x0(e){return e&&e.__esModule?e:{default:e}}function q0(e){if(!(0,D0.default)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var j0=q0;Eo.default=j0});var vh=lt(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Object.defineProperty(Or,"v1",{enumerable:!0,get:function(){return M0.default}});Object.defineProperty(Or,"v3",{enumerable:!0,get:function(){return V0.default}});Object.defineProperty(Or,"v4",{enumerable:!0,get:function(){return F0.default}});Object.defineProperty(Or,"v5",{enumerable:!0,get:function(){return K0.default}});Object.defineProperty(Or,"NIL",{enumerable:!0,get:function(){return $0.default}});Object.defineProperty(Or,"version",{enumerable:!0,get:function(){return H0.default}});Object.defineProperty(Or,"validate",{enumerable:!0,get:function(){return z0.default}});Object.defineProperty(Or,"stringify",{enumerable:!0,get:function(){return W0.default}});Object.defineProperty(Or,"parse",{enumerable:!0,get:function(){return G0.default}});var M0=nn(ih()),V0=nn(ch()),F0=nn(fh()),K0=nn(yh()),$0=nn(gh()),H0=nn(mh()),z0=nn(ra()),W0=nn(na()),G0=nn(ou());function nn(e){return e&&e.__esModule?e:{default:e}}});var Sh=lt(Rr=>{"use strict";var Q0=Rr&&Rr.__createBinding||(Object.create?function(e,n,r,t){t===void 0&&(t=r),Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,t){t===void 0&&(t=r),e[t]=n[r]}),X0=Rr&&Rr.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),_h=Rr&&Rr.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Q0(n,e,r);return X0(n,e),n};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.prepareKeyValueMessage=Rr.issueFileCommand=void 0;var bh=_h(require("fs")),uu=_h(require("os")),Y0=vh(),wh=uo();function Z0(e,n){let r=process.env[`GITHUB_${e}`];if(!r)throw new Error(`Unable to find environment variable for file command ${e}`);if(!bh.existsSync(r))throw new Error(`Missing file at path: ${r}`);bh.appendFileSync(r,`${wh.toCommandValue(n)}${uu.EOL}`,{encoding:"utf8"})}Rr.issueFileCommand=Z0;function J0(e,n){let r=`ghadelimiter_${Y0.v4()}`,t=wh.toCommandValue(n);if(e.includes(r))throw new Error(`Unexpected input: name should not contain the delimiter "${r}"`);if(t.includes(r))throw new Error(`Unexpected input: value should not contain the delimiter "${r}"`);return`${e}<<${r}${uu.EOL}${t}${uu.EOL}${r}`}Rr.prepareKeyValueMessage=J0});var Ch=lt(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.checkBypass=Ti.getProxyUrl=void 0;function em(e){let n=e.protocol==="https:";if(Eh(e))return;let r=(()=>n?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(r)return new URL(r)}Ti.getProxyUrl=em;function Eh(e){if(!e.hostname)return!1;let n=process.env.no_proxy||process.env.NO_PROXY||"";if(!n)return!1;let r;e.port?r=Number(e.port):e.protocol==="http:"?r=80:e.protocol==="https:"&&(r=443);let t=[e.hostname.toUpperCase()];typeof r=="number"&&t.push(`${t[0]}:${r}`);for(let i of n.split(",").map(o=>o.trim().toUpperCase()).filter(o=>o))if(t.some(o=>o===i))return!0;return!1}Ti.checkBypass=Eh});var Ah=lt(Ii=>{"use strict";var gS=require("net"),tm=require("tls"),lu=require("http"),Th=require("https"),rm=require("events"),mS=require("assert"),nm=require("util");Ii.httpOverHttp=im;Ii.httpsOverHttp=am;Ii.httpOverHttps=om;Ii.httpsOverHttps=sm;function im(e){var n=new an(e);return n.request=lu.request,n}function am(e){var n=new an(e);return n.request=lu.request,n.createSocket=Ih,n.defaultPort=443,n}function om(e){var n=new an(e);return n.request=Th.request,n}function sm(e){var n=new an(e);return n.request=Th.request,n.createSocket=Ih,n.defaultPort=443,n}function an(e){var n=this;n.options=e||{},n.proxyOptions=n.options.proxy||{},n.maxSockets=n.options.maxSockets||lu.Agent.defaultMaxSockets,n.requests=[],n.sockets=[],n.on("free",function(t,i,o,l){for(var u=Rh(i,o,l),s=0,a=n.requests.length;s=this.maxSockets){o.requests.push(l);return}o.createSocket(l,function(u){u.on("free",s),u.on("close",a),u.on("agentRemove",a),n.onSocket(u);function s(){o.emit("free",u,l)}function a(y){o.removeSocket(u),u.removeListener("free",s),u.removeListener("close",a),u.removeListener("agentRemove",a)}})};an.prototype.createSocket=function(n,r){var t=this,i={};t.sockets.push(i);var o=cu({},t.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1,headers:{host:n.host+":"+n.port}});n.localAddress&&(o.localAddress=n.localAddress),o.proxyAuth&&(o.headers=o.headers||{},o.headers["Proxy-Authorization"]="Basic "+new Buffer(o.proxyAuth).toString("base64")),Sn("making CONNECT request");var l=t.request(o);l.useChunkedEncodingByDefault=!1,l.once("response",u),l.once("upgrade",s),l.once("connect",a),l.once("error",y),l.end();function u(c){c.upgrade=!0}function s(c,g,I){process.nextTick(function(){a(c,g,I)})}function a(c,g,I){if(l.removeAllListeners(),g.removeAllListeners(),c.statusCode!==200){Sn("tunneling socket could not be established, statusCode=%d",c.statusCode),g.destroy();var w=new Error("tunneling socket could not be established, statusCode="+c.statusCode);w.code="ECONNRESET",n.request.emit("error",w),t.removeSocket(i);return}if(I.length>0){Sn("got illegal response body from proxy"),g.destroy();var w=new Error("got illegal response body from proxy");w.code="ECONNRESET",n.request.emit("error",w),t.removeSocket(i);return}return Sn("tunneling connection has established"),t.sockets[t.sockets.indexOf(i)]=g,r(g)}function y(c){l.removeAllListeners(),Sn(`tunneling socket could not be established, cause=%s -`,c.message,c.stack);var g=new Error("tunneling socket could not be established, cause="+c.message);g.code="ECONNRESET",n.request.emit("error",g),t.removeSocket(i)}};an.prototype.removeSocket=function(n){var r=this.sockets.indexOf(n);if(r!==-1){this.sockets.splice(r,1);var t=this.requests.shift();t&&this.createSocket(t,function(i){t.request.onSocket(i)})}};function Ih(e,n){var r=this;an.prototype.createSocket.call(r,e,function(t){var i=e.request.getHeader("host"),o=cu({},r.options,{socket:t,servername:i?i.replace(/:.*$/,""):e.host}),l=tm.connect(0,o);r.sockets[r.sockets.indexOf(t)]=l,n(l)})}function Rh(e,n,r){return typeof e=="string"?{host:e,port:n,localAddress:r}:e}function cu(e){for(var n=1,r=arguments.length;n{Bh.exports=Ah()});var Nh=lt(at=>{"use strict";var um=at&&at.__createBinding||(Object.create?function(e,n,r,t){t===void 0&&(t=r),Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,t){t===void 0&&(t=r),e[t]=n[r]}),lm=at&&at.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Ao=at&&at.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&um(n,e,r);return lm(n,e),n},Kt=at&&at.__awaiter||function(e,n,r,t){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function u(y){try{a(t.next(y))}catch(c){l(c)}}function s(y){try{a(t.throw(y))}catch(c){l(c)}}function a(y){y.done?o(y.value):i(y.value).then(u,s)}a((t=t.apply(e,n||[])).next())})};Object.defineProperty(at,"__esModule",{value:!0});at.HttpClient=at.isHttps=at.HttpClientResponse=at.HttpClientError=at.getProxyUrl=at.MediaTypes=at.Headers=at.HttpCodes=void 0;var Co=Ao(require("http")),hu=Ao(require("https")),Ph=Ao(Ch()),To=Ao(kh()),Lr;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(Lr=at.HttpCodes||(at.HttpCodes={}));var or;(function(e){e.Accept="accept",e.ContentType="content-type"})(or=at.Headers||(at.Headers={}));var En;(function(e){e.ApplicationJson="application/json"})(En=at.MediaTypes||(at.MediaTypes={}));function cm(e){let n=Ph.getProxyUrl(new URL(e));return n?n.href:""}at.getProxyUrl=cm;var hm=[Lr.MovedPermanently,Lr.ResourceMoved,Lr.SeeOther,Lr.TemporaryRedirect,Lr.PermanentRedirect],fm=[Lr.BadGateway,Lr.ServiceUnavailable,Lr.GatewayTimeout],dm=["OPTIONS","GET","DELETE","HEAD"],pm=10,ym=5,Ri=class extends Error{constructor(n,r){super(n),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,Ri.prototype)}};at.HttpClientError=Ri;var Ro=class{constructor(n){this.message=n}readBody(){return Kt(this,void 0,void 0,function*(){return new Promise(n=>Kt(this,void 0,void 0,function*(){let r=Buffer.alloc(0);this.message.on("data",t=>{r=Buffer.concat([r,t])}),this.message.on("end",()=>{n(r.toString())})}))})}};at.HttpClientResponse=Ro;function gm(e){return new URL(e).protocol==="https:"}at.isHttps=gm;var fu=class{constructor(n,r,t){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=n,this.handlers=r||[],this.requestOptions=t,t&&(t.ignoreSslError!=null&&(this._ignoreSslError=t.ignoreSslError),this._socketTimeout=t.socketTimeout,t.allowRedirects!=null&&(this._allowRedirects=t.allowRedirects),t.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=t.allowRedirectDowngrade),t.maxRedirects!=null&&(this._maxRedirects=Math.max(t.maxRedirects,0)),t.keepAlive!=null&&(this._keepAlive=t.keepAlive),t.allowRetries!=null&&(this._allowRetries=t.allowRetries),t.maxRetries!=null&&(this._maxRetries=t.maxRetries))}options(n,r){return Kt(this,void 0,void 0,function*(){return this.request("OPTIONS",n,null,r||{})})}get(n,r){return Kt(this,void 0,void 0,function*(){return this.request("GET",n,null,r||{})})}del(n,r){return Kt(this,void 0,void 0,function*(){return this.request("DELETE",n,null,r||{})})}post(n,r,t){return Kt(this,void 0,void 0,function*(){return this.request("POST",n,r,t||{})})}patch(n,r,t){return Kt(this,void 0,void 0,function*(){return this.request("PATCH",n,r,t||{})})}put(n,r,t){return Kt(this,void 0,void 0,function*(){return this.request("PUT",n,r,t||{})})}head(n,r){return Kt(this,void 0,void 0,function*(){return this.request("HEAD",n,null,r||{})})}sendStream(n,r,t,i){return Kt(this,void 0,void 0,function*(){return this.request(n,r,t,i)})}getJson(n,r={}){return Kt(this,void 0,void 0,function*(){r[or.Accept]=this._getExistingOrDefaultHeader(r,or.Accept,En.ApplicationJson);let t=yield this.get(n,r);return this._processResponse(t,this.requestOptions)})}postJson(n,r,t={}){return Kt(this,void 0,void 0,function*(){let i=JSON.stringify(r,null,2);t[or.Accept]=this._getExistingOrDefaultHeader(t,or.Accept,En.ApplicationJson),t[or.ContentType]=this._getExistingOrDefaultHeader(t,or.ContentType,En.ApplicationJson);let o=yield this.post(n,i,t);return this._processResponse(o,this.requestOptions)})}putJson(n,r,t={}){return Kt(this,void 0,void 0,function*(){let i=JSON.stringify(r,null,2);t[or.Accept]=this._getExistingOrDefaultHeader(t,or.Accept,En.ApplicationJson),t[or.ContentType]=this._getExistingOrDefaultHeader(t,or.ContentType,En.ApplicationJson);let o=yield this.put(n,i,t);return this._processResponse(o,this.requestOptions)})}patchJson(n,r,t={}){return Kt(this,void 0,void 0,function*(){let i=JSON.stringify(r,null,2);t[or.Accept]=this._getExistingOrDefaultHeader(t,or.Accept,En.ApplicationJson),t[or.ContentType]=this._getExistingOrDefaultHeader(t,or.ContentType,En.ApplicationJson);let o=yield this.patch(n,i,t);return this._processResponse(o,this.requestOptions)})}request(n,r,t,i){return Kt(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let o=new URL(r),l=this._prepareRequest(n,o,i),u=this._allowRetries&&dm.includes(n)?this._maxRetries+1:1,s=0,a;do{if(a=yield this.requestRaw(l,t),a&&a.message&&a.message.statusCode===Lr.Unauthorized){let c;for(let g of this.handlers)if(g.canHandleAuthentication(a)){c=g;break}return c?c.handleAuthentication(this,l,t):a}let y=this._maxRedirects;for(;a.message.statusCode&&hm.includes(a.message.statusCode)&&this._allowRedirects&&y>0;){let c=a.message.headers.location;if(!c)break;let g=new URL(c);if(o.protocol==="https:"&&o.protocol!==g.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 a.readBody(),g.hostname!==o.hostname)for(let I in i)I.toLowerCase()==="authorization"&&delete i[I];l=this._prepareRequest(n,g,i),a=yield this.requestRaw(l,t),y--}if(!a.message.statusCode||!fm.includes(a.message.statusCode))return a;s+=1,s{function o(l,u){l?i(l):u?t(u):i(new Error("Unknown error"))}this.requestRawWithCallback(n,r,o)})})}requestRawWithCallback(n,r,t){typeof r=="string"&&(n.options.headers||(n.options.headers={}),n.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let i=!1;function o(s,a){i||(i=!0,t(s,a))}let l=n.httpModule.request(n.options,s=>{let a=new Ro(s);o(void 0,a)}),u;l.on("socket",s=>{u=s}),l.setTimeout(this._socketTimeout||3*6e4,()=>{u&&u.end(),o(new Error(`Request timeout: ${n.options.path}`))}),l.on("error",function(s){o(s)}),r&&typeof r=="string"&&l.write(r,"utf8"),r&&typeof r!="string"?(r.on("close",function(){l.end()}),r.pipe(l)):l.end()}getAgent(n){let r=new URL(n);return this._getAgent(r)}_prepareRequest(n,r,t){let i={};i.parsedUrl=r;let o=i.parsedUrl.protocol==="https:";i.httpModule=o?hu:Co;let l=o?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):l,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=n,i.options.headers=this._mergeHeaders(t),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let u of this.handlers)u.prepareRequest(i.options);return i}_mergeHeaders(n){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Io(this.requestOptions.headers),Io(n||{})):Io(n||{})}_getExistingOrDefaultHeader(n,r,t){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Io(this.requestOptions.headers)[r]),n[r]||i||t}_getAgent(n){let r,t=Ph.getProxyUrl(n),i=t&&t.hostname;if(this._keepAlive&&i&&(r=this._proxyAgent),this._keepAlive&&!i&&(r=this._agent),r)return r;let o=n.protocol==="https:",l=100;if(this.requestOptions&&(l=this.requestOptions.maxSockets||Co.globalAgent.maxSockets),t&&t.hostname){let u={maxSockets:l,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(t.username||t.password)&&{proxyAuth:`${t.username}:${t.password}`}),{host:t.hostname,port:t.port})},s,a=t.protocol==="https:";o?s=a?To.httpsOverHttps:To.httpsOverHttp:s=a?To.httpOverHttps:To.httpOverHttp,r=s(u),this._proxyAgent=r}if(this._keepAlive&&!r){let u={keepAlive:this._keepAlive,maxSockets:l};r=o?new hu.Agent(u):new Co.Agent(u),this._agent=r}return r||(r=o?hu.globalAgent:Co.globalAgent),o&&this._ignoreSslError&&(r.options=Object.assign(r.options||{},{rejectUnauthorized:!1})),r}_performExponentialBackoff(n){return Kt(this,void 0,void 0,function*(){n=Math.min(pm,n);let r=ym*Math.pow(2,n);return new Promise(t=>setTimeout(()=>t(),r))})}_processResponse(n,r){return Kt(this,void 0,void 0,function*(){return new Promise((t,i)=>Kt(this,void 0,void 0,function*(){let o=n.message.statusCode||0,l={statusCode:o,result:null,headers:{}};o===Lr.NotFound&&t(l);function u(y,c){if(typeof c=="string"){let g=new Date(c);if(!isNaN(g.valueOf()))return g}return c}let s,a;try{a=yield n.readBody(),a&&a.length>0&&(r&&r.deserializeDates?s=JSON.parse(a,u):s=JSON.parse(a),l.result=s),l.headers=n.message.headers}catch{}if(o>299){let y;s&&s.message?y=s.message:a&&a.length>0?y=a:y=`Failed request: (${o})`;let c=new Ri(y,o);c.result=l.result,i(c)}else t(l)}))})}};at.HttpClient=fu;var Io=e=>Object.keys(e).reduce((n,r)=>(n[r.toLowerCase()]=e[r],n),{})});var Oh=lt(zr=>{"use strict";var gu=zr&&zr.__awaiter||function(e,n,r,t){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function u(y){try{a(t.next(y))}catch(c){l(c)}}function s(y){try{a(t.throw(y))}catch(c){l(c)}}function a(y){y.done?o(y.value):i(y.value).then(u,s)}a((t=t.apply(e,n||[])).next())})};Object.defineProperty(zr,"__esModule",{value:!0});zr.PersonalAccessTokenCredentialHandler=zr.BearerCredentialHandler=zr.BasicCredentialHandler=void 0;var du=class{constructor(n,r){this.username=n,this.password=r}prepareRequest(n){if(!n.headers)throw Error("The request has no headers");n.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return gu(this,void 0,void 0,function*(){throw new Error("not implemented")})}};zr.BasicCredentialHandler=du;var pu=class{constructor(n){this.token=n}prepareRequest(n){if(!n.headers)throw Error("The request has no headers");n.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return gu(this,void 0,void 0,function*(){throw new Error("not implemented")})}};zr.BearerCredentialHandler=pu;var yu=class{constructor(n){this.token=n}prepareRequest(n){if(!n.headers)throw Error("The request has no headers");n.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return gu(this,void 0,void 0,function*(){throw new Error("not implemented")})}};zr.PersonalAccessTokenCredentialHandler=yu});var Dh=lt(Ai=>{"use strict";var Lh=Ai&&Ai.__awaiter||function(e,n,r,t){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function u(y){try{a(t.next(y))}catch(c){l(c)}}function s(y){try{a(t.throw(y))}catch(c){l(c)}}function a(y){y.done?o(y.value):i(y.value).then(u,s)}a((t=t.apply(e,n||[])).next())})};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.OidcClient=void 0;var mm=Nh(),vm=Oh(),Uh=mu(),Cn=class{static createHttpClient(n=!0,r=10){let t={allowRetries:n,maxRetries:r};return new mm.HttpClient("actions/oidc-client",[new vm.BearerCredentialHandler(Cn.getRequestToken())],t)}static getRequestToken(){let n=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!n)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return n}static getIDTokenUrl(){let n=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!n)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return n}static getCall(n){var r;return Lh(this,void 0,void 0,function*(){let o=(r=(yield Cn.createHttpClient().getJson(n).catch(l=>{throw new Error(`Failed to get ID Token. +"use strict";var Rc=Object.create;var as=Object.defineProperty;var Pc=Object.getOwnPropertyDescriptor;var xc=Object.getOwnPropertyNames;var kc=Object.getPrototypeOf,Ac=Object.prototype.hasOwnProperty;var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xc(t))!Ac.call(e,o)&&o!==r&&as(e,o,{get:()=>t[o],enumerable:!(n=Pc(t,o))||n.enumerable});return e};var ls=(e,t,r)=>(r=e!=null?Rc(kc(e)):{},qc(t||!e||!e.__esModule?as(r,"default",{value:e,enumerable:!0}):r,e));var us=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(u){o(u)}},s=l=>{try{a(r.throw(l))}catch(u){o(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())});var Qr=ce(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.toCommandProperties=Kt.toCommandValue=void 0;function Cc(e){return e==null?"":typeof e=="string"||e instanceof String?e:JSON.stringify(e)}Kt.toCommandValue=Cc;function jc(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}Kt.toCommandProperties=jc});var fs=ce(Be=>{"use strict";var Ic=Be&&Be.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),$c=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Mc=Be&&Be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Ic(t,e,r);return $c(t,e),t};Object.defineProperty(Be,"__esModule",{value:!0});Be.issue=Be.issueCommand=void 0;var Lc=Mc(require("os")),hs=Qr();function ds(e,t,r){let n=new bo(e,t,r);process.stdout.write(n.toString()+Lc.EOL)}Be.issueCommand=ds;function Nc(e,t=""){ds(e,{},t)}Be.issue=Nc;var cs="::",bo=class{constructor(t,r,n){t||(t="missing.command"),this.command=t,this.properties=r,this.message=n}toString(){let t=cs+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let r=!0;for(let n in this.properties)if(this.properties.hasOwnProperty(n)){let o=this.properties[n];o&&(r?r=!1:t+=",",t+=`${n}=${Uc(o)}`)}}return t+=`${cs}${Bc(this.message)}`,t}};function Bc(e){return hs.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function Uc(e){return hs.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});var _o=ce(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.default=Hc;var zc=Dc(require("crypto"));function Dc(e){return e&&e.__esModule?e:{default:e}}var Xr=new Uint8Array(256),Yr=Xr.length;function Hc(){return Yr>Xr.length-16&&(zc.default.randomFillSync(Xr),Yr=0),Xr.slice(Yr,Yr+=16)}});var ps=ce(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.default=void 0;var Fc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Zr.default=Fc});var gr=ce(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.default=void 0;var Wc=Vc(ps());function Vc(e){return e&&e.__esModule?e:{default:e}}function Gc(e){return typeof e=="string"&&Wc.default.test(e)}var Jc=Gc;en.default=Jc});var br=ce(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.default=void 0;var Kc=Qc(gr());function Qc(e){return e&&e.__esModule?e:{default:e}}var _e=[];for(let e=0;e<256;++e)_e.push((e+256).toString(16).substr(1));function Yc(e,t=0){let r=(_e[e[t+0]]+_e[e[t+1]]+_e[e[t+2]]+_e[e[t+3]]+"-"+_e[e[t+4]]+_e[e[t+5]]+"-"+_e[e[t+6]]+_e[e[t+7]]+"-"+_e[e[t+8]]+_e[e[t+9]]+"-"+_e[e[t+10]]+_e[e[t+11]]+_e[e[t+12]]+_e[e[t+13]]+_e[e[t+14]]+_e[e[t+15]]).toLowerCase();if(!(0,Kc.default)(r))throw TypeError("Stringified UUID is invalid");return r}var Xc=Yc;tn.default=Xc});var gs=ce(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.default=void 0;var Zc=ys(_o()),eh=ys(br());function ys(e){return e&&e.__esModule?e:{default:e}}var ms,wo,So=0,Eo=0;function th(e,t,r){let n=t&&r||0,o=t||new Array(16);e=e||{};let i=e.node||ms,s=e.clockseq!==void 0?e.clockseq:wo;if(i==null||s==null){let c=e.random||(e.rng||Zc.default)();i==null&&(i=ms=[c[0]|1,c[1],c[2],c[3],c[4],c[5]]),s==null&&(s=wo=(c[6]<<8|c[7])&16383)}let a=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:Eo+1,u=a-So+(l-Eo)/1e4;if(u<0&&e.clockseq===void 0&&(s=s+1&16383),(u<0||a>So)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");So=a,Eo=l,wo=s,a+=122192928e5;let d=((a&268435455)*1e4+l)%4294967296;o[n++]=d>>>24&255,o[n++]=d>>>16&255,o[n++]=d>>>8&255,o[n++]=d&255;let h=a/4294967296*1e4&268435455;o[n++]=h>>>8&255,o[n++]=h&255,o[n++]=h>>>24&15|16,o[n++]=h>>>16&255,o[n++]=s>>>8|128,o[n++]=s&255;for(let c=0;c<6;++c)o[n+c]=i[c];return t||(0,eh.default)(o)}var rh=th;rn.default=rh});var To=ce(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.default=void 0;var nh=oh(gr());function oh(e){return e&&e.__esModule?e:{default:e}}function ih(e){if(!(0,nh.default)(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var sh=ih;nn.default=sh});var Oo=ce(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.default=ch;Tt.URL=Tt.DNS=void 0;var ah=bs(br()),lh=bs(To());function bs(e){return e&&e.__esModule?e:{default:e}}function uh(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=void 0;var hh=dh(require("crypto"));function dh(e){return e&&e.__esModule?e:{default:e}}function fh(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),hh.default.createHash("md5").update(e).digest()}var ph=fh;on.default=ph});var Es=ce(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.default=void 0;var mh=Ss(Oo()),yh=Ss(ws());function Ss(e){return e&&e.__esModule?e:{default:e}}var gh=(0,mh.default)("v3",48,yh.default),bh=gh;sn.default=bh});var Os=ce(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.default=void 0;var vh=Ts(_o()),_h=Ts(br());function Ts(e){return e&&e.__esModule?e:{default:e}}function wh(e,t,r){e=e||{};let n=e.random||(e.rng||vh.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return(0,_h.default)(n)}var Sh=wh;an.default=Sh});var Rs=ce(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.default=void 0;var Eh=Th(require("crypto"));function Th(e){return e&&e.__esModule?e:{default:e}}function Oh(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Eh.default.createHash("sha1").update(e).digest()}var Rh=Oh;ln.default=Rh});var xs=ce(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.default=void 0;var Ph=Ps(Oo()),xh=Ps(Rs());function Ps(e){return e&&e.__esModule?e:{default:e}}var kh=(0,Ph.default)("v5",80,xh.default),Ah=kh;un.default=Ah});var ks=ce(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.default=void 0;var qh="00000000-0000-0000-0000-000000000000";cn.default=qh});var As=ce(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.default=void 0;var Ch=jh(gr());function jh(e){return e&&e.__esModule?e:{default:e}}function Ih(e){if(!(0,Ch.default)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var $h=Ih;hn.default=$h});var qs=ce(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});Object.defineProperty(We,"v1",{enumerable:!0,get:function(){return Mh.default}});Object.defineProperty(We,"v3",{enumerable:!0,get:function(){return Lh.default}});Object.defineProperty(We,"v4",{enumerable:!0,get:function(){return Nh.default}});Object.defineProperty(We,"v5",{enumerable:!0,get:function(){return Bh.default}});Object.defineProperty(We,"NIL",{enumerable:!0,get:function(){return Uh.default}});Object.defineProperty(We,"version",{enumerable:!0,get:function(){return zh.default}});Object.defineProperty(We,"validate",{enumerable:!0,get:function(){return Dh.default}});Object.defineProperty(We,"stringify",{enumerable:!0,get:function(){return Hh.default}});Object.defineProperty(We,"parse",{enumerable:!0,get:function(){return Fh.default}});var Mh=lt(gs()),Lh=lt(Es()),Nh=lt(Os()),Bh=lt(xs()),Uh=lt(ks()),zh=lt(As()),Dh=lt(gr()),Hh=lt(br()),Fh=lt(To());function lt(e){return e&&e.__esModule?e:{default:e}}});var $s=ce(Ue=>{"use strict";var Wh=Ue&&Ue.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Vh=Ue&&Ue.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),js=Ue&&Ue.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Wh(t,e,r);return Vh(t,e),t};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.prepareKeyValueMessage=Ue.issueFileCommand=void 0;var Cs=js(require("fs")),Ro=js(require("os")),Gh=qs(),Is=Qr();function Jh(e,t){let r=process.env[`GITHUB_${e}`];if(!r)throw new Error(`Unable to find environment variable for file command ${e}`);if(!Cs.existsSync(r))throw new Error(`Missing file at path: ${r}`);Cs.appendFileSync(r,`${Is.toCommandValue(t)}${Ro.EOL}`,{encoding:"utf8"})}Ue.issueFileCommand=Jh;function Kh(e,t){let r=`ghadelimiter_${Gh.v4()}`,n=Is.toCommandValue(t);if(e.includes(r))throw new Error(`Unexpected input: name should not contain the delimiter "${r}"`);if(n.includes(r))throw new Error(`Unexpected input: value should not contain the delimiter "${r}"`);return`${e}<<${r}${Ro.EOL}${n}${Ro.EOL}${r}`}Ue.prepareKeyValueMessage=Kh});var Ls=ce(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.checkBypass=Qt.getProxyUrl=void 0;function Qh(e){let t=e.protocol==="https:";if(Ms(e))return;let r=(()=>t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(r)return new URL(r)}Qt.getProxyUrl=Qh;function Ms(e){if(!e.hostname)return!1;let t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let r;e.port?r=Number(e.port):e.protocol==="http:"?r=80:e.protocol==="https:"&&(r=443);let n=[e.hostname.toUpperCase()];typeof r=="number"&&n.push(`${n[0]}:${r}`);for(let o of t.split(",").map(i=>i.trim().toUpperCase()).filter(i=>i))if(n.some(i=>i===o))return!0;return!1}Qt.checkBypass=Ms});var zs=ce(Yt=>{"use strict";var _g=require("net"),Yh=require("tls"),Po=require("http"),Ns=require("https"),Xh=require("events"),wg=require("assert"),Zh=require("util");Yt.httpOverHttp=ed;Yt.httpsOverHttp=td;Yt.httpOverHttps=rd;Yt.httpsOverHttps=nd;function ed(e){var t=new ut(e);return t.request=Po.request,t}function td(e){var t=new ut(e);return t.request=Po.request,t.createSocket=Bs,t.defaultPort=443,t}function rd(e){var t=new ut(e);return t.request=Ns.request,t}function nd(e){var t=new ut(e);return t.request=Ns.request,t.createSocket=Bs,t.defaultPort=443,t}function ut(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||Po.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",function(n,o,i,s){for(var a=Us(o,i,s),l=0,u=t.requests.length;l=this.maxSockets){i.requests.push(s);return}i.createSocket(s,function(a){a.on("free",l),a.on("close",u),a.on("agentRemove",u),t.onSocket(a);function l(){i.emit("free",a,s)}function u(d){i.removeSocket(a),a.removeListener("free",l),a.removeListener("close",u),a.removeListener("agentRemove",u)}})};ut.prototype.createSocket=function(t,r){var n=this,o={};n.sockets.push(o);var i=xo({},n.proxyOptions,{method:"CONNECT",path:t.host+":"+t.port,agent:!1,headers:{host:t.host+":"+t.port}});t.localAddress&&(i.localAddress=t.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),yt("making CONNECT request");var s=n.request(i);s.useChunkedEncodingByDefault=!1,s.once("response",a),s.once("upgrade",l),s.once("connect",u),s.once("error",d),s.end();function a(h){h.upgrade=!0}function l(h,c,p){process.nextTick(function(){u(h,c,p)})}function u(h,c,p){if(s.removeAllListeners(),c.removeAllListeners(),h.statusCode!==200){yt("tunneling socket could not be established, statusCode=%d",h.statusCode),c.destroy();var m=new Error("tunneling socket could not be established, statusCode="+h.statusCode);m.code="ECONNRESET",t.request.emit("error",m),n.removeSocket(o);return}if(p.length>0){yt("got illegal response body from proxy"),c.destroy();var m=new Error("got illegal response body from proxy");m.code="ECONNRESET",t.request.emit("error",m),n.removeSocket(o);return}return yt("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=c,r(c)}function d(h){s.removeAllListeners(),yt(`tunneling socket could not be established, cause=%s +`,h.message,h.stack);var c=new Error("tunneling socket could not be established, cause="+h.message);c.code="ECONNRESET",t.request.emit("error",c),n.removeSocket(o)}};ut.prototype.removeSocket=function(t){var r=this.sockets.indexOf(t);if(r!==-1){this.sockets.splice(r,1);var n=this.requests.shift();n&&this.createSocket(n,function(o){n.request.onSocket(o)})}};function Bs(e,t){var r=this;ut.prototype.createSocket.call(r,e,function(n){var o=e.request.getHeader("host"),i=xo({},r.options,{socket:n,servername:o?o.replace(/:.*$/,""):e.host}),s=Yh.connect(0,i);r.sockets[r.sockets.indexOf(n)]=s,t(s)})}function Us(e,t,r){return typeof e=="string"?{host:e,port:t,localAddress:r}:e}function xo(e){for(var t=1,r=arguments.length;t{Ds.exports=zs()});var Ws=ce(ue=>{"use strict";var od=ue&&ue.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),id=ue&&ue.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yn=ue&&ue.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&od(t,e,r);return id(t,e),t},ye=ue&&ue.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(ue,"__esModule",{value:!0});ue.HttpClient=ue.isHttps=ue.HttpClientResponse=ue.HttpClientError=ue.getProxyUrl=ue.MediaTypes=ue.Headers=ue.HttpCodes=void 0;var dn=yn(require("http")),ko=yn(require("https")),Fs=yn(Ls()),fn=yn(Hs()),Ve;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(Ve=ue.HttpCodes||(ue.HttpCodes={}));var Oe;(function(e){e.Accept="accept",e.ContentType="content-type"})(Oe=ue.Headers||(ue.Headers={}));var gt;(function(e){e.ApplicationJson="application/json"})(gt=ue.MediaTypes||(ue.MediaTypes={}));function sd(e){let t=Fs.getProxyUrl(new URL(e));return t?t.href:""}ue.getProxyUrl=sd;var ad=[Ve.MovedPermanently,Ve.ResourceMoved,Ve.SeeOther,Ve.TemporaryRedirect,Ve.PermanentRedirect],ld=[Ve.BadGateway,Ve.ServiceUnavailable,Ve.GatewayTimeout],ud=["OPTIONS","GET","DELETE","HEAD"],cd=10,hd=5,Xt=class extends Error{constructor(t,r){super(t),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,Xt.prototype)}};ue.HttpClientError=Xt;var mn=class{constructor(t){this.message=t}readBody(){return ye(this,void 0,void 0,function*(){return new Promise(t=>ye(this,void 0,void 0,function*(){let r=Buffer.alloc(0);this.message.on("data",n=>{r=Buffer.concat([r,n])}),this.message.on("end",()=>{t(r.toString())})}))})}};ue.HttpClientResponse=mn;function dd(e){return new URL(e).protocol==="https:"}ue.isHttps=dd;var Ao=class{constructor(t,r,n){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=t,this.handlers=r||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}options(t,r){return ye(this,void 0,void 0,function*(){return this.request("OPTIONS",t,null,r||{})})}get(t,r){return ye(this,void 0,void 0,function*(){return this.request("GET",t,null,r||{})})}del(t,r){return ye(this,void 0,void 0,function*(){return this.request("DELETE",t,null,r||{})})}post(t,r,n){return ye(this,void 0,void 0,function*(){return this.request("POST",t,r,n||{})})}patch(t,r,n){return ye(this,void 0,void 0,function*(){return this.request("PATCH",t,r,n||{})})}put(t,r,n){return ye(this,void 0,void 0,function*(){return this.request("PUT",t,r,n||{})})}head(t,r){return ye(this,void 0,void 0,function*(){return this.request("HEAD",t,null,r||{})})}sendStream(t,r,n,o){return ye(this,void 0,void 0,function*(){return this.request(t,r,n,o)})}getJson(t,r={}){return ye(this,void 0,void 0,function*(){r[Oe.Accept]=this._getExistingOrDefaultHeader(r,Oe.Accept,gt.ApplicationJson);let n=yield this.get(t,r);return this._processResponse(n,this.requestOptions)})}postJson(t,r,n={}){return ye(this,void 0,void 0,function*(){let o=JSON.stringify(r,null,2);n[Oe.Accept]=this._getExistingOrDefaultHeader(n,Oe.Accept,gt.ApplicationJson),n[Oe.ContentType]=this._getExistingOrDefaultHeader(n,Oe.ContentType,gt.ApplicationJson);let i=yield this.post(t,o,n);return this._processResponse(i,this.requestOptions)})}putJson(t,r,n={}){return ye(this,void 0,void 0,function*(){let o=JSON.stringify(r,null,2);n[Oe.Accept]=this._getExistingOrDefaultHeader(n,Oe.Accept,gt.ApplicationJson),n[Oe.ContentType]=this._getExistingOrDefaultHeader(n,Oe.ContentType,gt.ApplicationJson);let i=yield this.put(t,o,n);return this._processResponse(i,this.requestOptions)})}patchJson(t,r,n={}){return ye(this,void 0,void 0,function*(){let o=JSON.stringify(r,null,2);n[Oe.Accept]=this._getExistingOrDefaultHeader(n,Oe.Accept,gt.ApplicationJson),n[Oe.ContentType]=this._getExistingOrDefaultHeader(n,Oe.ContentType,gt.ApplicationJson);let i=yield this.patch(t,o,n);return this._processResponse(i,this.requestOptions)})}request(t,r,n,o){return ye(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let i=new URL(r),s=this._prepareRequest(t,i,o),a=this._allowRetries&&ud.includes(t)?this._maxRetries+1:1,l=0,u;do{if(u=yield this.requestRaw(s,n),u&&u.message&&u.message.statusCode===Ve.Unauthorized){let h;for(let c of this.handlers)if(c.canHandleAuthentication(u)){h=c;break}return h?h.handleAuthentication(this,s,n):u}let d=this._maxRedirects;for(;u.message.statusCode&&ad.includes(u.message.statusCode)&&this._allowRedirects&&d>0;){let h=u.message.headers.location;if(!h)break;let c=new URL(h);if(i.protocol==="https:"&&i.protocol!==c.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 u.readBody(),c.hostname!==i.hostname)for(let p in o)p.toLowerCase()==="authorization"&&delete o[p];s=this._prepareRequest(t,c,o),u=yield this.requestRaw(s,n),d--}if(!u.message.statusCode||!ld.includes(u.message.statusCode))return u;l+=1,l{function i(s,a){s?o(s):a?n(a):o(new Error("Unknown error"))}this.requestRawWithCallback(t,r,i)})})}requestRawWithCallback(t,r,n){typeof r=="string"&&(t.options.headers||(t.options.headers={}),t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let o=!1;function i(l,u){o||(o=!0,n(l,u))}let s=t.httpModule.request(t.options,l=>{let u=new mn(l);i(void 0,u)}),a;s.on("socket",l=>{a=l}),s.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),i(new Error(`Request timeout: ${t.options.path}`))}),s.on("error",function(l){i(l)}),r&&typeof r=="string"&&s.write(r,"utf8"),r&&typeof r!="string"?(r.on("close",function(){s.end()}),r.pipe(s)):s.end()}getAgent(t){let r=new URL(t);return this._getAgent(r)}_prepareRequest(t,r,n){let o={};o.parsedUrl=r;let i=o.parsedUrl.protocol==="https:";o.httpModule=i?ko:dn;let s=i?443:80;if(o.options={},o.options.host=o.parsedUrl.hostname,o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):s,o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||""),o.options.method=t,o.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(o.options.headers["user-agent"]=this.userAgent),o.options.agent=this._getAgent(o.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(o.options);return o}_mergeHeaders(t){return this.requestOptions&&this.requestOptions.headers?Object.assign({},pn(this.requestOptions.headers),pn(t||{})):pn(t||{})}_getExistingOrDefaultHeader(t,r,n){let o;return this.requestOptions&&this.requestOptions.headers&&(o=pn(this.requestOptions.headers)[r]),t[r]||o||n}_getAgent(t){let r,n=Fs.getProxyUrl(t),o=n&&n.hostname;if(this._keepAlive&&o&&(r=this._proxyAgent),this._keepAlive&&!o&&(r=this._agent),r)return r;let i=t.protocol==="https:",s=100;if(this.requestOptions&&(s=this.requestOptions.maxSockets||dn.globalAgent.maxSockets),n&&n.hostname){let a={maxSockets:s,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},l,u=n.protocol==="https:";i?l=u?fn.httpsOverHttps:fn.httpsOverHttp:l=u?fn.httpOverHttps:fn.httpOverHttp,r=l(a),this._proxyAgent=r}if(this._keepAlive&&!r){let a={keepAlive:this._keepAlive,maxSockets:s};r=i?new ko.Agent(a):new dn.Agent(a),this._agent=r}return r||(r=i?ko.globalAgent:dn.globalAgent),i&&this._ignoreSslError&&(r.options=Object.assign(r.options||{},{rejectUnauthorized:!1})),r}_performExponentialBackoff(t){return ye(this,void 0,void 0,function*(){t=Math.min(cd,t);let r=hd*Math.pow(2,t);return new Promise(n=>setTimeout(()=>n(),r))})}_processResponse(t,r){return ye(this,void 0,void 0,function*(){return new Promise((n,o)=>ye(this,void 0,void 0,function*(){let i=t.message.statusCode||0,s={statusCode:i,result:null,headers:{}};i===Ve.NotFound&&n(s);function a(d,h){if(typeof h=="string"){let c=new Date(h);if(!isNaN(c.valueOf()))return c}return h}let l,u;try{u=yield t.readBody(),u&&u.length>0&&(r&&r.deserializeDates?l=JSON.parse(u,a):l=JSON.parse(u),s.result=l),s.headers=t.message.headers}catch{}if(i>299){let d;l&&l.message?d=l.message:u&&u.length>0?d=u:d=`Failed request: (${i})`;let h=new Xt(d,i);h.result=s.result,o(h)}else n(s)}))})}};ue.HttpClient=Ao;var pn=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{})});var Vs=ce(rt=>{"use strict";var Io=rt&&rt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(rt,"__esModule",{value:!0});rt.PersonalAccessTokenCredentialHandler=rt.BearerCredentialHandler=rt.BasicCredentialHandler=void 0;var qo=class{constructor(t,r){this.username=t,this.password=r}prepareRequest(t){if(!t.headers)throw Error("The request has no headers");t.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return Io(this,void 0,void 0,function*(){throw new Error("not implemented")})}};rt.BasicCredentialHandler=qo;var Co=class{constructor(t){this.token=t}prepareRequest(t){if(!t.headers)throw Error("The request has no headers");t.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return Io(this,void 0,void 0,function*(){throw new Error("not implemented")})}};rt.BearerCredentialHandler=Co;var jo=class{constructor(t){this.token=t}prepareRequest(t){if(!t.headers)throw Error("The request has no headers");t.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return Io(this,void 0,void 0,function*(){throw new Error("not implemented")})}};rt.PersonalAccessTokenCredentialHandler=jo});var Ks=ce(Zt=>{"use strict";var Gs=Zt&&Zt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.OidcClient=void 0;var fd=Ws(),pd=Vs(),Js=$o(),bt=class{static createHttpClient(t=!0,r=10){let n={allowRetries:t,maxRetries:r};return new fd.HttpClient("actions/oidc-client",[new pd.BearerCredentialHandler(bt.getRequestToken())],n)}static getRequestToken(){let t=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!t)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return t}static getIDTokenUrl(){let t=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!t)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return t}static getCall(t){var r;return Gs(this,void 0,void 0,function*(){let i=(r=(yield bt.createHttpClient().getJson(t).catch(s=>{throw new Error(`Failed to get ID Token. - Error Code : ${l.statusCode} + Error Code : ${s.statusCode} - Error Message: ${l.result.message}`)})).result)===null||r===void 0?void 0:r.value;if(!o)throw new Error("Response json body do not have ID Token field");return o})}static getIDToken(n){return Lh(this,void 0,void 0,function*(){try{let r=Cn.getIDTokenUrl();if(n){let i=encodeURIComponent(n);r=`${r}&audience=${i}`}Uh.debug(`ID token url is ${r}`);let t=yield Cn.getCall(r);return Uh.setSecret(t),t}catch(r){throw new Error(`Error message: ${r.message}`)}})}};Ai.OidcClient=Cn});var wu=lt(yr=>{"use strict";var vu=yr&&yr.__awaiter||function(e,n,r,t){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function u(y){try{a(t.next(y))}catch(c){l(c)}}function s(y){try{a(t.throw(y))}catch(c){l(c)}}function a(y){y.done?o(y.value):i(y.value).then(u,s)}a((t=t.apply(e,n||[])).next())})};Object.defineProperty(yr,"__esModule",{value:!0});yr.summary=yr.markdownSummary=yr.SUMMARY_DOCS_URL=yr.SUMMARY_ENV_VAR=void 0;var bm=require("os"),bu=require("fs"),{access:_m,appendFile:wm,writeFile:Sm}=bu.promises;yr.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";yr.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var _u=class{constructor(){this._buffer=""}filePath(){return vu(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let n=process.env[yr.SUMMARY_ENV_VAR];if(!n)throw new Error(`Unable to find environment variable for $${yr.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield _m(n,bu.constants.R_OK|bu.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${n}'. Check if the file has correct read/write permissions.`)}return this._filePath=n,this._filePath})}wrap(n,r,t={}){let i=Object.entries(t).map(([o,l])=>` ${o}="${l}"`).join("");return r?`<${n}${i}>${r}`:`<${n}${i}>`}write(n){return vu(this,void 0,void 0,function*(){let r=!!n?.overwrite,t=yield this.filePath();return yield(r?Sm:wm)(t,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return vu(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(n,r=!1){return this._buffer+=n,r?this.addEOL():this}addEOL(){return this.addRaw(bm.EOL)}addCodeBlock(n,r){let t=Object.assign({},r&&{lang:r}),i=this.wrap("pre",this.wrap("code",n),t);return this.addRaw(i).addEOL()}addList(n,r=!1){let t=r?"ol":"ul",i=n.map(l=>this.wrap("li",l)).join(""),o=this.wrap(t,i);return this.addRaw(o).addEOL()}addTable(n){let r=n.map(i=>{let o=i.map(l=>{if(typeof l=="string")return this.wrap("td",l);let{header:u,data:s,colspan:a,rowspan:y}=l,c=u?"th":"td",g=Object.assign(Object.assign({},a&&{colspan:a}),y&&{rowspan:y});return this.wrap(c,s,g)}).join("");return this.wrap("tr",o)}).join(""),t=this.wrap("table",r);return this.addRaw(t).addEOL()}addDetails(n,r){let t=this.wrap("details",this.wrap("summary",n)+r);return this.addRaw(t).addEOL()}addImage(n,r,t){let{width:i,height:o}=t||{},l=Object.assign(Object.assign({},i&&{width:i}),o&&{height:o}),u=this.wrap("img",null,Object.assign({src:n,alt:r},l));return this.addRaw(u).addEOL()}addHeading(n,r){let t=`h${r}`,i=["h1","h2","h3","h4","h5","h6"].includes(t)?t:"h1",o=this.wrap(i,n);return this.addRaw(o).addEOL()}addSeparator(){let n=this.wrap("hr",null);return this.addRaw(n).addEOL()}addBreak(){let n=this.wrap("br",null);return this.addRaw(n).addEOL()}addQuote(n,r){let t=Object.assign({},r&&{cite:r}),i=this.wrap("blockquote",n,t);return this.addRaw(i).addEOL()}addLink(n,r){let t=this.wrap("a",n,{href:r});return this.addRaw(t).addEOL()}},xh=new _u;yr.markdownSummary=xh;yr.summary=xh});var qh=lt(gr=>{"use strict";var Em=gr&&gr.__createBinding||(Object.create?function(e,n,r,t){t===void 0&&(t=r),Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,t){t===void 0&&(t=r),e[t]=n[r]}),Cm=gr&&gr.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Tm=gr&&gr.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Em(n,e,r);return Cm(n,e),n};Object.defineProperty(gr,"__esModule",{value:!0});gr.toPlatformPath=gr.toWin32Path=gr.toPosixPath=void 0;var Im=Tm(require("path"));function Rm(e){return e.replace(/[\\]/g,"/")}gr.toPosixPath=Rm;function Am(e){return e.replace(/[/]/g,"\\")}gr.toWin32Path=Am;function Bm(e){return e.replace(/[/\\]/g,Im.sep)}gr.toPlatformPath=Bm});var mu=lt(Ae=>{"use strict";var km=Ae&&Ae.__createBinding||(Object.create?function(e,n,r,t){t===void 0&&(t=r),Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[r]}})}:function(e,n,r,t){t===void 0&&(t=r),e[t]=n[r]}),Pm=Ae&&Ae.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),jh=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&km(n,e,r);return Pm(n,e),n},Mh=Ae&&Ae.__awaiter||function(e,n,r,t){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function u(y){try{a(t.next(y))}catch(c){l(c)}}function s(y){try{a(t.throw(y))}catch(c){l(c)}}function a(y){y.done?o(y.value):i(y.value).then(u,s)}a((t=t.apply(e,n||[])).next())})};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getIDToken=Ae.getState=Ae.saveState=Ae.group=Ae.endGroup=Ae.startGroup=Ae.info=Ae.notice=Ae.warning=Ae.error=Ae.debug=Ae.isDebug=Ae.setFailed=Ae.setCommandEcho=Ae.setOutput=Ae.getBooleanInput=Ae.getMultilineInput=Ae.getInput=Ae.addPath=Ae.setSecret=Ae.exportVariable=Ae.ExitCode=void 0;var Ar=eh(),Vn=Sh(),Bi=uo(),Vh=jh(require("os")),Nm=jh(require("path")),Om=Dh(),Fh;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(Fh=Ae.ExitCode||(Ae.ExitCode={}));function Lm(e,n){let r=Bi.toCommandValue(n);if(process.env[e]=r,process.env.GITHUB_ENV||"")return Vn.issueFileCommand("ENV",Vn.prepareKeyValueMessage(e,n));Ar.issueCommand("set-env",{name:e},r)}Ae.exportVariable=Lm;function Um(e){Ar.issueCommand("add-mask",{},e)}Ae.setSecret=Um;function Dm(e){process.env.GITHUB_PATH||""?Vn.issueFileCommand("PATH",e):Ar.issueCommand("add-path",{},e),process.env.PATH=`${e}${Nm.delimiter}${process.env.PATH}`}Ae.addPath=Dm;function Su(e,n){let r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(n&&n.required&&!r)throw new Error(`Input required and not supplied: ${e}`);return n&&n.trimWhitespace===!1?r:r.trim()}Ae.getInput=Su;function xm(e,n){let r=Su(e,n).split(` -`).filter(t=>t!=="");return n&&n.trimWhitespace===!1?r:r.map(t=>t.trim())}Ae.getMultilineInput=xm;function qm(e,n){let r=["true","True","TRUE"],t=["false","False","FALSE"],i=Su(e,n);if(r.includes(i))return!0;if(t.includes(i))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}Ae.getBooleanInput=qm;function jm(e,n){if(process.env.GITHUB_OUTPUT||"")return Vn.issueFileCommand("OUTPUT",Vn.prepareKeyValueMessage(e,n));process.stdout.write(Vh.EOL),Ar.issueCommand("set-output",{name:e},Bi.toCommandValue(n))}Ae.setOutput=jm;function Mm(e){Ar.issue("echo",e?"on":"off")}Ae.setCommandEcho=Mm;function Vm(e){process.exitCode=Fh.Failure,Kh(e)}Ae.setFailed=Vm;function Fm(){return process.env.RUNNER_DEBUG==="1"}Ae.isDebug=Fm;function Km(e){Ar.issueCommand("debug",{},e)}Ae.debug=Km;function Kh(e,n={}){Ar.issueCommand("error",Bi.toCommandProperties(n),e instanceof Error?e.toString():e)}Ae.error=Kh;function $m(e,n={}){Ar.issueCommand("warning",Bi.toCommandProperties(n),e instanceof Error?e.toString():e)}Ae.warning=$m;function Hm(e,n={}){Ar.issueCommand("notice",Bi.toCommandProperties(n),e instanceof Error?e.toString():e)}Ae.notice=Hm;function zm(e){process.stdout.write(e+Vh.EOL)}Ae.info=zm;function $h(e){Ar.issue("group",e)}Ae.startGroup=$h;function Hh(){Ar.issue("endgroup")}Ae.endGroup=Hh;function Wm(e,n){return Mh(this,void 0,void 0,function*(){$h(e);let r;try{r=yield n()}finally{Hh()}return r})}Ae.group=Wm;function Gm(e,n){if(process.env.GITHUB_STATE||"")return Vn.issueFileCommand("STATE",Vn.prepareKeyValueMessage(e,n));Ar.issueCommand("save-state",{name:e},Bi.toCommandValue(n))}Ae.saveState=Gm;function Qm(e){return process.env[`STATE_${e}`]||""}Ae.getState=Qm;function Xm(e){return Mh(this,void 0,void 0,function*(){return yield Om.OidcClient.getIDToken(e)})}Ae.getIDToken=Xm;var Ym=wu();Object.defineProperty(Ae,"summary",{enumerable:!0,get:function(){return Ym.summary}});var Zm=wu();Object.defineProperty(Ae,"markdownSummary",{enumerable:!0,get:function(){return Zm.markdownSummary}});var Eu=qh();Object.defineProperty(Ae,"toPosixPath",{enumerable:!0,get:function(){return Eu.toPosixPath}});Object.defineProperty(Ae,"toWin32Path",{enumerable:!0,get:function(){return Eu.toWin32Path}});Object.defineProperty(Ae,"toPlatformPath",{enumerable:!0,get:function(){return Eu.toPlatformPath}})});var By=lt((MS,Ay)=>{var Jm=Object.create,Ba=Object.defineProperty,ev=Object.getOwnPropertyDescriptor,tv=Object.getOwnPropertyNames,as=Object.getOwnPropertySymbols,rv=Object.getPrototypeOf,Bl=Object.prototype.hasOwnProperty,ad=Object.prototype.propertyIsEnumerable,zh=(e,n,r)=>n in e?Ba(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,vs=(e,n)=>{for(var r in n||={})Bl.call(n,r)&&zh(e,r,n[r]);if(as)for(var r of as(n))ad.call(n,r)&&zh(e,r,n[r]);return e},bs=(e,n)=>{var r={};for(var t in e)Bl.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&as)for(var t of as(e))n.indexOf(t)<0&&ad.call(e,t)&&(r[t]=e[t]);return r},Re=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),nv=(e,n)=>{for(var r in n)Ba(e,r,{get:n[r],enumerable:!0})},od=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of tv(n))!Bl.call(e,i)&&i!==r&&Ba(e,i,{get:()=>n[i],enumerable:!(t=ev(n,i))||t.enumerable});return e},Vt=(e,n,r)=>(r=e!=null?Jm(rv(e)):{},od(n||!e||!e.__esModule?Ba(r,"default",{value:e,enumerable:!0}):r,e)),iv=e=>od(Ba({},"__esModule",{value:!0}),e),pn=(e,n,r)=>new Promise((t,i)=>{var o=s=>{try{u(r.next(s))}catch(a){i(a)}},l=s=>{try{u(r.throw(s))}catch(a){i(a)}},u=s=>s.done?t(s.value):Promise.resolve(s.value).then(o,l);u((r=r.apply(e,n)).next())}),av=Re((e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function r(i){return i.encrypted}var t=(i,o)=>{let l;typeof o=="function"?l={connect:o}:l=o;let u=typeof l.connect=="function",s=typeof l.secureConnect=="function",a=typeof l.close=="function",y=()=>{u&&l.connect(),r(i)&&s&&(i.authorized?l.secureConnect():i.authorizationError||i.once("secureConnect",l.secureConnect)),a&&i.once("close",l.close)};i.writable&&!i.connecting?y():i.connecting?i.once("connect",y):i.destroyed&&a&&l.close(i._hadError)};e.default=t,n.exports=t,n.exports.default=t}),ov=Re((e,n)=>{"use strict";var{PassThrough:r}=require("stream");n.exports=t=>{t={...t};let{array:i}=t,{encoding:o}=t,l=o==="buffer",u=!1;i?u=!(o||l):o=o||"utf8",l&&(o=null);let s=new r({objectMode:u});o&&s.setEncoding(o);let a=0,y=[];return s.on("data",c=>{y.push(c),u?a=y.length:a+=c.length}),s.getBufferedValue=()=>i?y:l?Buffer.concat(y,a):y.join(""),s.getBufferedLength=()=>a,s}}),sd=Re((e,n)=>{"use strict";var{constants:r}=require("buffer"),t=require("stream"),{promisify:i}=require("util"),o=ov(),l=i(t.pipeline),u=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function s(a,y){if(!a)throw new Error("Expected a stream");y={maxBuffer:1/0,...y};let{maxBuffer:c}=y,g=o(y);return await new Promise((I,w)=>{let m=S=>{S&&g.getBufferedLength()<=r.MAX_LENGTH&&(S.bufferedData=g.getBufferedValue()),w(S)};(async()=>{try{await l(a,g),I()}catch(S){m(S)}})(),g.on("data",()=>{g.getBufferedLength()>c&&m(new u)})}),g.getBufferedValue()}n.exports=s,n.exports.buffer=(a,y)=>s(a,{...y,encoding:"buffer"}),n.exports.array=(a,y)=>s(a,{...y,array:!0}),n.exports.MaxBufferError=u}),sv=Re((e,n)=>{"use strict";var r=new Set([200,203,204,206,300,301,404,405,410,414,501]),t=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),o={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},l={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function u(c){let g=parseInt(c,10);return isFinite(g)?g:0}function s(c){return c?i.has(c.status):!0}function a(c){let g={};if(!c)return g;let I=c.trim().split(/\s*,\s*/);for(let w of I){let[m,S]=w.split(/\s*=\s*/,2);g[m]=S===void 0?!0:S.replace(/^"|"$/g,"")}return g}function y(c){let g=[];for(let I in c){let w=c[I];g.push(w===!0?I:I+"="+w)}if(g.length)return g.join(", ")}n.exports=class{constructor(c,g,{shared:I,cacheHeuristic:w,immutableMinTimeToLive:m,ignoreCargoCult:S,_fromObject:B}={}){if(B){this._fromObject(B);return}if(!g||!g.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(c),this._responseTime=this.now(),this._isShared=I!==!1,this._cacheHeuristic=w!==void 0?w:.1,this._immutableMinTtl=m!==void 0?m:24*3600*1e3,this._status="status"in g?g.status:200,this._resHeaders=g.headers,this._rescc=a(g.headers["cache-control"]),this._method="method"in c?c.method:"GET",this._url=c.url,this._host=c.headers.host,this._noAuthorization=!c.headers.authorization,this._reqHeaders=g.headers.vary?c.headers:null,this._reqcc=a(c.headers["cache-control"]),S&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":y(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),g.headers["cache-control"]==null&&/no-cache/.test(g.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&t.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(c){if(!c||!c.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(c){this._assertRequestHasHeaders(c);let g=a(c.headers["cache-control"]);return g["no-cache"]||/no-cache/.test(c.headers.pragma)||g["max-age"]&&this.age()>g["max-age"]||g["min-fresh"]&&this.timeToLive()<1e3*g["min-fresh"]||this.stale()&&!(g["max-stale"]&&!this._rescc["must-revalidate"]&&(g["max-stale"]===!0||g["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(c,!1)}_requestMatches(c,g){return(!this._url||this._url===c.url)&&this._host===c.headers.host&&(!c.method||this._method===c.method||g&&c.method==="HEAD")&&this._varyMatches(c)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(c){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let g=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let I of g)if(c.headers[I]!==this._reqHeaders[I])return!1;return!0}_copyWithoutHopByHopHeaders(c){let g={};for(let I in c)o[I]||(g[I]=c[I]);if(c.connection){let I=c.connection.trim().split(/\s*,\s*/);for(let w of I)delete g[w]}if(g.warning){let I=g.warning.split(/,/).filter(w=>!/^\s*1[0-9][0-9]/.test(w));I.length?g.warning=I.join(",").trim():delete g.warning}return g}responseHeaders(){let c=this._copyWithoutHopByHopHeaders(this._resHeaders),g=this.age();return g>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(c.warning=(c.warning?`${c.warning}, `:"")+'113 - "rfc7234 5.5.4"'),c.age=`${Math.round(g)}`,c.date=new Date(this.now()).toUTCString(),c}date(){let c=Date.parse(this._resHeaders.date);return isFinite(c)?c:this._responseTime}age(){let c=this._ageValue(),g=(this.now()-this._responseTime)/1e3;return c+g}_ageValue(){return u(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return u(this._rescc["s-maxage"])}if(this._rescc["max-age"])return u(this._rescc["max-age"]);let c=this._rescc.immutable?this._immutableMinTtl:0,g=this.date();if(this._resHeaders.expires){let I=Date.parse(this._resHeaders.expires);return Number.isNaN(I)||II)return Math.max(c,(g-I)/1e3*this._cacheHeuristic)}return c}timeToLive(){let c=this.maxAge()-this.age(),g=c+u(this._rescc["stale-if-error"]),I=c+u(this._rescc["stale-while-revalidate"]);return Math.max(0,c,g,I)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+u(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+u(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(c){return new this(void 0,void 0,{_fromObject:c})}_fromObject(c){if(this._responseTime)throw Error("Reinitialized");if(!c||c.v!==1)throw Error("Invalid serialization");this._responseTime=c.t,this._isShared=c.sh,this._cacheHeuristic=c.ch,this._immutableMinTtl=c.imm!==void 0?c.imm:24*3600*1e3,this._status=c.st,this._resHeaders=c.resh,this._rescc=c.rescc,this._method=c.m,this._url=c.u,this._host=c.h,this._noAuthorization=c.a,this._reqHeaders=c.reqh,this._reqcc=c.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(c){this._assertRequestHasHeaders(c);let g=this._copyWithoutHopByHopHeaders(c.headers);if(delete g["if-range"],!this._requestMatches(c,!0)||!this.storable())return delete g["if-none-match"],delete g["if-modified-since"],g;if(this._resHeaders.etag&&(g["if-none-match"]=g["if-none-match"]?`${g["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),g["accept-ranges"]||g["if-match"]||g["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete g["if-modified-since"],g["if-none-match"]){let I=g["if-none-match"].split(/,/).filter(w=>!/^\s*W\//.test(w));I.length?g["if-none-match"]=I.join(",").trim():delete g["if-none-match"]}}else this._resHeaders["last-modified"]&&!g["if-modified-since"]&&(g["if-modified-since"]=this._resHeaders["last-modified"]);return g}revalidatedPolicy(c,g){if(this._assertRequestHasHeaders(c),this._useStaleIfError()&&s(g))return{modified:!1,matches:!1,policy:this};if(!g||!g.headers)throw Error("Response headers missing");let I=!1;if(g.status!==void 0&&g.status!=304?I=!1:g.headers.etag&&!/^\s*W\//.test(g.headers.etag)?I=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===g.headers.etag:this._resHeaders.etag&&g.headers.etag?I=this._resHeaders.etag.replace(/^\s*W\//,"")===g.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?I=this._resHeaders["last-modified"]===g.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!g.headers.etag&&!g.headers["last-modified"]&&(I=!0),!I)return{policy:new this.constructor(c,g),modified:g.status!=304,matches:!1};let w={};for(let S in this._resHeaders)w[S]=S in g.headers&&!l[S]?g.headers[S]:this._resHeaders[S];let m=Object.assign({},g,{status:this._status,method:this._method,headers:w});return{policy:new this.constructor(c,m,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),uv=Re(e=>{e.stringify=function n(r){if(typeof r>"u")return r;if(r&&Buffer.isBuffer(r))return JSON.stringify(":base64:"+r.toString("base64"));if(r&&r.toJSON&&(r=r.toJSON()),r&&typeof r=="object"){var t="",i=Array.isArray(r);t=i?"[":"{";var o=!0;for(var l in r){var u=typeof r[l]=="function"||!i&&typeof r[l]>"u";Object.hasOwnProperty.call(r,l)&&!u&&(o||(t+=","),o=!1,i?r[l]==null?t+="null":t+=n(r[l]):r[l]!==void 0&&(t+=n(l)+":"+n(r[l])))}return t+=i?"]":"}",t}else return typeof r=="string"?JSON.stringify(/^:/.test(r)?":"+r:r):typeof r>"u"?"null":JSON.stringify(r)},e.parse=function(n){return JSON.parse(n,function(r,t){return typeof t=="string"?/^:base64:/.test(t)?Buffer.from(t.substring(8),"base64"):/^:/.test(t)?t.substring(1):t:t})}}),lv=Re((e,n)=>{"use strict";var r=require("events"),t=uv(),i=u=>{let s={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(u.adapter||u.uri){let a=u.adapter||/^[^:+]*/.exec(u.uri)[0];return new(require(s[a]))(u)}return new Map},o=["sqlite","postgres","mysql","mongo","redis","tiered"],l=class extends r{constructor(u,{emitErrors:s=!0,...a}={}){if(super(),this.opts={namespace:"keyv",serialize:t.stringify,deserialize:t.parse,...typeof u=="string"?{uri:u}:u,...a},!this.opts.store){let c={...this.opts};this.opts.store=i(c)}if(this.opts.compression){let c=this.opts.compression,{serialize:g,deserialize:I}=c.opts;this.opts.serialize=g,this.opts.deserialize=I}typeof this.opts.store.on=="function"&&s&&this.opts.store.on("error",c=>this.emit("error",c)),this.opts.store.namespace=this.opts.namespace;let y=c=>async function*(){for await(let[g,I]of typeof c=="function"?c(this.opts.store.namespace):c){let w=this.opts.deserialize(I);if(!(this.opts.store.namespace&&!g.includes(this.opts.store.namespace))){if(typeof w.expires=="number"&&Date.now()>w.expires){this.delete(g);continue}yield[this._getKeyUnprefix(g),w.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=y(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=y(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return o.includes(this.opts.store.opts.dialect)||o.findIndex(u=>this.opts.store.opts.url.includes(u))>=0}_getKeyPrefix(u){return`${this.opts.namespace}:${u}`}_getKeyPrefixArray(u){return u.map(s=>`${this.opts.namespace}:${s}`)}_getKeyUnprefix(u){return u.split(":").splice(1).join(":")}get(u,s){let{store:a}=this.opts,y=Array.isArray(u),c=y?this._getKeyPrefixArray(u):this._getKeyPrefix(u);if(y&&a.getMany===void 0){let g=[];for(let I of c)g.push(Promise.resolve().then(()=>a.get(I)).then(w=>typeof w=="string"?this.opts.deserialize(w):w).then(w=>{if(w!=null)return typeof w.expires=="number"&&Date.now()>w.expires?this.delete(I).then(()=>{}):s&&s.raw?w:w.value}));return Promise.allSettled(g).then(I=>{let w=[];for(let m of I)w.push(m.value);return w})}return Promise.resolve().then(()=>y?a.getMany(c):a.get(c)).then(g=>typeof g=="string"?this.opts.deserialize(g):g).then(g=>{if(g!=null){if(y){let I=[];for(let w of g){if(typeof w=="string"&&(w=this.opts.deserialize(w)),w==null){I.push(void 0);continue}typeof w.expires=="number"&&Date.now()>w.expires?(this.delete(u).then(()=>{}),I.push(void 0)):I.push(s&&s.raw?w:w.value)}return I}return typeof g.expires=="number"&&Date.now()>g.expires?this.delete(u).then(()=>{}):s&&s.raw?g:g.value}})}set(u,s,a){let y=this._getKeyPrefix(u);typeof a>"u"&&(a=this.opts.ttl),a===0&&(a=void 0);let{store:c}=this.opts;return Promise.resolve().then(()=>{let g=typeof a=="number"?Date.now()+a:null;return typeof s=="symbol"&&this.emit("error","symbol cannot be serialized"),s={value:s,expires:g},this.opts.serialize(s)}).then(g=>c.set(y,g,a)).then(()=>!0)}delete(u){let{store:s}=this.opts;if(Array.isArray(u)){let y=this._getKeyPrefixArray(u);if(s.deleteMany===void 0){let c=[];for(let g of y)c.push(s.delete(g));return Promise.allSettled(c).then(g=>g.every(I=>I.value===!0))}return Promise.resolve().then(()=>s.deleteMany(y))}let a=this._getKeyPrefix(u);return Promise.resolve().then(()=>s.delete(a))}clear(){let{store:u}=this.opts;return Promise.resolve().then(()=>u.clear())}has(u){let s=this._getKeyPrefix(u),{store:a}=this.opts;return Promise.resolve().then(async()=>typeof a.has=="function"?a.has(s):await a.get(s)!==void 0)}disconnect(){let{store:u}=this.opts;if(typeof u.disconnect=="function")return u.disconnect()}};n.exports=l}),cv=Re((e,n)=>{"use strict";var r=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];n.exports=(t,i)=>{if(i._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let o=new Set(Object.keys(t).concat(r)),l={};for(let u of o)u in i||(l[u]={get(){let s=t[u];return typeof s=="function"?s.bind(t):s},set(s){t[u]=s},enumerable:!0,configurable:!1});return Object.defineProperties(i,l),t.once("aborted",()=>{i.destroy(),i.emit("aborted")}),t.once("close",()=>{t.complete&&i.readable?i.once("end",()=>{i.emit("close")}):i.emit("close")}),i}}),hv=Re((e,n)=>{"use strict";var{Transform:r,PassThrough:t}=require("stream"),i=require("zlib"),o=cv();n.exports=l=>{let u=(l.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(u))return l;let s=u==="br";if(s&&typeof i.createBrotliDecompress!="function")return l.destroy(new Error("Brotli is not supported on Node.js < 12")),l;let a=!0,y=new r({transform(I,w,m){a=!1,m(null,I)},flush(I){I()}}),c=new t({autoDestroy:!1,destroy(I,w){l.destroy(),w(I)}}),g=s?i.createBrotliDecompress():i.createUnzip();return g.once("error",I=>{if(a&&!l.readable){c.end();return}c.destroy(I)}),o(l,c),l.pipe(y).pipe(g).pipe(c),c}}),ud=Re((e,n)=>{"use strict";var r=class{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,i){if(this.cache.set(t,i),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[o,l]of this.oldCache.entries())this.onEviction(o,l);this.oldCache=this.cache,this.cache=new Map}}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){let i=this.oldCache.get(t);return this.oldCache.delete(t),this._set(t,i),i}}set(t,i){return this.cache.has(t)?this.cache.set(t,i):this._set(t,i),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t))return this.oldCache.get(t)}delete(t){let i=this.cache.delete(t);return i&&this._size--,this.oldCache.delete(t)||i}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[t]of this)yield t}*values(){for(let[,t]of this)yield t}*[Symbol.iterator](){for(let t of this.cache)yield t;for(let t of this.oldCache){let[i]=t;this.cache.has(i)||(yield t)}}get size(){let t=0;for(let i of this.oldCache.keys())this.cache.has(i)||t++;return Math.min(this._size+t,this.maxSize)}};n.exports=r}),ld=Re((e,n)=>{"use strict";n.exports=r=>{if(r.listenerCount("error")!==0)return r;r.__destroy=r._destroy,r._destroy=(...i)=>{let o=i.pop();r.__destroy(...i,async l=>{await Promise.resolve(),o(l)})};let t=i=>{Promise.resolve().then(()=>{r.emit("error",i)})};return r.once("error",t),Promise.resolve().then(()=>{r.off("error",t)}),r}}),zi=Re((e,n)=>{"use strict";var{URL:r}=require("url"),t=require("events"),i=require("tls"),o=require("http2"),l=ud(),u=ld(),s=Symbol("currentStreamCount"),a=Symbol("request"),y=Symbol("cachedOriginSet"),c=Symbol("gracefullyClosing"),g=Symbol("length"),I=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],w=(b,E,R)=>{let P=0,C=b.length;for(;P>>1;R(b[d],E)?P=d+1:C=d}return P},m=(b,E)=>b.remoteSettings.maxConcurrentStreams>E.remoteSettings.maxConcurrentStreams,S=(b,E)=>{for(let R=0;R0&&P[y].lengthE[y].includes(C))&&P[s]+E[s]<=E.remoteSettings.maxConcurrentStreams&&A(P)}},B=(b,E)=>{for(let R=0;R0&&E[y].lengthP[y].includes(C))&&E[s]+P[s]<=P.remoteSettings.maxConcurrentStreams)return A(E),!0}return!1},A=b=>{b[c]=!0,b[s]===0&&b.close()},f=class extends t{constructor({timeout:b=0,maxSessions:E=Number.POSITIVE_INFINITY,maxEmptySessions:R=10,maxCachedTlsSessions:P=100}={}){super(),this.sessions={},this.queue={},this.timeout=b,this.maxSessions=E,this.maxEmptySessions=R,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new l({maxSize:P})}get protocol(){return"https:"}normalizeOptions(b){let E="";for(let R=0;R=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let b in this.queue)for(let E in this.queue[b]){let R=this.queue[b][E];R.completed||(R.completed=!0,R())}}_isBetterSession(b,E){return b>E}_accept(b,E,R,P){let C=0;for(;C0&&(this.getSession(R,P,E),E.length=0)}getSession(b,E,R){return new Promise((P,C)=>{Array.isArray(R)&&R.length>0?(R=[...R],P()):R=[{resolve:P,reject:C}];try{if(typeof b=="string")b=new r(b);else if(!(b instanceof r))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(E){let{servername:M}=E,{hostname:v}=b;if(M&&v!==M)throw new Error(`Origin ${v} differs from servername ${M}`)}}catch(M){for(let v=0;v=Y||K[c]||K.destroyed||(L||(v=Y),this._isBetterSession(te,N)&&(L=K,N=te))}if(L){this._accept(L,R,h,E);return}}if(d in this.queue){if(h in this.queue[d]){this.queue[d][h].listeners.push(...R);return}}else this.queue[d]={[g]:0};let U=()=>{d in this.queue&&this.queue[d][h]===j&&(delete this.queue[d][h],--this.queue[d][g]===0&&delete this.queue[d])},j=async()=>{this._sessionCount++;let M=`${h}:${d}`,v=!1,N;try{let L={...E};L.settings===void 0&&(L.settings=this.settings),L.session===void 0&&(L.session=this.tlsSessionCache.get(M)),N=await(L.createConnection||this.createConnection).call(this,b,L),L.createConnection=()=>N;let O=o.connect(b,L);O[s]=0,O[c]=!1;let K=()=>{let{socket:re}=O,oe;return re.servername===!1?(re.servername=re.remoteAddress,oe=O.originSet,re.servername=!1):oe=O.originSet,oe},Y=()=>O[s]{this.tlsSessionCache.set(M,re)}),O.once("error",re=>{for(let oe=0;oe{O.destroy()}),O.once("close",()=>{if(this._sessionCount--,v){this._emptySessionCount--;let re=this.sessions[d];re.length===1?delete this.sessions[d]:re.splice(re.indexOf(O),1)}else{U();let re=new Error("Session closed without receiving a SETTINGS frame");re.code="HTTP2WRAPPER_NOSETTINGS";for(let oe=0;oe{let re=this.queue[d];if(!re)return;let oe=O[y];for(let be=0;be{O[y]=K()||[],O[c]=!1,B(this.sessions[d],O),!(O[c]||!Y())&&(te(),Y()&&S(this.sessions[d],O))}),O.once("remoteSettings",()=>{if(j.destroyed){let re=new Error("Agent has been destroyed");for(let oe=0;oethis.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),O.on("remoteSettings",()=>{!Y()||(te(),Y()&&S(this.sessions[d],O))})}),O[a]=O.request,O.request=(re,oe)=>{if(O[c])throw new Error("The session is gracefully closing. No new streams are allowed.");let be=O[a](re,oe);return O.ref(),O[s]++===0&&this._emptySessionCount--,be.once("close",()=>{if(--O[s]===0&&(this._emptySessionCount++,O.unref(),this._emptySessionCount>this.maxEmptySessions||O[c])){O.close();return}O.destroyed||O.closed||Y()&&!B(this.sessions[d],O)&&(S(this.sessions[d],O),te(),O[s]===0&&this._processQueue())}),be}}catch(L){U(),this._sessionCount--;for(let O=0;O{this.getSession(b,E,[{reject:d,resolve:h=>{try{let U=h.request(R,P);u(U),C(U)}catch(U){d(U)}}}])})}async createConnection(b,E){return f.connect(b,E)}static connect(b,E){E.ALPNProtocols=["h2"];let R=b.port||443,P=b.hostname;typeof E.servername>"u"&&(E.servername=P);let C=i.connect(R,P,E);return E.socket&&(C._peername={family:void 0,address:void 0,port:R}),C}closeEmptySessions(b=Number.POSITIVE_INFINITY){let E=0,{sessions:R}=this;for(let P in R){let C=R[P];for(let d=0;d=b))return E}}return E}destroy(b){let{sessions:E,queue:R}=this;for(let P in E){let C=E[P];for(let d=0;d{"use strict";var{Readable:r}=require("stream"),t=class extends r{constructor(i,o){super({emitClose:!1,autoDestroy:!0,highWaterMark:o}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=i,this._dumped=!1}get connection(){return this.socket}set connection(i){this.socket=i}_destroy(i,o){this.readableEnded||(this.aborted=!0),o(),this.req._request.destroy(i)}setTimeout(i,o){return this.req.setTimeout(i,o),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};n.exports=t}),fv=Re((e,n)=>{"use strict";n.exports=(r,t,i)=>{for(let o of i)r.on(o,(...l)=>t.emit(o,...l))}}),_s=Re((e,n)=>{"use strict";var r=(t,i,o)=>{n.exports[i]=class extends t{constructor(...l){super(typeof o=="string"?o:o(l)),this.name=`${super.name} [${i}]`,this.code=i}}};r(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let i=t[0].includes(".")?"property":"argument",o=t[1],l=Array.isArray(o);return l&&(o=`${o.slice(0,-1).join(", ")} or ${o.slice(-1)}`),`The "${t[0]}" ${i} must be ${l?"one of":"of"} type ${o}. Received ${typeof t[2]}`}),r(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`),r(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`),r(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`),r(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`),r(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`),r(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}),dv=Re((e,n)=>{"use strict";n.exports=r=>{switch(r){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),hd=Re((e,n)=>{"use strict";var{ERR_INVALID_HTTP_TOKEN:r}=_s(),t=dv(),i=/^[\^`\-\w!#$%&*+.|~]+$/;n.exports=o=>{if(typeof o!="string"||!i.test(o)&&!t(o))throw new r("Header name",o)}}),fd=Re((e,n)=>{"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE:r,ERR_INVALID_CHAR:t}=_s(),i=/[^\t\u0020-\u007E\u0080-\u00FF]/;n.exports=(o,l)=>{if(typeof l>"u")throw new r(l,o);if(i.test(l))throw new t("header content",o)}}),pv=Re((e,n)=>{"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION:r}=_s(),t={has(i,o){let l=i.session===void 0?i:i.session.socket;return o in i||o in l},get(i,o){switch(o){case"on":case"once":case"end":case"emit":case"destroy":return i[o].bind(i);case"writable":case"destroyed":return i[o];case"readable":return i.destroyed?!1:i.readable;case"setTimeout":{let{session:l}=i;return l!==void 0?l.setTimeout.bind(l):i.setTimeout.bind(i)}case"write":case"read":case"pause":case"resume":throw new r;default:{let l=i.session===void 0?i:i.session.socket,u=l[o];return typeof u=="function"?u.bind(l):u}}},getPrototypeOf(i){return i.session!==void 0?Reflect.getPrototypeOf(i.session.socket):Reflect.getPrototypeOf(i)},set(i,o,l){switch(o){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return i[o]=l,!0;case"setTimeout":{let{session:u}=i;return u===void 0?i.setTimeout=l:u.setTimeout=l,!0}case"write":case"read":case"pause":case"resume":throw new r;default:{let u=i.session===void 0?i:i.session.socket;return u[o]=l,!0}}}};n.exports=t}),dd=Re((e,n)=>{"use strict";var{URL:r,urlToHttpOptions:t}=require("url"),i=require("http2"),{Writable:o}=require("stream"),{Agent:l,globalAgent:u}=zi(),s=cd(),a=fv(),{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_PROTOCOL:c,ERR_HTTP_HEADERS_SENT:g}=_s(),I=hd(),w=fd(),m=pv(),{HTTP2_HEADER_STATUS:S,HTTP2_HEADER_METHOD:B,HTTP2_HEADER_PATH:A,HTTP2_HEADER_AUTHORITY:f,HTTP2_METHOD_CONNECT:b}=i.constants,E=Symbol("headers"),R=Symbol("origin"),P=Symbol("session"),C=Symbol("options"),d=Symbol("flushedHeaders"),h=Symbol("jobs"),U=Symbol("pendingAgentPromise"),j=class extends o{constructor(M,v,N){if(super({autoDestroy:!1,emitClose:!1}),typeof M=="string"?M=t(new r(M)):M instanceof r?M=t(M):M={...M},typeof v=="function"||v===void 0?(N=v,v=M):v=Object.assign(M,v),v.h2session){if(this[P]=v.h2session,this[P].destroyed)throw new Error("The session has been closed already");this.protocol=this[P].socket.encrypted?"https:":"http:"}else if(v.agent===!1)this.agent=new l({maxEmptySessions:0});else if(typeof v.agent>"u"||v.agent===null)this.agent=u;else if(typeof v.agent.request=="function")this.agent=v.agent;else throw new y("options.agent",["http2wrapper.Agent-like Object","undefined","false"],v.agent);if(this.agent&&(this.protocol=this.agent.protocol),v.protocol&&v.protocol!==this.protocol)throw new c(v.protocol,this.protocol);v.port||(v.port=v.defaultPort||this.agent&&this.agent.defaultPort||443),v.host=v.hostname||v.host||"localhost",delete v.hostname;let{timeout:L}=v;v.timeout=void 0,this[E]=Object.create(null),this[h]=[],this[U]=void 0,this.socket=null,this.connection=null,this.method=v.method||"GET",this.method==="CONNECT"&&(v.path==="/"||v.path===void 0)||(this.path=v.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:O}=v;if(O)for(let Y in O)this.setHeader(Y,O[Y]);v.auth&&!("authorization"in this[E])&&(this[E].authorization="Basic "+Buffer.from(v.auth).toString("base64")),v.session=v.tlsSession,v.path=v.socketPath,this[C]=v,this[R]=new r(`${this.protocol}//${v.servername||v.host}:${v.port}`);let K=v._reuseSocket;K&&(v.createConnection=(...Y)=>K.destroyed?this.agent.createConnection(...Y):K,this.agent.getSession(this[R],this[C]).catch(()=>{})),L&&this.setTimeout(L),N&&this.once("response",N),this[d]=!1}get method(){return this[E][B]}set method(M){M&&(this[E][B]=M.toUpperCase())}get path(){let M=this.method==="CONNECT"?f:A;return this[E][M]}set path(M){if(M){let v=this.method==="CONNECT"?f:A;this[E][v]=M}}get host(){return this[R].hostname}set host(M){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(M,v,N){if(this._mustNotHaveABody){N(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let L=()=>this._request.write(M,v,N);this._request?L():this[h].push(L)}_final(M){this.flushHeaders();let v=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){M();return}this._request.end(M)};this._request?v():this[h].push(v)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(M,v){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[U]}catch(N){this.aborted&&(M=N)}v(M)}async flushHeaders(){if(this[d]||this.destroyed)return;this[d]=!0;let M=this.method===b,v=N=>{if(this._request=N,this.destroyed){N.destroy();return}M||a(N,this,["timeout","continue"]),N.once("error",O=>{this.destroy(O)}),N.once("aborted",()=>{let{res:O}=this;O?(O.aborted=!0,O.emit("aborted"),O.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let L=(O,K,Y)=>{let te=new s(this.socket,N.readableHighWaterMark);this.res=te,te.url=`${this[R].origin}${this.path}`,te.req=this,te.statusCode=O[S],te.headers=O,te.rawHeaders=Y,te.once("end",()=>{te.complete=!0,te.socket=null,te.connection=null}),M?(te.upgrade=!0,this.emit("connect",te,N,Buffer.alloc(0))?this.emit("close"):N.destroy()):(N.on("data",re=>{!te._dumped&&!te.push(re)&&N.pause()}),N.once("end",()=>{this.aborted||te.push(null)}),this.emit("response",te)||te._dump())};N.once("response",L),N.once("headers",O=>this.emit("information",{statusCode:O[S]})),N.once("trailers",(O,K,Y)=>{let{res:te}=this;if(te===null){L(O,K,Y);return}te.trailers=O,te.rawTrailers=Y}),N.once("close",()=>{let{aborted:O,res:K}=this;if(K){O&&(K.aborted=!0,K.emit("aborted"),K.destroy());let Y=()=>{K.emit("close"),this.destroy(),this.emit("close")};K.readable?K.once("end",Y):Y();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(N,m);for(let O of this[h])O();this.emit("socket",this.socket)};if(!(f in this[E])&&!M&&(this[E][f]=this[R].host),this[P])try{v(this[P].request(this[E]))}catch(N){this.destroy(N)}else{this.reusedSocket=!0;try{let N=this.agent.request(this[R],this[C],this[E]);this[U]=N,v(await N),this[U]=!1}catch(N){this[U]=!1,this.destroy(N)}}}get connection(){return this.socket}set connection(M){this.socket=M}getHeaderNames(){return Object.keys(this[E])}hasHeader(M){if(typeof M!="string")throw new y("name","string",M);return Boolean(this[E][M.toLowerCase()])}getHeader(M){if(typeof M!="string")throw new y("name","string",M);return this[E][M.toLowerCase()]}get headersSent(){return this[d]}removeHeader(M){if(typeof M!="string")throw new y("name","string",M);if(this.headersSent)throw new g("remove");delete this[E][M.toLowerCase()]}setHeader(M,v){if(this.headersSent)throw new g("set");I(M),w(M,v);let N=M.toLowerCase();if(N==="connection"){if(v.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${v}`)}N==="host"&&this.method==="CONNECT"?this[E][f]=v:this[E][N]=v}setNoDelay(){}setSocketKeepAlive(){}setTimeout(M,v){let N=()=>this._request.setTimeout(M,v);return this._request?N():this[h].push(N),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(M){}};n.exports=j}),yv=Re((e,n)=>{"use strict";var r=require("tls");n.exports=(t={},i=r.connect)=>new Promise((o,l)=>{let u=!1,s,a=async()=>{await c,s.off("timeout",y),s.off("error",l),t.resolveSocket?(o({alpnProtocol:s.alpnProtocol,socket:s,timeout:u}),u&&(await Promise.resolve(),s.emit("timeout"))):(s.destroy(),o({alpnProtocol:s.alpnProtocol,timeout:u}))},y=async()=>{u=!0,a()},c=(async()=>{try{s=await i(t,a),s.on("error",l),s.once("timeout",y)}catch(g){l(g)}})()})}),gv=Re((e,n)=>{"use strict";var{isIP:r}=require("net"),t=require("assert"),i=o=>{if(o[0]==="["){let u=o.indexOf("]");return t(u!==-1),o.slice(1,u)}let l=o.indexOf(":");return l===-1?o:o.slice(0,l)};n.exports=o=>{let l=i(o);return r(l)?"":l}}),mv=Re((e,n)=>{"use strict";var{URL:r,urlToHttpOptions:t}=require("url"),i=require("http"),o=require("https"),l=yv(),u=ud(),{Agent:s,globalAgent:a}=zi(),y=dd(),c=gv(),g=ld(),I=new u({maxSize:100}),w=new Map,m=(A,f,b)=>{f._httpMessage={shouldKeepAlive:!0};let E=()=>{A.emit("free",f,b)};f.on("free",E);let R=()=>{A.removeSocket(f,b)};f.on("close",R);let P=()=>{let{freeSockets:d}=A;for(let h of Object.values(d))if(h.includes(f)){f.destroy();return}};f.on("timeout",P);let C=()=>{A.removeSocket(f,b),f.off("close",R),f.off("free",E),f.off("timeout",P),f.off("agentRemove",C)};f.on("agentRemove",C),A.emit("free",f,b)},S=(A,f=new Map,b=void 0)=>async E=>{let R=`${E.host}:${E.port}:${E.ALPNProtocols.sort()}`;if(!A.has(R)){if(f.has(R))return{alpnProtocol:(await f.get(R)).alpnProtocol};let{path:P}=E;E.path=E.socketPath;let C=l(E,b);f.set(R,C);try{let d=await C;return A.set(R,d.alpnProtocol),f.delete(R),E.path=P,d}catch(d){throw f.delete(R),E.path=P,d}}return{alpnProtocol:A.get(R)}},B=S(I,w);n.exports=async(A,f,b)=>{if(typeof A=="string"?A=t(new r(A)):A instanceof r?A=t(A):A={...A},typeof f=="function"||f===void 0?(b=f,f=A):f=Object.assign(A,f),f.ALPNProtocols=f.ALPNProtocols||["h2","http/1.1"],!Array.isArray(f.ALPNProtocols)||f.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");f.protocol=f.protocol||"https:";let E=f.protocol==="https:";f.host=f.hostname||f.host||"localhost",f.session=f.tlsSession,f.servername=f.servername||c(f.headers&&f.headers.host||f.host),f.port=f.port||(E?443:80),f._defaultAgent=E?o.globalAgent:i.globalAgent;let R=f.resolveProtocol||B,{agent:P}=f;if(P!==void 0&&P!==!1&&P.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(E){f.resolveSocket=!0;let{socket:C,alpnProtocol:d,timeout:h}=await R(f);if(h){C&&C.destroy();let j=new Error(`Timed out resolving ALPN: ${f.timeout} ms`);throw j.code="ETIMEDOUT",j.ms=f.timeout,j}C&&f.createConnection&&(C.destroy(),C=void 0),delete f.resolveSocket;let U=d==="h2";if(P&&(P=U?P.http2:P.https,f.agent=P),P===void 0&&(P=U?a:o.globalAgent),C)if(P===!1)C.destroy();else{let j=(U?s:o.Agent).prototype.createConnection;P.createConnection===j?U?f._reuseSocket=C:m(P,C,f):C.destroy()}if(U)return g(new y(f,b))}else P&&(f.agent=P.http);return g(i.request(f,b))},n.exports.protocolCache=I,n.exports.resolveProtocol=B,n.exports.createResolveProtocol=S}),pd=Re((e,n)=>{"use strict";var r=require("stream"),t=require("tls"),i=new t.TLSSocket(new r.PassThrough)._handle._parentWrap.constructor;n.exports=i}),yd=Re((e,n)=>{"use strict";var r=class extends Error{constructor(t){super(`The proxy server rejected the request with status code ${t}`),this.statusCode=t}};n.exports=r}),vv=Re((e,n)=>{"use strict";var r=(t,i,o)=>{if(!o.some(l=>typeof l=="string"?typeof i===l:i instanceof l)){let l=o.map(u=>typeof u=="string"?u:u.name);throw new TypeError(`Expected '${t}' to be a type of ${l.join(" or ")}, got ${typeof i}`)}};n.exports=r}),gd=Re((e,n)=>{"use strict";var{URL:r}=require("url"),t=vv();n.exports=(i,o)=>{t("proxyOptions",o,["object"]),t("proxyOptions.headers",o.headers,["object","undefined"]),t("proxyOptions.raw",o.raw,["boolean","undefined"]),t("proxyOptions.url",o.url,[r,"string"]);let l=new r(o.url);i.proxyOptions={raw:!0,...o,headers:{...o.headers},url:l}}}),kl=Re((e,n)=>{"use strict";n.exports=r=>{let{username:t,password:i}=r.proxyOptions.url;if(t||i){let o=`${t}:${i}`,l=`Basic ${Buffer.from(o).toString("base64")}`;return{"proxy-authorization":l,authorization:l}}return{}}}),bv=Re((e,n)=>{"use strict";var r=require("tls"),t=require("http"),i=require("https"),o=pd(),{globalAgent:l}=zi(),u=yd(),s=gd(),a=kl(),y=(I,w,m)=>{(async()=>{try{let{proxyOptions:S}=I,{url:B,headers:A,raw:f}=S,b=await l.request(B,S,{...a(I),...A,":method":"CONNECT",":authority":`${w.host}:${w.port}`});b.once("error",m),b.once("response",E=>{let R=E[":status"];if(R!==200){m(new u(R));return}let P=I instanceof i.Agent;if(f&&P){w.socket=b;let d=r.connect(w);d.once("close",()=>{b.destroy()}),m(null,d);return}let C=new o(b);C.encrypted=!1,C._handle.getpeername=d=>{d.family=void 0,d.address=void 0,d.port=void 0},m(null,C)})}catch(S){m(S)}})()},c=class extends t.Agent{constructor(I){super(I),s(this,I.proxyOptions)}createConnection(I,w){y(this,I,w)}},g=class extends i.Agent{constructor(I){super(I),s(this,I.proxyOptions)}createConnection(I,w){y(this,I,w)}};n.exports={HttpOverHttp2:c,HttpsOverHttp2:g}}),md=Re((e,n)=>{"use strict";var{Agent:r}=zi(),t=pd(),i=yd(),o=gd(),l=class extends r{constructor(u){super(u),o(this,u.proxyOptions)}async createConnection(u,s){let a=`${u.hostname}:${u.port||443}`,[y,c]=await this._getProxyStream(a);if(c!==200)throw new i(c);if(this.proxyOptions.raw)s.socket=y;else{let g=new t(y);return g.encrypted=!1,g._handle.getpeername=I=>{I.family=void 0,I.address=void 0,I.port=void 0},g}return super.createConnection(u,s)}};n.exports=l}),_v=Re((e,n)=>{"use strict";var{globalAgent:r}=zi(),t=md(),i=kl(),o=u=>new Promise((s,a)=>{u.once("error",a),u.once("response",y=>{u.off("error",a),s(y[":status"])})}),l=class extends t{async _getProxyStream(u){let{proxyOptions:s}=this,a={...i(this),...s.headers,":method":"CONNECT",":authority":u},y=await r.request(s.url,s,a),c=await o(y);return[y,c]}};n.exports=l}),wv=Re((e,n)=>{"use strict";var r=require("http"),t=require("https"),i=md(),o=kl(),l=s=>new Promise((a,y)=>{let c=(g,I,w)=>{I.unshift(w),s.off("error",y),a([I,g.statusCode])};s.once("error",y),s.once("connect",c)}),u=class extends i{async _getProxyStream(s){let{proxyOptions:a}=this,{url:y,headers:c}=this.proxyOptions,g=(y.protocol==="https:"?t:r).request({...a,hostname:y.hostname,port:y.port,path:s,headers:{...o(this),...c,host:s},method:"CONNECT"}).end();return l(g)}};n.exports={Http2OverHttp:u,Http2OverHttps:u}}),Sv=Re((e,n)=>{"use strict";var r=require("http2"),{Agent:t,globalAgent:i}=zi(),o=dd(),l=cd(),u=mv(),{HttpOverHttp2:s,HttpsOverHttp2:a}=bv(),y=_v(),{Http2OverHttp:c,Http2OverHttps:g}=wv(),I=hd(),w=fd(),m=(B,A,f)=>new o(B,A,f),S=(B,A,f)=>{let b=new o(B,A,f);return b.end(),b};n.exports={...r,ClientRequest:o,IncomingMessage:l,Agent:t,globalAgent:i,request:m,get:S,auto:u,proxies:{HttpOverHttp2:s,HttpsOverHttp2:a,Http2OverHttp2:y,Http2OverHttp:c,Http2OverHttps:g},validateHeaderName:I,validateHeaderValue:w}}),Ev=Re((e,n)=>{if(!globalThis.DOMException)try{let{MessageChannel:r}=require("worker_threads"),t=new r().port1,i=new ArrayBuffer;t.postMessage(i,[i,i])}catch(r){r.constructor.name==="DOMException"&&(globalThis.DOMException=r.constructor)}n.exports=globalThis.DOMException}),ka=Re((e,n)=>{var r=require("buffer"),t=r.Buffer;function i(l,u){for(var s in l)u[s]=l[s]}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?n.exports=r:(i(r,e),e.Buffer=o);function o(l,u,s){return t(l,u,s)}o.prototype=Object.create(t.prototype),i(t,o),o.from=function(l,u,s){if(typeof l=="number")throw new TypeError("Argument must not be a number");return t(l,u,s)},o.alloc=function(l,u,s){if(typeof l!="number")throw new TypeError("Argument must be a number");var a=t(l);return u!==void 0?typeof s=="string"?a.fill(u,s):a.fill(u):a.fill(0),a},o.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return t(l)},o.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(l)}}),vd=Re((e,n)=>{var r=ka().Buffer,t=require("stream"),i=require("util");function o(l){if(this.buffer=null,this.writable=!0,this.readable=!0,!l)return this.buffer=r.alloc(0),this;if(typeof l.pipe=="function")return this.buffer=r.alloc(0),l.pipe(this),this;if(l.length||typeof l=="object")return this.buffer=l,this.writable=!1,process.nextTick(function(){this.emit("end",l),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof l+")")}i.inherits(o,t),o.prototype.write=function(l){this.buffer=r.concat([this.buffer,r.from(l)]),this.emit("data",l)},o.prototype.end=function(l){l&&this.write(l),this.emit("end",l),this.emit("close"),this.writable=!1,this.readable=!1},n.exports=o}),Cv=Re((e,n)=>{"use strict";var r=require("buffer").Buffer,t=require("buffer").SlowBuffer;n.exports=i;function i(u,s){if(!r.isBuffer(u)||!r.isBuffer(s)||u.length!==s.length)return!1;for(var a=0,y=0;y{"use strict";function r(o){var l=(o/8|0)+(o%8===0?0:1);return l}var t={ES256:r(256),ES384:r(384),ES512:r(521)};function i(o){var l=t[o];if(l)return l;throw new Error('Unknown algorithm "'+o+'"')}n.exports=i}),Iv=Re((e,n)=>{"use strict";var r=ka().Buffer,t=Tv(),i=128,o=0,l=32,u=16,s=2,a=u|l|o<<6,y=s|o<<6;function c(S){return S.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function g(S){if(r.isBuffer(S))return S;if(typeof S=="string")return r.from(S,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function I(S,B){S=g(S);var A=t(B),f=A+1,b=S.length,E=0;if(S[E++]!==a)throw new Error('Could not find expected "seq"');var R=S[E++];if(R===(i|1)&&(R=S[E++]),b-E=i;return b&&--f,f}function m(S,B){S=g(S);var A=t(B),f=S.length;if(f!==A*2)throw new TypeError('"'+B+'" signatures must be "'+A*2+'" bytes, saw "'+f+'"');var b=w(S,0,A),E=w(S,A,S.length),R=A-b,P=A-E,C=1+1+R+1+1+P,d=C{var r=Cv(),t=ka().Buffer,i=require("crypto"),o=Iv(),l=require("util"),u=`"%s" is not a valid algorithm. + Error Message: ${s.result.message}`)})).result)===null||r===void 0?void 0:r.value;if(!i)throw new Error("Response json body do not have ID Token field");return i})}static getIDToken(t){return Gs(this,void 0,void 0,function*(){try{let r=bt.getIDTokenUrl();if(t){let o=encodeURIComponent(t);r=`${r}&audience=${o}`}Js.debug(`ID token url is ${r}`);let n=yield bt.getCall(r);return Js.setSecret(n),n}catch(r){throw new Error(`Error message: ${r.message}`)}})}};Zt.OidcClient=bt});var Bo=ce(ke=>{"use strict";var Mo=ke&&ke.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(ke,"__esModule",{value:!0});ke.summary=ke.markdownSummary=ke.SUMMARY_DOCS_URL=ke.SUMMARY_ENV_VAR=void 0;var md=require("os"),Lo=require("fs"),{access:yd,appendFile:gd,writeFile:bd}=Lo.promises;ke.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";ke.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var No=class{constructor(){this._buffer=""}filePath(){return Mo(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[ke.SUMMARY_ENV_VAR];if(!t)throw new Error(`Unable to find environment variable for $${ke.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield yd(t,Lo.constants.R_OK|Lo.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath})}wrap(t,r,n={}){let o=Object.entries(n).map(([i,s])=>` ${i}="${s}"`).join("");return r?`<${t}${o}>${r}`:`<${t}${o}>`}write(t){return Mo(this,void 0,void 0,function*(){let r=!!t?.overwrite,n=yield this.filePath();return yield(r?bd:gd)(n,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Mo(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(t,r=!1){return this._buffer+=t,r?this.addEOL():this}addEOL(){return this.addRaw(md.EOL)}addCodeBlock(t,r){let n=Object.assign({},r&&{lang:r}),o=this.wrap("pre",this.wrap("code",t),n);return this.addRaw(o).addEOL()}addList(t,r=!1){let n=r?"ol":"ul",o=t.map(s=>this.wrap("li",s)).join(""),i=this.wrap(n,o);return this.addRaw(i).addEOL()}addTable(t){let r=t.map(o=>{let i=o.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:a,data:l,colspan:u,rowspan:d}=s,h=a?"th":"td",c=Object.assign(Object.assign({},u&&{colspan:u}),d&&{rowspan:d});return this.wrap(h,l,c)}).join("");return this.wrap("tr",i)}).join(""),n=this.wrap("table",r);return this.addRaw(n).addEOL()}addDetails(t,r){let n=this.wrap("details",this.wrap("summary",t)+r);return this.addRaw(n).addEOL()}addImage(t,r,n){let{width:o,height:i}=n||{},s=Object.assign(Object.assign({},o&&{width:o}),i&&{height:i}),a=this.wrap("img",null,Object.assign({src:t,alt:r},s));return this.addRaw(a).addEOL()}addHeading(t,r){let n=`h${r}`,o=["h1","h2","h3","h4","h5","h6"].includes(n)?n:"h1",i=this.wrap(o,t);return this.addRaw(i).addEOL()}addSeparator(){let t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){let t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,r){let n=Object.assign({},r&&{cite:r}),o=this.wrap("blockquote",t,n);return this.addRaw(o).addEOL()}addLink(t,r){let n=this.wrap("a",t,{href:r});return this.addRaw(n).addEOL()}},Qs=new No;ke.markdownSummary=Qs;ke.summary=Qs});var Ys=ce(Ae=>{"use strict";var vd=Ae&&Ae.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),_d=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wd=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&vd(t,e,r);return _d(t,e),t};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.toPlatformPath=Ae.toWin32Path=Ae.toPosixPath=void 0;var Sd=wd(require("path"));function Ed(e){return e.replace(/[\\]/g,"/")}Ae.toPosixPath=Ed;function Td(e){return e.replace(/[/]/g,"\\")}Ae.toWin32Path=Td;function Od(e){return e.replace(/[/\\]/g,Sd.sep)}Ae.toPlatformPath=Od});var $o=ce(V=>{"use strict";var Rd=V&&V.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Pd=V&&V.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xs=V&&V.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Rd(t,e,r);return Pd(t,e),t},Zs=V&&V.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(V,"__esModule",{value:!0});V.getIDToken=V.getState=V.saveState=V.group=V.endGroup=V.startGroup=V.info=V.notice=V.warning=V.error=V.debug=V.isDebug=V.setFailed=V.setCommandEcho=V.setOutput=V.getBooleanInput=V.getMultilineInput=V.getInput=V.addPath=V.setSecret=V.exportVariable=V.ExitCode=void 0;var ze=fs(),Ot=$s(),er=Qr(),ea=Xs(require("os")),xd=Xs(require("path")),kd=Ks(),ta;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(ta=V.ExitCode||(V.ExitCode={}));function Ad(e,t){let r=er.toCommandValue(t);if(process.env[e]=r,process.env.GITHUB_ENV||"")return Ot.issueFileCommand("ENV",Ot.prepareKeyValueMessage(e,t));ze.issueCommand("set-env",{name:e},r)}V.exportVariable=Ad;function qd(e){ze.issueCommand("add-mask",{},e)}V.setSecret=qd;function Cd(e){process.env.GITHUB_PATH||""?Ot.issueFileCommand("PATH",e):ze.issueCommand("add-path",{},e),process.env.PATH=`${e}${xd.delimiter}${process.env.PATH}`}V.addPath=Cd;function Uo(e,t){let r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r)throw new Error(`Input required and not supplied: ${e}`);return t&&t.trimWhitespace===!1?r:r.trim()}V.getInput=Uo;function jd(e,t){let r=Uo(e,t).split(` +`).filter(n=>n!=="");return t&&t.trimWhitespace===!1?r:r.map(n=>n.trim())}V.getMultilineInput=jd;function Id(e,t){let r=["true","True","TRUE"],n=["false","False","FALSE"],o=Uo(e,t);if(r.includes(o))return!0;if(n.includes(o))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}V.getBooleanInput=Id;function $d(e,t){if(process.env.GITHUB_OUTPUT||"")return Ot.issueFileCommand("OUTPUT",Ot.prepareKeyValueMessage(e,t));process.stdout.write(ea.EOL),ze.issueCommand("set-output",{name:e},er.toCommandValue(t))}V.setOutput=$d;function Md(e){ze.issue("echo",e?"on":"off")}V.setCommandEcho=Md;function Ld(e){process.exitCode=ta.Failure,ra(e)}V.setFailed=Ld;function Nd(){return process.env.RUNNER_DEBUG==="1"}V.isDebug=Nd;function Bd(e){ze.issueCommand("debug",{},e)}V.debug=Bd;function ra(e,t={}){ze.issueCommand("error",er.toCommandProperties(t),e instanceof Error?e.toString():e)}V.error=ra;function Ud(e,t={}){ze.issueCommand("warning",er.toCommandProperties(t),e instanceof Error?e.toString():e)}V.warning=Ud;function zd(e,t={}){ze.issueCommand("notice",er.toCommandProperties(t),e instanceof Error?e.toString():e)}V.notice=zd;function Dd(e){process.stdout.write(e+ea.EOL)}V.info=Dd;function na(e){ze.issue("group",e)}V.startGroup=na;function oa(){ze.issue("endgroup")}V.endGroup=oa;function Hd(e,t){return Zs(this,void 0,void 0,function*(){na(e);let r;try{r=yield t()}finally{oa()}return r})}V.group=Hd;function Fd(e,t){if(process.env.GITHUB_STATE||"")return Ot.issueFileCommand("STATE",Ot.prepareKeyValueMessage(e,t));ze.issueCommand("save-state",{name:e},er.toCommandValue(t))}V.saveState=Fd;function Wd(e){return process.env[`STATE_${e}`]||""}V.getState=Wd;function Vd(e){return Zs(this,void 0,void 0,function*(){return yield kd.OidcClient.getIDToken(e)})}V.getIDToken=Vd;var Gd=Bo();Object.defineProperty(V,"summary",{enumerable:!0,get:function(){return Gd.summary}});var Jd=Bo();Object.defineProperty(V,"markdownSummary",{enumerable:!0,get:function(){return Jd.markdownSummary}});var zo=Ys();Object.defineProperty(V,"toPosixPath",{enumerable:!0,get:function(){return zo.toPosixPath}});Object.defineProperty(V,"toWin32Path",{enumerable:!0,get:function(){return zo.toWin32Path}});Object.defineProperty(V,"toPlatformPath",{enumerable:!0,get:function(){return zo.toPlatformPath}})});var Yu=ce((qg,Qu)=>{var Kd=Object.create,Br=Object.defineProperty,Qd=Object.getOwnPropertyDescriptor,Yd=Object.getOwnPropertyNames,Dn=Object.getOwnPropertySymbols,Xd=Object.getPrototypeOf,Ti=Object.prototype.hasOwnProperty,al=Object.prototype.propertyIsEnumerable,ia=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oi=(e,t)=>{for(var r in t||={})Ti.call(t,r)&&ia(e,r,t[r]);if(Dn)for(var r of Dn(t))al.call(t,r)&&ia(e,r,t[r]);return e},Ri=(e,t)=>{var r={};for(var n in e)Ti.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dn)for(var n of Dn(e))t.indexOf(n)<0&&al.call(e,n)&&(r[n]=e[n]);return r},W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zd=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})},ll=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yd(t))!Ti.call(e,o)&&o!==r&&Br(e,o,{get:()=>t[o],enumerable:!(n=Qd(t,o))||n.enumerable});return e},me=(e,t,r)=>(r=e!=null?Kd(Xd(e)):{},ll(t||!e||!e.__esModule?Br(r,"default",{value:e,enumerable:!0}):r,e)),ef=e=>ll(Br({},"__esModule",{value:!0}),e),Vt=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(u){o(u)}},s=l=>{try{a(r.throw(l))}catch(u){o(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())}),tf=W((e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function r(o){return o.encrypted}var n=(o,i)=>{let s;typeof i=="function"?s={connect:i}:s=i;let a=typeof s.connect=="function",l=typeof s.secureConnect=="function",u=typeof s.close=="function",d=()=>{a&&s.connect(),r(o)&&l&&(o.authorized?s.secureConnect():o.authorizationError||o.once("secureConnect",s.secureConnect)),u&&o.once("close",s.close)};o.writable&&!o.connecting?d():o.connecting?o.once("connect",d):o.destroyed&&u&&s.close(o._hadError)};e.default=n,t.exports=n,t.exports.default=n}),rf=W((e,t)=>{"use strict";var{PassThrough:r}=require("stream");t.exports=n=>{n={...n};let{array:o}=n,{encoding:i}=n,s=i==="buffer",a=!1;o?a=!(i||s):i=i||"utf8",s&&(i=null);let l=new r({objectMode:a});i&&l.setEncoding(i);let u=0,d=[];return l.on("data",h=>{d.push(h),a?u=d.length:u+=h.length}),l.getBufferedValue=()=>o?d:s?Buffer.concat(d,u):d.join(""),l.getBufferedLength=()=>u,l}}),ul=W((e,t)=>{"use strict";var{constants:r}=require("buffer"),n=require("stream"),{promisify:o}=require("util"),i=rf(),s=o(n.pipeline),a=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function l(u,d){if(!u)throw new Error("Expected a stream");d={maxBuffer:1/0,...d};let{maxBuffer:h}=d,c=i(d);return await new Promise((p,m)=>{let O=g=>{g&&c.getBufferedLength()<=r.MAX_LENGTH&&(g.bufferedData=c.getBufferedValue()),m(g)};(async()=>{try{await s(u,c),p()}catch(g){O(g)}})(),c.on("data",()=>{c.getBufferedLength()>h&&O(new a)})}),c.getBufferedValue()}t.exports=l,t.exports.buffer=(u,d)=>l(u,{...d,encoding:"buffer"}),t.exports.array=(u,d)=>l(u,{...d,array:!0}),t.exports.MaxBufferError=a}),nf=W((e,t)=>{"use strict";var r=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),o=new Set([500,502,503,504]),i={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},s={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function a(h){let c=parseInt(h,10);return isFinite(c)?c:0}function l(h){return h?o.has(h.status):!0}function u(h){let c={};if(!h)return c;let p=h.trim().split(/\s*,\s*/);for(let m of p){let[O,g]=m.split(/\s*=\s*/,2);c[O]=g===void 0?!0:g.replace(/^"|"$/g,"")}return c}function d(h){let c=[];for(let p in h){let m=h[p];c.push(m===!0?p:p+"="+m)}if(c.length)return c.join(", ")}t.exports=class{constructor(h,c,{shared:p,cacheHeuristic:m,immutableMinTimeToLive:O,ignoreCargoCult:g,_fromObject:M}={}){if(M){this._fromObject(M);return}if(!c||!c.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(h),this._responseTime=this.now(),this._isShared=p!==!1,this._cacheHeuristic=m!==void 0?m:.1,this._immutableMinTtl=O!==void 0?O:24*3600*1e3,this._status="status"in c?c.status:200,this._resHeaders=c.headers,this._rescc=u(c.headers["cache-control"]),this._method="method"in h?h.method:"GET",this._url=h.url,this._host=h.headers.host,this._noAuthorization=!h.headers.authorization,this._reqHeaders=c.headers.vary?h.headers:null,this._reqcc=u(h.headers["cache-control"]),g&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":d(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),c.headers["cache-control"]==null&&/no-cache/.test(c.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&n.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(h){if(!h||!h.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(h){this._assertRequestHasHeaders(h);let c=u(h.headers["cache-control"]);return c["no-cache"]||/no-cache/.test(h.headers.pragma)||c["max-age"]&&this.age()>c["max-age"]||c["min-fresh"]&&this.timeToLive()<1e3*c["min-fresh"]||this.stale()&&!(c["max-stale"]&&!this._rescc["must-revalidate"]&&(c["max-stale"]===!0||c["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(h,!1)}_requestMatches(h,c){return(!this._url||this._url===h.url)&&this._host===h.headers.host&&(!h.method||this._method===h.method||c&&h.method==="HEAD")&&this._varyMatches(h)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(h){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let c=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let p of c)if(h.headers[p]!==this._reqHeaders[p])return!1;return!0}_copyWithoutHopByHopHeaders(h){let c={};for(let p in h)i[p]||(c[p]=h[p]);if(h.connection){let p=h.connection.trim().split(/\s*,\s*/);for(let m of p)delete c[m]}if(c.warning){let p=c.warning.split(/,/).filter(m=>!/^\s*1[0-9][0-9]/.test(m));p.length?c.warning=p.join(",").trim():delete c.warning}return c}responseHeaders(){let h=this._copyWithoutHopByHopHeaders(this._resHeaders),c=this.age();return c>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(h.warning=(h.warning?`${h.warning}, `:"")+'113 - "rfc7234 5.5.4"'),h.age=`${Math.round(c)}`,h.date=new Date(this.now()).toUTCString(),h}date(){let h=Date.parse(this._resHeaders.date);return isFinite(h)?h:this._responseTime}age(){let h=this._ageValue(),c=(this.now()-this._responseTime)/1e3;return h+c}_ageValue(){return a(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return a(this._rescc["s-maxage"])}if(this._rescc["max-age"])return a(this._rescc["max-age"]);let h=this._rescc.immutable?this._immutableMinTtl:0,c=this.date();if(this._resHeaders.expires){let p=Date.parse(this._resHeaders.expires);return Number.isNaN(p)||pp)return Math.max(h,(c-p)/1e3*this._cacheHeuristic)}return h}timeToLive(){let h=this.maxAge()-this.age(),c=h+a(this._rescc["stale-if-error"]),p=h+a(this._rescc["stale-while-revalidate"]);return Math.max(0,h,c,p)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+a(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+a(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(h){return new this(void 0,void 0,{_fromObject:h})}_fromObject(h){if(this._responseTime)throw Error("Reinitialized");if(!h||h.v!==1)throw Error("Invalid serialization");this._responseTime=h.t,this._isShared=h.sh,this._cacheHeuristic=h.ch,this._immutableMinTtl=h.imm!==void 0?h.imm:24*3600*1e3,this._status=h.st,this._resHeaders=h.resh,this._rescc=h.rescc,this._method=h.m,this._url=h.u,this._host=h.h,this._noAuthorization=h.a,this._reqHeaders=h.reqh,this._reqcc=h.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(h){this._assertRequestHasHeaders(h);let c=this._copyWithoutHopByHopHeaders(h.headers);if(delete c["if-range"],!this._requestMatches(h,!0)||!this.storable())return delete c["if-none-match"],delete c["if-modified-since"],c;if(this._resHeaders.etag&&(c["if-none-match"]=c["if-none-match"]?`${c["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),c["accept-ranges"]||c["if-match"]||c["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete c["if-modified-since"],c["if-none-match"]){let p=c["if-none-match"].split(/,/).filter(m=>!/^\s*W\//.test(m));p.length?c["if-none-match"]=p.join(",").trim():delete c["if-none-match"]}}else this._resHeaders["last-modified"]&&!c["if-modified-since"]&&(c["if-modified-since"]=this._resHeaders["last-modified"]);return c}revalidatedPolicy(h,c){if(this._assertRequestHasHeaders(h),this._useStaleIfError()&&l(c))return{modified:!1,matches:!1,policy:this};if(!c||!c.headers)throw Error("Response headers missing");let p=!1;if(c.status!==void 0&&c.status!=304?p=!1:c.headers.etag&&!/^\s*W\//.test(c.headers.etag)?p=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===c.headers.etag:this._resHeaders.etag&&c.headers.etag?p=this._resHeaders.etag.replace(/^\s*W\//,"")===c.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?p=this._resHeaders["last-modified"]===c.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!c.headers.etag&&!c.headers["last-modified"]&&(p=!0),!p)return{policy:new this.constructor(h,c),modified:c.status!=304,matches:!1};let m={};for(let g in this._resHeaders)m[g]=g in c.headers&&!s[g]?c.headers[g]:this._resHeaders[g];let O=Object.assign({},c,{status:this._status,method:this._method,headers:m});return{policy:new this.constructor(h,O,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),of=W(e=>{e.stringify=function t(r){if(typeof r>"u")return r;if(r&&Buffer.isBuffer(r))return JSON.stringify(":base64:"+r.toString("base64"));if(r&&r.toJSON&&(r=r.toJSON()),r&&typeof r=="object"){var n="",o=Array.isArray(r);n=o?"[":"{";var i=!0;for(var s in r){var a=typeof r[s]=="function"||!o&&typeof r[s]>"u";Object.hasOwnProperty.call(r,s)&&!a&&(i||(n+=","),i=!1,o?r[s]==null?n+="null":n+=t(r[s]):r[s]!==void 0&&(n+=t(s)+":"+t(r[s])))}return n+=o?"]":"}",n}else return typeof r=="string"?JSON.stringify(/^:/.test(r)?":"+r:r):typeof r>"u"?"null":JSON.stringify(r)},e.parse=function(t){return JSON.parse(t,function(r,n){return typeof n=="string"?/^:base64:/.test(n)?Buffer.from(n.substring(8),"base64"):/^:/.test(n)?n.substring(1):n:n})}}),sf=W((e,t)=>{"use strict";var r=require("events"),n=of(),o=a=>{let l={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(a.adapter||a.uri){let u=a.adapter||/^[^:+]*/.exec(a.uri)[0];return new(require(l[u]))(a)}return new Map},i=["sqlite","postgres","mysql","mongo","redis","tiered"],s=class extends r{constructor(a,{emitErrors:l=!0,...u}={}){if(super(),this.opts={namespace:"keyv",serialize:n.stringify,deserialize:n.parse,...typeof a=="string"?{uri:a}:a,...u},!this.opts.store){let h={...this.opts};this.opts.store=o(h)}if(this.opts.compression){let h=this.opts.compression,{serialize:c,deserialize:p}=h.opts;this.opts.serialize=c,this.opts.deserialize=p}typeof this.opts.store.on=="function"&&l&&this.opts.store.on("error",h=>this.emit("error",h)),this.opts.store.namespace=this.opts.namespace;let d=h=>async function*(){for await(let[c,p]of typeof h=="function"?h(this.opts.store.namespace):h){let m=this.opts.deserialize(p);if(!(this.opts.store.namespace&&!c.includes(this.opts.store.namespace))){if(typeof m.expires=="number"&&Date.now()>m.expires){this.delete(c);continue}yield[this._getKeyUnprefix(c),m.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=d(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=d(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return i.includes(this.opts.store.opts.dialect)||i.findIndex(a=>this.opts.store.opts.url.includes(a))>=0}_getKeyPrefix(a){return`${this.opts.namespace}:${a}`}_getKeyPrefixArray(a){return a.map(l=>`${this.opts.namespace}:${l}`)}_getKeyUnprefix(a){return a.split(":").splice(1).join(":")}get(a,l){let{store:u}=this.opts,d=Array.isArray(a),h=d?this._getKeyPrefixArray(a):this._getKeyPrefix(a);if(d&&u.getMany===void 0){let c=[];for(let p of h)c.push(Promise.resolve().then(()=>u.get(p)).then(m=>typeof m=="string"?this.opts.deserialize(m):m).then(m=>{if(m!=null)return typeof m.expires=="number"&&Date.now()>m.expires?this.delete(p).then(()=>{}):l&&l.raw?m:m.value}));return Promise.allSettled(c).then(p=>{let m=[];for(let O of p)m.push(O.value);return m})}return Promise.resolve().then(()=>d?u.getMany(h):u.get(h)).then(c=>typeof c=="string"?this.opts.deserialize(c):c).then(c=>{if(c!=null){if(d){let p=[];for(let m of c){if(typeof m=="string"&&(m=this.opts.deserialize(m)),m==null){p.push(void 0);continue}typeof m.expires=="number"&&Date.now()>m.expires?(this.delete(a).then(()=>{}),p.push(void 0)):p.push(l&&l.raw?m:m.value)}return p}return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(a).then(()=>{}):l&&l.raw?c:c.value}})}set(a,l,u){let d=this._getKeyPrefix(a);typeof u>"u"&&(u=this.opts.ttl),u===0&&(u=void 0);let{store:h}=this.opts;return Promise.resolve().then(()=>{let c=typeof u=="number"?Date.now()+u:null;return typeof l=="symbol"&&this.emit("error","symbol cannot be serialized"),l={value:l,expires:c},this.opts.serialize(l)}).then(c=>h.set(d,c,u)).then(()=>!0)}delete(a){let{store:l}=this.opts;if(Array.isArray(a)){let d=this._getKeyPrefixArray(a);if(l.deleteMany===void 0){let h=[];for(let c of d)h.push(l.delete(c));return Promise.allSettled(h).then(c=>c.every(p=>p.value===!0))}return Promise.resolve().then(()=>l.deleteMany(d))}let u=this._getKeyPrefix(a);return Promise.resolve().then(()=>l.delete(u))}clear(){let{store:a}=this.opts;return Promise.resolve().then(()=>a.clear())}has(a){let l=this._getKeyPrefix(a),{store:u}=this.opts;return Promise.resolve().then(async()=>typeof u.has=="function"?u.has(l):await u.get(l)!==void 0)}disconnect(){let{store:a}=this.opts;if(typeof a.disconnect=="function")return a.disconnect()}};t.exports=s}),af=W((e,t)=>{"use strict";var r=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];t.exports=(n,o)=>{if(o._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let i=new Set(Object.keys(n).concat(r)),s={};for(let a of i)a in o||(s[a]={get(){let l=n[a];return typeof l=="function"?l.bind(n):l},set(l){n[a]=l},enumerable:!0,configurable:!1});return Object.defineProperties(o,s),n.once("aborted",()=>{o.destroy(),o.emit("aborted")}),n.once("close",()=>{n.complete&&o.readable?o.once("end",()=>{o.emit("close")}):o.emit("close")}),o}}),lf=W((e,t)=>{"use strict";var{Transform:r,PassThrough:n}=require("stream"),o=require("zlib"),i=af();t.exports=s=>{let a=(s.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(a))return s;let l=a==="br";if(l&&typeof o.createBrotliDecompress!="function")return s.destroy(new Error("Brotli is not supported on Node.js < 12")),s;let u=!0,d=new r({transform(p,m,O){u=!1,O(null,p)},flush(p){p()}}),h=new n({autoDestroy:!1,destroy(p,m){s.destroy(),m(p)}}),c=l?o.createBrotliDecompress():o.createUnzip();return c.once("error",p=>{if(u&&!s.readable){h.end();return}h.destroy(p)}),i(s,h),s.pipe(d).pipe(c).pipe(h),h}}),cl=W((e,t)=>{"use strict";var r=class{constructor(n={}){if(!(n.maxSize&&n.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=n.maxSize,this.onEviction=n.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(n,o){if(this.cache.set(n,o),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[i,s]of this.oldCache.entries())this.onEviction(i,s);this.oldCache=this.cache,this.cache=new Map}}get(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n)){let o=this.oldCache.get(n);return this.oldCache.delete(n),this._set(n,o),o}}set(n,o){return this.cache.has(n)?this.cache.set(n,o):this._set(n,o),this}has(n){return this.cache.has(n)||this.oldCache.has(n)}peek(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n))return this.oldCache.get(n)}delete(n){let o=this.cache.delete(n);return o&&this._size--,this.oldCache.delete(n)||o}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[n]of this)yield n}*values(){for(let[,n]of this)yield n}*[Symbol.iterator](){for(let n of this.cache)yield n;for(let n of this.oldCache){let[o]=n;this.cache.has(o)||(yield n)}}get size(){let n=0;for(let o of this.oldCache.keys())this.cache.has(o)||n++;return Math.min(this._size+n,this.maxSize)}};t.exports=r}),hl=W((e,t)=>{"use strict";t.exports=r=>{if(r.listenerCount("error")!==0)return r;r.__destroy=r._destroy,r._destroy=(...o)=>{let i=o.pop();r.__destroy(...o,async s=>{await Promise.resolve(),i(s)})};let n=o=>{Promise.resolve().then(()=>{r.emit("error",o)})};return r.once("error",n),Promise.resolve().then(()=>{r.off("error",n)}),r}}),fr=W((e,t)=>{"use strict";var{URL:r}=require("url"),n=require("events"),o=require("tls"),i=require("http2"),s=cl(),a=hl(),l=Symbol("currentStreamCount"),u=Symbol("request"),d=Symbol("cachedOriginSet"),h=Symbol("gracefullyClosing"),c=Symbol("length"),p=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],m=(y,_,v)=>{let R=0,$=y.length;for(;R<$;){let x=R+$>>>1;v(y[x],_)?R=x+1:$=x}return R},O=(y,_)=>y.remoteSettings.maxConcurrentStreams>_.remoteSettings.maxConcurrentStreams,g=(y,_)=>{for(let v=0;v0&&R[d].length<_[d].length&&R[d].every($=>_[d].includes($))&&R[l]+_[l]<=_.remoteSettings.maxConcurrentStreams&&I(R)}},M=(y,_)=>{for(let v=0;v0&&_[d].lengthR[d].includes($))&&_[l]+R[l]<=R.remoteSettings.maxConcurrentStreams)return I(_),!0}return!1},I=y=>{y[h]=!0,y[l]===0&&y.close()},S=class extends n{constructor({timeout:y=0,maxSessions:_=Number.POSITIVE_INFINITY,maxEmptySessions:v=10,maxCachedTlsSessions:R=100}={}){super(),this.sessions={},this.queue={},this.timeout=y,this.maxSessions=_,this.maxEmptySessions=v,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new s({maxSize:R})}get protocol(){return"https:"}normalizeOptions(y){let _="";for(let v=0;v=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let y in this.queue)for(let _ in this.queue[y]){let v=this.queue[y][_];v.completed||(v.completed=!0,v())}}_isBetterSession(y,_){return y>_}_accept(y,_,v,R){let $=0;for(;$<_.length&&y[l]0&&(this.getSession(v,R,_),_.length=0)}getSession(y,_,v){return new Promise((R,$)=>{Array.isArray(v)&&v.length>0?(v=[...v],R()):v=[{resolve:R,reject:$}];try{if(typeof y=="string")y=new r(y);else if(!(y instanceof r))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(_){let{servername:j}=_,{hostname:w}=y;if(j&&w!==j)throw new Error(`Origin ${w} differs from servername ${j}`)}}catch(j){for(let w=0;w=Z||H[h]||H.destroyed||(U||(w=Z),this._isBetterSession(te,C)&&(U=H,C=te))}if(U){this._accept(U,v,q,_);return}}if(x in this.queue){if(q in this.queue[x]){this.queue[x][q].listeners.push(...v);return}}else this.queue[x]={[c]:0};let N=()=>{x in this.queue&&this.queue[x][q]===J&&(delete this.queue[x][q],--this.queue[x][c]===0&&delete this.queue[x])},J=async()=>{this._sessionCount++;let j=`${q}:${x}`,w=!1,C;try{let U={..._};U.settings===void 0&&(U.settings=this.settings),U.session===void 0&&(U.session=this.tlsSessionCache.get(j)),C=await(U.createConnection||this.createConnection).call(this,y,U),U.createConnection=()=>C;let A=i.connect(y,U);A[l]=0,A[h]=!1;let H=()=>{let{socket:Y}=A,re;return Y.servername===!1?(Y.servername=Y.remoteAddress,re=A.originSet,Y.servername=!1):re=A.originSet,re},Z=()=>A[l]{this.tlsSessionCache.set(j,Y)}),A.once("error",Y=>{for(let re=0;re{A.destroy()}),A.once("close",()=>{if(this._sessionCount--,w){this._emptySessionCount--;let Y=this.sessions[x];Y.length===1?delete this.sessions[x]:Y.splice(Y.indexOf(A),1)}else{N();let Y=new Error("Session closed without receiving a SETTINGS frame");Y.code="HTTP2WRAPPER_NOSETTINGS";for(let re=0;re{let Y=this.queue[x];if(!Y)return;let re=A[d];for(let be=0;be{A[d]=H()||[],A[h]=!1,M(this.sessions[x],A),!(A[h]||!Z())&&(te(),Z()&&g(this.sessions[x],A))}),A.once("remoteSettings",()=>{if(J.destroyed){let Y=new Error("Agent has been destroyed");for(let re=0;rethis.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),A.on("remoteSettings",()=>{!Z()||(te(),Z()&&g(this.sessions[x],A))})}),A[u]=A.request,A.request=(Y,re)=>{if(A[h])throw new Error("The session is gracefully closing. No new streams are allowed.");let be=A[u](Y,re);return A.ref(),A[l]++===0&&this._emptySessionCount--,be.once("close",()=>{if(--A[l]===0&&(this._emptySessionCount++,A.unref(),this._emptySessionCount>this.maxEmptySessions||A[h])){A.close();return}A.destroyed||A.closed||Z()&&!M(this.sessions[x],A)&&(g(this.sessions[x],A),te(),A[l]===0&&this._processQueue())}),be}}catch(U){N(),this._sessionCount--;for(let A=0;A{this.getSession(y,_,[{reject:x,resolve:q=>{try{let N=q.request(v,R);a(N),$(N)}catch(N){x(N)}}}])})}async createConnection(y,_){return S.connect(y,_)}static connect(y,_){_.ALPNProtocols=["h2"];let v=y.port||443,R=y.hostname;typeof _.servername>"u"&&(_.servername=R);let $=o.connect(v,R,_);return _.socket&&($._peername={family:void 0,address:void 0,port:v}),$}closeEmptySessions(y=Number.POSITIVE_INFINITY){let _=0,{sessions:v}=this;for(let R in v){let $=v[R];for(let x=0;x<$.length;x++){let q=$[x];if(q[l]===0&&(_++,q.close(),_>=y))return _}}return _}destroy(y){let{sessions:_,queue:v}=this;for(let R in _){let $=_[R];for(let x=0;x<$.length;x++)$[x].destroy(y)}for(let R in v){let $=v[R];for(let x in $)$[x].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};S.kCurrentStreamCount=l,S.kGracefullyClosing=h,t.exports={Agent:S,globalAgent:new S}}),dl=W((e,t)=>{"use strict";var{Readable:r}=require("stream"),n=class extends r{constructor(o,i){super({emitClose:!1,autoDestroy:!0,highWaterMark:i}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=o,this._dumped=!1}get connection(){return this.socket}set connection(o){this.socket=o}_destroy(o,i){this.readableEnded||(this.aborted=!0),i(),this.req._request.destroy(o)}setTimeout(o,i){return this.req.setTimeout(o,i),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};t.exports=n}),uf=W((e,t)=>{"use strict";t.exports=(r,n,o)=>{for(let i of o)r.on(i,(...s)=>n.emit(i,...s))}}),to=W((e,t)=>{"use strict";var r=(n,o,i)=>{t.exports[o]=class extends n{constructor(...s){super(typeof i=="string"?i:i(s)),this.name=`${super.name} [${o}]`,this.code=o}}};r(TypeError,"ERR_INVALID_ARG_TYPE",n=>{let o=n[0].includes(".")?"property":"argument",i=n[1],s=Array.isArray(i);return s&&(i=`${i.slice(0,-1).join(", ")} or ${i.slice(-1)}`),`The "${n[0]}" ${o} must be ${s?"one of":"of"} type ${i}. Received ${typeof n[2]}`}),r(TypeError,"ERR_INVALID_PROTOCOL",n=>`Protocol "${n[0]}" not supported. Expected "${n[1]}"`),r(Error,"ERR_HTTP_HEADERS_SENT",n=>`Cannot ${n[0]} headers after they are sent to the client`),r(TypeError,"ERR_INVALID_HTTP_TOKEN",n=>`${n[0]} must be a valid HTTP token [${n[1]}]`),r(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",n=>`Invalid value "${n[0]} for header "${n[1]}"`),r(TypeError,"ERR_INVALID_CHAR",n=>`Invalid character in ${n[0]} [${n[1]}]`),r(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}),cf=W((e,t)=>{"use strict";t.exports=r=>{switch(r){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),fl=W((e,t)=>{"use strict";var{ERR_INVALID_HTTP_TOKEN:r}=to(),n=cf(),o=/^[\^`\-\w!#$%&*+.|~]+$/;t.exports=i=>{if(typeof i!="string"||!o.test(i)&&!n(i))throw new r("Header name",i)}}),pl=W((e,t)=>{"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE:r,ERR_INVALID_CHAR:n}=to(),o=/[^\t\u0020-\u007E\u0080-\u00FF]/;t.exports=(i,s)=>{if(typeof s>"u")throw new r(s,i);if(o.test(s))throw new n("header content",i)}}),hf=W((e,t)=>{"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION:r}=to(),n={has(o,i){let s=o.session===void 0?o:o.session.socket;return i in o||i in s},get(o,i){switch(i){case"on":case"once":case"end":case"emit":case"destroy":return o[i].bind(o);case"writable":case"destroyed":return o[i];case"readable":return o.destroyed?!1:o.readable;case"setTimeout":{let{session:s}=o;return s!==void 0?s.setTimeout.bind(s):o.setTimeout.bind(o)}case"write":case"read":case"pause":case"resume":throw new r;default:{let s=o.session===void 0?o:o.session.socket,a=s[i];return typeof a=="function"?a.bind(s):a}}},getPrototypeOf(o){return o.session!==void 0?Reflect.getPrototypeOf(o.session.socket):Reflect.getPrototypeOf(o)},set(o,i,s){switch(i){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return o[i]=s,!0;case"setTimeout":{let{session:a}=o;return a===void 0?o.setTimeout=s:a.setTimeout=s,!0}case"write":case"read":case"pause":case"resume":throw new r;default:{let a=o.session===void 0?o:o.session.socket;return a[i]=s,!0}}}};t.exports=n}),ml=W((e,t)=>{"use strict";var{URL:r,urlToHttpOptions:n}=require("url"),o=require("http2"),{Writable:i}=require("stream"),{Agent:s,globalAgent:a}=fr(),l=dl(),u=uf(),{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_PROTOCOL:h,ERR_HTTP_HEADERS_SENT:c}=to(),p=fl(),m=pl(),O=hf(),{HTTP2_HEADER_STATUS:g,HTTP2_HEADER_METHOD:M,HTTP2_HEADER_PATH:I,HTTP2_HEADER_AUTHORITY:S,HTTP2_METHOD_CONNECT:y}=o.constants,_=Symbol("headers"),v=Symbol("origin"),R=Symbol("session"),$=Symbol("options"),x=Symbol("flushedHeaders"),q=Symbol("jobs"),N=Symbol("pendingAgentPromise"),J=class extends i{constructor(j,w,C){if(super({autoDestroy:!1,emitClose:!1}),typeof j=="string"?j=n(new r(j)):j instanceof r?j=n(j):j={...j},typeof w=="function"||w===void 0?(C=w,w=j):w=Object.assign(j,w),w.h2session){if(this[R]=w.h2session,this[R].destroyed)throw new Error("The session has been closed already");this.protocol=this[R].socket.encrypted?"https:":"http:"}else if(w.agent===!1)this.agent=new s({maxEmptySessions:0});else if(typeof w.agent>"u"||w.agent===null)this.agent=a;else if(typeof w.agent.request=="function")this.agent=w.agent;else throw new d("options.agent",["http2wrapper.Agent-like Object","undefined","false"],w.agent);if(this.agent&&(this.protocol=this.agent.protocol),w.protocol&&w.protocol!==this.protocol)throw new h(w.protocol,this.protocol);w.port||(w.port=w.defaultPort||this.agent&&this.agent.defaultPort||443),w.host=w.hostname||w.host||"localhost",delete w.hostname;let{timeout:U}=w;w.timeout=void 0,this[_]=Object.create(null),this[q]=[],this[N]=void 0,this.socket=null,this.connection=null,this.method=w.method||"GET",this.method==="CONNECT"&&(w.path==="/"||w.path===void 0)||(this.path=w.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:A}=w;if(A)for(let Z in A)this.setHeader(Z,A[Z]);w.auth&&!("authorization"in this[_])&&(this[_].authorization="Basic "+Buffer.from(w.auth).toString("base64")),w.session=w.tlsSession,w.path=w.socketPath,this[$]=w,this[v]=new r(`${this.protocol}//${w.servername||w.host}:${w.port}`);let H=w._reuseSocket;H&&(w.createConnection=(...Z)=>H.destroyed?this.agent.createConnection(...Z):H,this.agent.getSession(this[v],this[$]).catch(()=>{})),U&&this.setTimeout(U),C&&this.once("response",C),this[x]=!1}get method(){return this[_][M]}set method(j){j&&(this[_][M]=j.toUpperCase())}get path(){let j=this.method==="CONNECT"?S:I;return this[_][j]}set path(j){if(j){let w=this.method==="CONNECT"?S:I;this[_][w]=j}}get host(){return this[v].hostname}set host(j){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(j,w,C){if(this._mustNotHaveABody){C(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let U=()=>this._request.write(j,w,C);this._request?U():this[q].push(U)}_final(j){this.flushHeaders();let w=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){j();return}this._request.end(j)};this._request?w():this[q].push(w)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(j,w){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[N]}catch(C){this.aborted&&(j=C)}w(j)}async flushHeaders(){if(this[x]||this.destroyed)return;this[x]=!0;let j=this.method===y,w=C=>{if(this._request=C,this.destroyed){C.destroy();return}j||u(C,this,["timeout","continue"]),C.once("error",A=>{this.destroy(A)}),C.once("aborted",()=>{let{res:A}=this;A?(A.aborted=!0,A.emit("aborted"),A.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let U=(A,H,Z)=>{let te=new l(this.socket,C.readableHighWaterMark);this.res=te,te.url=`${this[v].origin}${this.path}`,te.req=this,te.statusCode=A[g],te.headers=A,te.rawHeaders=Z,te.once("end",()=>{te.complete=!0,te.socket=null,te.connection=null}),j?(te.upgrade=!0,this.emit("connect",te,C,Buffer.alloc(0))?this.emit("close"):C.destroy()):(C.on("data",Y=>{!te._dumped&&!te.push(Y)&&C.pause()}),C.once("end",()=>{this.aborted||te.push(null)}),this.emit("response",te)||te._dump())};C.once("response",U),C.once("headers",A=>this.emit("information",{statusCode:A[g]})),C.once("trailers",(A,H,Z)=>{let{res:te}=this;if(te===null){U(A,H,Z);return}te.trailers=A,te.rawTrailers=Z}),C.once("close",()=>{let{aborted:A,res:H}=this;if(H){A&&(H.aborted=!0,H.emit("aborted"),H.destroy());let Z=()=>{H.emit("close"),this.destroy(),this.emit("close")};H.readable?H.once("end",Z):Z();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(C,O);for(let A of this[q])A();this.emit("socket",this.socket)};if(!(S in this[_])&&!j&&(this[_][S]=this[v].host),this[R])try{w(this[R].request(this[_]))}catch(C){this.destroy(C)}else{this.reusedSocket=!0;try{let C=this.agent.request(this[v],this[$],this[_]);this[N]=C,w(await C),this[N]=!1}catch(C){this[N]=!1,this.destroy(C)}}}get connection(){return this.socket}set connection(j){this.socket=j}getHeaderNames(){return Object.keys(this[_])}hasHeader(j){if(typeof j!="string")throw new d("name","string",j);return Boolean(this[_][j.toLowerCase()])}getHeader(j){if(typeof j!="string")throw new d("name","string",j);return this[_][j.toLowerCase()]}get headersSent(){return this[x]}removeHeader(j){if(typeof j!="string")throw new d("name","string",j);if(this.headersSent)throw new c("remove");delete this[_][j.toLowerCase()]}setHeader(j,w){if(this.headersSent)throw new c("set");p(j),m(j,w);let C=j.toLowerCase();if(C==="connection"){if(w.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${w}`)}C==="host"&&this.method==="CONNECT"?this[_][S]=w:this[_][C]=w}setNoDelay(){}setSocketKeepAlive(){}setTimeout(j,w){let C=()=>this._request.setTimeout(j,w);return this._request?C():this[q].push(C),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(j){}};t.exports=J}),df=W((e,t)=>{"use strict";var r=require("tls");t.exports=(n={},o=r.connect)=>new Promise((i,s)=>{let a=!1,l,u=async()=>{await h,l.off("timeout",d),l.off("error",s),n.resolveSocket?(i({alpnProtocol:l.alpnProtocol,socket:l,timeout:a}),a&&(await Promise.resolve(),l.emit("timeout"))):(l.destroy(),i({alpnProtocol:l.alpnProtocol,timeout:a}))},d=async()=>{a=!0,u()},h=(async()=>{try{l=await o(n,u),l.on("error",s),l.once("timeout",d)}catch(c){s(c)}})()})}),ff=W((e,t)=>{"use strict";var{isIP:r}=require("net"),n=require("assert"),o=i=>{if(i[0]==="["){let a=i.indexOf("]");return n(a!==-1),i.slice(1,a)}let s=i.indexOf(":");return s===-1?i:i.slice(0,s)};t.exports=i=>{let s=o(i);return r(s)?"":s}}),pf=W((e,t)=>{"use strict";var{URL:r,urlToHttpOptions:n}=require("url"),o=require("http"),i=require("https"),s=df(),a=cl(),{Agent:l,globalAgent:u}=fr(),d=ml(),h=ff(),c=hl(),p=new a({maxSize:100}),m=new Map,O=(I,S,y)=>{S._httpMessage={shouldKeepAlive:!0};let _=()=>{I.emit("free",S,y)};S.on("free",_);let v=()=>{I.removeSocket(S,y)};S.on("close",v);let R=()=>{let{freeSockets:x}=I;for(let q of Object.values(x))if(q.includes(S)){S.destroy();return}};S.on("timeout",R);let $=()=>{I.removeSocket(S,y),S.off("close",v),S.off("free",_),S.off("timeout",R),S.off("agentRemove",$)};S.on("agentRemove",$),I.emit("free",S,y)},g=(I,S=new Map,y=void 0)=>async _=>{let v=`${_.host}:${_.port}:${_.ALPNProtocols.sort()}`;if(!I.has(v)){if(S.has(v))return{alpnProtocol:(await S.get(v)).alpnProtocol};let{path:R}=_;_.path=_.socketPath;let $=s(_,y);S.set(v,$);try{let x=await $;return I.set(v,x.alpnProtocol),S.delete(v),_.path=R,x}catch(x){throw S.delete(v),_.path=R,x}}return{alpnProtocol:I.get(v)}},M=g(p,m);t.exports=async(I,S,y)=>{if(typeof I=="string"?I=n(new r(I)):I instanceof r?I=n(I):I={...I},typeof S=="function"||S===void 0?(y=S,S=I):S=Object.assign(I,S),S.ALPNProtocols=S.ALPNProtocols||["h2","http/1.1"],!Array.isArray(S.ALPNProtocols)||S.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");S.protocol=S.protocol||"https:";let _=S.protocol==="https:";S.host=S.hostname||S.host||"localhost",S.session=S.tlsSession,S.servername=S.servername||h(S.headers&&S.headers.host||S.host),S.port=S.port||(_?443:80),S._defaultAgent=_?i.globalAgent:o.globalAgent;let v=S.resolveProtocol||M,{agent:R}=S;if(R!==void 0&&R!==!1&&R.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(_){S.resolveSocket=!0;let{socket:$,alpnProtocol:x,timeout:q}=await v(S);if(q){$&&$.destroy();let J=new Error(`Timed out resolving ALPN: ${S.timeout} ms`);throw J.code="ETIMEDOUT",J.ms=S.timeout,J}$&&S.createConnection&&($.destroy(),$=void 0),delete S.resolveSocket;let N=x==="h2";if(R&&(R=N?R.http2:R.https,S.agent=R),R===void 0&&(R=N?u:i.globalAgent),$)if(R===!1)$.destroy();else{let J=(N?l:i.Agent).prototype.createConnection;R.createConnection===J?N?S._reuseSocket=$:O(R,$,S):$.destroy()}if(N)return c(new d(S,y))}else R&&(S.agent=R.http);return c(o.request(S,y))},t.exports.protocolCache=p,t.exports.resolveProtocol=M,t.exports.createResolveProtocol=g}),yl=W((e,t)=>{"use strict";var r=require("stream"),n=require("tls"),o=new n.TLSSocket(new r.PassThrough)._handle._parentWrap.constructor;t.exports=o}),gl=W((e,t)=>{"use strict";var r=class extends Error{constructor(n){super(`The proxy server rejected the request with status code ${n}`),this.statusCode=n}};t.exports=r}),mf=W((e,t)=>{"use strict";var r=(n,o,i)=>{if(!i.some(s=>typeof s=="string"?typeof o===s:o instanceof s)){let s=i.map(a=>typeof a=="string"?a:a.name);throw new TypeError(`Expected '${n}' to be a type of ${s.join(" or ")}, got ${typeof o}`)}};t.exports=r}),bl=W((e,t)=>{"use strict";var{URL:r}=require("url"),n=mf();t.exports=(o,i)=>{n("proxyOptions",i,["object"]),n("proxyOptions.headers",i.headers,["object","undefined"]),n("proxyOptions.raw",i.raw,["boolean","undefined"]),n("proxyOptions.url",i.url,[r,"string"]);let s=new r(i.url);o.proxyOptions={raw:!0,...i,headers:{...i.headers},url:s}}}),Pi=W((e,t)=>{"use strict";t.exports=r=>{let{username:n,password:o}=r.proxyOptions.url;if(n||o){let i=`${n}:${o}`,s=`Basic ${Buffer.from(i).toString("base64")}`;return{"proxy-authorization":s,authorization:s}}return{}}}),yf=W((e,t)=>{"use strict";var r=require("tls"),n=require("http"),o=require("https"),i=yl(),{globalAgent:s}=fr(),a=gl(),l=bl(),u=Pi(),d=(p,m,O)=>{(async()=>{try{let{proxyOptions:g}=p,{url:M,headers:I,raw:S}=g,y=await s.request(M,g,{...u(p),...I,":method":"CONNECT",":authority":`${m.host}:${m.port}`});y.once("error",O),y.once("response",_=>{let v=_[":status"];if(v!==200){O(new a(v));return}let R=p instanceof o.Agent;if(S&&R){m.socket=y;let x=r.connect(m);x.once("close",()=>{y.destroy()}),O(null,x);return}let $=new i(y);$.encrypted=!1,$._handle.getpeername=x=>{x.family=void 0,x.address=void 0,x.port=void 0},O(null,$)})}catch(g){O(g)}})()},h=class extends n.Agent{constructor(p){super(p),l(this,p.proxyOptions)}createConnection(p,m){d(this,p,m)}},c=class extends o.Agent{constructor(p){super(p),l(this,p.proxyOptions)}createConnection(p,m){d(this,p,m)}};t.exports={HttpOverHttp2:h,HttpsOverHttp2:c}}),vl=W((e,t)=>{"use strict";var{Agent:r}=fr(),n=yl(),o=gl(),i=bl(),s=class extends r{constructor(a){super(a),i(this,a.proxyOptions)}async createConnection(a,l){let u=`${a.hostname}:${a.port||443}`,[d,h]=await this._getProxyStream(u);if(h!==200)throw new o(h);if(this.proxyOptions.raw)l.socket=d;else{let c=new n(d);return c.encrypted=!1,c._handle.getpeername=p=>{p.family=void 0,p.address=void 0,p.port=void 0},c}return super.createConnection(a,l)}};t.exports=s}),gf=W((e,t)=>{"use strict";var{globalAgent:r}=fr(),n=vl(),o=Pi(),i=a=>new Promise((l,u)=>{a.once("error",u),a.once("response",d=>{a.off("error",u),l(d[":status"])})}),s=class extends n{async _getProxyStream(a){let{proxyOptions:l}=this,u={...o(this),...l.headers,":method":"CONNECT",":authority":a},d=await r.request(l.url,l,u),h=await i(d);return[d,h]}};t.exports=s}),bf=W((e,t)=>{"use strict";var r=require("http"),n=require("https"),o=vl(),i=Pi(),s=l=>new Promise((u,d)=>{let h=(c,p,m)=>{p.unshift(m),l.off("error",d),u([p,c.statusCode])};l.once("error",d),l.once("connect",h)}),a=class extends o{async _getProxyStream(l){let{proxyOptions:u}=this,{url:d,headers:h}=this.proxyOptions,c=(d.protocol==="https:"?n:r).request({...u,hostname:d.hostname,port:d.port,path:l,headers:{...i(this),...h,host:l},method:"CONNECT"}).end();return s(c)}};t.exports={Http2OverHttp:a,Http2OverHttps:a}}),vf=W((e,t)=>{"use strict";var r=require("http2"),{Agent:n,globalAgent:o}=fr(),i=ml(),s=dl(),a=pf(),{HttpOverHttp2:l,HttpsOverHttp2:u}=yf(),d=gf(),{Http2OverHttp:h,Http2OverHttps:c}=bf(),p=fl(),m=pl(),O=(M,I,S)=>new i(M,I,S),g=(M,I,S)=>{let y=new i(M,I,S);return y.end(),y};t.exports={...r,ClientRequest:i,IncomingMessage:s,Agent:n,globalAgent:o,request:O,get:g,auto:a,proxies:{HttpOverHttp2:l,HttpsOverHttp2:u,Http2OverHttp2:d,Http2OverHttp:h,Http2OverHttps:c},validateHeaderName:p,validateHeaderValue:m}}),_f=W((e,t)=>{if(!globalThis.DOMException)try{let{MessageChannel:r}=require("worker_threads"),n=new r().port1,o=new ArrayBuffer;n.postMessage(o,[o,o])}catch(r){r.constructor.name==="DOMException"&&(globalThis.DOMException=r.constructor)}t.exports=globalThis.DOMException}),Ur=W((e,t)=>{var r=require("buffer"),n=r.Buffer;function o(s,a){for(var l in s)a[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=i);function i(s,a,l){return n(s,a,l)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,a,l)},i.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=n(s);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}),_l=W((e,t)=>{var r=Ur().Buffer,n=require("stream"),o=require("util");function i(s){if(this.buffer=null,this.writable=!0,this.readable=!0,!s)return this.buffer=r.alloc(0),this;if(typeof s.pipe=="function")return this.buffer=r.alloc(0),s.pipe(this),this;if(s.length||typeof s=="object")return this.buffer=s,this.writable=!1,process.nextTick(function(){this.emit("end",s),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof s+")")}o.inherits(i,n),i.prototype.write=function(s){this.buffer=r.concat([this.buffer,r.from(s)]),this.emit("data",s)},i.prototype.end=function(s){s&&this.write(s),this.emit("end",s),this.emit("close"),this.writable=!1,this.readable=!1},t.exports=i}),wf=W((e,t)=>{"use strict";var r=require("buffer").Buffer,n=require("buffer").SlowBuffer;t.exports=o;function o(a,l){if(!r.isBuffer(a)||!r.isBuffer(l)||a.length!==l.length)return!1;for(var u=0,d=0;d{"use strict";function r(i){var s=(i/8|0)+(i%8===0?0:1);return s}var n={ES256:r(256),ES384:r(384),ES512:r(521)};function o(i){var s=n[i];if(s)return s;throw new Error('Unknown algorithm "'+i+'"')}t.exports=o}),Ef=W((e,t)=>{"use strict";var r=Ur().Buffer,n=Sf(),o=128,i=0,s=32,a=16,l=2,u=a|s|i<<6,d=l|i<<6;function h(g){return g.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(g){if(r.isBuffer(g))return g;if(typeof g=="string")return r.from(g,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function p(g,M){g=c(g);var I=n(M),S=I+1,y=g.length,_=0;if(g[_++]!==u)throw new Error('Could not find expected "seq"');var v=g[_++];if(v===(o|1)&&(v=g[_++]),y-_=o;return y&&--S,S}function O(g,M){g=c(g);var I=n(M),S=g.length;if(S!==I*2)throw new TypeError('"'+M+'" signatures must be "'+I*2+'" bytes, saw "'+S+'"');var y=m(g,0,I),_=m(g,I,g.length),v=I-y,R=I-_,$=1+1+v+1+1+R,x=${var r=wf(),n=Ur().Buffer,o=require("crypto"),i=Ef(),s=require("util"),a=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,s="secret must be a string or buffer",a="key must be a string or a buffer",y="key must be a string, a buffer or an object",c=typeof i.createPublicKey=="function";c&&(a+=" or a KeyObject",s+="or a KeyObject");function g(v){if(!t.isBuffer(v)&&typeof v!="string"&&(!c||typeof v!="object"||typeof v.type!="string"||typeof v.asymmetricKeyType!="string"||typeof v.export!="function"))throw B(a)}function I(v){if(!t.isBuffer(v)&&typeof v!="string"&&typeof v!="object")throw B(y)}function w(v){if(!t.isBuffer(v)){if(typeof v=="string")return v;if(!c||typeof v!="object"||v.type!=="secret"||typeof v.export!="function")throw B(s)}}function m(v){return v.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function S(v){v=v.toString();var N=4-v.length%4;if(N!==4)for(var L=0;L{var r=require("buffer").Buffer;n.exports=function(t){return typeof t=="string"?t:typeof t=="number"||r.isBuffer(t)?t.toString():JSON.stringify(t)}}),Rv=Re((e,n)=>{var r=ka().Buffer,t=vd(),i=bd(),o=require("stream"),l=_d(),u=require("util");function s(g,I){return r.from(g,I).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function a(g,I,w){w=w||"utf8";var m=s(l(g),"binary"),S=s(l(I),w);return u.format("%s.%s",m,S)}function y(g){var I=g.header,w=g.payload,m=g.secret||g.privateKey,S=g.encoding,B=i(I.alg),A=a(I,w,S),f=B.sign(A,m);return u.format("%s.%s",A,f)}function c(g){var I=g.secret||g.privateKey||g.key,w=new t(I);this.readable=!0,this.header=g.header,this.encoding=g.encoding,this.secret=this.privateKey=this.key=w,this.payload=new t(g.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}u.inherits(c,o),c.prototype.sign=function(){try{var g=y({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",g),this.emit("data",g),this.emit("end"),this.readable=!1,g}catch(I){this.readable=!1,this.emit("error",I),this.emit("close")}},c.sign=y,n.exports=c}),Av=Re((e,n)=>{var r=ka().Buffer,t=vd(),i=bd(),o=require("stream"),l=_d(),u=require("util"),s=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function a(f){return Object.prototype.toString.call(f)==="[object Object]"}function y(f){if(a(f))return f;try{return JSON.parse(f)}catch{return}}function c(f){var b=f.split(".",1)[0];return y(r.from(b,"base64").toString("binary"))}function g(f){return f.split(".",2).join(".")}function I(f){return f.split(".")[2]}function w(f,b){b=b||"utf8";var E=f.split(".")[1];return r.from(E,"base64").toString(b)}function m(f){return s.test(f)&&!!c(f)}function S(f,b,E){if(!b){var R=new Error("Missing algorithm parameter for jws.verify");throw R.code="MISSING_ALGORITHM",R}f=l(f);var P=I(f),C=g(f),d=i(b);return d.verify(C,P,E)}function B(f,b){if(b=b||{},f=l(f),!m(f))return null;var E=c(f);if(!E)return null;var R=w(f);return(E.typ==="JWT"||b.json)&&(R=JSON.parse(R,b.encoding)),{header:E,payload:R,signature:I(f)}}function A(f){f=f||{};var b=f.secret||f.publicKey||f.key,E=new t(b);this.readable=!0,this.algorithm=f.algorithm,this.encoding=f.encoding,this.secret=this.publicKey=this.key=E,this.signature=new t(f.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}u.inherits(A,o),A.prototype.verify=function(){try{var f=S(this.signature.buffer,this.algorithm,this.key.buffer),b=B(this.signature.buffer,this.encoding);return this.emit("done",f,b),this.emit("data",f),this.emit("end"),this.readable=!1,f}catch(E){this.readable=!1,this.emit("error",E),this.emit("close")}},A.decode=B,A.isValid=m,A.verify=S,n.exports=A}),Pl=Re(e=>{var n=Rv(),r=Av(),t=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.ALGORITHMS=t,e.sign=n.sign,e.verify=r.verify,e.decode=r.decode,e.isValid=r.isValid,e.createSign=function(i){return new n(i)},e.createVerify=function(i){return new r(i)}}),wd=Re((e,n)=>{var r=Pl();n.exports=function(t,i){i=i||{};var o=r.decode(t,i);if(!o)return null;var l=o.payload;if(typeof l=="string")try{var u=JSON.parse(l);u!==null&&typeof u=="object"&&(l=u)}catch{}return i.complete===!0?{header:o.header,payload:l,signature:o.signature}:l}}),ws=Re((e,n)=>{var r=function(t,i){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,i&&(this.inner=i)};r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,n.exports=r}),Sd=Re((e,n)=>{var r=ws(),t=function(i,o){r.call(this,i),this.name="NotBeforeError",this.date=o};t.prototype=Object.create(r.prototype),t.prototype.constructor=t,n.exports=t}),Ed=Re((e,n)=>{var r=ws(),t=function(i,o){r.call(this,i),this.name="TokenExpiredError",this.expiredAt=o};t.prototype=Object.create(r.prototype),t.prototype.constructor=t,n.exports=t}),Bv=Re((e,n)=>{var r=1e3,t=r*60,i=t*60,o=i*24,l=o*7,u=o*365.25;n.exports=function(g,I){I=I||{};var w=typeof g;if(w==="string"&&g.length>0)return s(g);if(w==="number"&&isFinite(g))return I.long?y(g):a(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function s(g){if(g=String(g),!(g.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(I){var w=parseFloat(I[1]),m=(I[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return w*u;case"weeks":case"week":case"w":return w*l;case"days":case"day":case"d":return w*o;case"hours":case"hour":case"hrs":case"hr":case"h":return w*i;case"minutes":case"minute":case"mins":case"min":case"m":return w*t;case"seconds":case"second":case"secs":case"sec":case"s":return w*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function a(g){var I=Math.abs(g);return I>=o?Math.round(g/o)+"d":I>=i?Math.round(g/i)+"h":I>=t?Math.round(g/t)+"m":I>=r?Math.round(g/r)+"s":g+"ms"}function y(g){var I=Math.abs(g);return I>=o?c(g,I,o,"day"):I>=i?c(g,I,i,"hour"):I>=t?c(g,I,t,"minute"):I>=r?c(g,I,r,"second"):g+" ms"}function c(g,I,w,m){var S=I>=w*1.5;return Math.round(g/w)+" "+m+(S?"s":"")}}),Cd=Re((e,n)=>{var r=Bv();n.exports=function(t,i){var o=i||Math.floor(Date.now()/1e3);if(typeof t=="string"){var l=r(t);return typeof l>"u"?void 0:Math.floor(o+l/1e3)}else return typeof t=="number"?o+t:void 0}}),kv=Re((e,n)=>{e=n.exports=z;var r;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?r=function(){var W=Array.prototype.slice.call(arguments,0);W.unshift("SEMVER"),console.log.apply(console,W)}:r=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var t=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,l=e.re=[],u=e.src=[],s=0,a=s++;u[a]="0|[1-9]\\d*";var y=s++;u[y]="[0-9]+";var c=s++;u[c]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var g=s++;u[g]="("+u[a]+")\\.("+u[a]+")\\.("+u[a]+")";var I=s++;u[I]="("+u[y]+")\\.("+u[y]+")\\.("+u[y]+")";var w=s++;u[w]="(?:"+u[a]+"|"+u[c]+")";var m=s++;u[m]="(?:"+u[y]+"|"+u[c]+")";var S=s++;u[S]="(?:-("+u[w]+"(?:\\."+u[w]+")*))";var B=s++;u[B]="(?:-?("+u[m]+"(?:\\."+u[m]+")*))";var A=s++;u[A]="[0-9A-Za-z-]+";var f=s++;u[f]="(?:\\+("+u[A]+"(?:\\."+u[A]+")*))";var b=s++,E="v?"+u[g]+u[S]+"?"+u[f]+"?";u[b]="^"+E+"$";var R="[v=\\s]*"+u[I]+u[B]+"?"+u[f]+"?",P=s++;u[P]="^"+R+"$";var C=s++;u[C]="((?:<|>)?=?)";var d=s++;u[d]=u[y]+"|x|X|\\*";var h=s++;u[h]=u[a]+"|x|X|\\*";var U=s++;u[U]="[v=\\s]*("+u[h]+")(?:\\.("+u[h]+")(?:\\.("+u[h]+")(?:"+u[S]+")?"+u[f]+"?)?)?";var j=s++;u[j]="[v=\\s]*("+u[d]+")(?:\\.("+u[d]+")(?:\\.("+u[d]+")(?:"+u[B]+")?"+u[f]+"?)?)?";var M=s++;u[M]="^"+u[C]+"\\s*"+u[U]+"$";var v=s++;u[v]="^"+u[C]+"\\s*"+u[j]+"$";var N=s++;u[N]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var L=s++;u[L]="(?:~>?)";var O=s++;u[O]="(\\s*)"+u[L]+"\\s+",l[O]=new RegExp(u[O],"g");var K="$1~",Y=s++;u[Y]="^"+u[L]+u[U]+"$";var te=s++;u[te]="^"+u[L]+u[j]+"$";var re=s++;u[re]="(?:\\^)";var oe=s++;u[oe]="(\\s*)"+u[re]+"\\s+",l[oe]=new RegExp(u[oe],"g");var be="$1^",Ce=s++;u[Ce]="^"+u[re]+u[U]+"$";var ke=s++;u[ke]="^"+u[re]+u[j]+"$";var fe=s++;u[fe]="^"+u[C]+"\\s*("+R+")$|^$";var Pe=s++;u[Pe]="^"+u[C]+"\\s*("+E+")$|^$";var ce=s++;u[ce]="(\\s*)"+u[C]+"\\s*("+R+"|"+u[U]+")",l[ce]=new RegExp(u[ce],"g");var Ve="$1$2$3",De=s++;u[De]="^\\s*("+u[U]+")\\s+-\\s+("+u[U]+")\\s*$";var k=s++;u[k]="^\\s*("+u[j]+")\\s+-\\s+("+u[j]+")\\s*$";var $=s++;for(u[$]="(<|>)?=?\\s*\\*",V=0;Vt)return null;var ie=Z.loose?l[P]:l[b];if(!ie.test(W))return null;try{return new z(W,Z)}catch{return null}}e.valid=D;function D(W,Z){var ie=_(W,Z);return ie?ie.version:null}e.clean=G;function G(W,Z){var ie=_(W.trim().replace(/^[=v]+/,""),Z);return ie?ie.version:null}e.SemVer=z;function z(W,Z){if((!Z||typeof Z!="object")&&(Z={loose:!!Z,includePrerelease:!1}),W instanceof z){if(W.loose===Z.loose)return W;W=W.version}else if(typeof W!="string")throw new TypeError("Invalid Version: "+W);if(W.length>t)throw new TypeError("version is longer than "+t+" characters");if(!(this instanceof z))return new z(W,Z);r("SemVer",W,Z),this.options=Z,this.loose=!!Z.loose;var ie=W.trim().match(Z.loose?l[P]:l[b]);if(!ie)throw new TypeError("Invalid Version: "+W);if(this.raw=W,this.major=+ie[1],this.minor=+ie[2],this.patch=+ie[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");ie[4]?this.prerelease=ie[4].split(".").map(function(pe){if(/^[0-9]+$/.test(pe)){var ye=+pe;if(ye>=0&&ye=0;)typeof this.prerelease[ie]=="number"&&(this.prerelease[ie]++,ie=-2);ie===-1&&this.prerelease.push(0)}Z&&(this.prerelease[0]===Z?isNaN(this.prerelease[1])&&(this.prerelease=[Z,0]):this.prerelease=[Z,0]);break;default:throw new Error("invalid increment argument: "+W)}return this.format(),this.raw=this.version,this},e.inc=se;function se(W,Z,ie,pe){typeof ie=="string"&&(pe=ie,ie=void 0);try{return new z(W,ie).inc(Z,pe).version}catch{return null}}e.diff=me;function me(W,Z){if(Et(W,Z))return null;var ie=_(W),pe=_(Z),ye="";if(ie.prerelease.length||pe.prerelease.length){ye="pre";var we="prerelease"}for(var Ie in ie)if((Ie==="major"||Ie==="minor"||Ie==="patch")&&ie[Ie]!==pe[Ie])return ye+Ie;return we}e.compareIdentifiers=ae;var Te=/^[0-9]+$/;function ae(W,Z){var ie=Te.test(W),pe=Te.test(Z);return ie&&pe&&(W=+W,Z=+Z),W===Z?0:ie&&!pe?-1:pe&&!ie?1:W0}e.lt=mt;function mt(W,Z,ie){return Ke(W,Z,ie)<0}e.eq=Et;function Et(W,Z,ie){return Ke(W,Z,ie)===0}e.neq=Ct;function Ct(W,Z,ie){return Ke(W,Z,ie)!==0}e.gte=_t;function _t(W,Z,ie){return Ke(W,Z,ie)>=0}e.lte=Ut;function Ut(W,Z,ie){return Ke(W,Z,ie)<=0}e.cmp=Ft;function Ft(W,Z,ie,pe){switch(Z){case"===":return typeof W=="object"&&(W=W.version),typeof ie=="object"&&(ie=ie.version),W===ie;case"!==":return typeof W=="object"&&(W=W.version),typeof ie=="object"&&(ie=ie.version),W!==ie;case"":case"=":case"==":return Et(W,ie,pe);case"!=":return Ct(W,ie,pe);case">":return Je(W,ie,pe);case">=":return _t(W,ie,pe);case"<":return mt(W,ie,pe);case"<=":return Ut(W,ie,pe);default:throw new TypeError("Invalid operator: "+Z)}}e.Comparator=et;function et(W,Z){if((!Z||typeof Z!="object")&&(Z={loose:!!Z,includePrerelease:!1}),W instanceof et){if(W.loose===!!Z.loose)return W;W=W.value}if(!(this instanceof et))return new et(W,Z);r("comparator",W,Z),this.options=Z,this.loose=!!Z.loose,this.parse(W),this.semver===qt?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var qt={};et.prototype.parse=function(W){var Z=this.options.loose?l[fe]:l[Pe],ie=W.match(Z);if(!ie)throw new TypeError("Invalid comparator: "+W);this.operator=ie[1],this.operator==="="&&(this.operator=""),ie[2]?this.semver=new z(ie[2],this.options.loose):this.semver=qt},et.prototype.toString=function(){return this.value},et.prototype.test=function(W){return r("Comparator.test",W,this.options.loose),this.semver===qt?!0:(typeof W=="string"&&(W=new z(W,this.options)),Ft(W,this.operator,this.semver,this.options))},et.prototype.intersects=function(W,Z){if(!(W instanceof et))throw new TypeError("a Comparator is required");(!Z||typeof Z!="object")&&(Z={loose:!!Z,includePrerelease:!1});var ie;if(this.operator==="")return ie=new He(W.value,Z),vt(this.value,ie,Z);if(W.operator==="")return ie=new He(this.value,Z),vt(W.semver,ie,Z);var pe=(this.operator===">="||this.operator===">")&&(W.operator===">="||W.operator===">"),ye=(this.operator==="<="||this.operator==="<")&&(W.operator==="<="||W.operator==="<"),we=this.semver.version===W.semver.version,Ie=(this.operator===">="||this.operator==="<=")&&(W.operator===">="||W.operator==="<="),$e=Ft(this.semver,"<",W.semver,Z)&&(this.operator===">="||this.operator===">")&&(W.operator==="<="||W.operator==="<"),je=Ft(this.semver,">",W.semver,Z)&&(this.operator==="<="||this.operator==="<")&&(W.operator===">="||W.operator===">");return pe||ye||we&&Ie||$e||je},e.Range=He;function He(W,Z){if((!Z||typeof Z!="object")&&(Z={loose:!!Z,includePrerelease:!1}),W instanceof He)return W.loose===!!Z.loose&&W.includePrerelease===!!Z.includePrerelease?W:new He(W.raw,Z);if(W instanceof et)return new He(W.value,Z);if(!(this instanceof He))return new He(W,Z);if(this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease,this.raw=W,this.set=W.split(/\s*\|\|\s*/).map(function(ie){return this.parseRange(ie.trim())},this).filter(function(ie){return ie.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+W);this.format()}He.prototype.format=function(){return this.range=this.set.map(function(W){return W.join(" ").trim()}).join("||").trim(),this.range},He.prototype.toString=function(){return this.range},He.prototype.parseRange=function(W){var Z=this.options.loose;W=W.trim();var ie=Z?l[k]:l[De];W=W.replace(ie,Bt),r("hyphen replace",W),W=W.replace(l[ce],Ve),r("comparator trim",W,l[ce]),W=W.replace(l[O],K),W=W.replace(l[oe],be),W=W.split(/\s+/).join(" ");var pe=Z?l[fe]:l[Pe],ye=W.split(" ").map(function(we){return cr(we,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(ye=ye.filter(function(we){return!!we.match(pe)})),ye=ye.map(function(we){return new et(we,this.options)},this),ye},He.prototype.intersects=function(W,Z){if(!(W instanceof He))throw new TypeError("a Range is required");return this.set.some(function(ie){return ie.every(function(pe){return W.set.some(function(ye){return ye.every(function(we){return pe.intersects(we,Z)})})})})},e.toComparators=lr;function lr(W,Z){return new He(W,Z).set.map(function(ie){return ie.map(function(pe){return pe.value}).join(" ").trim().split(" ")})}function cr(W,Z){return r("comp",W,Z),W=Cr(W,Z),r("caret",W),W=Kr(W,Z),r("tildes",W),W=st(W,Z),r("xrange",W),W=ut(W,Z),r("stars",W),W}function dt(W){return!W||W.toLowerCase()==="x"||W==="*"}function Kr(W,Z){return W.trim().split(/\s+/).map(function(ie){return er(ie,Z)}).join(" ")}function er(W,Z){var ie=Z.loose?l[te]:l[Y];return W.replace(ie,function(pe,ye,we,Ie,$e){r("tilde",W,pe,ye,we,Ie,$e);var je;return dt(ye)?je="":dt(we)?je=">="+ye+".0.0 <"+(+ye+1)+".0.0":dt(Ie)?je=">="+ye+"."+we+".0 <"+ye+"."+(+we+1)+".0":$e?(r("replaceTilde pr",$e),je=">="+ye+"."+we+"."+Ie+"-"+$e+" <"+ye+"."+(+we+1)+".0"):je=">="+ye+"."+we+"."+Ie+" <"+ye+"."+(+we+1)+".0",r("tilde return",je),je})}function Cr(W,Z){return W.trim().split(/\s+/).map(function(ie){return pt(ie,Z)}).join(" ")}function pt(W,Z){r("caret",W,Z);var ie=Z.loose?l[ke]:l[Ce];return W.replace(ie,function(pe,ye,we,Ie,$e){r("caret",W,pe,ye,we,Ie,$e);var je;return dt(ye)?je="":dt(we)?je=">="+ye+".0.0 <"+(+ye+1)+".0.0":dt(Ie)?ye==="0"?je=">="+ye+"."+we+".0 <"+ye+"."+(+we+1)+".0":je=">="+ye+"."+we+".0 <"+(+ye+1)+".0.0":$e?(r("replaceCaret pr",$e),ye==="0"?we==="0"?je=">="+ye+"."+we+"."+Ie+"-"+$e+" <"+ye+"."+we+"."+(+Ie+1):je=">="+ye+"."+we+"."+Ie+"-"+$e+" <"+ye+"."+(+we+1)+".0":je=">="+ye+"."+we+"."+Ie+"-"+$e+" <"+(+ye+1)+".0.0"):(r("no pr"),ye==="0"?we==="0"?je=">="+ye+"."+we+"."+Ie+" <"+ye+"."+we+"."+(+Ie+1):je=">="+ye+"."+we+"."+Ie+" <"+ye+"."+(+we+1)+".0":je=">="+ye+"."+we+"."+Ie+" <"+(+ye+1)+".0.0"),r("caret return",je),je})}function st(W,Z){return r("replaceXRanges",W,Z),W.split(/\s+/).map(function(ie){return Tt(ie,Z)}).join(" ")}function Tt(W,Z){W=W.trim();var ie=Z.loose?l[v]:l[M];return W.replace(ie,function(pe,ye,we,Ie,$e,je){r("xRange",W,pe,ye,we,Ie,$e,je);var Wt=dt(we),ir=Wt||dt(Ie),tr=ir||dt($e),Gt=tr;return ye==="="&&Gt&&(ye=""),Wt?ye===">"||ye==="<"?pe="<0.0.0":pe="*":ye&&Gt?(ir&&(Ie=0),$e=0,ye===">"?(ye=">=",ir?(we=+we+1,Ie=0,$e=0):(Ie=+Ie+1,$e=0)):ye==="<="&&(ye="<",ir?we=+we+1:Ie=+Ie+1),pe=ye+we+"."+Ie+"."+$e):ir?pe=">="+we+".0.0 <"+(+we+1)+".0.0":tr&&(pe=">="+we+"."+Ie+".0 <"+we+"."+(+Ie+1)+".0"),r("xRange return",pe),pe})}function ut(W,Z){return r("replaceStars",W,Z),W.trim().replace(l[$],"")}function Bt(W,Z,ie,pe,ye,we,Ie,$e,je,Wt,ir,tr,Gt){return dt(ie)?Z="":dt(pe)?Z=">="+ie+".0.0":dt(ye)?Z=">="+ie+"."+pe+".0":Z=">="+Z,dt(je)?$e="":dt(Wt)?$e="<"+(+je+1)+".0.0":dt(ir)?$e="<"+je+"."+(+Wt+1)+".0":tr?$e="<="+je+"."+Wt+"."+ir+"-"+tr:$e="<="+$e,(Z+" "+$e).trim()}He.prototype.test=function(W){if(!W)return!1;typeof W=="string"&&(W=new z(W,this.options));for(var Z=0;Z0){var ye=W[pe].semver;if(ye.major===Z.major&&ye.minor===Z.minor&&ye.patch===Z.patch)return!0}return!1}return!0}e.satisfies=vt;function vt(W,Z,ie){try{Z=new He(Z,ie)}catch{return!1}return Z.test(W)}e.maxSatisfying=wt;function wt(W,Z,ie){var pe=null,ye=null;try{var we=new He(Z,ie)}catch{return null}return W.forEach(function(Ie){we.test(Ie)&&(!pe||ye.compare(Ie)===-1)&&(pe=Ie,ye=new z(pe,ie))}),pe}e.minSatisfying=kt;function kt(W,Z,ie){var pe=null,ye=null;try{var we=new He(Z,ie)}catch{return null}return W.forEach(function(Ie){we.test(Ie)&&(!pe||ye.compare(Ie)===1)&&(pe=Ie,ye=new z(pe,ie))}),pe}e.minVersion=Pt;function Pt(W,Z){W=new He(W,Z);var ie=new z("0.0.0");if(W.test(ie)||(ie=new z("0.0.0-0"),W.test(ie)))return ie;ie=null;for(var pe=0;pe":Ie.prerelease.length===0?Ie.patch++:Ie.prerelease.push(0),Ie.raw=Ie.format();case"":case">=":(!ie||Je(ie,Ie))&&(ie=Ie);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+we.operator)}})}return ie&&W.test(ie)?ie:null}e.validRange=Nt;function Nt(W,Z){try{return new He(W,Z).range||"*"}catch{return null}}e.ltr=Rt;function Rt(W,Z,ie){return At(W,Z,"<",ie)}e.gtr=Ot;function Ot(W,Z,ie){return At(W,Z,">",ie)}e.outside=At;function At(W,Z,ie,pe){W=new z(W,pe),Z=new He(Z,pe);var ye,we,Ie,$e,je;switch(ie){case">":ye=Je,we=Ut,Ie=mt,$e=">",je=">=";break;case"<":ye=mt,we=_t,Ie=Je,$e="<",je="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vt(W,Z,pe))return!1;for(var Wt=0;Wt=0.0.0")),tr=tr||hr,Gt=Gt||hr,ye(hr.semver,tr.semver,pe)?tr=hr:Ie(hr.semver,Gt.semver,pe)&&(Gt=hr)}),tr.operator===$e||tr.operator===je||(!Gt.operator||Gt.operator===$e)&&we(W,Gt.semver)||Gt.operator===je&&Ie(W,Gt.semver))return!1}return!0}e.prerelease=bt;function bt(W,Z){var ie=_(W,Z);return ie&&ie.prerelease.length?ie.prerelease:null}e.intersects=Lt;function Lt(W,Z,ie){return W=new He(W,ie),Z=new He(Z,ie),W.intersects(Z)}e.coerce=di;function di(W){if(W instanceof z)return W;if(typeof W!="string")return null;var Z=W.match(l[N]);return Z==null?null:_(Z[1]+"."+(Z[2]||"0")+"."+(Z[3]||"0"))}}),Td=Re((e,n)=>{var r=kv();n.exports=r.satisfies(process.version,"^6.12.0 || >=8.0.0")}),Pv=Re((e,n)=>{var r=ws(),t=Sd(),i=Ed(),o=wd(),l=Cd(),u=Td(),s=Pl(),a=["RS256","RS384","RS512","ES256","ES384","ES512"],y=["RS256","RS384","RS512"],c=["HS256","HS384","HS512"];u&&(a.splice(3,0,"PS256","PS384","PS512"),y.splice(3,0,"PS256","PS384","PS512")),n.exports=function(g,I,w,m){typeof w=="function"&&!m&&(m=w,w={}),w||(w={}),w=Object.assign({},w);var S;if(m?S=m:S=function(R,P){if(R)throw R;return P},w.clockTimestamp&&typeof w.clockTimestamp!="number")return S(new r("clockTimestamp must be a number"));if(w.nonce!==void 0&&(typeof w.nonce!="string"||w.nonce.trim()===""))return S(new r("nonce must be a non-empty string"));var B=w.clockTimestamp||Math.floor(Date.now()/1e3);if(!g)return S(new r("jwt must be provided"));if(typeof g!="string")return S(new r("jwt must be a string"));var A=g.split(".");if(A.length!==3)return S(new r("jwt malformed"));var f;try{f=o(g,{complete:!0})}catch(R){return S(R)}if(!f)return S(new r("invalid token"));var b=f.header,E;if(typeof I=="function"){if(!m)return S(new r("verify must be called asynchronous if secret or public key is provided as a callback"));E=I}else E=function(R,P){return P(null,I)};return E(b,function(R,P){if(R)return S(new r("error in secret or public key callback: "+R.message));var C=A[2].trim()!=="";if(!C&&P)return S(new r("jwt signature is required"));if(C&&!P)return S(new r("secret or public key must be provided"));if(!C&&!w.algorithms&&(w.algorithms=["none"]),w.algorithms||(w.algorithms=~P.toString().indexOf("BEGIN CERTIFICATE")||~P.toString().indexOf("BEGIN PUBLIC KEY")?a:~P.toString().indexOf("BEGIN RSA PUBLIC KEY")?y:c),!~w.algorithms.indexOf(f.header.alg))return S(new r("invalid algorithm"));var d;try{d=s.verify(g,f.header.alg,P)}catch(O){return S(O)}if(!d)return S(new r("invalid signature"));var h=f.payload;if(typeof h.nbf<"u"&&!w.ignoreNotBefore){if(typeof h.nbf!="number")return S(new r("invalid nbf value"));if(h.nbf>B+(w.clockTolerance||0))return S(new t("jwt not active",new Date(h.nbf*1e3)))}if(typeof h.exp<"u"&&!w.ignoreExpiration){if(typeof h.exp!="number")return S(new r("invalid exp value"));if(B>=h.exp+(w.clockTolerance||0))return S(new i("jwt expired",new Date(h.exp*1e3)))}if(w.audience){var U=Array.isArray(w.audience)?w.audience:[w.audience],j=Array.isArray(h.aud)?h.aud:[h.aud],M=j.some(function(O){return U.some(function(K){return K instanceof RegExp?K.test(O):K===O})});if(!M)return S(new r("jwt audience invalid. expected: "+U.join(" or ")))}if(w.issuer){var v=typeof w.issuer=="string"&&h.iss!==w.issuer||Array.isArray(w.issuer)&&w.issuer.indexOf(h.iss)===-1;if(v)return S(new r("jwt issuer invalid. expected: "+w.issuer))}if(w.subject&&h.sub!==w.subject)return S(new r("jwt subject invalid. expected: "+w.subject));if(w.jwtid&&h.jti!==w.jwtid)return S(new r("jwt jwtid invalid. expected: "+w.jwtid));if(w.nonce&&h.nonce!==w.nonce)return S(new r("jwt nonce invalid. expected: "+w.nonce));if(w.maxAge){if(typeof h.iat!="number")return S(new r("iat required when maxAge is specified"));var N=l(w.maxAge,h.iat);if(typeof N>"u")return S(new r('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(B>=N+(w.clockTolerance||0))return S(new i("maxAge exceeded",new Date(N*1e3)))}if(w.complete===!0){var L=f.signature;return S(null,{header:b,payload:h,signature:L})}return S(null,h)})}}),Nv=Re((e,n)=>{var r=1/0,t=9007199254740991,i=17976931348623157e292,o=0/0,l="[object Arguments]",u="[object Function]",s="[object GeneratorFunction]",a="[object String]",y="[object Symbol]",c=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,w=/^0o[0-7]+$/i,m=/^(?:0|[1-9]\d*)$/,S=parseInt;function B(_,D){for(var G=-1,z=_?_.length:0,se=Array(z);++G-1&&_%1==0&&_-1:!!se&&f(_,D,G)>-1}function Y(_){return oe(_)&&d.call(_,"callee")&&(!U.call(_,"callee")||h.call(_)==l)}var te=Array.isArray;function re(_){return _!=null&&Ce(_.length)&&!be(_)}function oe(_){return fe(_)&&re(_)}function be(_){var D=ke(_)?h.call(_):"";return D==u||D==s}function Ce(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=t}function ke(_){var D=typeof _;return!!_&&(D=="object"||D=="function")}function fe(_){return!!_&&typeof _=="object"}function Pe(_){return typeof _=="string"||!te(_)&&fe(_)&&h.call(_)==a}function ce(_){return typeof _=="symbol"||fe(_)&&h.call(_)==y}function Ve(_){if(!_)return _===0?_:0;if(_=k(_),_===r||_===-r){var D=_<0?-1:1;return D*i}return _===_?_:0}function De(_){var D=Ve(_),G=D%1;return D===D?G?D-G:D:0}function k(_){if(typeof _=="number")return _;if(ce(_))return o;if(ke(_)){var D=typeof _.valueOf=="function"?_.valueOf():_;_=ke(D)?D+"":D}if(typeof _!="string")return _===0?_:+_;_=_.replace(c,"");var G=I.test(_);return G||w.test(_)?S(_.slice(2),G?2:8):g.test(_)?o:+_}function $(_){return re(_)?v(_):N(_)}function V(_){return _?R(_,$(_)):[]}n.exports=K}),Ov=Re((e,n)=>{var r="[object Boolean]",t=Object.prototype,i=t.toString;function o(u){return u===!0||u===!1||l(u)&&i.call(u)==r}function l(u){return!!u&&typeof u=="object"}n.exports=o}),Lv=Re((e,n)=>{var r=1/0,t=17976931348623157e292,i=0/0,o="[object Symbol]",l=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,y=parseInt,c=Object.prototype,g=c.toString;function I(b){return typeof b=="number"&&b==A(b)}function w(b){var E=typeof b;return!!b&&(E=="object"||E=="function")}function m(b){return!!b&&typeof b=="object"}function S(b){return typeof b=="symbol"||m(b)&&g.call(b)==o}function B(b){if(!b)return b===0?b:0;if(b=f(b),b===r||b===-r){var E=b<0?-1:1;return E*t}return b===b?b:0}function A(b){var E=B(b),R=E%1;return E===E?R?E-R:E:0}function f(b){if(typeof b=="number")return b;if(S(b))return i;if(w(b)){var E=typeof b.valueOf=="function"?b.valueOf():b;b=w(E)?E+"":E}if(typeof b!="string")return b===0?b:+b;b=b.replace(l,"");var R=s.test(b);return R||a.test(b)?y(b.slice(2),R?2:8):u.test(b)?i:+b}n.exports=I}),Uv=Re((e,n)=>{var r="[object Number]",t=Object.prototype,i=t.toString;function o(u){return!!u&&typeof u=="object"}function l(u){return typeof u=="number"||o(u)&&i.call(u)==r}n.exports=l}),Dv=Re((e,n)=>{var r="[object Object]";function t(w){var m=!1;if(w!=null&&typeof w.toString!="function")try{m=!!(w+"")}catch{}return m}function i(w,m){return function(S){return w(m(S))}}var o=Function.prototype,l=Object.prototype,u=o.toString,s=l.hasOwnProperty,a=u.call(Object),y=l.toString,c=i(Object.getPrototypeOf,Object);function g(w){return!!w&&typeof w=="object"}function I(w){if(!g(w)||y.call(w)!=r||t(w))return!1;var m=c(w);if(m===null)return!0;var S=s.call(m,"constructor")&&m.constructor;return typeof S=="function"&&S instanceof S&&u.call(S)==a}n.exports=I}),xv=Re((e,n)=>{var r="[object String]",t=Object.prototype,i=t.toString,o=Array.isArray;function l(s){return!!s&&typeof s=="object"}function u(s){return typeof s=="string"||!o(s)&&l(s)&&i.call(s)==r}n.exports=u}),qv=Re((e,n)=>{var r="Expected a function",t=1/0,i=17976931348623157e292,o=0/0,l="[object Symbol]",u=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,y=/^0o[0-7]+$/i,c=parseInt,g=Object.prototype,I=g.toString;function w(R,P){var C;if(typeof P!="function")throw new TypeError(r);return R=b(R),function(){return--R>0&&(C=P.apply(this,arguments)),R<=1&&(P=void 0),C}}function m(R){return w(2,R)}function S(R){var P=typeof R;return!!R&&(P=="object"||P=="function")}function B(R){return!!R&&typeof R=="object"}function A(R){return typeof R=="symbol"||B(R)&&I.call(R)==l}function f(R){if(!R)return R===0?R:0;if(R=E(R),R===t||R===-t){var P=R<0?-1:1;return P*i}return R===R?R:0}function b(R){var P=f(R),C=P%1;return P===P?C?P-C:P:0}function E(R){if(typeof R=="number")return R;if(A(R))return o;if(S(R)){var P=typeof R.valueOf=="function"?R.valueOf():R;R=S(P)?P+"":P}if(typeof R!="string")return R===0?R:+R;R=R.replace(u,"");var C=a.test(R);return C||y.test(R)?c(R.slice(2),C?2:8):s.test(R)?o:+R}n.exports=m}),jv=Re((e,n)=>{var r=Cd(),t=Td(),i=Pl(),o=Nv(),l=Ov(),u=Lv(),s=Uv(),a=Dv(),y=xv(),c=qv(),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];t&&g.splice(3,0,"PS256","PS384","PS512");var I={expiresIn:{isValid:function(b){return u(b)||y(b)&&b},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(b){return u(b)||y(b)&&b},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(b){return y(b)||Array.isArray(b)},message:'"audience" must be a string or array'},algorithm:{isValid:o.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:a,message:'"header" must be an object'},encoding:{isValid:y,message:'"encoding" must be a string'},issuer:{isValid:y,message:'"issuer" must be a string'},subject:{isValid:y,message:'"subject" must be a string'},jwtid:{isValid:y,message:'"jwtid" must be a string'},noTimestamp:{isValid:l,message:'"noTimestamp" must be a boolean'},keyid:{isValid:y,message:'"keyid" must be a string'},mutatePayload:{isValid:l,message:'"mutatePayload" must be a boolean'}},w={iat:{isValid:s,message:'"iat" should be a number of seconds'},exp:{isValid:s,message:'"exp" should be a number of seconds'},nbf:{isValid:s,message:'"nbf" should be a number of seconds'}};function m(b,E,R,P){if(!a(R))throw new Error('Expected "'+P+'" to be a plain object.');Object.keys(R).forEach(function(C){var d=b[C];if(!d){if(!E)throw new Error('"'+C+'" is not allowed in "'+P+'"');return}if(!d.isValid(R[C]))throw new Error(d.message)})}function S(b){return m(I,!1,b,"options")}function B(b){return m(w,!0,b,"payload")}var A={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},f=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];n.exports=function(b,E,R,P){typeof R=="function"?(P=R,R={}):R=R||{};var C=typeof b=="object"&&!Buffer.isBuffer(b),d=Object.assign({alg:R.algorithm||"HS256",typ:C?"JWT":void 0,kid:R.keyid},R.header);function h(v){if(P)return P(v);throw v}if(!E&&R.algorithm!=="none")return h(new Error("secretOrPrivateKey must have a value"));if(typeof b>"u")return h(new Error("payload is required"));if(C){try{B(b)}catch(v){return h(v)}R.mutatePayload||(b=Object.assign({},b))}else{var U=f.filter(function(v){return typeof R[v]<"u"});if(U.length>0)return h(new Error("invalid "+U.join(",")+" option for "+typeof b+" payload"))}if(typeof b.exp<"u"&&typeof R.expiresIn<"u")return h(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof b.nbf<"u"&&typeof R.notBefore<"u")return h(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{S(R)}catch(v){return h(v)}var j=b.iat||Math.floor(Date.now()/1e3);if(R.noTimestamp?delete b.iat:C&&(b.iat=j),typeof R.notBefore<"u"){try{b.nbf=r(R.notBefore,j)}catch(v){return h(v)}if(typeof b.nbf>"u")return h(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof R.expiresIn<"u"&&typeof b=="object"){try{b.exp=r(R.expiresIn,j)}catch(v){return h(v)}if(typeof b.exp>"u")return h(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(A).forEach(function(v){var N=A[v];if(typeof R[v]<"u"){if(typeof b[N]<"u")return h(new Error('Bad "options.'+v+'" option. The payload already has an "'+N+'" property.'));b[N]=R[v]}});var M=R.encoding||"utf8";if(typeof P=="function")P=P&&c(P),i.createSign({header:d,privateKey:E,payload:b,encoding:M}).once("error",P).once("done",function(v){P(null,v)});else return i.sign({header:d,payload:b,secret:E,encoding:M})}}),Mv=Re((e,n)=>{n.exports={decode:wd(),verify:Pv(),sign:jv(),JsonWebTokenError:ws(),NotBeforeError:Sd(),TokenExpiredError:Ed()}}),Id={};nv(Id,{BrowserName:()=>Rd,marketNameMap:()=>Ad,submitChrome:()=>r2,submitEdge:()=>l2,submitFirefox:()=>J2,submitItero:()=>zw,submitOpera:()=>Gw,supportedBrowserSet:()=>Vv});Ay.exports=iv(Id);var Rd=(e=>(e.Chrome="chrome",e.Firefox="firefox",e.Opera="opera",e.Edge="edge",e.Itero="itero",e))(Rd||{}),Vv=new Set(["chrome","edge","firefox","itero"]),Ad={chrome:"Chrome Web Store",edge:"Edge Add-ons",firefox:"Firefox Add-ons",itero:"Itero TestBed"},Fv=require("fs"),Bd=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Kv(e){return Bd.includes(e)}var $v=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Bd];function Hv(e){return $v.includes(e)}var zv=["null","undefined","string","number","bigint","boolean","symbol"];function Wv(e){return zv.includes(e)}function Wi(e){return n=>typeof n===e}var{toString:Gv}=Object.prototype,Pa=e=>{let n=Gv.call(e).slice(8,-1);if(/HTML\w+Element/.test(n)&&Q.domElement(e))return"HTMLElement";if(Hv(n))return n},ct=e=>n=>Pa(n)===e;function Q(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(Q.observable(e))return"Observable";if(Q.array(e))return"Array";if(Q.buffer(e))return"Buffer";let n=Pa(e);if(n)return n;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}Q.undefined=Wi("undefined");Q.string=Wi("string");var Qv=Wi("number");Q.number=e=>Qv(e)&&!Q.nan(e);Q.bigint=Wi("bigint");Q.function_=Wi("function");Q.null_=e=>e===null;Q.class_=e=>Q.function_(e)&&e.toString().startsWith("class ");Q.boolean=e=>e===!0||e===!1;Q.symbol=Wi("symbol");Q.numericString=e=>Q.string(e)&&!Q.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));Q.array=(e,n)=>Array.isArray(e)?Q.function_(n)?e.every(r=>n(r)):!0:!1;Q.buffer=e=>e?.constructor?.isBuffer?.(e)??!1;Q.blob=e=>ct("Blob")(e);Q.nullOrUndefined=e=>Q.null_(e)||Q.undefined(e);Q.object=e=>!Q.null_(e)&&(typeof e=="object"||Q.function_(e));Q.iterable=e=>Q.function_(e?.[Symbol.iterator]);Q.asyncIterable=e=>Q.function_(e?.[Symbol.asyncIterator]);Q.generator=e=>Q.iterable(e)&&Q.function_(e?.next)&&Q.function_(e?.throw);Q.asyncGenerator=e=>Q.asyncIterable(e)&&Q.function_(e.next)&&Q.function_(e.throw);Q.nativePromise=e=>ct("Promise")(e);var Xv=e=>Q.function_(e?.then)&&Q.function_(e?.catch);Q.promise=e=>Q.nativePromise(e)||Xv(e);Q.generatorFunction=ct("GeneratorFunction");Q.asyncGeneratorFunction=e=>Pa(e)==="AsyncGeneratorFunction";Q.asyncFunction=e=>Pa(e)==="AsyncFunction";Q.boundFunction=e=>Q.function_(e)&&!e.hasOwnProperty("prototype");Q.regExp=ct("RegExp");Q.date=ct("Date");Q.error=ct("Error");Q.map=e=>ct("Map")(e);Q.set=e=>ct("Set")(e);Q.weakMap=e=>ct("WeakMap")(e);Q.weakSet=e=>ct("WeakSet")(e);Q.weakRef=e=>ct("WeakRef")(e);Q.int8Array=ct("Int8Array");Q.uint8Array=ct("Uint8Array");Q.uint8ClampedArray=ct("Uint8ClampedArray");Q.int16Array=ct("Int16Array");Q.uint16Array=ct("Uint16Array");Q.int32Array=ct("Int32Array");Q.uint32Array=ct("Uint32Array");Q.float32Array=ct("Float32Array");Q.float64Array=ct("Float64Array");Q.bigInt64Array=ct("BigInt64Array");Q.bigUint64Array=ct("BigUint64Array");Q.arrayBuffer=ct("ArrayBuffer");Q.sharedArrayBuffer=ct("SharedArrayBuffer");Q.dataView=ct("DataView");Q.enumCase=(e,n)=>Object.values(n).includes(e);Q.directInstanceOf=(e,n)=>Object.getPrototypeOf(e)===n.prototype;Q.urlInstance=e=>ct("URL")(e);Q.urlString=e=>{if(!Q.string(e))return!1;try{return new URL(e),!0}catch{return!1}};Q.truthy=e=>Boolean(e);Q.falsy=e=>!e;Q.nan=e=>Number.isNaN(e);Q.primitive=e=>Q.null_(e)||Wv(typeof e);Q.integer=e=>Number.isInteger(e);Q.safeInteger=e=>Number.isSafeInteger(e);Q.plainObject=e=>{if(typeof e!="object"||e===null)return!1;let n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};Q.typedArray=e=>Kv(Pa(e));var Yv=e=>Q.safeInteger(e)&&e>=0;Q.arrayLike=e=>!Q.nullOrUndefined(e)&&!Q.function_(e)&&Yv(e.length);Q.inRange=(e,n)=>{if(Q.number(n))return e>=Math.min(0,n)&&e<=Math.max(n,0);if(Q.array(n)&&n.length===2)return e>=Math.min(...n)&&e<=Math.max(...n);throw new TypeError(`Invalid range: ${JSON.stringify(n)}`)};var Zv=1,Jv=["innerHTML","ownerDocument","style","attributes","nodeValue"];Q.domElement=e=>Q.object(e)&&e.nodeType===Zv&&Q.string(e.nodeName)&&!Q.plainObject(e)&&Jv.every(n=>n in e);Q.observable=e=>e?e===e[Symbol.observable]?.()||e===e["@@observable"]?.():!1;Q.nodeStream=e=>Q.object(e)&&Q.function_(e.pipe)&&!Q.observable(e);Q.infinite=e=>e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY;var kd=e=>n=>Q.integer(n)&&Math.abs(n%2)===e;Q.evenInteger=kd(0);Q.oddInteger=kd(1);Q.emptyArray=e=>Q.array(e)&&e.length===0;Q.nonEmptyArray=e=>Q.array(e)&&e.length>0;Q.emptyString=e=>Q.string(e)&&e.length===0;var e1=e=>Q.string(e)&&!/\S/.test(e);Q.emptyStringOrWhitespace=e=>Q.emptyString(e)||e1(e);Q.nonEmptyString=e=>Q.string(e)&&e.length>0;Q.nonEmptyStringAndNotWhitespace=e=>Q.string(e)&&!Q.emptyStringOrWhitespace(e);Q.emptyObject=e=>Q.object(e)&&!Q.map(e)&&!Q.set(e)&&Object.keys(e).length===0;Q.nonEmptyObject=e=>Q.object(e)&&!Q.map(e)&&!Q.set(e)&&Object.keys(e).length>0;Q.emptySet=e=>Q.set(e)&&e.size===0;Q.nonEmptySet=e=>Q.set(e)&&e.size>0;Q.emptyMap=e=>Q.map(e)&&e.size===0;Q.nonEmptyMap=e=>Q.map(e)&&e.size>0;Q.propertyKey=e=>Q.any([Q.string,Q.number,Q.symbol],e);Q.formData=e=>ct("FormData")(e);Q.urlSearchParams=e=>ct("URLSearchParams")(e);var Pd=(e,n,r)=>{if(!Q.function_(n))throw new TypeError(`Invalid predicate: ${JSON.stringify(n)}`);if(r.length===0)throw new TypeError("Invalid number of values");return e.call(r,n)};Q.any=(e,...n)=>(Q.array(e)?e:[e]).some(r=>Pd(Array.prototype.some,r,n));Q.all=(e,...n)=>Pd(Array.prototype.every,e,n);var ve=(e,n,r,t={})=>{if(!e){let{multipleValues:i}=t,o=i?`received values of types ${[...new Set(r.map(l=>`\`${Q(l)}\``))].join(", ")}`:`received value of type \`${Q(r)}\``;throw new TypeError(`Expected value which is \`${n}\`, ${o}.`)}},de={undefined:e=>ve(Q.undefined(e),"undefined",e),string:e=>ve(Q.string(e),"string",e),number:e=>ve(Q.number(e),"number",e),bigint:e=>ve(Q.bigint(e),"bigint",e),function_:e=>ve(Q.function_(e),"Function",e),null_:e=>ve(Q.null_(e),"null",e),class_:e=>ve(Q.class_(e),"Class",e),boolean:e=>ve(Q.boolean(e),"boolean",e),symbol:e=>ve(Q.symbol(e),"symbol",e),numericString:e=>ve(Q.numericString(e),"string with a number",e),array:(e,n)=>{ve(Q.array(e),"Array",e),n&&e.forEach(n)},buffer:e=>ve(Q.buffer(e),"Buffer",e),blob:e=>ve(Q.blob(e),"Blob",e),nullOrUndefined:e=>ve(Q.nullOrUndefined(e),"null or undefined",e),object:e=>ve(Q.object(e),"Object",e),iterable:e=>ve(Q.iterable(e),"Iterable",e),asyncIterable:e=>ve(Q.asyncIterable(e),"AsyncIterable",e),generator:e=>ve(Q.generator(e),"Generator",e),asyncGenerator:e=>ve(Q.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>ve(Q.nativePromise(e),"native Promise",e),promise:e=>ve(Q.promise(e),"Promise",e),generatorFunction:e=>ve(Q.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>ve(Q.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>ve(Q.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>ve(Q.boundFunction(e),"Function",e),regExp:e=>ve(Q.regExp(e),"RegExp",e),date:e=>ve(Q.date(e),"Date",e),error:e=>ve(Q.error(e),"Error",e),map:e=>ve(Q.map(e),"Map",e),set:e=>ve(Q.set(e),"Set",e),weakMap:e=>ve(Q.weakMap(e),"WeakMap",e),weakSet:e=>ve(Q.weakSet(e),"WeakSet",e),weakRef:e=>ve(Q.weakRef(e),"WeakRef",e),int8Array:e=>ve(Q.int8Array(e),"Int8Array",e),uint8Array:e=>ve(Q.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>ve(Q.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>ve(Q.int16Array(e),"Int16Array",e),uint16Array:e=>ve(Q.uint16Array(e),"Uint16Array",e),int32Array:e=>ve(Q.int32Array(e),"Int32Array",e),uint32Array:e=>ve(Q.uint32Array(e),"Uint32Array",e),float32Array:e=>ve(Q.float32Array(e),"Float32Array",e),float64Array:e=>ve(Q.float64Array(e),"Float64Array",e),bigInt64Array:e=>ve(Q.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>ve(Q.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>ve(Q.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>ve(Q.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>ve(Q.dataView(e),"DataView",e),enumCase:(e,n)=>ve(Q.enumCase(e,n),"EnumCase",e),urlInstance:e=>ve(Q.urlInstance(e),"URL",e),urlString:e=>ve(Q.urlString(e),"string with a URL",e),truthy:e=>ve(Q.truthy(e),"truthy",e),falsy:e=>ve(Q.falsy(e),"falsy",e),nan:e=>ve(Q.nan(e),"NaN",e),primitive:e=>ve(Q.primitive(e),"primitive",e),integer:e=>ve(Q.integer(e),"integer",e),safeInteger:e=>ve(Q.safeInteger(e),"integer",e),plainObject:e=>ve(Q.plainObject(e),"plain object",e),typedArray:e=>ve(Q.typedArray(e),"TypedArray",e),arrayLike:e=>ve(Q.arrayLike(e),"array-like",e),domElement:e=>ve(Q.domElement(e),"HTMLElement",e),observable:e=>ve(Q.observable(e),"Observable",e),nodeStream:e=>ve(Q.nodeStream(e),"Node.js Stream",e),infinite:e=>ve(Q.infinite(e),"infinite number",e),emptyArray:e=>ve(Q.emptyArray(e),"empty array",e),nonEmptyArray:e=>ve(Q.nonEmptyArray(e),"non-empty array",e),emptyString:e=>ve(Q.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>ve(Q.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>ve(Q.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>ve(Q.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>ve(Q.emptyObject(e),"empty object",e),nonEmptyObject:e=>ve(Q.nonEmptyObject(e),"non-empty object",e),emptySet:e=>ve(Q.emptySet(e),"empty set",e),nonEmptySet:e=>ve(Q.nonEmptySet(e),"non-empty set",e),emptyMap:e=>ve(Q.emptyMap(e),"empty map",e),nonEmptyMap:e=>ve(Q.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>ve(Q.propertyKey(e),"PropertyKey",e),formData:e=>ve(Q.formData(e),"FormData",e),urlSearchParams:e=>ve(Q.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>ve(Q.evenInteger(e),"even integer",e),oddInteger:e=>ve(Q.oddInteger(e),"odd integer",e),directInstanceOf:(e,n)=>ve(Q.directInstanceOf(e,n),"T",e),inRange:(e,n)=>ve(Q.inRange(e,n),"in range",e),any:(e,...n)=>ve(Q.any(e,...n),"predicate returns truthy for any value",n,{multipleValues:!0}),all:(e,...n)=>ve(Q.all(e,...n),"predicate returns truthy for all values",n,{multipleValues:!0})};Object.defineProperties(Q,{class:{value:Q.class_},function:{value:Q.function_},null:{value:Q.null_}});Object.defineProperties(de,{class:{value:de.class_},function:{value:de.function_},null:{value:de.null_}});var J=Q,t1=require("node:events"),r1=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Nl=class{static fn(e){return(...n)=>new Nl((r,t,i)=>{n.push(i),e(...n).then(r,t)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((n,r)=>{this._reject=r;let t=l=>{(!this._isCanceled||!o.shouldReject)&&(this._isPending=!1,n(l))},i=l=>{this._isPending=!1,r(l)},o=l=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(l)};Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:l=>{this._rejectOnCancel=l}}}),e(t,i,o)})}then(e,n){return this._promise.then(e,n)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let n of this._cancelHandlers)n()}catch(n){this._reject(n);return}this._rejectOnCancel&&this._reject(new r1(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Nl.prototype,Promise.prototype);function n1(e){return J.object(e)&&"_onResponse"in e}var $t=class extends Error{constructor(e,n,r){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=n.code??"ERR_GOT_REQUEST_ERROR",this.input=n.input,n1(r)?(Object.defineProperty(this,"request",{enumerable:!1,value:r}),Object.defineProperty(this,"response",{enumerable:!1,value:r.response}),this.options=r.options):this.options=r,this.timings=this.request?.timings,J.string(n.stack)&&J.string(this.stack)){let t=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(t).split(` -`).reverse(),o=n.stack.slice(n.stack.indexOf(n.message)+n.message.length).split(` -`).reverse();for(;o.length>0&&o[0]===i[0];)i.shift();this.stack=`${this.stack.slice(0,t)}${i.reverse().join(` -`)}${o.reverse().join(` -`)}`}}},i1=class extends $t{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},os=class extends $t{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},a1=class extends $t{constructor(e,n){super(e.message,e,n),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},Wh=class extends $t{constructor(e,n){super(e.message,e,n),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},o1=class extends $t{constructor(e,n,r){super(e.message,e,r),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=n}},Gh=class extends $t{constructor(e,n){super(e.message,e,n),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},s1=class extends $t{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},Qh=class extends $t{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},Nd=Vt(require("node:process"),1),Cu=require("node:buffer"),u1=require("node:stream"),Xh=require("node:url"),Tu=Vt(require("node:http"),1),l1=require("events"),c1=require("util"),h1=Vt(av(),1),f1=e=>{if(e.timings)return e.timings;let n={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};e.timings=n;let r=l=>{l.once(l1.errorMonitor,()=>{n.error=Date.now(),n.phases.total=n.error-n.start})};r(e);let t=()=>{n.abort=Date.now(),n.phases.total=n.abort-n.start};e.prependOnceListener("abort",t);let i=l=>{if(n.socket=Date.now(),n.phases.wait=n.socket-n.start,c1.types.isProxy(l))return;let u=()=>{n.lookup=Date.now(),n.phases.dns=n.lookup-n.socket};l.prependOnceListener("lookup",u),(0,h1.default)(l,{connect:()=>{n.connect=Date.now(),n.lookup===void 0&&(l.removeListener("lookup",u),n.lookup=n.connect,n.phases.dns=n.lookup-n.socket),n.phases.tcp=n.connect-n.lookup},secureConnect:()=>{n.secureConnect=Date.now(),n.phases.tls=n.secureConnect-n.connect}})};e.socket?i(e.socket):e.prependOnceListener("socket",i);let o=()=>{n.upload=Date.now(),n.phases.request=n.upload-(n.secureConnect??n.connect)};return e.writableFinished?o():e.prependOnceListener("finish",o),e.prependOnceListener("response",l=>{n.response=Date.now(),n.phases.firstByte=n.response-n.upload,l.timings=n,r(l),l.prependOnceListener("end",()=>{e.off("abort",t),l.off("aborted",t),!n.phases.total&&(n.end=Date.now(),n.phases.download=n.end-n.response,n.phases.total=n.end-n.start)}),l.prependOnceListener("aborted",t)}),n},d1=f1,p1=Vt(require("node:events"),1),Bo=Vt(require("node:url"),1),y1=Vt(require("node:crypto"),1),Od=Vt(require("node:stream"),1),g1="text/plain",m1="us-ascii",Iu=(e,n)=>n.some(r=>r instanceof RegExp?r.test(e):r===e),v1=(e,{stripHash:n})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!r)throw new Error(`Invalid URL: ${e}`);let{type:t,data:i,hash:o}=r.groups,l=t.split(";");o=n?"":o;let u=!1;l[l.length-1]==="base64"&&(l.pop(),u=!0);let s=(l.shift()||"").toLowerCase(),a=[...l.map(y=>{let[c,g=""]=y.split("=").map(I=>I.trim());return c==="charset"&&(g=g.toLowerCase(),g===m1)?"":`${c}${g?`=${g}`:""}`}).filter(Boolean)];return u&&a.push("base64"),(a.length>0||s&&s!==g1)&&a.unshift(s),`data:${a.join(";")},${u?i.trim():i}${o?`#${o}`:""}`};function b1(e,n){if(n={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...n},e=e.trim(),/^data:/i.test(e))return v1(e,n);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=e.startsWith("//");!r&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,n.defaultProtocol));let t=new URL(e);if(n.forceHttp&&n.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(n.forceHttp&&t.protocol==="https:"&&(t.protocol="http:"),n.forceHttps&&t.protocol==="http:"&&(t.protocol="https:"),n.stripAuthentication&&(t.username="",t.password=""),n.stripHash?t.hash="":n.stripTextFragment&&(t.hash=t.hash.replace(/#?:~:text.*?$/i,"")),t.pathname){let o=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let s=o.exec(t.pathname);if(!s)break;let a=s[0],y=s.index;u+=t.pathname.slice(l,y).replace(/\/{2,}/g,"/"),u+=a,l=y+a.length}u+=t.pathname.slice(l,t.pathname.length).replace(/\/{2,}/g,"/"),t.pathname=u}if(t.pathname)try{t.pathname=decodeURI(t.pathname)}catch{}if(n.removeDirectoryIndex===!0&&(n.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(n.removeDirectoryIndex)&&n.removeDirectoryIndex.length>0){let o=t.pathname.split("/"),l=o[o.length-1];Iu(l,n.removeDirectoryIndex)&&(o=o.slice(0,-1),t.pathname=o.slice(1).join("/")+"/")}if(t.hostname&&(t.hostname=t.hostname.replace(/\.$/,""),n.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(t.hostname)&&(t.hostname=t.hostname.replace(/^www\./,""))),Array.isArray(n.removeQueryParameters))for(let o of[...t.searchParams.keys()])Iu(o,n.removeQueryParameters)&&t.searchParams.delete(o);if(!Array.isArray(n.keepQueryParameters)&&n.removeQueryParameters===!0&&(t.search=""),Array.isArray(n.keepQueryParameters)&&n.keepQueryParameters.length>0)for(let o of[...t.searchParams.keys()])Iu(o,n.keepQueryParameters)||t.searchParams.delete(o);if(n.sortQueryParameters){t.searchParams.sort();try{t.search=decodeURIComponent(t.search)}catch{}}n.removeTrailingSlash&&(t.pathname=t.pathname.replace(/\/$/,"")),n.removeExplicitPort&&t.port&&(t.port="");let i=e;return e=t.toString(),!n.removeSingleSlash&&t.pathname==="/"&&!i.endsWith("/")&&t.hash===""&&(e=e.replace(/\/$/,"")),(n.removeTrailingSlash||t.pathname==="/")&&t.hash===""&&n.removeSingleSlash&&(e=e.replace(/\/$/,"")),r&&!n.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),n.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var _1=Vt(sd(),1),Ru=Vt(sv(),1),w1=require("node:stream");function nl(e){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n.toLowerCase(),r]))}var Yh=class extends w1.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:n,body:r,url:t}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof n!="object")throw new TypeError("Argument `headers` should be an object");if(!(r instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof t!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(r),this.push(null)}}),this.statusCode=e,this.headers=nl(n),this.body=r,this.url=t}},ko=Vt(lv(),1),S1=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function E1(e,n){if(n._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set([...Object.keys(e),...S1]),t={};for(let i of r)i in n||(t[i]={get(){let o=e[i];return typeof o=="function"?o.bind(e):o},set(o){e[i]=o},enumerable:!0,configurable:!1});return Object.defineProperties(n,t),e.once("aborted",()=>{n.destroy(),n.emit("aborted")}),e.once("close",()=>{e.complete&&n.readable?n.once("end",()=>{n.emit("close")}):n.emit("close")}),n}var C1=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},ya=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},T1=class{constructor(e,n){this.hooks=new Map,this.request=()=>(r,t)=>{let i;if(typeof r=="string")i=Au(Bo.default.parse(r)),r={};else if(r instanceof Bo.default.URL)i=Au(Bo.default.parse(r.toString())),r={};else{let[c,...g]=(r.path??"").split("?"),I=g.length>0?`?${g.join("?")}`:"";i=Au({...r,pathname:c,search:I})}r={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...A1(i)},r.headers=Object.fromEntries(I1(r.headers).map(([c,g])=>[c.toLowerCase(),g]));let o=new p1.default,l=b1(Bo.default.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),u=`${r.method}:${l}`;r.body&&r.method!==void 0&&["POST","PATCH","PUT"].includes(r.method)&&(r.body instanceof Od.default.Readable?r.cache=!1:u+=`:${y1.default.createHash("md5").update(r.body).digest("hex")}`);let s=!1,a=!1,y=c=>{a=!0;let g=!1,I=()=>{},w=new Promise(S=>{I=()=>{g||(g=!0,S())}}),m=async S=>{if(s){S.status=S.statusCode;let A=Ru.default.fromObject(s.cachePolicy).revalidatedPolicy(c,S);if(!A.modified){S.resume(),await new Promise(b=>{S.once("end",b)});let f=Zh(A.policy.responseHeaders());S=new Yh({statusCode:s.statusCode,headers:f,body:s.body,url:s.url}),S.cachePolicy=A.policy,S.fromCache=!0}}S.fromCache||(S.cachePolicy=new Ru.default(c,S,c),S.fromCache=!1);let B;c.cache&&S.cachePolicy.storable()?(B=R1(S),(async()=>{try{let A=_1.default.buffer(S);await Promise.race([w,new Promise(R=>S.once("end",R))]);let f=await A,b={url:S.url,statusCode:S.fromCache?s.statusCode:S.statusCode,body:f,cachePolicy:S.cachePolicy.toObject()},E=c.strictTtl?S.cachePolicy.timeToLive():void 0;if(c.maxTtl&&(E=E?Math.min(E,c.maxTtl):c.maxTtl),this.hooks.size>0)for(let R of this.hooks.keys())b=await this.runHook(R,b,S);await this.cache.set(u,b,E)}catch(A){o.emit("error",new ya(A))}})()):c.cache&&s&&(async()=>{try{await this.cache.delete(u)}catch(A){o.emit("error",new ya(A))}})(),o.emit("response",B??S),typeof t=="function"&&t(B??S)};try{let S=this.cacheRequest(c,m);S.once("error",I),S.once("abort",I),o.emit("request",S)}catch(S){o.emit("error",new C1(S))}};return(async()=>{let c=async I=>{await Promise.resolve();let w=I.cache?await this.cache.get(u):void 0;if(typeof w>"u"&&!I.forceRefresh){y(I);return}let m=Ru.default.fromObject(w.cachePolicy);if(m.satisfiesWithoutRevalidation(I)&&!I.forceRefresh){let S=Zh(m.responseHeaders()),B=new Yh({statusCode:w.statusCode,headers:S,body:w.body,url:w.url});B.cachePolicy=m,B.fromCache=!0,o.emit("response",B),typeof t=="function"&&t(B)}else m.satisfiesWithoutRevalidation(I)&&Date.now()>=m.timeToLive()&&I.forceRefresh?(await this.cache.delete(u),I.headers=m.revalidationHeaders(I),y(I)):(s=w,I.headers=m.revalidationHeaders(I),y(I))},g=I=>o.emit("error",new ya(I));if(this.cache instanceof ko.default){let I=this.cache;I.once("error",g),o.on("error",()=>I.removeListener("error",g))}try{await c(r)}catch(I){r.automaticFailover&&!a&&y(r),o.emit("error",new ya(I))}})(),o},this.addHook=(r,t)=>{this.hooks.has(r)||this.hooks.set(r,t)},this.removeHook=r=>this.hooks.delete(r),this.getHook=r=>this.hooks.get(r),this.runHook=async(r,...t)=>this.hooks.get(r)?.(...t),n instanceof ko.default?this.cache=n:typeof n=="string"?this.cache=new ko.default({uri:n,namespace:"cacheable-request"}):this.cache=new ko.default({store:n,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},I1=Object.entries,R1=e=>{let n=new Od.PassThrough({autoDestroy:!1});return E1(e,n),e.pipe(n)},A1=e=>{let n={...e};return n.path=`${e.pathname||"/"}${e.search||""}`,delete n.pathname,delete n.search,n},Au=e=>({protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}),Zh=e=>{let n=[];for(let r of Object.keys(e))n[r.toLowerCase()]=e[r];return n},B1=T1,k1=Vt(hv(),1),P1=Vt(sd(),1),Jh="abcdefghijklmnopqrstuvwxyz0123456789";function N1(){let e=16,n="";for(;e--;)n+=Jh[Math.random()*Jh.length<<0];return n}var ef=e=>String(e).replace(/\r|\n/g,(n,r,t)=>n==="\r"&&t[r+1]!==` -`||n===` -`&&t[r-1]!=="\r"?`\r -`:n),O1=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function tf(e){if(O1(e)!=="object")return!1;let n=Object.getPrototypeOf(e);return n==null?!0:(n.constructor&&n.constructor.toString())===Object.toString()}function rf(e,n){if(typeof n=="string"){for(let[r,t]of Object.entries(e))if(n.toLowerCase()===r.toLowerCase())return t}}var L1=e=>new Proxy(e,{get:(n,r)=>rf(n,r),has:(n,r)=>rf(n,r)!==void 0}),Yn=e=>typeof e=="function",Ol=e=>Boolean(e&&Yn(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&Yn(e.append)&&Yn(e.getAll)&&Yn(e.entries)&&Yn(e[Symbol.iterator])),nf=e=>String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),Fn=e=>Boolean(e&&typeof e=="object"&&Yn(e.constructor)&&e[Symbol.toStringTag]==="File"&&Yn(e.stream)&&e.name!=null),ia=function(e,n,r,t,i){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!i:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?i.call(e,r):i?i.value=r:n.set(e,r),r},St=function(e,n,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!t:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(e):t?t.value:n.get(e)},aa,Tn,oa,Po,sa,Kn,ua,la,No,Bu,af,U1={enableAdditionalHeaders:!1},Oo={writable:!1,configurable:!1},D1=class{constructor(e,n,r){if(aa.add(this),Tn.set(this,`\r -`),oa.set(this,void 0),Po.set(this,void 0),sa.set(this,"-".repeat(2)),Kn.set(this,new TextEncoder),ua.set(this,void 0),la.set(this,void 0),No.set(this,void 0),!Ol(e))throw new TypeError("Expected first argument to be a FormData instance.");let t;if(tf(n)?r=n:t=n,t||(t=N1()),typeof t!="string")throw new TypeError("Expected boundary argument to be a string.");if(r&&!tf(r))throw new TypeError("Expected options argument to be an object.");ia(this,la,Array.from(e.entries()),"f"),ia(this,No,{...U1,...r},"f"),ia(this,oa,St(this,Kn,"f").encode(St(this,Tn,"f")),"f"),ia(this,Po,St(this,oa,"f").byteLength,"f"),this.boundary=`form-data-boundary-${t}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,ia(this,ua,St(this,Kn,"f").encode(`${St(this,sa,"f")}${this.boundary}${St(this,sa,"f")}${St(this,Tn,"f").repeat(2)}`),"f");let i={"Content-Type":this.contentType},o=St(this,aa,"m",af).call(this);o&&(this.contentLength=o,i["Content-Length"]=o),this.headers=L1(Object.freeze(i)),Object.defineProperties(this,{boundary:Oo,contentType:Oo,contentLength:Oo,headers:Oo})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,n]of St(this,la,"f")){let r=Fn(n)?n:St(this,Kn,"f").encode(ef(n));yield St(this,aa,"m",Bu).call(this,e,r),yield r,yield St(this,oa,"f")}yield St(this,ua,"f")}async*encode(){for(let e of this.values())Fn(e)?yield*e.stream():yield e}[(Tn=new WeakMap,oa=new WeakMap,Po=new WeakMap,sa=new WeakMap,Kn=new WeakMap,ua=new WeakMap,la=new WeakMap,No=new WeakMap,aa=new WeakSet,Bu=function(e,n){let r="";r+=`${St(this,sa,"f")}${this.boundary}${St(this,Tn,"f")}`,r+=`Content-Disposition: form-data; name="${nf(e)}"`,Fn(n)&&(r+=`; filename="${nf(n.name)}"${St(this,Tn,"f")}`,r+=`Content-Type: ${n.type||"application/octet-stream"}`);let t=Fn(n)?n.size:n.byteLength;return St(this,No,"f").enableAdditionalHeaders===!0&&t!=null&&!isNaN(t)&&(r+=`${St(this,Tn,"f")}Content-Length: ${Fn(n)?n.size:n.byteLength}`),St(this,Kn,"f").encode(`${r}${St(this,Tn,"f").repeat(2)}`)},af=function(){let e=0;for(let[n,r]of St(this,la,"f")){let t=Fn(r)?r:St(this,Kn,"f").encode(ef(r)),i=Fn(t)?t.size:t.byteLength;if(i==null||isNaN(i))return;e+=St(this,aa,"m",Bu).call(this,n,t).byteLength,e+=i,e+=St(this,Po,"f")}return String(e+St(this,ua,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}},x1=require("node:buffer"),q1=require("node:util");function Ld(e){return J.nodeStream(e)&&J.function_(e.getBoundary)}async function j1(e,n){if(n&&"content-length"in n)return Number(n["content-length"]);if(!e)return 0;if(J.string(e))return x1.Buffer.byteLength(e);if(J.buffer(e))return e.length;if(Ld(e))return(0,q1.promisify)(e.getLength.bind(e))()}function Ud(e,n,r){let t={};for(let i of r){let o=(...l)=>{n.emit(i,...l)};t[i]=o,e.on(i,o)}return()=>{for(let[i,o]of Object.entries(t))e.off(i,o)}}var M1=Vt(require("node:net"),1);function V1(){let e=[];return{once(n,r,t){n.once(r,t),e.push({origin:n,event:r,fn:t})},unhandleAll(){for(let n of e){let{origin:r,event:t,fn:i}=n;r.removeListener(t,i)}e.length=0}}}var of=Symbol("reentry"),F1=()=>{},Dd=class extends Error{constructor(e,n){super(`Timeout awaiting '${n}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function K1(e,n,r){if(of in e)return F1;e[of]=!0;let t=[],{once:i,unhandleAll:o}=V1(),l=(m,S,B)=>{let A=setTimeout(S,m,m,B);A.unref?.();let f=()=>{clearTimeout(A)};return t.push(f),f},{host:u,hostname:s}=r,a=(m,S)=>{e.destroy(new Dd(m,S))},y=()=>{for(let m of t)m();o()};if(e.once("error",m=>{if(y(),e.listenerCount("error")===0)throw m}),typeof n.request<"u"){let m=l(n.request,a,"request");i(e,"response",S=>{i(S,"end",m)})}if(typeof n.socket<"u"){let{socket:m}=n,S=()=>{a(m,"socket")};e.setTimeout(m,S),t.push(()=>{e.removeListener("timeout",S)})}let c=typeof n.lookup<"u",g=typeof n.connect<"u",I=typeof n.secureConnect<"u",w=typeof n.send<"u";return(c||g||I||w)&&i(e,"socket",m=>{let{socketPath:S}=e;if(m.connecting){let B=Boolean(S??M1.default.isIP(s??u??"")!==0);if(c&&!B&&typeof m.address().address>"u"){let A=l(n.lookup,a,"lookup");i(m,"lookup",A)}if(g){let A=()=>l(n.connect,a,"connect");B?i(m,"connect",A()):i(m,"lookup",f=>{f===null&&i(m,"connect",A())})}I&&r.protocol==="https:"&&i(m,"connect",()=>{let A=l(n.secureConnect,a,"secureConnect");i(m,"secureConnect",A)})}if(w){let B=()=>l(n.send,a,"send");m.connecting?i(m,"connect",()=>{i(e,"upload-complete",B())}):i(e,"upload-complete",B())}}),typeof n.response<"u"&&i(e,"upload-complete",()=>{let m=l(n.response,a,"response");i(e,"response",m)}),typeof n.read<"u"&&i(e,"response",m=>{let S=l(n.read,a,"read");i(m,"end",S)}),y}function $1(e){e=e;let n={protocol:e.protocol,hostname:J.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return J.string(e.port)&&e.port.length>0&&(n.port=Number(e.port)),(e.username||e.password)&&(n.auth=`${e.username||""}:${e.password||""}`),n}var H1=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,n){typeof e=="object"?this.weakMap.set(e,n):this.map.set(e,n)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}},z1=({attemptCount:e,retryOptions:n,error:r,retryAfter:t,computedValue:i})=>{if(r.name==="RetryError")return 1;if(e>n.limit)return 0;let o=n.methods.includes(r.options.method),l=n.errorCodes.includes(r.code),u=r.response&&n.statusCodes.includes(r.response.statusCode);if(!o||!l&&!u)return 0;if(r.response){if(t)return t>i?0:t;if(r.response.statusCode===413)return 0}let s=Math.random()*n.noise;return Math.min(2**(e-1)*1e3,n.backoffLimit)+s},W1=z1,G1=Vt(require("node:process"),1),ku=require("node:util"),Zn=require("node:url"),Q1=require("node:tls"),X1=Vt(require("node:http"),1),Y1=Vt(require("node:https"),1),Di=require("node:dns"),Pu=require("node:util"),Z1=Vt(require("node:os"),1),{Resolver:sf}=Di.promises,ki=Symbol("cacheableLookupCreateConnection"),Nu=Symbol("cacheableLookupInstance"),uf=Symbol("expires"),J1=typeof Di.ALL=="number",lf=e=>{if(!(e&&typeof e.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},eb=e=>{for(let n of e)n.family!==6&&(n.address=`::ffff:${n.address}`,n.family=6)},cf=()=>{let e=!1,n=!1;for(let r of Object.values(Z1.default.networkInterfaces()))for(let t of r)if(!t.internal&&(t.family==="IPv6"?n=!0:e=!0,e&&n))return{has4:e,has6:n};return{has4:e,has6:n}},tb=e=>Symbol.iterator in e,Lo=e=>e.catch(n=>{if(n.code==="ENODATA"||n.code==="ENOTFOUND"||n.code==="ENOENT")return[];throw n}),hf={ttl:!0},rb={all:!0},nb={all:!0,family:4},ib={all:!0,family:6},ab=class{constructor({cache:e=new Map,maxTtl:n=1/0,fallbackDuration:r=3600,errorTtl:t=.15,resolver:i=new sf,lookup:o=Di.lookup}={}){if(this.maxTtl=n,this.errorTtl=t,this._cache=e,this._resolver=i,this._dnsLookup=o&&(0,Pu.promisify)(o),this.stats={cache:0,query:0},this._resolver instanceof sf?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,Pu.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,Pu.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=cf(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=r,r>0){let l=setInterval(()=>{this._hostnamesToFallback.clear()},r*1e3);l.unref&&l.unref(),this._fallbackInterval=l}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,n,r){if(typeof n=="function"?(r=n,n={}):typeof n=="number"&&(n={family:n}),!r)throw new Error("Callback must be a function.");this.lookupAsync(e,n).then(t=>{n.all?r(null,t):r(null,t.address,t.family,t.expires,t.ttl,t.source)},r)}async lookupAsync(e,n={}){typeof n=="number"&&(n={family:n});let r=await this.query(e);if(n.family===6){let t=r.filter(i=>i.family===6);n.hints&Di.V4MAPPED&&(J1&&n.hints&Di.ALL||t.length===0)?eb(r):r=t}else n.family===4&&(r=r.filter(t=>t.family===4));if(n.hints&Di.ADDRCONFIG){let{_iface:t}=this;r=r.filter(i=>i.family===6?t.has6:t.has4)}if(r.length===0){let t=new Error(`cacheableLookup ENOTFOUND ${e}`);throw t.code="ENOTFOUND",t.hostname=e,t}return n.all?r:r[0]}async query(e){let n="cache",r=await this._cache.get(e);if(r&&this.stats.cache++,!r){let t=this._pending[e];if(t)this.stats.cache++,r=await t;else{n="query";let i=this.queryAndCache(e);this._pending[e]=i,this.stats.query++;try{r=await i}finally{delete this._pending[e]}}}return r=r.map(t=>({...t,source:n})),r}async _resolve(e){let[n,r]=await Promise.all([Lo(this._resolve4(e,hf)),Lo(this._resolve6(e,hf))]),t=0,i=0,o=0,l=Date.now();for(let u of n)u.family=4,u.expires=l+u.ttl*1e3,t=Math.max(t,u.ttl);for(let u of r)u.family=6,u.expires=l+u.ttl*1e3,i=Math.max(i,u.ttl);return n.length>0?r.length>0?o=Math.min(t,i):o=t:o=i,{entries:[...n,...r],cacheTtl:o}}async _lookup(e){try{let[n,r]=await Promise.all([Lo(this._dnsLookup(e,nb)),Lo(this._dnsLookup(e,ib))]);return{entries:[...n,...r],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,n,r){if(this.maxTtl>0&&r>0){r=Math.min(r,this.maxTtl)*1e3,n[uf]=Date.now()+r;try{await this._cache.set(e,n,r)}catch(t){this.lookupAsync=async()=>{let i=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw i.cause=t,i}}tb(this._cache)&&this._tick(r)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,rb);let n=await this._resolve(e);n.entries.length===0&&this._dnsLookup&&(n=await this._lookup(e),n.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let r=n.entries.length===0?this.errorTtl:n.cacheTtl;return await this._set(e,n.entries,r),n.entries}_tick(e){let n=this._nextRemovalTime;(!n||e{this._nextRemovalTime=!1;let r=1/0,t=Date.now();for(let[i,o]of this._cache){let l=o[uf];t>=l?this._cache.delete(i):l("lookup"in n||(n.lookup=this.lookup),e[ki](n,r))}uninstall(e){if(lf(e),e[ki]){if(e[Nu]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[ki],delete e[ki],delete e[Nu]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=cf(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}},ob=Vt(Sv(),1);function sb(e){let n=[],r=e.split(",");for(let t of r){let[i,...o]=t.split(";"),l=i.trim();if(l[0]!=="<"||l[l.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${l}`);let u=l.slice(1,-1),s={};if(o.length===0)throw new Error(`Unexpected end of Link header parameters: ${o.join(";")}`);for(let a of o){let y=a.trim(),c=y.indexOf("=");if(c===-1)throw new Error(`Failed to parse Link header: ${e}`);let g=y.slice(0,c).trim(),I=y.slice(c+1).trim();s[g]=I}n.push({reference:u,parameters:s})}return n}var[ff,ub]=G1.default.versions.node.split(".").map(Number);function lb(e){for(let n in e){let r=e[n];de.any([J.string,J.number,J.boolean,J.null_,J.undefined],r)}}var cb=new Map,Ou,hb=()=>Ou||(Ou=new ab,Ou),fb={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:e})=>e,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(e){return e.request.options.responseType==="json"?e.body:JSON.parse(e.body)},paginate({response:e}){let n=e.headers.link;if(typeof n!="string"||n.trim()==="")return!1;let r=sb(n).find(t=>t.parameters.rel==="next"||t.parameters.rel==='"next"');return r?{url:new Zn.URL(r.reference,e.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},db=e=>{let{hooks:n,retry:r}=e,t={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...r,errorCodes:[...r.errorCodes],methods:[...r.methods],statusCodes:[...r.statusCodes]},timeout:{...e.timeout},hooks:{init:[...n.init],beforeRequest:[...n.beforeRequest],beforeError:[...n.beforeError],beforeRedirect:[...n.beforeRedirect],beforeRetry:[...n.beforeRetry],afterResponse:[...n.afterResponse]},searchParams:e.searchParams?new Zn.URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return t.url!==void 0&&(t.prefixUrl=""),t},pb=e=>{let{hooks:n,retry:r}=e,t={...e};return J.object(e.context)&&(t.context={...e.context}),J.object(e.cacheOptions)&&(t.cacheOptions={...e.cacheOptions}),J.object(e.https)&&(t.https={...e.https}),J.object(e.cacheOptions)&&(t.cacheOptions={...t.cacheOptions}),J.object(e.agent)&&(t.agent={...e.agent}),J.object(e.headers)&&(t.headers={...e.headers}),J.object(r)&&(t.retry={...r},J.array(r.errorCodes)&&(t.retry.errorCodes=[...r.errorCodes]),J.array(r.methods)&&(t.retry.methods=[...r.methods]),J.array(r.statusCodes)&&(t.retry.statusCodes=[...r.statusCodes])),J.object(e.timeout)&&(t.timeout={...e.timeout}),J.object(n)&&(t.hooks={...n},J.array(n.init)&&(t.hooks.init=[...n.init]),J.array(n.beforeRequest)&&(t.hooks.beforeRequest=[...n.beforeRequest]),J.array(n.beforeError)&&(t.hooks.beforeError=[...n.beforeError]),J.array(n.beforeRedirect)&&(t.hooks.beforeRedirect=[...n.beforeRedirect]),J.array(n.beforeRetry)&&(t.hooks.beforeRetry=[...n.beforeRetry]),J.array(n.afterResponse)&&(t.hooks.afterResponse=[...n.afterResponse])),J.object(e.pagination)&&(t.pagination={...e.pagination}),t},yb=e=>{let n=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(r=>typeof r=="number");if(n.length>0)return Math.min(...n)},df=(e,n,r)=>{let t=e.hooks?.init;if(t)for(let i of t)i(n,r)},ln=class{constructor(e,n,r){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),de.any([J.string,J.urlInstance,J.object,J.undefined],e),de.any([J.object,J.undefined],n),de.any([J.object,J.undefined],r),e instanceof ln||n instanceof ln)throw new TypeError("The defaults must be passed as the third argument");this._internals=db(r?._internals??r??fb),this._init=[...r?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(J.plainObject(e))try{this.merge(e),this.merge(n)}finally{this.url=e.url}else try{this.merge(n)}finally{if(n?.url!==void 0)if(e===void 0)this.url=n.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(t){throw t.options=this,t}}merge(e){if(e){if(e instanceof ln){for(let n of e._init)this.merge(n);return}e=pb(e),df(this,e,this),df(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let n=!1;for(let r in e)if(!(r==="mutableDefaults"||r==="handlers")&&r!=="url"){if(!(r in this))throw new Error(`Unexpected option: ${r}`);this[r]=e[r],n=!0}n&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){de.any([J.function_,J.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){de.plainObject(e);for(let n in e){if(!(n in this._internals.agent))throw new TypeError(`Unexpected agent option: ${n}`);de.any([J.object,J.undefined],e[n])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){de.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){de.plainObject(e);for(let n in e){if(!(n in this._internals.timeout))throw new Error(`Unexpected timeout option: ${n}`);de.any([J.number,J.undefined],e[n])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if(de.any([J.string,J.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:n}=this._internals.url;this._internals.url.href=e+n.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){de.any([J.string,J.buffer,J.nodeStream,J.generator,J.asyncGenerator,Ol,J.undefined],e),J.nodeStream(e)&&de.truthy(e.readable),e!==void 0&&(de.undefined(this._internals.form),de.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){de.any([J.plainObject,J.undefined],e),e!==void 0&&(de.undefined(this._internals.body),de.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(de.undefined(this._internals.body),de.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(de.any([J.string,J.urlInstance,J.undefined],e),e===void 0){this._internals.url=void 0;return}if(J.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let n=`${this.prefixUrl}${e.toString()}`,r=new Zn.URL(n);if(this._internals.url=r,decodeURI(n),r.protocol==="unix:"&&(r.href=`http://unix${r.pathname}${r.search}`),r.protocol!=="http:"&&r.protocol!=="https:"){let t=new Error(`Unsupported protocol: ${r.protocol}`);throw t.code="ERR_UNSUPPORTED_PROTOCOL",t}if(this._internals.username&&(r.username=this._internals.username,this._internals.username=""),this._internals.password&&(r.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(r.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),r.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let t=/(?.+?):(?.+)/.exec(`${r.pathname}${r.search}`);if(t?.groups){let{socketPath:i,path:o}=t.groups;this._unixOptions={socketPath:i,path:o,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(de.any([J.object,J.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:n,getCookieString:r}=e;de.function_(n),de.function_(r),n.length===4&&r.length===0?(n=(0,ku.promisify)(n.bind(e)),r=(0,ku.promisify)(r.bind(e)),this._internals.cookieJar={setCookie:n,getCookieString:r}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){de.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){de.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new Zn.URLSearchParams),this._internals.searchParams)}set searchParams(e){de.any([J.string,J.object,J.undefined],e);let n=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,n&&(n.search="");return}let r=this.searchParams,t;if(J.string(e))t=new Zn.URLSearchParams(e);else if(e instanceof Zn.URLSearchParams)t=e;else{lb(e),t=new Zn.URLSearchParams;for(let i in e){let o=e[i];o===null?t.append(i,""):o===void 0?r.delete(i):t.append(i,o)}}if(this._merging){for(let i of t.keys())r.delete(i);for(let[i,o]of t)r.append(i,o)}else n?n.search=r.toString():this._internals.searchParams=r}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){de.any([J.function_,J.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){de.any([J.object,J.boolean,J.undefined],e),e===!0?this._internals.dnsCache=hb():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){de.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){de.object(e);for(let n in e){if(!(n in this._internals.hooks))throw new Error(`Unexpected hook event: ${n}`);let r=n,t=e[r];if(de.any([J.array,J.undefined],t),t)for(let i of t)de.function_(i);if(this._merging)t&&this._internals.hooks[r].push(...t);else{if(!t)throw new Error(`Missing hook event: ${n}`);this._internals.hooks[n]=[...t]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){de.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){de.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){de.any([J.object,J.string,J.boolean,J.undefined],e),e===!0?this._internals.cache=cb:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){de.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,n=e?e.username:this._internals.username;return decodeURIComponent(n)}set username(e){de.string(e);let n=this._internals.url,r=encodeURIComponent(e);n?n.username=r:this._internals.username=r}get password(){let e=this._internals.url,n=e?e.password:this._internals.password;return decodeURIComponent(n)}set password(e){de.string(e);let n=this._internals.url,r=encodeURIComponent(e);n?n.password=r:this._internals.password=r}get http2(){return this._internals.http2}set http2(e){de.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){de.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){de.plainObject(e),this._merging?Object.assign(this._internals.headers,nl(e)):this._internals.headers=nl(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){de.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){de.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){de.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(de.plainObject(e),de.any([J.function_,J.undefined],e.calculateDelay),de.any([J.number,J.undefined],e.maxRetryAfter),de.any([J.number,J.undefined],e.limit),de.any([J.array,J.undefined],e.methods),de.any([J.array,J.undefined],e.statusCodes),de.any([J.array,J.undefined],e.errorCodes),de.any([J.number,J.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let r in e)if(!(r in this._internals.retry))throw new Error(`Unexpected retry option: ${r}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:n}=this._internals;n.methods=[...new Set(n.methods.map(r=>r.toUpperCase()))],n.statusCodes=[...new Set(n.statusCodes)],n.errorCodes=[...new Set(n.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){de.any([J.string,J.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){de.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){de.any([J.function_,J.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){de.plainObject(e),de.any([J.boolean,J.undefined],e.shared),de.any([J.number,J.undefined],e.cacheHeuristic),de.any([J.number,J.undefined],e.immutableMinTimeToLive),de.any([J.boolean,J.undefined],e.ignoreCargoCult);for(let n in e)if(!(n in this._internals.cacheOptions))throw new Error(`Cache option \`${n}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){de.plainObject(e),de.any([J.boolean,J.undefined],e.rejectUnauthorized),de.any([J.function_,J.undefined],e.checkServerIdentity),de.any([J.string,J.object,J.array,J.undefined],e.certificateAuthority),de.any([J.string,J.object,J.array,J.undefined],e.key),de.any([J.string,J.object,J.array,J.undefined],e.certificate),de.any([J.string,J.undefined],e.passphrase),de.any([J.string,J.buffer,J.array,J.undefined],e.pfx),de.any([J.array,J.undefined],e.alpnProtocols),de.any([J.string,J.undefined],e.ciphers),de.any([J.string,J.buffer,J.undefined],e.dhparam),de.any([J.string,J.undefined],e.signatureAlgorithms),de.any([J.string,J.undefined],e.minVersion),de.any([J.string,J.undefined],e.maxVersion),de.any([J.boolean,J.undefined],e.honorCipherOrder),de.any([J.number,J.undefined],e.tlsSessionLifetime),de.any([J.string,J.undefined],e.ecdhCurve),de.any([J.string,J.buffer,J.array,J.undefined],e.certificateRevocationLists);for(let n in e)if(!(n in this._internals.https))throw new Error(`HTTPS option \`${n}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");de.any([J.string,J.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){de.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){de.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){de.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){de.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){de.any([J.number,J.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){de.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,n){return(0,ku.inspect)(this._internals,n)}createNativeRequestOptions(){let e=this._internals,n=e.url,r;n.protocol==="https:"?r=e.http2?e.agent:e.agent.https:r=e.agent.http;let{https:t}=e,{pfx:i}=t;return J.array(i)&&J.plainObject(i[0])&&(i=i.map(o=>({buf:o.buffer,passphrase:o.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:t.alpnProtocols,ca:t.certificateAuthority,cert:t.certificate,key:t.key,passphrase:t.passphrase,pfx:t.pfx,rejectUnauthorized:t.rejectUnauthorized,checkServerIdentity:t.checkServerIdentity??Q1.checkServerIdentity,ciphers:t.ciphers,honorCipherOrder:t.honorCipherOrder,minVersion:t.minVersion,maxVersion:t.maxVersion,sigalgs:t.signatureAlgorithms,sessionTimeout:t.tlsSessionLifetime,dhparam:t.dhparam,ecdhCurve:t.ecdhCurve,crl:t.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:r,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?yb(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:n}=this._internals;return!n&&e?this.getFallbackRequestFunction():n}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(ff<15||ff===15&&ub<10){let n=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw n.code="EUNSUPPORTED",n}return ob.default.auto}return Y1.default.request}return X1.default.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}},ss=e=>{let{statusCode:n}=e,r=e.request.options.followRedirect?299:399;return n>=200&&n<=r||n===304},pf=class extends $t{constructor(e,n){let{options:r}=n.request;super(`${e.message} in "${r.url.toString()}"`,e,n.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},yf=(e,n,r,t)=>{let{rawBody:i}=e;try{if(n==="text")return i.toString(t);if(n==="json")return i.length===0?"":r(i.toString(t));if(n==="buffer")return i}catch(o){throw new pf(o,e)}throw new pf({message:`Unknown body type '${n}'`,name:"Error"},e)};function gb(e){return e.writable&&!e.writableEnded}var mb=gb;function gf(e){return e.protocol==="unix:"||e.hostname==="unix"}var vb=J.string(Nd.default.versions.brotli),bb=new Set(["GET","HEAD"]),Lu=new H1,_b=new Set([300,301,302,303,304,307,308]),wb=["socket","connect","continue","information","upgrade"],Uu=()=>{},Ll=class extends u1.Duplex{constructor(e,n,r){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=Uu,this._triggerRead=!1,this._cancelTimeouts=Uu,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=Uu,this.on("pipe",i=>{i.headers&&Object.assign(this.options.headers,i.headers)}),this.on("newListener",i=>{if(i==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new ln(e,n,r),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(i){let{options:o}=i;o&&(this.options=o),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}this.options.signal?.aborted&&this.destroy(new Qh(this)),this.options.signal?.addEventListener("abort",()=>{this.destroy(new Qh(this))});let{body:t}=this.options;J.nodeStream(t)&&t.once("error",i=>{this._flushed?this._beforeError(new Wh(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new Wh(i,this))}})}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:n,options:r}=this,t=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof $t||(e=new $t(e.message,e,this));let i=e;(async()=>{if(n?.readable&&!n.rawBody&&!this._request?.socket?.destroyed&&(n.setEncoding(this.readableEncoding),await this._setRawBody(n)&&(n.body=n.rawBody.toString())),this.listenerCount("retry")!==0){let o;try{let l;n&&"retry-after"in n.headers&&(l=Number(n.headers["retry-after"]),Number.isNaN(l)?(l=Date.parse(n.headers["retry-after"])-Date.now(),l<=0&&(l=1)):l*=1e3);let u=r.retry;o=await u.calculateDelay({attemptCount:t,retryOptions:u,error:i,retryAfter:l,computedValue:W1({attemptCount:t,retryOptions:u,error:i,retryAfter:l,computedValue:u.maxRetryAfter??r.timeout.request??Number.POSITIVE_INFINITY})})}catch(l){this._error(new $t(l.message,l,this));return}if(o){if(await new Promise(l=>{let u=setTimeout(l,o);this._stopRetry=()=>{clearTimeout(u),l()}}),this.destroyed)return;try{for(let l of this.options.hooks.beforeRetry)await l(i,this.retryCount+1)}catch(l){this._error(new $t(l.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,l=>{let u=new Ll(r.url,l,r);return u.retryCount=this.retryCount+1,Nd.default.nextTick(()=>{u.flush()}),u});return}}this._error(i)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let n;for(;(n=e.read())!==null;){this._downloadedSize+=n.length;let r=this.downloadProgress;r.percent<1&&this.emit("downloadProgress",r),this.push(n)}}}_write(e,n,r){let t=()=>{this._writeRequest(e,n,r)};this._requestInitialized?t():this._jobs.push(t)}_final(e){let n=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(r=>{this._request._writableState?.errored||(r||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(r))})};this._requestInitialized?n():this._jobs.push(n)}_destroy(e,n){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this.options){let{body:r}=this.options;J.nodeStream(r)&&r.destroy()}this._request&&this._request.destroy(),e!==null&&!J.undefined(e)&&!(e instanceof $t)&&(e=new $t(e.message,e,this)),n(e)}pipe(e,n){return e instanceof Tu.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,n)}unpipe(e){return e instanceof Tu.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:n}=e,r=!J.undefined(e.form),t=!J.undefined(e.json),i=!J.undefined(e.body),o=bb.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=o,r||t||i){if(o)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let l=!J.string(n["content-type"]);if(i){if(Ol(e.body)){let s=new D1(e.body);l&&(n["content-type"]=s.headers["Content-Type"]),"Content-Length"in s.headers&&(n["content-length"]=s.headers["Content-Length"]),e.body=s.encode()}Ld(e.body)&&l&&(n["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(r){l&&(n["content-type"]="application/x-www-form-urlencoded");let{form:s}=e;e.form=void 0,e.body=new Xh.URLSearchParams(s).toString()}else{l&&(n["content-type"]="application/json");let{json:s}=e;e.json=void 0,e.body=e.stringifyJson(s)}let u=await j1(e.body,e.headers);J.undefined(n["content-length"])&&J.undefined(n["transfer-encoding"])&&!o&&!J.undefined(u)&&(n["content-length"]=String(u))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(n["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:n}=this,{url:r}=n;this._nativeResponse=e,n.decompress&&(e=(0,k1.default)(e));let t=e.statusCode,i=e;i.statusMessage=i.statusMessage?i.statusMessage:Tu.default.STATUS_CODES[t],i.url=n.url.toString(),i.requestUrl=this.requestUrl,i.redirectUrls=this.redirectUrls,i.request=this,i.isFromCache=this._nativeResponse.fromCache??!1,i.ip=this.ip,i.retryCount=this.retryCount,i.ok=ss(i),this._isFromCache=i.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=i,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",l=>{this._aborted=!0,e.destroy(),this._beforeError(new Gh(l,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Gh({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(J.object(n.cookieJar)&&o){let l=o.map(async u=>n.cookieJar.setCookie(u,r.toString()));n.ignoreInvalidCookies&&(l=l.map(async u=>{try{await u}catch{}}));try{await Promise.all(l)}catch(u){this._beforeError(u);return}}if(!this.isAborted){if(n.followRedirect&&e.headers.location&&_b.has(t)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=n.maxRedirects){this._beforeError(new i1(this));return}this._request=void 0;let l=new ln(void 0,void 0,this.options),u=t===303&&l.method!=="GET"&&l.method!=="HEAD",s=t!==307&&t!==308,a=l.methodRewriting&&s;(u||a)&&(l.method="GET",l.body=void 0,l.json=void 0,l.form=void 0,delete l.headers["content-length"]);try{let y=Cu.Buffer.from(e.headers.location,"binary").toString(),c=new Xh.URL(y,r);if(!gf(r)&&gf(c)){this._beforeError(new $t("Cannot redirect to UNIX socket",{},this));return}c.hostname!==r.hostname||c.port!==r.port?("host"in l.headers&&delete l.headers.host,"cookie"in l.headers&&delete l.headers.cookie,"authorization"in l.headers&&delete l.headers.authorization,(l.username||l.password)&&(l.username="",l.password="")):(c.username=l.username,c.password=l.password),this.redirectUrls.push(c),l.prefixUrl="",l.url=c;for(let g of l.hooks.beforeRedirect)await g(l,i);this.emit("redirect",l,i),this.options=l,await this._makeRequest()}catch(y){this._beforeError(y);return}return}if(n.isStream&&n.throwHttpErrors&&!ss(i)){this._beforeError(new os(i));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let l of this._pipedServerResponses)if(!l.headersSent){for(let u in e.headers){let s=n.decompress?u!=="content-encoding":!0,a=e.headers[u];s&&l.setHeader(u,a)}l.statusCode=t}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let n=await(0,P1.buffer)(e);if(!this.isAborted)return this.response.rawBody=n,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(n){this._beforeError(n)}}_onRequest(e){let{options:n}=this,{timeout:r,url:t}=n;d1(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=K1(e,r,t);let i=n.cache?"cacheableResponse":"response";e.once(i,o=>{this._onResponse(o)}),e.once("error",o=>{this._aborted=!0,e.destroy(),o=o instanceof Dd?new o1(o,this.timings,this):new $t(o.message,o,this),this._beforeError(o)}),this._unproxyEvents=Ud(e,this,wb),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((n,r)=>{super.write(e,t=>{if(t){r(t);return}n()})})}_sendBody(){let{body:e}=this.options,n=this.redirectUrls.length===0?this:this._request??this;J.nodeStream(e)?e.pipe(n):J.generator(e)||J.asyncGenerator(e)?(async()=>{try{for await(let r of e)await this._asyncWrite(r);super.end()}catch(r){this._beforeError(r)}})():J.undefined(e)?(this._cannotHaveBody||this._noPipe)&&n.end():(this._writeRequest(e,void 0,()=>{}),n.end())}_prepareCache(e){if(!Lu.has(e)){let n=new B1((r,t)=>{let i=r._request(r,t);return J.promise(i)&&(i.once=(o,l)=>{if(o==="error")(async()=>{try{await i}catch(u){l(u)}})();else if(o==="abort")(async()=>{try{(await i).once("abort",l)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${o}`);return i}),i},e);Lu.set(e,n.request())}}async _createCacheableRequest(e,n){return new Promise((r,t)=>{Object.assign(n,$1(e));let i,o=Lu.get(n.cache)(n,async l=>{if(l._readableState.autoDestroy=!1,i){let u=()=>{l.req&&(l.complete=l.req.res.complete)};l.prependOnceListener("end",u),u(),(await i).emit("cacheableResponse",l)}r(l)});o.once("error",t),o.once("request",async l=>{i=l,r(i)})})}async _makeRequest(){let{options:e}=this,{headers:n,username:r,password:t}=e,i=e.cookieJar;for(let s in n)if(J.undefined(n[s]))delete n[s];else if(J.null_(n[s]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${s}\` header`);if(e.decompress&&J.undefined(n["accept-encoding"])&&(n["accept-encoding"]=vb?"gzip, deflate, br":"gzip, deflate"),r||t){let s=Cu.Buffer.from(`${r}:${t}`).toString("base64");n.authorization=`Basic ${s}`}if(i){let s=await i.getCookieString(e.url.toString());J.nonEmptyString(s)&&(n.cookie=s)}e.prefixUrl="";let o;for(let s of e.hooks.beforeRequest){let a=await s(e);if(!J.undefined(a)){o=()=>a;break}}o||(o=e.getRequestFunction());let l=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=o,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let u=e.cache?this._createCacheableRequest:o;try{let s=u(l,this._requestOptions);J.promise(s)&&(s=await s),J.undefined(s)&&(s=e.getFallbackRequestFunction()(l,this._requestOptions),J.promise(s)&&(s=await s)),mb(s)?this._onRequest(s):this.writable?(this.once("finish",()=>{this._onResponse(s)}),this._sendBody()):this._onResponse(s)}catch(s){throw s instanceof ya?new a1(s,this):s}}async _error(e){try{if(!(e instanceof os&&!this.options.throwHttpErrors))for(let n of this.options.hooks.beforeError)e=await n(e)}catch(n){e=new $t(n.message,n,this)}this.destroy(e)}_writeRequest(e,n,r){!this._request||this._request.destroyed||this._request.write(e,n,t=>{if(!t&&!this._request.destroyed){this._uploadedSize+=Cu.Buffer.byteLength(e,n);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}r(t)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}},Sb=class extends $t{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},Eb=["request","response","redirect","uploadProgress","downloadProgress"];function mf(e){let n,r,t,i=new t1.EventEmitter,o=new Nl((u,s,a)=>{a(()=>{n.destroy()}),a.shouldReject=!1,a(()=>{s(new Sb(n))});let y=c=>{a(()=>{});let g=e??new Ll(void 0,void 0,t);g.retryCount=c,g._noPipe=!0,n=g,g.once("response",async m=>{let S=(m.headers["content-encoding"]??"").toLowerCase(),B=S==="gzip"||S==="deflate"||S==="br",{options:A}=g;if(B&&!A.decompress)m.body=m.rawBody;else try{m.body=yf(m,A.responseType,A.parseJson,A.encoding)}catch(f){if(m.body=m.rawBody.toString(),ss(m)){g._beforeError(f);return}}try{let f=A.hooks.afterResponse;for(let[b,E]of f.entries())if(m=await E(m,async R=>{throw A.merge(R),A.prefixUrl="",R.url&&(A.url=R.url),A.hooks.afterResponse=A.hooks.afterResponse.slice(0,b),new s1(g)}),!(J.object(m)&&J.number(m.statusCode)&&!J.nullOrUndefined(m.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(f){g._beforeError(f);return}if(r=m,!ss(m)){g._beforeError(new os(m));return}g.destroy(),u(g.options.resolveBodyOnly?m.body:m)});let I=m=>{if(o.isCanceled)return;let{options:S}=g;if(m instanceof os&&!S.throwHttpErrors){let{response:B}=m;g.destroy(),u(g.options.resolveBodyOnly?B.body:B);return}s(m)};g.once("error",I);let w=g.options?.body;g.once("retry",(m,S)=>{e=void 0;let B=g.options.body;if(w===B&&J.nodeStream(B)){S.message="Cannot retry with consumed body stream",I(S);return}t=g.options,y(m)}),Ud(g,i,Eb),J.undefined(e)&&g.flush()};y(0)});o.on=(u,s)=>(i.on(u,s),o),o.off=(u,s)=>(i.off(u,s),o);let l=u=>{let s=(async()=>{await o;let{options:a}=r.request;return yf(r,u,a.parseJson,a.encoding)})();return Object.defineProperties(s,Object.getOwnPropertyDescriptors(o)),s};return o.json=()=>{if(n.options){let{headers:u}=n.options;!n.writableFinished&&!("accept"in u)&&(u.accept="application/json")}return l("json")},o.buffer=()=>l("buffer"),o.text=()=>l("text"),o}var Cb=async e=>new Promise(n=>{setTimeout(n,e)}),Tb=e=>J.function_(e),Ib=["get","post","put","patch","head","delete"],xd=e=>{e={options:new ln(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let n=(t,i,o=e.options)=>{let l=new Ll(t,i,o),u,s=c=>(l.options=c,l._noPipe=!c.isStream,l.flush(),c.isStream?l:(u||(u=mf(l)),u)),a=0,y=c=>{let g=(e.handlers[a++]??s)(c,y);if(J.promise(g)&&!l.options.isStream&&(u||(u=mf(l)),g!==u)){let I=Object.getOwnPropertyDescriptors(u);for(let w in I)w in g&&delete I[w];Object.defineProperties(g,I),g.cancel=u.cancel}return g};return y(l.options)};n.extend=(...t)=>{let i=new ln(void 0,void 0,e.options),o=[...e.handlers],l;for(let u of t)Tb(u)?(i.merge(u.defaults.options),o.push(...u.defaults.handlers),l=u.defaults.mutableDefaults):(i.merge(u),u.handlers&&o.push(...u.handlers),l=u.mutableDefaults);return xd({options:i,handlers:o,mutableDefaults:Boolean(l)})};let r=async function*(t,i){let o=new ln(t,i,e.options);o.resolveBodyOnly=!1;let{pagination:l}=o;de.function_(l.transform),de.function_(l.shouldContinue),de.function_(l.filter),de.function_(l.paginate),de.number(l.countLimit),de.number(l.requestLimit),de.number(l.backoff);let u=[],{countLimit:s}=l,a=0;for(;a{let o=[];for await(let l of r(t,i))o.push(l);return o},n.paginate.each=r,n.stream=(t,i)=>n(t,{...i,isStream:!0});for(let t of Ib)n[t]=(i,o)=>n(i,{...o,method:t}),n.stream[t]=(i,o)=>n(i,{...o,method:t,isStream:!0});return e.mutableDefaults||(Object.freeze(e.handlers),e.options.freeze()),Object.defineProperty(n,"defaults",{value:e,writable:!1,configurable:!1,enumerable:!0}),n},Rb=xd,Ab={options:new ln,handlers:[],mutableDefaults:!1},Bb=Rb(Ab),vr=Bb,Xo="https://www.googleapis.com",kb=`${Xo}/oauth2/v4/token`,Ul={extId:"No extension ID provided, e.g. https://chrome.google.com/webstore/detail/EXT_ID",clientId:"No client ID provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",clientSecret:"No client secret provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",refreshToken:"No refresh token provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md"},Pb=Object.keys(Ul),Nb=class{options={};constructor(e){for(let n of Pb){if(!e[n])throw new Error(Ul[n]);this.options[n]=e[n]}}get uploadEndpoint(){return`${Xo}/upload/chromewebstore/v1.1/items/${this.options.extId}`}getPublishEndpoint(e){return`${Xo}/chromewebstore/v1.1/items/${this.options.extId}/publish?publishTarget=${e}`}getInfoEndpoint(e){return`${Xo}/chromewebstore/v1.1/items/${this.options.extId}?projection=${e}`}async submit({filePath:e="",target:n="default"}){let r=await this.getAccessToken(),{uploadState:t,itemError:i}=await this.upload({readStream:(0,Fv.createReadStream)(e)},r);if(t==="FAILURE"||t==="NOT_FOUND")throw new Error(i.map(({error_detail:o})=>o).join(` -`));return this.publish({target:n},r)}async upload({readStream:e=null},n=""){if(!e)throw new Error("Read stream missing");let r=n||await this.getAccessToken();return vr.put(this.uploadEndpoint,{headers:this.getHeaders(r),body:e,throwHttpErrors:!1}).json()}async publish({target:e="default"},n=""){let r=n||await this.getAccessToken();return vr.post(this.getPublishEndpoint(e),{headers:this.getHeaders(r)}).json()}async get({projection:e="DRAFT"},n=""){let r=n||await this.getAccessToken();return vr.get(this.getInfoEndpoint(e),{headers:this.getHeaders(r)}).json()}async getAccessToken(){return(await vr.post(kb,{json:{client_id:this.options.clientId,refresh_token:this.options.refreshToken,grant_type:"refresh_token",client_secret:this.options.clientSecret}}).json()).access_token}getHeaders(e){return{Authorization:`Bearer ${e}`,"x-goog-api-version":"2"}}},Ob=require("module"),Lb=(0,Ob.createRequire)("/"),Ub;try{Ub=Lb("worker_threads").Worker}catch{}var Er=Uint8Array,ai=Uint16Array,qd=Uint32Array,jd=new Er([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Md=new Er([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Db=new Er([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vd=function(e,n){for(var r=new ai(31),t=0;t<31;++t)r[t]=n+=1<>>1|(tt&21845)<<1,on=(on&52428)>>>2|(on&13107)<<2,on=(on&61680)>>>4|(on&3855)<<4,il[tt]=((on&65280)>>>8|(on&255)<<8)>>>1;var on,tt,ba=function(e,n,r){for(var t=e.length,i=0,o=new ai(n);i>>s]=a}else for(u=new ai(t),i=0;i>>15-e[i]);return u},Na=new Er(288);for(tt=0;tt<144;++tt)Na[tt]=8;var tt;for(tt=144;tt<256;++tt)Na[tt]=9;var tt;for(tt=256;tt<280;++tt)Na[tt]=7;var tt;for(tt=280;tt<288;++tt)Na[tt]=8;var tt,Hd=new Er(32);for(tt=0;tt<32;++tt)Hd[tt]=5;var tt,jb=ba(Na,9,1),Mb=ba(Hd,5,1),Du=function(e){for(var n=e[0],r=1;rn&&(n=e[r]);return n},Ur=function(e,n,r){var t=n/8|0;return(e[t]|e[t+1]<<8)>>(n&7)&r},xu=function(e,n){var r=n/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(n&7)},Vb=function(e){return(e+7)/8|0},Dl=function(e,n,r){(n==null||n<0)&&(n=0),(r==null||r>e.length)&&(r=e.length);var t=new(e.BYTES_PER_ELEMENT==2?ai:e.BYTES_PER_ELEMENT==4?qd:Er)(r-n);return t.set(e.subarray(n,r)),t},Fb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],xr=function(e,n,r){var t=new Error(n||Fb[e]);if(t.code=e,Error.captureStackTrace&&Error.captureStackTrace(t,xr),!r)throw t;return t},Kb=function(e,n,r){var t=e.length;if(!t||r&&r.f&&!r.l)return n||new Er(0);var i=!n||r,o=!r||r.i;r||(r={}),n||(n=new Er(t*3));var l=function(fe){var Pe=n.length;if(fe>Pe){var ce=new Er(Math.max(Pe*2,fe));ce.set(n),n=ce}},u=r.f||0,s=r.p||0,a=r.b||0,y=r.l,c=r.d,g=r.m,I=r.n,w=t*8;do{if(!y){u=Ur(e,s,1);var m=Ur(e,s+1,3);if(s+=3,m)if(m==1)y=jb,c=Mb,g=9,I=5;else if(m==2){var S=Ur(e,s,31)+257,B=Ur(e,s+10,15)+4,A=S+Ur(e,s+5,31)+1;s+=14;for(var f=new Er(A),b=new Er(19),E=0;E>>4;if(h<16)f[E++]=h;else{var U=0,j=0;for(h==16?(j=3+Ur(e,s,3),s+=2,U=f[E-1]):h==17?(j=3+Ur(e,s,7),s+=3):h==18&&(j=11+Ur(e,s,127),s+=7);j--;)f[E++]=U}}var M=f.subarray(0,S),v=f.subarray(S);g=Du(M),I=Du(v),y=ba(M,g,1),c=ba(v,I,1)}else xr(1);else{var h=Vb(s)+4,N=e[h-4]|e[h-3]<<8,L=h+N;if(L>t){o&&xr(0);break}i&&l(a+N),n.set(e.subarray(h,L),a),r.b=a+=N,r.p=s=L*8,r.f=u;continue}if(s>w){o&&xr(0);break}}i&&l(a+131072);for(var O=(1<>>4;if(s+=U&15,s>w){o&&xr(0);break}if(U||xr(2),te<256)n[a++]=te;else if(te==256){Y=s,y=null;break}else{var re=te-254;if(te>264){var E=te-257,oe=jd[E];re=Ur(e,s,(1<>>4;be||xr(3),s+=be&15;var v=qb[Ce];if(Ce>3){var oe=Md[Ce];v+=xu(e,s)&(1<w){o&&xr(0);break}i&&l(a+131072);for(var ke=a+re;a>>0},qu=function(e,n){return qr(e,n)+qr(e,n+4)*4294967296};function Hb(e,n){return Kb(e,n)}var al=typeof TextDecoder<"u"&&new TextDecoder,zb=0;try{al.decode($b,{stream:!0}),zb=1}catch{}var Wb=function(e){for(var n="",r=0;;){var t=e[r++],i=(t>127)+(t>223)+(t>239);if(r+i>e.length)return[n,Dl(e,r-1)];i?i==3?(t=((t&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|t>>10,56320|t&1023)):i&1?n+=String.fromCharCode((t&31)<<6|e[r++]&63):n+=String.fromCharCode((t&15)<<12|(e[r++]&63)<<6|e[r++]&63):n+=String.fromCharCode(t)}};function zd(e,n){if(n){for(var r="",t=0;t65558)&&xr(13);var i=Qr(e,t+8);if(!i)return{};var o=qr(e,t+16),l=o==4294967295||i==65535;if(l){var u=qr(e,t-12);l=qr(e,u)==101075792,l&&(i=qr(e,u+32),o=qr(e,u+48))}for(var s=n&&n.filter,a=0;a(0,Zb.resolve)((0,Jb.cwd)(),e),Wd=e=>(0,xl.existsSync)(ql(e));function Oa({zip:e="",file:n="",versionFile:r="package.json"}){let t=e||n;if(Wd(r)&&t.includes("{version}")){let i=JSON.parse((0,xl.readFileSync)(r).toString());return t.replace("{version}",i.version||"")}else return t}function Ss(e){let n=(0,xl.readFileSync)(ql(e)),r=Yb(n),t=zd(r["manifest.json"]);return JSON.parse(t)}function Es({extId:e=null,market:n="",zip:r=""}){let{name:t,version:i}=Ss(r),o=Ad[n]||n;console.log(`Successfully updated "${e}" (${t}) to version ${i} on ${o}!`)}var Uo={};function Gd({message:e="Message",prefix:n="",market:r=""}){var t;Uo[r]=1+((t=Uo?.[r])!=null?t:0);let i=`${r}: Step ${Uo[r]}) ${e}`;return n!=="Error"&&(n=n||"Info",i=`${n} ${i}`),n==="Info"?i=i.trim():n==="Error"&&(i=i.trimStart()),i}var Qd={},La=e=>{Qd[e]=!0,process.env.VERBOSE="true"};function Cs(e=""){return n=>Qd[e]&&console.log(Gd({market:e,message:n}))}var Ts=(e,n,r)=>{let t=new Error(Gd({market:n,message:`Item "${r}": ${e.message}`,prefix:"Error"}));return t.stack=e.stack,t};function ju(e,n){return`${e}: ${n}`}var Ua=({market:e="chrome",options:n={},errorMap:r={}})=>{if(Object.keys(r).some(i=>{if(!n[i])throw new Error(ju(e,r[i]))}),!n.zip&&!n.file)throw new Error(ju(e,"No extension bundle provided"));let t=n.zip||n.file;if(!Wd(t))throw new Error(ju(e,`Extension bundle file doesn't exist: ${ql(t)}`))},Sa="chrome",e2=Cs(Sa);function t2(e){return pn(this,null,function*(){var n=e,{extId:r,target:t="default",zip:i,dryRun:o}=n,l=bs(n,["extId","target","zip","dryRun"]);let u=new Nb(vs({extId:r},l));if(e2(`Updating extension with ID ${r}`),o)return!0;try{return yield u.submit({filePath:i,target:t}),Es({extId:r,market:Sa,zip:i}),!0}catch(s){let a=Ss(i);throw Ts(s,Sa,`"${r}" (${a.name})`)}})}function r2(e){return pn(this,null,function*(){return e.zip=Oa(e),e.verbose&&La(Sa),Ua({market:Sa,options:e,errorMap:Ul}),t2(e)})}var n2=require("fs"),jl={productId:"Product ID is required. To get one, go to: https://partner.microsoft.com/en-us/dashboard/microsoftedge/{product-id}/package/dashboard",clientId:"Client ID is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",clientSecret:"Client Secret is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",accessTokenUrl:"Access token URL is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi"},i2=Object.keys(jl),a2=e=>new Promise(n=>setTimeout(n,e)),vf="https://api.addons.microsoftedge.microsoft.com",o2=class{options={};constructor(e){for(let n of i2){if(!e[n])throw new Error(jl[n]);this.options[n]=e[n]}}get productEndpoint(){return`${vf}/v1/products/${this.options.productId}`}get publishEndpoint(){return`${this.productEndpoint}/submissions`}get uploadEndpoint(){return`${this.publishEndpoint}/draft/package`}async submit({filePath:e="",notes:n=""}){let r=await this.getAccessToken(),t=await this.upload((0,n2.createReadStream)(e),r);return await this.waitForUpload(t,r),this.publish(n,r)}async publish(e="",n=null){let r={headers:{Authorization:`Bearer ${n||await this.getAccessToken()}`,"Content-Type":"application/x-www-form-urlencoded"}};e.length>0&&(r.body=`{ "notes"="${e}" }`);let t=await vr.post(this.publishEndpoint,r);return this.handleTempStatus(t.statusCode,"Submit"),t.headers.location}async upload(e=null,n=null){let r=n||await this.getAccessToken(),t=await vr.post(this.uploadEndpoint,{body:e,headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/zip"}});return this.handleTempStatus(t.statusCode,"Upload"),t.headers.location}async getPublishStatus(e,n=null){let r=n||await this.getAccessToken(),t=`${this.publishEndpoint}/operations/${e}`;return vr.get(t,{headers:{Authorization:`Bearer ${r}`}}).json()}async waitForUpload(e,n=null,r=5,t=3e3){let i=n||await this.getAccessToken(),o=`${this.uploadEndpoint}/operations/${e}`,l,u,s=0;for(;u!=="Succeeded"&&s{if(e!==202)throw e>=500?new Error("Edge server error, please try again later"):new Error(`${n} failed, double check your api credentials`)};getAccessToken=async()=>(await vr.post(`${this.options.accessTokenUrl}`,{body:`client_id=${this.options.clientId}&scope=${vf}/.default&client_secret=${this.options.clientSecret}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).json()).access_token},Ea="edge",s2=Cs(Ea);function u2(e){return pn(this,null,function*(){var n=e,{productId:r,notes:t,zip:i,dryRun:o}=n,l=bs(n,["productId","notes","zip","dryRun"]);let u=Ss(i),s=new o2(vs({productId:r},l));if(s2(`Updating extension with Product ID ${r}`),o)return!0;try{return yield s.submit({filePath:i,notes:t}),Es({extId:r,market:Ea,zip:i}),!0}catch(a){throw Ts(a,Ea,`"${r}" (${u.name})`)}})}function l2(e){return pn(this,null,function*(){return e.zip=Oa(e),e.verbose&&La(Ea),Ua({market:Ea,options:e,errorMap:jl}),u2(e)})}var Ht=e=>typeof e=="function",We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:e=>`Symbol(${e})`;function Xd(){}function nr(e){return typeof e=="object"&&e!==null||typeof e=="function"}var Yd=Xd;function Ye(e,n){try{Object.defineProperty(e,"name",{value:n,configurable:!0})}catch{}}var Ml=Promise,c2=Promise.prototype.then,h2=Promise.resolve.bind(Ml),f2=Promise.reject.bind(Ml);function sr(e){return new Ml(e)}function rt(e){return h2(e)}function xe(e){return f2(e)}function cn(e,n,r){return c2.call(e,n,r)}function rr(e,n,r){cn(cn(e,n,r),void 0,Yd)}function bf(e,n){rr(e,n)}function _f(e,n){rr(e,void 0,n)}function Mr(e,n,r){return cn(e,n,r)}function Vi(e){cn(e,void 0,Yd)}var Yo=e=>{if(typeof queueMicrotask=="function")Yo=queueMicrotask;else{let n=rt(void 0);Yo=r=>cn(n,r)}return Yo(e)};function Is(e,n,r){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,n,r)}function ci(e,n,r){try{return rt(Is(e,n,r))}catch(t){return xe(t)}}var Br=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let n=this._back,r=n;n._elements.length===16383&&(r={_elements:[],_next:void 0}),n._elements.push(e),r!==n&&(this._back=r,n._next=r),++this._size}shift(){let e=this._front,n=e,r=this._cursor,t=r+1,i=e._elements,o=i[r];return t===16384&&(n=e._next,t=0),--this._size,this._cursor=t,e!==n&&(this._front=n),i[r]=void 0,o}forEach(e){let n=this._cursor,r=this._front,t=r._elements;for(;!(n===t.length&&r._next===void 0||n===t.length&&(r=r._next,t=r._elements,n=0,t.length===0));)e(t[n]),++n}peek(){let e=this._front,n=this._cursor;return e._elements[n]}},Zd=We("[[AbortSteps]]"),Jd=We("[[ErrorSteps]]"),Vl=We("[[CancelSteps]]"),Fl=We("[[PullSteps]]"),Kl=We("[[ReleaseSteps]]");function ep(e,n){e._ownerReadableStream=n,n._reader=e,n._state==="readable"?ol(e):n._state==="closed"?function(r){ol(r),ip(r)}(e):np(e,n._storedError)}function tp(e,n){return Up(e._ownerReadableStream,n)}function rp(e){let n=e._ownerReadableStream;n._state==="readable"?$l(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(r,t){np(r,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),n._readableStreamController[Kl](),n._reader=void 0,e._ownerReadableStream=void 0}function Fi(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function ol(e){e._closedPromise=sr((n,r)=>{e._closedPromise_resolve=n,e._closedPromise_reject=r})}function np(e,n){ol(e),$l(e,n)}function $l(e,n){e._closedPromise_reject!==void 0&&(Vi(e._closedPromise),e._closedPromise_reject(n),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ip(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var wf=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},d2=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function hn(e,n){if(e!==void 0&&typeof(r=e)!="object"&&typeof r!="function")throw new TypeError(`${n} is not an object.`);var r}function Vr(e,n){if(typeof e!="function")throw new TypeError(`${n} is not a function.`)}function ap(e,n){if(!function(r){return typeof r=="object"&&r!==null||typeof r=="function"}(e))throw new TypeError(`${n} is not an object.`)}function dn(e,n,r){if(e===void 0)throw new TypeError(`Parameter ${n} is required in '${r}'.`)}function sl(e,n,r){if(e===void 0)throw new TypeError(`${n} is required in '${r}'.`)}function Hl(e){return Number(e)}function Sf(e){return e===0?0:e}function op(e,n){let r=Number.MAX_SAFE_INTEGER,t=Number(e);if(t=Sf(t),!wf(t))throw new TypeError(`${n} is not a finite number`);if(t=function(i){return Sf(d2(i))}(t),t<0||t>r)throw new TypeError(`${n} is outside the accepted range of 0 to ${r}, inclusive`);return wf(t)&&t!==0?t:0}function ga(e){if(!nr(e)||typeof e.getReader!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function sp(e){if(!nr(e)||typeof e.getWriter!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function up(e,n){if(!ui(e))throw new TypeError(`${n} is not a ReadableStream.`)}function lp(e,n){e._reader._readRequests.push(n)}function zl(e,n,r){let t=e._reader._readRequests.shift();r?t._closeSteps():t._chunkSteps(n)}function Rs(e){return e._reader._readRequests.length}function cp(e){let n=e._reader;return n!==void 0&&!!oi(n)}var Jn=class{constructor(e){if(dn(e,1,"ReadableStreamDefaultReader"),up(e,"First parameter"),$i(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ep(this,e),this._readRequests=new Br}get closed(){return oi(this)?this._closedPromise:xe(Do("closed"))}cancel(e){return oi(this)?this._ownerReadableStream===void 0?xe(Fi("cancel")):tp(this,e):xe(Do("cancel"))}read(){if(!oi(this))return xe(Do("read"));if(this._ownerReadableStream===void 0)return xe(Fi("read from"));let e,n,r=sr((t,i)=>{e=t,n=i});return function(t,i){let o=t._ownerReadableStream;o._disturbed=!0,o._state==="closed"?i._closeSteps():o._state==="errored"?i._errorSteps(o._storedError):o._readableStreamController[Fl](i)}(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:t=>n(t)}),r}releaseLock(){if(!oi(this))throw Do("releaseLock");this._ownerReadableStream!==void 0&&function(e){rp(e);let n=new TypeError("Reader was released");hp(e,n)}(this)}};function oi(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof Jn}function hp(e,n){let r=e._readRequests;e._readRequests=new Br,r.forEach(t=>{t._errorSteps(n)})}function Do(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(Jn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Ye(Jn.prototype.cancel,"cancel"),Ye(Jn.prototype.read,"read"),Ye(Jn.prototype.releaseLock,"releaseLock"),typeof We.toStringTag=="symbol"&&Object.defineProperty(Jn.prototype,We.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var fp=class{constructor(e,n){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=n}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Mr(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let n=()=>this._returnSteps(e);return this._ongoingPromise?Mr(this._ongoingPromise,n,n):n()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader;return e===void 0?xe(Fi("iterate")):cn(e.read(),n=>{var r;return this._ongoingPromise=void 0,n.done&&(this._isFinished=!0,(r=this._reader)===null||r===void 0||r.releaseLock(),this._reader=void 0),n},n=>{var r;throw this._ongoingPromise=void 0,this._isFinished=!0,(r=this._reader)===null||r===void 0||r.releaseLock(),this._reader=void 0,n})}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let n=this._reader;if(n===void 0)return xe(Fi("finish iterating"));if(this._reader=void 0,!this._preventCancel){let r=n.cancel(e);return n.releaseLock(),Mr(r,()=>({value:e,done:!0}))}return n.releaseLock(),rt({value:e,done:!0})}},dp={next(){return Ef(this)?this._asyncIteratorImpl.next():xe(Cf("next"))},return(e){return Ef(this)?this._asyncIteratorImpl.return(e):xe(Cf("return"))}};function Ef(e){if(!nr(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof fp}catch{return!1}}function Cf(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}typeof We.asyncIterator=="symbol"&&Object.defineProperty(dp,We.asyncIterator,{value(){return this},writable:!0,configurable:!0});var pp=Number.isNaN||function(e){return e!=e};function yp(e,n,r,t,i){new Uint8Array(e).set(new Uint8Array(r,t,i),n)}function Tf(e){let n=function(r,t,i){if(r.slice)return r.slice(t,i);let o=i-t,l=new ArrayBuffer(o);return yp(l,0,r,t,o),l}(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}function ul(e){let n=e._queue.shift();return e._queueTotalSize-=n.size,e._queueTotalSize<0&&(e._queueTotalSize=0),n.value}function Wl(e,n,r){if(typeof(t=r)!="number"||pp(t)||t<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var t;e._queue.push({value:n,size:r}),e._queueTotalSize+=r}function Un(e){e._queue=new Br,e._queueTotalSize=0}var xi=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Mu(this))throw Vu("view");return this._view}respond(e){if(!Mu(this))throw Vu("respond");if(dn(e,1,"respond"),e=op(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(n,r){let t=n._pendingPullIntos.peek();if(n._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=t.buffer,If(n,r)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!Mu(this))throw Vu("respondWithNewView");if(dn(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");e.buffer,function(n,r){let t=n._pendingPullIntos.peek();if(n._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=r.byteLength;t.buffer=r.buffer,If(n,i)}(this._associatedReadableByteStreamController,e)}};Object.defineProperties(xi.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Ye(xi.prototype.respond,"respond"),Ye(xi.prototype.respondWithNewView,"respondWithNewView"),typeof We.toStringTag=="symbol"&&Object.defineProperty(xi.prototype,We.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var ei=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Oi(this))throw ca("byobRequest");return function(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let n=e._pendingPullIntos.peek(),r=new Uint8Array(n.buffer,n.byteOffset+n.bytesFilled,n.byteLength-n.bytesFilled),t=Object.create(xi.prototype);(function(i,o,l){i._associatedReadableByteStreamController=o,i._view=l})(t,e,r),e._byobRequest=t}return e._byobRequest}(this)}get desiredSize(){if(!Oi(this))throw ca("desiredSize");return Ep(this)}close(){if(!Oi(this))throw ca("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if(e!=="readable")throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);(function(n){let r=n._controlledReadableByteStream;if(!(n._closeRequested||r._state!=="readable")){if(n._queueTotalSize>0)return void(n._closeRequested=!0);if(n._pendingPullIntos.length>0&&n._pendingPullIntos.peek().bytesFilled>0){let t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ki(n,t),t}us(n),Ta(r)}})(this)}enqueue(e){if(!Oi(this))throw ca("enqueue");if(dn(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let n=this._controlledReadableByteStream._state;if(n!=="readable")throw new TypeError(`The stream (in ${n} state) is not in the readable state and cannot be enqueued to`);(function(r,t){let i=r._controlledReadableByteStream;if(r._closeRequested||i._state!=="readable")return;let o=t.buffer,l=t.byteOffset,u=t.byteLength,s=o;if(r._pendingPullIntos.length>0){let a=r._pendingPullIntos.peek();a.buffer,Gl(r),a.buffer=a.buffer,a.readerType==="none"&&bp(r,a)}cp(i)?(function(a){let y=a._controlledReadableByteStream._reader;for(;y._readRequests.length>0;){if(a._queueTotalSize===0)return;Rf(a,y._readRequests.shift())}}(r),Rs(i)===0?Zo(r,s,l,u):(r._pendingPullIntos.length>0&&ji(r),zl(i,new Uint8Array(s,l,u),!1))):Ql(i)?(Zo(r,s,l,u),cl(r)):Zo(r,s,l,u),li(r)})(this,e)}error(e){if(!Oi(this))throw ca("error");Ki(this,e)}[Vl](e){gp(this),Un(this);let n=this._cancelAlgorithm(e);return us(this),n}[Fl](e){let n=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void Rf(this,e);let r=this._autoAllocateChunkSize;if(r!==void 0){let t;try{t=new ArrayBuffer(r)}catch(o){return void e._errorSteps(o)}let i={buffer:t,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}lp(n,e),li(this)}[Kl](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new Br,this._pendingPullIntos.push(e)}}};function Oi(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof ei}function Mu(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof xi}function li(e){if(function(n){let r=n._controlledReadableByteStream;return r._state!=="readable"||n._closeRequested||!n._started?!1:!!(cp(r)&&Rs(r)>0||Ql(r)&&Cp(r)>0||Ep(n)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,rr(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,li(e)),null),n=>(Ki(e,n),null))}}function gp(e){Gl(e),e._pendingPullIntos=new Br}function ll(e,n){let r=!1;e._state==="closed"&&(r=!0);let t=mp(n);n.readerType==="default"?zl(e,t,r):function(i,o,l){let u=i._reader._readIntoRequests.shift();l?u._closeSteps(o):u._chunkSteps(o)}(e,t,r)}function mp(e){let n=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,n/r)}function Zo(e,n,r,t){e._queue.push({buffer:n,byteOffset:r,byteLength:t}),e._queueTotalSize+=t}function vp(e,n,r,t){let i;try{i=n.slice(r,r+t)}catch(o){throw Ki(e,o),o}Zo(e,i,0,t)}function bp(e,n){n.bytesFilled>0&&vp(e,n.buffer,n.byteOffset,n.bytesFilled),ji(e)}function _p(e,n){let r=n.elementSize,t=n.bytesFilled-n.bytesFilled%r,i=Math.min(e._queueTotalSize,n.byteLength-n.bytesFilled),o=n.bytesFilled+i,l=o-o%r,u=i,s=!1;l>t&&(u=l-n.bytesFilled,s=!0);let a=e._queue;for(;u>0;){let y=a.peek(),c=Math.min(u,y.byteLength),g=n.byteOffset+n.bytesFilled;yp(n.buffer,g,y.buffer,y.byteOffset,c),y.byteLength===c?a.shift():(y.byteOffset+=c,y.byteLength-=c),e._queueTotalSize-=c,wp(e,c,n),u-=c}return s}function wp(e,n,r){r.bytesFilled+=n}function Sp(e){e._queueTotalSize===0&&e._closeRequested?(us(e),Ta(e._controlledReadableByteStream)):li(e)}function Gl(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function cl(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let n=e._pendingPullIntos.peek();_p(e,n)&&(ji(e),ll(e._controlledReadableByteStream,n))}}function If(e,n){let r=e._pendingPullIntos.peek();Gl(e),e._controlledReadableByteStream._state==="closed"?function(t,i){i.readerType==="none"&&ji(t);let o=t._controlledReadableByteStream;if(Ql(o))for(;Cp(o)>0;)ll(o,ji(t))}(e,r):function(t,i,o){if(wp(0,i,o),o.readerType==="none")return bp(t,o),void cl(t);if(o.bytesFilled0){let u=o.byteOffset+o.bytesFilled;vp(t,o.buffer,u-l,l)}o.bytesFilled-=l,ll(t._controlledReadableByteStream,o),cl(t)}(e,n,r),li(e)}function ji(e){return e._pendingPullIntos.shift()}function us(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ki(e,n){let r=e._controlledReadableByteStream;r._state==="readable"&&(gp(e),Un(e),us(e),Dp(r,n))}function Rf(e,n){let r=e._queue.shift();e._queueTotalSize-=r.byteLength,Sp(e);let t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);n._chunkSteps(t)}function Ep(e){let n=e._controlledReadableByteStream._state;return n==="errored"?null:n==="closed"?0:e._strategyHWM-e._queueTotalSize}function p2(e,n,r){let t=Object.create(ei.prototype),i,o,l;i=n.start!==void 0?()=>n.start(t):()=>{},o=n.pull!==void 0?()=>n.pull(t):()=>rt(void 0),l=n.cancel!==void 0?s=>n.cancel(s):()=>rt(void 0);let u=n.autoAllocateChunkSize;if(u===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(s,a,y,c,g,I,w){a._controlledReadableByteStream=s,a._pullAgain=!1,a._pulling=!1,a._byobRequest=null,a._queue=a._queueTotalSize=void 0,Un(a),a._closeRequested=!1,a._started=!1,a._strategyHWM=I,a._pullAlgorithm=c,a._cancelAlgorithm=g,a._autoAllocateChunkSize=w,a._pendingPullIntos=new Br,s._readableStreamController=a,rr(rt(y()),()=>(a._started=!0,li(a),null),m=>(Ki(a,m),null))})(e,t,i,o,l,r,u)}function Vu(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function ca(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Af(e,n){e._reader._readIntoRequests.push(n)}function Cp(e){return e._reader._readIntoRequests.length}function Ql(e){let n=e._reader;return n!==void 0&&!!qi(n)}Object.defineProperties(ei.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Ye(ei.prototype.close,"close"),Ye(ei.prototype.enqueue,"enqueue"),Ye(ei.prototype.error,"error"),typeof We.toStringTag=="symbol"&&Object.defineProperty(ei.prototype,We.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var ti=class{constructor(e){if(dn(e,1,"ReadableStreamBYOBReader"),up(e,"First parameter"),$i(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Oi(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ep(this,e),this._readIntoRequests=new Br}get closed(){return qi(this)?this._closedPromise:xe(xo("closed"))}cancel(e){return qi(this)?this._ownerReadableStream===void 0?xe(Fi("cancel")):tp(this,e):xe(xo("cancel"))}read(e){if(!qi(this))return xe(xo("read"));if(!ArrayBuffer.isView(e))return xe(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return xe(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return xe(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,this._ownerReadableStream===void 0)return xe(Fi("read from"));let n,r,t=sr((i,o)=>{n=i,r=o});return function(i,o,l){let u=i._ownerReadableStream;u._disturbed=!0,u._state==="errored"?l._errorSteps(u._storedError):function(s,a,y){let c=s._controlledReadableByteStream,g=1;a.constructor!==DataView&&(g=a.constructor.BYTES_PER_ELEMENT);let I=a.constructor,w=a.buffer,m={buffer:w,bufferByteLength:w.byteLength,byteOffset:a.byteOffset,byteLength:a.byteLength,bytesFilled:0,elementSize:g,viewConstructor:I,readerType:"byob"};if(s._pendingPullIntos.length>0)return s._pendingPullIntos.push(m),void Af(c,y);if(c._state!=="closed"){if(s._queueTotalSize>0){if(_p(s,m)){let S=mp(m);return Sp(s),void y._chunkSteps(S)}if(s._closeRequested){let S=new TypeError("Insufficient bytes to fill elements in the given buffer");return Ki(s,S),void y._errorSteps(S)}}s._pendingPullIntos.push(m),Af(c,y),li(s)}else{let S=new I(m.buffer,m.byteOffset,0);y._closeSteps(S)}}(u._readableStreamController,o,l)}(this,e,{_chunkSteps:i=>n({value:i,done:!1}),_closeSteps:i=>n({value:i,done:!0}),_errorSteps:i=>r(i)}),t}releaseLock(){if(!qi(this))throw xo("releaseLock");this._ownerReadableStream!==void 0&&function(e){rp(e);let n=new TypeError("Reader was released");Tp(e,n)}(this)}};function qi(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof ti}function Tp(e,n){let r=e._readIntoRequests;e._readIntoRequests=new Br,r.forEach(t=>{t._errorSteps(n)})}function xo(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Ca(e,n){let{highWaterMark:r}=e;if(r===void 0)return n;if(pp(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function ls(e){let{size:n}=e;return n||(()=>1)}function cs(e,n){hn(e,n);let r=e?.highWaterMark,t=e?.size;return{highWaterMark:r===void 0?void 0:Hl(r),size:t===void 0?void 0:y2(t,`${n} has member 'size' that`)}}function y2(e,n){return Vr(e,n),r=>Hl(e(r))}function g2(e,n,r){return Vr(e,r),t=>ci(e,n,[t])}function m2(e,n,r){return Vr(e,r),()=>ci(e,n,[])}function v2(e,n,r){return Vr(e,r),t=>Is(e,n,[t])}function b2(e,n,r){return Vr(e,r),(t,i)=>ci(e,n,[t,i])}Object.defineProperties(ti.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Ye(ti.prototype.cancel,"cancel"),Ye(ti.prototype.read,"read"),Ye(ti.prototype.releaseLock,"releaseLock"),typeof We.toStringTag=="symbol"&&Object.defineProperty(ti.prototype,We.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var _2=typeof AbortController=="function",ri=class{constructor(e={},n={}){e===void 0?e=null:ap(e,"First parameter");let r=cs(n,"Second parameter"),t=function(l,u){hn(l,u);let s=l?.abort,a=l?.close,y=l?.start,c=l?.type,g=l?.write;return{abort:s===void 0?void 0:g2(s,l,`${u} has member 'abort' that`),close:a===void 0?void 0:m2(a,l,`${u} has member 'close' that`),start:y===void 0?void 0:v2(y,l,`${u} has member 'start' that`),write:g===void 0?void 0:b2(g,l,`${u} has member 'write' that`),type:c}}(e,"First parameter");var i;if((i=this)._state="writable",i._storedError=void 0,i._writer=void 0,i._writableStreamController=void 0,i._writeRequests=new Br,i._inFlightWriteRequest=void 0,i._closeRequest=void 0,i._inFlightCloseRequest=void 0,i._pendingAbortRequest=void 0,i._backpressure=!1,t.type!==void 0)throw new RangeError("Invalid type is specified");let o=ls(r);(function(l,u,s,a){let y=Object.create(hs.prototype),c,g,I,w;c=u.start!==void 0?()=>u.start(y):()=>{},g=u.write!==void 0?m=>u.write(m,y):()=>rt(void 0),I=u.close!==void 0?()=>u.close():()=>rt(void 0),w=u.abort!==void 0?m=>u.abort(m):()=>rt(void 0),function(m,S,B,A,f,b,E,R){S._controlledWritableStream=m,m._writableStreamController=S,S._queue=void 0,S._queueTotalSize=void 0,Un(S),S._abortReason=void 0,S._abortController=function(){if(_2)return new AbortController}(),S._started=!1,S._strategySizeAlgorithm=R,S._strategyHWM=E,S._writeAlgorithm=A,S._closeAlgorithm=f,S._abortAlgorithm=b;let P=Jl(S);Zl(m,P);let C=B();rr(rt(C),()=>(S._started=!0,As(S),null),d=>(S._started=!0,hl(m,d),null))}(l,y,c,g,I,w,s,a)})(this,t,Ca(r,1),o)}get locked(){if(!Yr(this))throw jo("locked");return Jo(this)}abort(e){return Yr(this)?Jo(this)?xe(new TypeError("Cannot abort a stream that already has a writer")):Ip(this,e):xe(jo("abort"))}close(){return Yr(this)?Jo(this)?xe(new TypeError("Cannot close a stream that already has a writer")):Nn(this)?xe(new TypeError("Cannot close an already-closing stream")):Rp(this):xe(jo("close"))}getWriter(){if(!Yr(this))throw jo("getWriter");return new kn(this)}};function Yr(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof ri}function Jo(e){return e._writer!==void 0}function Ip(e,n){var r;if(e._state==="closed"||e._state==="errored")return rt(void 0);e._writableStreamController._abortReason=n,(r=e._writableStreamController._abortController)===null||r===void 0||r.abort(n);let t=e._state;if(t==="closed"||t==="errored")return rt(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let i=!1;t==="erroring"&&(i=!0,n=void 0);let o=sr((l,u)=>{e._pendingAbortRequest={_promise:void 0,_resolve:l,_reject:u,_reason:n,_wasAlreadyErroring:i}});return e._pendingAbortRequest._promise=o,i||Xl(e,n),o}function Rp(e){let n=e._state;if(n==="closed"||n==="errored")return xe(new TypeError(`The stream (in ${n} state) is not in the writable state and cannot be closed`));let r=sr((o,l)=>{let u={_resolve:o,_reject:l};e._closeRequest=u}),t=e._writer;var i;return t!==void 0&&e._backpressure&&n==="writable"&&tc(t),Wl(i=e._writableStreamController,Bp,0),As(i),r}function hl(e,n){e._state!=="writable"?Yl(e):Xl(e,n)}function Xl(e,n){let r=e._writableStreamController;e._state="erroring",e._storedError=n;let t=e._writer;t!==void 0&&Ap(t,n),!function(i){return!(i._inFlightWriteRequest===void 0&&i._inFlightCloseRequest===void 0)}(e)&&r._started&&Yl(e)}function Yl(e){e._state="errored",e._writableStreamController[Jd]();let n=e._storedError;if(e._writeRequests.forEach(t=>{t._reject(n)}),e._writeRequests=new Br,e._pendingAbortRequest===void 0)return void qo(e);let r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(n),void qo(e);rr(e._writableStreamController[Zd](r._reason),()=>(r._resolve(),qo(e),null),t=>(r._reject(t),qo(e),null))}function Nn(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function qo(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let n=e._writer;n!==void 0&&ec(n,e._storedError)}function Zl(e,n){let r=e._writer;r!==void 0&&n!==e._backpressure&&(n?function(t){Bs(t)}(r):tc(r)),e._backpressure=n}Object.defineProperties(ri.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Ye(ri.prototype.abort,"abort"),Ye(ri.prototype.close,"close"),Ye(ri.prototype.getWriter,"getWriter"),typeof We.toStringTag=="symbol"&&Object.defineProperty(ri.prototype,We.toStringTag,{value:"WritableStream",configurable:!0});var kn=class{constructor(e){if(dn(e,1,"WritableStreamDefaultWriter"),function(t,i){if(!Yr(t))throw new TypeError(`${i} is not a WritableStream.`)}(e,"First parameter"),Jo(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let n=e._state;if(n==="writable")!Nn(e)&&e._backpressure?Bs(this):Pf(this),es(this);else if(n==="erroring")fl(this,e._storedError),es(this);else if(n==="closed")Pf(this),es(r=this),Np(r);else{let t=e._storedError;fl(this,t),kf(this,t)}var r}get closed(){return $n(this)?this._closedPromise:xe(Hn("closed"))}get desiredSize(){if(!$n(this))throw Hn("desiredSize");if(this._ownerWritableStream===void 0)throw ha("desiredSize");return function(e){let n=e._ownerWritableStream,r=n._state;return r==="errored"||r==="erroring"?null:r==="closed"?0:kp(n._writableStreamController)}(this)}get ready(){return $n(this)?this._readyPromise:xe(Hn("ready"))}abort(e){return $n(this)?this._ownerWritableStream===void 0?xe(ha("abort")):function(n,r){return Ip(n._ownerWritableStream,r)}(this,e):xe(Hn("abort"))}close(){if(!$n(this))return xe(Hn("close"));let e=this._ownerWritableStream;return e===void 0?xe(ha("close")):Nn(e)?xe(new TypeError("Cannot close an already-closing stream")):Rp(this._ownerWritableStream)}releaseLock(){if(!$n(this))throw Hn("releaseLock");this._ownerWritableStream!==void 0&&function(e){let n=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ap(e,r),function(t,i){t._closedPromiseState==="pending"?ec(t,i):function(o,l){kf(o,l)}(t,i)}(e,r),n._writer=void 0,e._ownerWritableStream=void 0}(this)}write(e){return $n(this)?this._ownerWritableStream===void 0?xe(ha("write to")):function(n,r){let t=n._ownerWritableStream,i=t._writableStreamController,o=function(s,a){try{return s._strategySizeAlgorithm(a)}catch(y){return Bf(s,y),1}}(i,r);if(t!==n._ownerWritableStream)return xe(ha("write to"));let l=t._state;if(l==="errored")return xe(t._storedError);if(Nn(t)||l==="closed")return xe(new TypeError("The stream is closing or closed and cannot be written to"));if(l==="erroring")return xe(t._storedError);let u=function(s){return sr((a,y)=>{let c={_resolve:a,_reject:y};s._writeRequests.push(c)})}(t);return function(s,a,y){try{Wl(s,a,y)}catch(g){return void Bf(s,g)}let c=s._controlledWritableStream;!Nn(c)&&c._state==="writable"&&Zl(c,Jl(s)),As(s)}(i,r,o),u}(this,e):xe(Hn("write"))}};function $n(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof kn}function Ap(e,n){e._readyPromiseState==="pending"?Op(e,n):function(r,t){fl(r,t)}(e,n)}Object.defineProperties(kn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Ye(kn.prototype.abort,"abort"),Ye(kn.prototype.close,"close"),Ye(kn.prototype.releaseLock,"releaseLock"),Ye(kn.prototype.write,"write"),typeof We.toStringTag=="symbol"&&Object.defineProperty(kn.prototype,We.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Bp={},hs=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Fu(this))throw Ku("abortReason");return this._abortReason}get signal(){if(!Fu(this))throw Ku("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!Fu(this))throw Ku("error");this._controlledWritableStream._state==="writable"&&Pp(this,e)}[Zd](e){let n=this._abortAlgorithm(e);return fs(this),n}[Jd](){Un(this)}};function Fu(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof hs}function fs(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function kp(e){return e._strategyHWM-e._queueTotalSize}function As(e){let n=e._controlledWritableStream;if(!e._started||n._inFlightWriteRequest!==void 0)return;if(n._state==="erroring")return void Yl(n);if(e._queue.length===0)return;let r=e._queue.peek().value;r===Bp?function(t){let i=t._controlledWritableStream;(function(l){l._inFlightCloseRequest=l._closeRequest,l._closeRequest=void 0})(i),ul(t);let o=t._closeAlgorithm();fs(t),rr(o,()=>(function(l){l._inFlightCloseRequest._resolve(void 0),l._inFlightCloseRequest=void 0,l._state==="erroring"&&(l._storedError=void 0,l._pendingAbortRequest!==void 0&&(l._pendingAbortRequest._resolve(),l._pendingAbortRequest=void 0)),l._state="closed";let u=l._writer;u!==void 0&&Np(u)}(i),null),l=>(function(u,s){u._inFlightCloseRequest._reject(s),u._inFlightCloseRequest=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._reject(s),u._pendingAbortRequest=void 0),hl(u,s)}(i,l),null))}(e):function(t,i){let o=t._controlledWritableStream;(function(l){l._inFlightWriteRequest=l._writeRequests.shift()})(o),rr(t._writeAlgorithm(i),()=>{(function(u){u._inFlightWriteRequest._resolve(void 0),u._inFlightWriteRequest=void 0})(o);let l=o._state;if(ul(t),!Nn(o)&&l==="writable"){let u=Jl(t);Zl(o,u)}return As(t),null},l=>(o._state==="writable"&&fs(t),function(u,s){u._inFlightWriteRequest._reject(s),u._inFlightWriteRequest=void 0,hl(u,s)}(o,l),null))}(e,r)}function Bf(e,n){e._controlledWritableStream._state==="writable"&&Pp(e,n)}function Jl(e){return kp(e)<=0}function Pp(e,n){let r=e._controlledWritableStream;fs(e),Xl(r,n)}function jo(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ku(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Hn(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function ha(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function es(e){e._closedPromise=sr((n,r)=>{e._closedPromise_resolve=n,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function kf(e,n){es(e),ec(e,n)}function ec(e,n){e._closedPromise_reject!==void 0&&(Vi(e._closedPromise),e._closedPromise_reject(n),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Np(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Bs(e){e._readyPromise=sr((n,r)=>{e._readyPromise_resolve=n,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function fl(e,n){Bs(e),Op(e,n)}function Pf(e){Bs(e),tc(e)}function Op(e,n){e._readyPromise_reject!==void 0&&(Vi(e._readyPromise),e._readyPromise_reject(n),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function tc(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(hs.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof We.toStringTag=="symbol"&&Object.defineProperty(hs.prototype,We.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Nf=typeof DOMException<"u"?DOMException:void 0,w2=function(e){if(typeof e!="function"&&typeof e!="object")return!1;try{return new e,!0}catch{return!1}}(Nf)?Nf:function(){let e=function(n,r){this.message=n||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Of(e,n,r,t,i,o){let l=e.getReader(),u=n.getWriter();ui(e)&&(e._disturbed=!0);let s,a,y,c=!1,g=!1,I="readable",w="writable",m=!1,S=!1,B=sr(f=>{y=f}),A=Promise.resolve(void 0);return sr((f,b)=>{let E;function R(){if(c)return;let M=sr((v,N)=>{(function L(O){O?v():cn(function(){return c?rt(!0):cn(u.ready,()=>cn(l.read(),K=>!!K.done||(A=u.write(K.value),Vi(A),!1)))}(),L,N)})(!1)});Vi(M)}function P(){return I="closed",r?U():h(()=>(Yr(n)&&(m=Nn(n),w=n._state),m||w==="closed"?rt(void 0):w==="erroring"||w==="errored"?xe(a):(m=!0,u.close())),!1,void 0),null}function C(M){return c||(I="errored",s=M,t?U(!0,M):h(()=>u.abort(M),!0,M)),null}function d(M){return g||(w="errored",a=M,i?U(!0,M):h(()=>l.cancel(M),!0,M)),null}if(o!==void 0&&(E=()=>{let M=o.reason!==void 0?o.reason:new w2("Aborted","AbortError"),v=[];t||v.push(()=>w==="writable"?u.abort(M):rt(void 0)),i||v.push(()=>I==="readable"?l.cancel(M):rt(void 0)),h(()=>Promise.all(v.map(N=>N())),!0,M)},o.aborted?E():o.addEventListener("abort",E)),ui(e)&&(I=e._state,s=e._storedError),Yr(n)&&(w=n._state,a=n._storedError,m=Nn(n)),ui(e)&&Yr(n)&&(S=!0,y()),I==="errored")C(s);else if(w==="erroring"||w==="errored")d(a);else if(I==="closed")P();else if(m||w==="closed"){let M=new TypeError("the destination writable stream closed before all data could be piped to it");i?U(!0,M):h(()=>l.cancel(M),!0,M)}function h(M,v,N){function L(){return w!=="writable"||m?O():bf(function(){let K;return rt(function Y(){if(K!==A)return K=A,Mr(A,Y,Y)}())}(),O),null}function O(){return M?rr(M(),()=>j(v,N),K=>j(!0,K)):j(v,N),null}c||(c=!0,S?L():bf(B,L))}function U(M,v){h(void 0,M,v)}function j(M,v){return g=!0,u.releaseLock(),l.releaseLock(),o!==void 0&&o.removeEventListener("abort",E),M?b(v):f(void 0),null}c||(rr(l.closed,P,C),rr(u.closed,function(){return g||(w="closed"),null},d)),S?R():Yo(()=>{S=!0,y(),R()})})}function S2(e,n){return function(r){try{return r.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}(e)?function(r){let t,i,o,l,u,s=r.getReader(),a=!1,y=!1,c=!1,g=!1,I=!1,w=!1,m=sr(d=>{u=d});function S(d){_f(d.closed,h=>(d!==s||(o.error(h),l.error(h),I&&w||u(void 0)),null))}function B(){a&&(s.releaseLock(),s=r.getReader(),S(s),a=!1),rr(s.read(),d=>{var h,U;if(c=!1,g=!1,d.done)return I||o.close(),w||l.close(),(h=o.byobRequest)===null||h===void 0||h.respond(0),(U=l.byobRequest)===null||U===void 0||U.respond(0),I&&w||u(void 0),null;let j=d.value,M=j,v=j;if(!I&&!w)try{v=Tf(j)}catch(N){return o.error(N),l.error(N),u(s.cancel(N)),null}return I||o.enqueue(M),w||l.enqueue(v),y=!1,c?f():g&&b(),null},()=>(y=!1,null))}function A(d,h){a||(s.releaseLock(),s=r.getReader({mode:"byob"}),S(s),a=!0);let U=h?l:o,j=h?o:l;rr(s.read(d),M=>{var v;c=!1,g=!1;let N=h?w:I,L=h?I:w;if(M.done){N||U.close(),L||j.close();let K=M.value;return K!==void 0&&(N||U.byobRequest.respondWithNewView(K),L||(v=j.byobRequest)===null||v===void 0||v.respond(0)),N&&L||u(void 0),null}let O=M.value;if(L)N||U.byobRequest.respondWithNewView(O);else{let K;try{K=Tf(O)}catch(Y){return U.error(Y),j.error(Y),u(s.cancel(Y)),null}N||U.byobRequest.respondWithNewView(O),j.enqueue(K)}return y=!1,c?f():g&&b(),null},()=>(y=!1,null))}function f(){if(y)return c=!0,rt(void 0);y=!0;let d=o.byobRequest;return d===null?B():A(d.view,!1),rt(void 0)}function b(){if(y)return g=!0,rt(void 0);y=!0;let d=l.byobRequest;return d===null?B():A(d.view,!0),rt(void 0)}function E(d){if(I=!0,t=d,w){let h=[t,i],U=s.cancel(h);u(U)}return m}function R(d){if(w=!0,i=d,I){let h=[t,i],U=s.cancel(h);u(U)}return m}let P=new Jt({type:"bytes",start(d){o=d},pull:f,cancel:E}),C=new Jt({type:"bytes",start(d){l=d},pull:b,cancel:R});return S(s),[P,C]}(e):function(r,t){let i=r.getReader(),o,l,u,s,a,y=!1,c=!1,g=!1,I=!1,w=sr(b=>{a=b});function m(){return y?(c=!0,rt(void 0)):(y=!0,rr(i.read(),b=>{if(c=!1,b.done)return g||u.close(),I||s.close(),g&&I||a(void 0),null;let E=b.value,R=E,P=E;return g||u.enqueue(R),I||s.enqueue(P),y=!1,c&&m(),null},()=>(y=!1,null)),rt(void 0))}function S(b){if(g=!0,o=b,I){let E=[o,l],R=i.cancel(E);a(R)}return w}function B(b){if(I=!0,l=b,g){let E=[o,l],R=i.cancel(E);a(R)}return w}let A=new Jt({start(b){u=b},pull:m,cancel:S}),f=new Jt({start(b){s=b},pull:m,cancel:B});return _f(i.closed,b=>(u.error(b),s.error(b),g&&I||a(void 0),null)),[A,f]}(e)}var ni=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Mo(this))throw Vo("desiredSize");return Lp(this)}close(){if(!Mo(this))throw Vo("close");if(!ma(this))throw new TypeError("The stream is not in a state that permits close");(function(e){if(!ma(e))return;let n=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(ts(e),Ta(n))})(this)}enqueue(e){if(!Mo(this))throw Vo("enqueue");if(!ma(this))throw new TypeError("The stream is not in a state that permits enqueue");return function(n,r){if(!ma(n))return;let t=n._controlledReadableStream;if($i(t)&&Rs(t)>0)zl(t,r,!1);else{let i;try{i=n._strategySizeAlgorithm(r)}catch(o){throw wa(n,o),o}try{Wl(n,r,i)}catch(o){throw wa(n,o),o}}_a(n)}(this,e)}error(e){if(!Mo(this))throw Vo("error");wa(this,e)}[Vl](e){Un(this);let n=this._cancelAlgorithm(e);return ts(this),n}[Fl](e){let n=this._controlledReadableStream;if(this._queue.length>0){let r=ul(this);this._closeRequested&&this._queue.length===0?(ts(this),Ta(n)):_a(this),e._chunkSteps(r)}else lp(n,e),_a(this)}[Kl](){}};function Mo(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof ni}function _a(e){if(function(n){let r=n._controlledReadableStream;return!ma(n)||!n._started?!1:!!($i(r)&&Rs(r)>0||Lp(n)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,rr(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,_a(e)),null),n=>(wa(e,n),null))}}function ts(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function wa(e,n){let r=e._controlledReadableStream;r._state==="readable"&&(Un(e),ts(e),Dp(r,n))}function Lp(e){let n=e._controlledReadableStream._state;return n==="errored"?null:n==="closed"?0:e._strategyHWM-e._queueTotalSize}function ma(e){return!e._closeRequested&&e._controlledReadableStream._state==="readable"}function E2(e,n,r,t){let i=Object.create(ni.prototype),o,l,u;o=n.start!==void 0?()=>n.start(i):()=>{},l=n.pull!==void 0?()=>n.pull(i):()=>rt(void 0),u=n.cancel!==void 0?s=>n.cancel(s):()=>rt(void 0),function(s,a,y,c,g,I,w){a._controlledReadableStream=s,a._queue=void 0,a._queueTotalSize=void 0,Un(a),a._started=!1,a._closeRequested=!1,a._pullAgain=!1,a._pulling=!1,a._strategySizeAlgorithm=w,a._strategyHWM=I,a._pullAlgorithm=c,a._cancelAlgorithm=g,s._readableStreamController=a,rr(rt(y()),()=>(a._started=!0,_a(a),null),m=>(wa(a,m),null))}(e,i,o,l,u,r,t)}function Vo(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function C2(e,n,r){return Vr(e,r),t=>ci(e,n,[t])}function T2(e,n,r){return Vr(e,r),t=>ci(e,n,[t])}function I2(e,n,r){return Vr(e,r),t=>Is(e,n,[t])}function R2(e,n){if((e=`${e}`)!="bytes")throw new TypeError(`${n} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function A2(e,n){if((e=`${e}`)!="byob")throw new TypeError(`${n} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Lf(e,n){hn(e,n);let r=e?.preventAbort,t=e?.preventCancel,i=e?.preventClose,o=e?.signal;return o!==void 0&&function(l,u){if(!function(s){if(typeof s!="object"||s===null)return!1;try{return typeof s.aborted=="boolean"}catch{return!1}}(l))throw new TypeError(`${u} is not an AbortSignal.`)}(o,`${n} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(t),preventClose:Boolean(i),signal:o}}function B2(e,n){hn(e,n);let r=e?.readable;sl(r,"readable","ReadableWritablePair"),function(i,o){if(!ga(i))throw new TypeError(`${o} is not a ReadableStream.`)}(r,`${n} has member 'readable' that`);let t=e?.writable;return sl(t,"writable","ReadableWritablePair"),function(i,o){if(!sp(i))throw new TypeError(`${o} is not a WritableStream.`)}(t,`${n} has member 'writable' that`),{readable:r,writable:t}}Object.defineProperties(ni.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Ye(ni.prototype.close,"close"),Ye(ni.prototype.enqueue,"enqueue"),Ye(ni.prototype.error,"error"),typeof We.toStringTag=="symbol"&&Object.defineProperty(ni.prototype,We.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Jt=class{constructor(e={},n={}){e===void 0?e=null:ap(e,"First parameter");let r=cs(n,"Second parameter"),t=function(o,l){hn(o,l);let u=o,s=u?.autoAllocateChunkSize,a=u?.cancel,y=u?.pull,c=u?.start,g=u?.type;return{autoAllocateChunkSize:s===void 0?void 0:op(s,`${l} has member 'autoAllocateChunkSize' that`),cancel:a===void 0?void 0:C2(a,u,`${l} has member 'cancel' that`),pull:y===void 0?void 0:T2(y,u,`${l} has member 'pull' that`),start:c===void 0?void 0:I2(c,u,`${l} has member 'start' that`),type:g===void 0?void 0:R2(g,`${l} has member 'type' that`)}}(e,"First parameter");var i;if((i=this)._state="readable",i._reader=void 0,i._storedError=void 0,i._disturbed=!1,t.type==="bytes"){if(r.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");p2(this,t,Ca(r,0))}else{let o=ls(r);E2(this,t,Ca(r,1),o)}}get locked(){if(!ui(this))throw zn("locked");return $i(this)}cancel(e){return ui(this)?$i(this)?xe(new TypeError("Cannot cancel a stream that already has a reader")):Up(this,e):xe(zn("cancel"))}getReader(e){if(!ui(this))throw zn("getReader");return function(n,r){hn(n,r);let t=n?.mode;return{mode:t===void 0?void 0:A2(t,`${r} has member 'mode' that`)}}(e,"First parameter").mode===void 0?new Jn(this):function(n){return new ti(n)}(this)}pipeThrough(e,n={}){if(!ga(this))throw zn("pipeThrough");dn(e,1,"pipeThrough");let r=B2(e,"First parameter"),t=Lf(n,"Second parameter");if(this.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(r.writable.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Vi(Of(this,r.writable,t.preventClose,t.preventAbort,t.preventCancel,t.signal)),r.readable}pipeTo(e,n={}){if(!ga(this))return xe(zn("pipeTo"));if(e===void 0)return xe("Parameter 1 is required in 'pipeTo'.");if(!sp(e))return xe(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Lf(n,"Second parameter")}catch(t){return xe(t)}return this.locked?xe(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):e.locked?xe(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Of(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!ga(this))throw zn("tee");if(this.locked)throw new TypeError("Cannot tee a stream that already has a reader");return S2(this)}values(e){if(!ga(this))throw zn("values");return function(n,r){let t=n.getReader(),i=new fp(t,r),o=Object.create(dp);return o._asyncIteratorImpl=i,o}(this,function(n,r){hn(n,r);let t=n?.preventCancel;return{preventCancel:Boolean(t)}}(e,"First parameter").preventCancel)}};function ui(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof Jt}function $i(e){return e._reader!==void 0}function Up(e,n){if(e._disturbed=!0,e._state==="closed")return rt(void 0);if(e._state==="errored")return xe(e._storedError);Ta(e);let r=e._reader;if(r!==void 0&&qi(r)){let t=r._readIntoRequests;r._readIntoRequests=new Br,t.forEach(i=>{i._closeSteps(void 0)})}return Mr(e._readableStreamController[Vl](n),Xd)}function Ta(e){e._state="closed";let n=e._reader;if(n!==void 0&&(ip(n),oi(n))){let r=n._readRequests;n._readRequests=new Br,r.forEach(t=>{t._closeSteps()})}}function Dp(e,n){e._state="errored",e._storedError=n;let r=e._reader;r!==void 0&&($l(r,n),oi(r)?hp(r,n):Tp(r,n))}function zn(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function xp(e,n){hn(e,n);let r=e?.highWaterMark;return sl(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Hl(r)}}Object.defineProperties(Jt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Ye(Jt.prototype.cancel,"cancel"),Ye(Jt.prototype.getReader,"getReader"),Ye(Jt.prototype.pipeThrough,"pipeThrough"),Ye(Jt.prototype.pipeTo,"pipeTo"),Ye(Jt.prototype.tee,"tee"),Ye(Jt.prototype.values,"values"),typeof We.toStringTag=="symbol"&&Object.defineProperty(Jt.prototype,We.toStringTag,{value:"ReadableStream",configurable:!0}),typeof We.asyncIterator=="symbol"&&Object.defineProperty(Jt.prototype,We.asyncIterator,{value:Jt.prototype.values,writable:!0,configurable:!0});var qp=e=>e.byteLength;Ye(qp,"size");var dl=class{constructor(e){dn(e,1,"ByteLengthQueuingStrategy"),e=xp(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Df(this))throw Uf("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Df(this))throw Uf("size");return qp}};function Uf(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Df(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof dl}Object.defineProperties(dl.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof We.toStringTag=="symbol"&&Object.defineProperty(dl.prototype,We.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var jp=()=>1;Ye(jp,"size");var pl=class{constructor(e){dn(e,1,"CountQueuingStrategy"),e=xp(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!qf(this))throw xf("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!qf(this))throw xf("size");return jp}};function xf(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function qf(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof pl}function k2(e,n,r){return Vr(e,r),t=>ci(e,n,[t])}function P2(e,n,r){return Vr(e,r),t=>Is(e,n,[t])}function N2(e,n,r){return Vr(e,r),(t,i)=>ci(e,n,[t,i])}Object.defineProperties(pl.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof We.toStringTag=="symbol"&&Object.defineProperty(pl.prototype,We.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var yl=class{constructor(e={},n={},r={}){e===void 0&&(e=null);let t=cs(n,"Second parameter"),i=cs(r,"Third parameter"),o=function(c,g){hn(c,g);let I=c?.flush,w=c?.readableType,m=c?.start,S=c?.transform,B=c?.writableType;return{flush:I===void 0?void 0:k2(I,c,`${g} has member 'flush' that`),readableType:w,start:m===void 0?void 0:P2(m,c,`${g} has member 'start' that`),transform:S===void 0?void 0:N2(S,c,`${g} has member 'transform' that`),writableType:B}}(e,"First parameter");if(o.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(o.writableType!==void 0)throw new RangeError("Invalid writableType specified");let l=Ca(i,0),u=ls(i),s=Ca(t,1),a=ls(t),y;(function(c,g,I,w,m,S){function B(){return g}function A(P){return function(C,d){let h=C._transformStreamController;return C._backpressure?Mr(C._backpressureChangePromise,()=>{if((Yr(C._writable)?C._writable._state:C._writableState)==="erroring")throw Yr(C._writable)?C._writable._storedError:C._writableStoredError;return Mf(h,d)}):Mf(h,d)}(c,P)}function f(P){return function(C,d){return ds(C,d),rt(void 0)}(c,P)}function b(){return function(P){let C=P._transformStreamController,d=C._flushAlgorithm();return Mp(C),Mr(d,()=>{if(P._readableState==="errored")throw P._readableStoredError;ys(P)&&Fp(P)},h=>{throw ds(P,h),P._readableStoredError})}(c)}function E(){return function(P){return ps(P,!1),P._backpressureChangePromise}(c)}function R(P){return ks(c,P),rt(void 0)}c._writableState="writable",c._writableStoredError=void 0,c._writableHasInFlightOperation=!1,c._writableStarted=!1,c._writable=function(P,C,d,h,U,j,M){return new ri({start(v){P._writableController=v;try{let N=v.signal;N!==void 0&&N.addEventListener("abort",()=>{P._writableState==="writable"&&(P._writableState="erroring",N.reason&&(P._writableStoredError=N.reason))})}catch{}return Mr(C(),()=>(P._writableStarted=!0,Ff(P),null),N=>{throw P._writableStarted=!0,$u(P,N),N})},write:v=>(function(N){N._writableHasInFlightOperation=!0}(P),Mr(d(v),()=>(function(N){N._writableHasInFlightOperation=!1}(P),Ff(P),null),N=>{throw function(L,O){L._writableHasInFlightOperation=!1,$u(L,O)}(P,N),N})),close:()=>(function(v){v._writableHasInFlightOperation=!0}(P),Mr(h(),()=>(function(v){v._writableHasInFlightOperation=!1,v._writableState==="erroring"&&(v._writableStoredError=void 0),v._writableState="closed"}(P),null),v=>{throw function(N,L){N._writableHasInFlightOperation=!1,N._writableState,$u(N,L)}(P,v),v})),abort:v=>(P._writableState="errored",P._writableStoredError=v,U(v))},{highWaterMark:j,size:M})}(c,B,A,b,f,I,w),c._readableState="readable",c._readableStoredError=void 0,c._readableCloseRequested=!1,c._readablePulling=!1,c._readable=function(P,C,d,h,U,j){return new Jt({start:M=>(P._readableController=M,C().catch(v=>{gs(P,v)})),pull:()=>(P._readablePulling=!0,d().catch(M=>{gs(P,M)})),cancel:M=>(P._readableState="closed",h(M))},{highWaterMark:U,size:j})}(c,B,E,R,m,S),c._backpressure=void 0,c._backpressureChangePromise=void 0,c._backpressureChangePromise_resolve=void 0,ps(c,!0),c._transformStreamController=void 0})(this,sr(c=>{y=c}),s,a,l,u),function(c,g){let I=Object.create(ii.prototype),w,m;w=g.transform!==void 0?S=>g.transform(S,I):S=>{try{return Vp(I,S),rt(void 0)}catch(B){return xe(B)}},m=g.flush!==void 0?()=>g.flush(I):()=>rt(void 0),function(S,B,A,f){B._controlledTransformStream=S,S._transformStreamController=B,B._transformAlgorithm=A,B._flushAlgorithm=f}(c,I,w,m)}(this,o),o.start!==void 0?y(o.start(this._transformStreamController)):y(void 0)}get readable(){if(!jf(this))throw Vf("readable");return this._readable}get writable(){if(!jf(this))throw Vf("writable");return this._writable}};function jf(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof yl}function ds(e,n){gs(e,n),ks(e,n)}function ks(e,n){Mp(e._transformStreamController),function(r,t){r._writableController.error(t),r._writableState==="writable"&&$p(r,t)}(e,n),e._backpressure&&ps(e,!1)}function ps(e,n){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=sr(r=>{e._backpressureChangePromise_resolve=r}),e._backpressure=n}Object.defineProperties(yl.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof We.toStringTag=="symbol"&&Object.defineProperty(yl.prototype,We.toStringTag,{value:"TransformStream",configurable:!0});var ii=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Fo(this))throw Ko("desiredSize");return Kp(this._controlledTransformStream)}enqueue(e){if(!Fo(this))throw Ko("enqueue");Vp(this,e)}error(e){if(!Fo(this))throw Ko("error");var n;n=e,ds(this._controlledTransformStream,n)}terminate(){if(!Fo(this))throw Ko("terminate");(function(e){let n=e._controlledTransformStream;ys(n)&&Fp(n);let r=new TypeError("TransformStream terminated");ks(n,r)})(this)}};function Fo(e){return!!nr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof ii}function Mp(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Vp(e,n){let r=e._controlledTransformStream;if(!ys(r))throw new TypeError("Readable side is not in a state that permits enqueue");try{(function(t,i){t._readablePulling=!1;try{t._readableController.enqueue(i)}catch(o){throw gs(t,o),o}})(r,n)}catch(t){throw ks(r,t),r._readableStoredError}(function(t){return!function(i){return ys(i)?!!(i._readablePulling||Kp(i)>0):!1}(t)})(r)!==r._backpressure&&ps(r,!0)}function Mf(e,n){return Mr(e._transformAlgorithm(n),void 0,r=>{throw ds(e._controlledTransformStream,r),r})}function Ko(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Vf(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}function ys(e){return!e._readableCloseRequested&&e._readableState==="readable"}function Fp(e){e._readableState="closed",e._readableCloseRequested=!0,e._readableController.close()}function gs(e,n){e._readableState==="readable"&&(e._readableState="errored",e._readableStoredError=n),e._readableController.error(n)}function Kp(e){return e._readableController.desiredSize}function $u(e,n){e._writableState!=="writable"?rc(e):$p(e,n)}function $p(e,n){e._writableState="erroring",e._writableStoredError=n,!function(r){return r._writableHasInFlightOperation}(e)&&e._writableStarted&&rc(e)}function rc(e){e._writableState="errored"}function Ff(e){e._writableState==="erroring"&&rc(e)}Object.defineProperties(ii.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Ye(ii.prototype.enqueue,"enqueue"),Ye(ii.prototype.error,"error"),Ye(ii.prototype.terminate,"terminate"),typeof We.toStringTag=="symbol"&&Object.defineProperty(ii.prototype,We.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Hp=65536;async function*O2(e){let n=e.byteOffset+e.byteLength,r=e.byteOffset;for(;r!==n;){let t=Math.min(n-r,Hp),i=e.buffer.slice(r,r+t);r+=i.byteLength,yield new Uint8Array(i)}}async function*L2(e){let n=0;for(;n!==e.size;){let r=await e.slice(n,Math.min(e.size,n+Hp)).arrayBuffer();n+=r.byteLength,yield new Uint8Array(r)}}async function*Hu(e,n=!1){for(let r of e)ArrayBuffer.isView(r)?n?yield*O2(r):yield r:Ht(r.stream)?yield*r.stream():yield*L2(r)}function*U2(e,n,r=0,t){t??(t=n);let i=r<0?Math.max(n+r,0):Math.min(r,n),o=t<0?Math.max(n+t,0):Math.min(t,n),l=Math.max(o-i,0),u=0;for(let s of e){if(u>=l)break;let a=ArrayBuffer.isView(s)?s.byteLength:s.size;if(i&&a<=i)i-=a,o-=a;else{let y;ArrayBuffer.isView(s)?(y=s.subarray(i,Math.min(a,o)),u+=y.byteLength):(y=s.slice(i,Math.min(a,o)),u+=y.size),o-=a,i=0,yield y}}}var In=function(e,n,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!t:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(e):t?t.value:n.get(e)},Kf=function(e,n,r,t,i){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!i:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?i.call(e,r):i?i.value=r:n.set(e,r),r},Wn,$o,fa,Hi=class{constructor(e=[],n={}){if(Wn.set(this,[]),$o.set(this,""),fa.set(this,0),n??(n={}),typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(!Ht(e[Symbol.iterator]))throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&!Ht(n))throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");let r=new TextEncoder;for(let i of e){let o;ArrayBuffer.isView(i)?o=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):i instanceof ArrayBuffer?o=new Uint8Array(i.slice(0)):i instanceof Hi?o=i:o=r.encode(String(i)),Kf(this,fa,In(this,fa,"f")+(ArrayBuffer.isView(o)?o.byteLength:o.size),"f"),In(this,Wn,"f").push(o)}let t=n.type===void 0?"":String(n.type);Kf(this,$o,/^[\x20-\x7E]*$/.test(t)?t:"","f")}static[(Wn=new WeakMap,$o=new WeakMap,fa=new WeakMap,Symbol.hasInstance)](e){return Boolean(e&&typeof e=="object"&&Ht(e.constructor)&&(Ht(e.stream)||Ht(e.arrayBuffer))&&/^(Blob|File)$/.test(e[Symbol.toStringTag]))}get type(){return In(this,$o,"f")}get size(){return In(this,fa,"f")}slice(e,n,r){return new Hi(U2(In(this,Wn,"f"),this.size,e,n),{type:r})}async text(){let e=new TextDecoder,n="";for await(let r of Hu(In(this,Wn,"f")))n+=e.decode(r,{stream:!0});return n+=e.decode(),n}async arrayBuffer(){let e=new Uint8Array(this.size),n=0;for await(let r of Hu(In(this,Wn,"f")))e.set(r,n),n+=r.length;return e.buffer}stream(){let e=Hu(In(this,Wn,"f"),!0);return new Jt({async pull(n){let{value:r,done:t}=await e.next();if(t)return queueMicrotask(()=>n.close());n.enqueue(r)},async cancel(){await e.return()}})}get[Symbol.toStringTag](){return"Blob"}};Object.defineProperties(Hi.prototype,{type:{enumerable:!0},size:{enumerable:!0},slice:{enumerable:!0},stream:{enumerable:!0},text:{enumerable:!0},arrayBuffer:{enumerable:!0}});var D2=e=>e instanceof Hi,$f=function(e,n,r,t,i){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!i:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?i.call(e,r):i?i.value=r:n.set(e,r),r},Hf=function(e,n,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!t:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(e):t?t.value:n.get(e)},Ho,zo,ms=class extends Hi{constructor(e,n,r={}){if(super(e,r),Ho.set(this,void 0),zo.set(this,0),arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);$f(this,Ho,String(n),"f");let t=r.lastModified===void 0?Date.now():Number(r.lastModified);Number.isNaN(t)||$f(this,zo,t,"f")}static[(Ho=new WeakMap,zo=new WeakMap,Symbol.hasInstance)](e){return e instanceof Hi&&e[Symbol.toStringTag]==="File"&&typeof e.name=="string"}get name(){return Hf(this,Ho,"f")}get webkitRelativePath(){return""}get lastModified(){return Hf(this,zo,"f")}get[Symbol.toStringTag](){return"File"}},x2=e=>e instanceof ms,Wr=function(e,n,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!t:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(e):t?t.value:n.get(e)},Wo,Gr,zu,q2=class{constructor(){Wo.add(this),Gr.set(this,new Map)}static[(Gr=new WeakMap,Wo=new WeakSet,Symbol.hasInstance)](e){if(!e)return!1;let n=e;return Boolean(Ht(n.constructor)&&n[Symbol.toStringTag]==="FormData"&&Ht(n.append)&&Ht(n.set)&&Ht(n.get)&&Ht(n.getAll)&&Ht(n.has)&&Ht(n.delete)&&Ht(n.entries)&&Ht(n.values)&&Ht(n.keys)&&Ht(n[Symbol.iterator])&&Ht(n.forEach))}append(e,n,r){Wr(this,Wo,"m",zu).call(this,{name:e,fileName:r,append:!0,rawValue:n,argsLength:arguments.length})}set(e,n,r){Wr(this,Wo,"m",zu).call(this,{name:e,fileName:r,append:!1,rawValue:n,argsLength:arguments.length})}get(e){let n=Wr(this,Gr,"f").get(String(e));return n?n[0]:null}getAll(e){let n=Wr(this,Gr,"f").get(String(e));return n?n.slice():[]}has(e){return Wr(this,Gr,"f").has(String(e))}delete(e){Wr(this,Gr,"f").delete(String(e))}*keys(){for(let e of Wr(this,Gr,"f").keys())yield e}*entries(){for(let e of this.keys()){let n=this.getAll(e);for(let r of n)yield[e,r]}}*values(){for(let[,e]of this)yield e}[(zu=function({name:e,rawValue:n,append:r,fileName:t,argsLength:i}){let o=r?"append":"set";if(i<2)throw new TypeError(`Failed to execute '${o}' on 'FormData': 2 arguments required, but only ${i} present.`);e=String(e);let l;if(x2(n))l=t===void 0?n:new ms([n],t,{type:n.type,lastModified:n.lastModified});else if(D2(n))l=new ms([n],t===void 0?"blob":t,{type:n.type});else{if(t)throw new TypeError(`Failed to execute '${o}' on 'FormData': parameter 2 is not of type 'Blob'.`);l=String(n)}let u=Wr(this,Gr,"f").get(e);if(!u)return void Wr(this,Gr,"f").set(e,[l]);if(!r)return void Wr(this,Gr,"f").set(e,[l]);u.push(l)},Symbol.iterator)](){return this.entries()}forEach(e,n){for(let[r,t]of this)e.call(n,t,r,this)}get[Symbol.toStringTag](){return"FormData"}},j2=require("node:fs"),zp=require("node:fs/promises"),M2=require("node:path"),V2=Vt(Ev(),1),F2=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function K2(e){if(F2(e)!=="object")return!1;let n=Object.getPrototypeOf(e);return n==null?!0:(n.constructor&&n.constructor.toString())===Object.toString()}var $2=K2,zf=function(e,n,r,t,i){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!i:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?i.call(e,r):i?i.value=r:n.set(e,r),r},Gn=function(e,n,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!t:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(e):t?t.value:n.get(e)},Qn,Pi,H2="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",Wp=class{constructor(e){Qn.set(this,void 0),Pi.set(this,void 0),zf(this,Qn,e.path,"f"),zf(this,Pi,e.start||0,"f"),this.name=(0,M2.basename)(Gn(this,Qn,"f")),this.size=e.size,this.lastModified=e.lastModified}slice(e,n){return new Wp({path:Gn(this,Qn,"f"),lastModified:this.lastModified,start:Gn(this,Pi,"f")+e,size:n-e})}async*stream(){let{mtimeMs:e}=await(0,zp.stat)(Gn(this,Qn,"f"));if(e>this.lastModified)throw new V2.default(H2,"NotReadableError");this.size&&(yield*(0,j2.createReadStream)(Gn(this,Qn,"f"),{start:Gn(this,Pi,"f"),end:Gn(this,Pi,"f")+this.size-1}))}get[(Qn=new WeakMap,Pi=new WeakMap,Symbol.toStringTag)](){return"File"}};function z2(e,{mtimeMs:n,size:r},t,i={}){let o;$2(t)?[i,o]=[t,void 0]:o=t;let l=new Wp({path:e,size:r,lastModified:n});return o||(o=l.name),new ms([l],o,{...i,lastModified:l.lastModified})}async function W2(e,n,r){let t=await(0,zp.stat)(e);return z2(e,t,n,r)}var G2=Vt(Mv(),1),nc={apiKey:"API Key is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key",apiSecret:"API Secret is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key"},Q2=Object.keys(nc),Wf="https://addons.mozilla.org/api",X2=class{options={};get productEndpoint(){return`${Wf}/v5/addons/${encodeURIComponent(this.options.extId)}`}constructor(e){for(let n of Q2){if(!e[n])throw new Error(nc[n]);this.options[n]=e[n]}typeof e.extId=="string"&&e.extId.length>0&&!e.extId.includes("@")&&(e.extId.startsWith("{")||(e.extId="{"+e.extId),e.extId.endsWith("}")||(e.extId+="}")),this.options.extId=e.extId}submit=async({filePath:e,version:n="1.0.0"})=>{let r=`${this.productEndpoint}/versions/${encodeURIComponent(n)}/`,t=new q2;t.append("upload",await W2(e));let i=await this.getAccessToken(),o=await vr.put(r,{throwHttpErrors:!1,body:t,headers:{Authorization:`JWT ${i}`}});if(o.statusCode>=400)throw o.statusCode===401?new Error("Invalid access token"):o.statusCode===403?new Error("You do not own this add-on"):o.statusCode===409?new Error(`Version ${n} already exists`):(console.log(o.body),new Error(JSON.parse(o.body).error||"Unknown error"));return JSON.parse(o.body)};getUploadStatus=async({version:e="1.0.0"})=>{let n=await this.getAccessToken(),r=`${this.productEndpoint}/versions/${encodeURIComponent(e)}/`;return vr.get(r,{headers:{Authorization:`JWT ${n}`}}).json()};getProfile=async()=>{let e=await this.getAccessToken(),n=`${Wf}/v5/accounts/profile`;return vr.get(n,{headers:{Authorization:`JWT ${e}`}}).json()};getAccessToken=async()=>{let e=Math.floor(Date.now()/1e3),n={iss:this.options.apiKey,jti:Math.random().toString(),iat:e,exp:e+60*5};return G2.default.sign(n,this.options.apiSecret,{algorithm:"HS256"})}},Ia="firefox",Y2=Cs(Ia);function Z2(e){return pn(this,null,function*(){var n=e,{extId:r,zip:t,dryRun:i}=n,o=bs(n,["extId","zip","dryRun"]),l,u,s,a;let y=Ss(t),c=((u=(l=y.browser_specific_settings)==null?void 0:l.gecko)==null?void 0:u.id)||((a=(s=y.applications)==null?void 0:s.gecko)==null?void 0:a.id)||r,g=new X2(vs({extId:c},o));if(Y2(`Updating extension with ID ${c}`),i)return!0;try{return yield g.submit({filePath:t,version:y.version}),Es({extId:c,market:Ia,zip:t}),!0}catch(I){throw Ts(I,Ia,`"${c}" (${y.name})`)}})}function J2(e){return pn(this,null,function*(){return e.zip=Oa(e),e.verbose&&La(Ia),Ua({market:Ia,options:e,errorMap:nc}),Z2(e)})}var e_=require("fs/promises"),t_=require("module"),r_=require("path"),Gp=require("crypto"),n_=Object.create,Qp=Object.defineProperty,i_=Object.getOwnPropertyDescriptor,a_=Object.getOwnPropertyNames,o_=Object.getPrototypeOf,s_=Object.prototype.hasOwnProperty,Mi=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,r)=>(typeof require<"u"?require:n)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Ue=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),u_=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of a_(n))!s_.call(e,i)&&i!==r&&Qp(e,i,{get:()=>n[i],enumerable:!(t=i_(n,i))||t.enumerable});return e},Gi=(e,n,r)=>(r=e!=null?n_(o_(e)):{},u_(n||!e||!e.__esModule?Qp(r,"default",{value:e,enumerable:!0}):r,e)),Xp=(e,n,r)=>{if(!n.has(e))throw TypeError("Cannot "+r)},zt=(e,n,r)=>(Xp(e,n,"read from private field"),r?r.call(e):n.get(e)),si=(e,n,r)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,r)},Pn=(e,n,r,t)=>(Xp(e,n,"write to private field"),t?t.call(e,r):n.set(e,r),r),l_=Ue((e,n)=>{(function(r,t){typeof e=="object"&&typeof n<"u"?t(e):typeof define=="function"&&define.amd?define(["exports"],t):(r=typeof globalThis<"u"?globalThis:r||self,t(r.WebStreamsPolyfill={}))})(e,function(r){"use strict";let t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:p=>`Symbol(${p})`;function i(){}function o(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}let l=o();function u(p){return typeof p=="object"&&p!==null||typeof p=="function"}let s=i,a=Promise,y=Promise.prototype.then,c=Promise.resolve.bind(a),g=Promise.reject.bind(a);function I(p){return new a(p)}function w(p){return c(p)}function m(p){return g(p)}function S(p,T,q){return y.call(p,T,q)}function B(p,T,q){S(S(p,T,q),void 0,s)}function A(p,T){B(p,T)}function f(p,T){B(p,void 0,T)}function b(p,T,q){return S(p,T,q)}function E(p){S(p,void 0,s)}let R=(()=>{let p=l&&l.queueMicrotask;if(typeof p=="function")return p;let T=w(void 0);return q=>S(T,q)})();function P(p,T,q){if(typeof p!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(p,T,q)}function C(p,T,q){try{return w(P(p,T,q))}catch(X){return m(X)}}let d=16384;class h{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(T){let q=this._back,X=q;q._elements.length===d-1&&(X={_elements:[],_next:void 0}),q._elements.push(T),X!==q&&(this._back=X,q._next=X),++this._size}shift(){let T=this._front,q=T,X=this._cursor,ne=X+1,ue=T._elements,ge=ue[X];return ne===d&&(q=T._next,ne=0),--this._size,this._cursor=ne,T!==q&&(this._front=q),ue[X]=void 0,ge}forEach(T){let q=this._cursor,X=this._front,ne=X._elements;for(;(q!==ne.length||X._next!==void 0)&&!(q===ne.length&&(X=X._next,ne=X._elements,q=0,ne.length===0));)T(ne[q]),++q}peek(){let T=this._front,q=this._cursor;return T._elements[q]}}function U(p,T){p._ownerReadableStream=T,T._reader=p,T._state==="readable"?N(p):T._state==="closed"?O(p):L(p,T._storedError)}function j(p,T){let q=p._ownerReadableStream;return Pr(q,T)}function M(p){p._ownerReadableStream._state==="readable"?K(p,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Y(p,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),p._ownerReadableStream._reader=void 0,p._ownerReadableStream=void 0}function v(p){return new TypeError("Cannot "+p+" a stream using a released reader")}function N(p){p._closedPromise=I((T,q)=>{p._closedPromise_resolve=T,p._closedPromise_reject=q})}function L(p,T){N(p),K(p,T)}function O(p){N(p),te(p)}function K(p,T){p._closedPromise_reject!==void 0&&(E(p._closedPromise),p._closedPromise_reject(T),p._closedPromise_resolve=void 0,p._closedPromise_reject=void 0)}function Y(p,T){L(p,T)}function te(p){p._closedPromise_resolve!==void 0&&(p._closedPromise_resolve(void 0),p._closedPromise_resolve=void 0,p._closedPromise_reject=void 0)}let re=t("[[AbortSteps]]"),oe=t("[[ErrorSteps]]"),be=t("[[CancelSteps]]"),Ce=t("[[PullSteps]]"),ke=Number.isFinite||function(p){return typeof p=="number"&&isFinite(p)},fe=Math.trunc||function(p){return p<0?Math.ceil(p):Math.floor(p)};function Pe(p){return typeof p=="object"||typeof p=="function"}function ce(p,T){if(p!==void 0&&!Pe(p))throw new TypeError(`${T} is not an object.`)}function Ve(p,T){if(typeof p!="function")throw new TypeError(`${T} is not a function.`)}function De(p){return typeof p=="object"&&p!==null||typeof p=="function"}function k(p,T){if(!De(p))throw new TypeError(`${T} is not an object.`)}function $(p,T,q){if(p===void 0)throw new TypeError(`Parameter ${T} is required in '${q}'.`)}function V(p,T,q){if(p===void 0)throw new TypeError(`${T} is required in '${q}'.`)}function _(p){return Number(p)}function D(p){return p===0?0:p}function G(p){return D(fe(p))}function z(p,T){let q=Number.MAX_SAFE_INTEGER,X=Number(p);if(X=D(X),!ke(X))throw new TypeError(`${T} is not a finite number`);if(X=G(X),X<0||X>q)throw new TypeError(`${T} is outside the accepted range of ${0} to ${q}, inclusive`);return!ke(X)||X===0?0:X}function se(p,T){if(!vn(p))throw new TypeError(`${T} is not a ReadableStream.`)}function me(p){return new qe(p)}function Te(p,T){p._reader._readRequests.push(T)}function ae(p,T,q){let X=p._reader._readRequests.shift();q?X._closeSteps():X._chunkSteps(T)}function Se(p){return p._reader._readRequests.length}function Le(p){let T=p._reader;return!(T===void 0||!Oe(T))}class qe{constructor(T){if($(T,1,"ReadableStreamDefaultReader"),se(T,"First parameter"),bn(T))throw new TypeError("This stream has already been locked for exclusive reading by another reader");U(this,T),this._readRequests=new h}get closed(){return Oe(this)?this._closedPromise:m(ht("closed"))}cancel(T=void 0){return Oe(this)?this._ownerReadableStream===void 0?m(v("cancel")):j(this,T):m(ht("cancel"))}read(){if(!Oe(this))return m(ht("read"));if(this._ownerReadableStream===void 0)return m(v("read from"));let T,q,X=I((ne,ue)=>{T=ne,q=ue});return Ke(this,{_chunkSteps:ne=>T({value:ne,done:!1}),_closeSteps:()=>T({value:void 0,done:!0}),_errorSteps:ne=>q(ne)}),X}releaseLock(){if(!Oe(this))throw ht("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");M(this)}}}Object.defineProperties(qe.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(qe.prototype,t.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Oe(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_readRequests")?!1:p instanceof qe}function Ke(p,T){let q=p._ownerReadableStream;q._disturbed=!0,q._state==="closed"?T._closeSteps():q._state==="errored"?T._errorSteps(q._storedError):q._readableStreamController[Ce](T)}function ht(p){return new TypeError(`ReadableStreamDefaultReader.prototype.${p} can only be used on a ReadableStreamDefaultReader`)}let gt=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class ft{constructor(T,q){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=T,this._preventCancel=q}next(){let T=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?b(this._ongoingPromise,T,T):T(),this._ongoingPromise}return(T){let q=()=>this._returnSteps(T);return this._ongoingPromise?b(this._ongoingPromise,q,q):q()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let T=this._reader;if(T._ownerReadableStream===void 0)return m(v("iterate"));let q,X,ne=I((ue,ge)=>{q=ue,X=ge});return Ke(T,{_chunkSteps:ue=>{this._ongoingPromise=void 0,R(()=>q({value:ue,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,M(T),q({value:void 0,done:!0})},_errorSteps:ue=>{this._ongoingPromise=void 0,this._isFinished=!0,M(T),X(ue)}}),ne}_returnSteps(T){if(this._isFinished)return Promise.resolve({value:T,done:!0});this._isFinished=!0;let q=this._reader;if(q._ownerReadableStream===void 0)return m(v("finish iterating"));if(!this._preventCancel){let X=j(q,T);return M(q),b(X,()=>({value:T,done:!0}))}return M(q),w({value:T,done:!0})}}let ot={next(){return mt(this)?this._asyncIteratorImpl.next():m(Et("next"))},return(p){return mt(this)?this._asyncIteratorImpl.return(p):m(Et("return"))}};gt!==void 0&&Object.setPrototypeOf(ot,gt);function Je(p,T){let q=me(p),X=new ft(q,T),ne=Object.create(ot);return ne._asyncIteratorImpl=X,ne}function mt(p){if(!u(p)||!Object.prototype.hasOwnProperty.call(p,"_asyncIteratorImpl"))return!1;try{return p._asyncIteratorImpl instanceof ft}catch{return!1}}function Et(p){return new TypeError(`ReadableStreamAsyncIterator.${p} can only be used on a ReadableSteamAsyncIterator`)}let Ct=Number.isNaN||function(p){return p!==p};function _t(p){return p.slice()}function Ut(p,T,q,X,ne){new Uint8Array(p).set(new Uint8Array(q,X,ne),T)}function Ft(p){return p}function et(p){return!1}function qt(p,T,q){if(p.slice)return p.slice(T,q);let X=q-T,ne=new ArrayBuffer(X);return Ut(ne,0,p,T,X),ne}function He(p){return!(typeof p!="number"||Ct(p)||p<0)}function lr(p){let T=qt(p.buffer,p.byteOffset,p.byteOffset+p.byteLength);return new Uint8Array(T)}function cr(p){let T=p._queue.shift();return p._queueTotalSize-=T.size,p._queueTotalSize<0&&(p._queueTotalSize=0),T.value}function dt(p,T,q){if(!He(q)||q===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");p._queue.push({value:T,size:q}),p._queueTotalSize+=q}function Kr(p){return p._queue.peek().value}function er(p){p._queue=new h,p._queueTotalSize=0}class Cr{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Tt(this))throw hr("view");return this._view}respond(T){if(!Tt(this))throw hr("respond");if($(T,1,"respond"),T=z(T,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");et(this._view.buffer),je(this._associatedReadableByteStreamController,T)}respondWithNewView(T){if(!Tt(this))throw hr("respondWithNewView");if($(T,1,"respondWithNewView"),!ArrayBuffer.isView(T))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");et(T.buffer),Wt(this._associatedReadableByteStreamController,T)}}Object.defineProperties(Cr.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(Cr.prototype,t.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class pt{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!st(this))throw Qt("byobRequest");return Ie(this)}get desiredSize(){if(!st(this))throw Qt("desiredSize");return $e(this)}close(){if(!st(this))throw Qt("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let T=this._controlledReadableByteStream._state;if(T!=="readable")throw new TypeError(`The stream (in ${T} state) is not in the readable state and cannot be closed`);pe(this)}enqueue(T){if(!st(this))throw Qt("enqueue");if($(T,1,"enqueue"),!ArrayBuffer.isView(T))throw new TypeError("chunk must be an array buffer view");if(T.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(T.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let q=this._controlledReadableByteStream._state;if(q!=="readable")throw new TypeError(`The stream (in ${q} state) is not in the readable state and cannot be enqueued to`);ye(this,T)}error(T=void 0){if(!st(this))throw Qt("error");we(this,T)}[be](T){Bt(this),er(this);let q=this._cancelAlgorithm(T);return ie(this),q}[Ce](T){let q=this._controlledReadableByteStream;if(this._queueTotalSize>0){let ne=this._queue.shift();this._queueTotalSize-=ne.byteLength,Nt(this);let ue=new Uint8Array(ne.buffer,ne.byteOffset,ne.byteLength);T._chunkSteps(ue);return}let X=this._autoAllocateChunkSize;if(X!==void 0){let ne;try{ne=new ArrayBuffer(X)}catch(ge){T._errorSteps(ge);return}let ue={buffer:ne,bufferByteLength:X,byteOffset:0,byteLength:X,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(ue)}Te(q,T),ut(this)}}Object.defineProperties(pt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(pt.prototype,t.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function st(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_controlledReadableByteStream")?!1:p instanceof pt}function Tt(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_associatedReadableByteStreamController")?!1:p instanceof Cr}function ut(p){if(!Z(p))return;if(p._pulling){p._pullAgain=!0;return}p._pulling=!0;let T=p._pullAlgorithm();B(T,()=>{p._pulling=!1,p._pullAgain&&(p._pullAgain=!1,ut(p))},q=>{we(p,q)})}function Bt(p){Rt(p),p._pendingPullIntos=new h}function It(p,T){let q=!1;p._state==="closed"&&(q=!0);let X=vt(T);T.readerType==="default"?ae(p,X,q):qs(p,X,q)}function vt(p){let T=p.bytesFilled,q=p.elementSize;return new p.viewConstructor(p.buffer,p.byteOffset,T/q)}function wt(p,T,q,X){p._queue.push({buffer:T,byteOffset:q,byteLength:X}),p._queueTotalSize+=X}function kt(p,T){let q=T.elementSize,X=T.bytesFilled-T.bytesFilled%q,ne=Math.min(p._queueTotalSize,T.byteLength-T.bytesFilled),ue=T.bytesFilled+ne,ge=ue-ue%q,Be=ne,Me=!1;ge>X&&(Be=ge-T.bytesFilled,Me=!0);let ze=p._queue;for(;Be>0;){let Qe=ze.peek(),Xe=Math.min(Be,Qe.byteLength),Mt=T.byteOffset+T.bytesFilled;Ut(T.buffer,Mt,Qe.buffer,Qe.byteOffset,Xe),Qe.byteLength===Xe?ze.shift():(Qe.byteOffset+=Xe,Qe.byteLength-=Xe),p._queueTotalSize-=Xe,Pt(p,Xe,T),Be-=Xe}return Me}function Pt(p,T,q){q.bytesFilled+=T}function Nt(p){p._queueTotalSize===0&&p._closeRequested?(ie(p),ea(p._controlledReadableByteStream)):ut(p)}function Rt(p){p._byobRequest!==null&&(p._byobRequest._associatedReadableByteStreamController=void 0,p._byobRequest._view=null,p._byobRequest=null)}function Ot(p){for(;p._pendingPullIntos.length>0;){if(p._queueTotalSize===0)return;let T=p._pendingPullIntos.peek();kt(p,T)&&(W(p),It(p._controlledReadableByteStream,T))}}function At(p,T,q){let X=p._controlledReadableByteStream,ne=1;T.constructor!==DataView&&(ne=T.constructor.BYTES_PER_ELEMENT);let ue=T.constructor,ge=T.buffer,Be={buffer:ge,bufferByteLength:ge.byteLength,byteOffset:T.byteOffset,byteLength:T.byteLength,bytesFilled:0,elementSize:ne,viewConstructor:ue,readerType:"byob"};if(p._pendingPullIntos.length>0){p._pendingPullIntos.push(Be),Va(X,q);return}if(X._state==="closed"){let Me=new ue(Be.buffer,Be.byteOffset,0);q._closeSteps(Me);return}if(p._queueTotalSize>0){if(kt(p,Be)){let Me=vt(Be);Nt(p),q._chunkSteps(Me);return}if(p._closeRequested){let Me=new TypeError("Insufficient bytes to fill elements in the given buffer");we(p,Me),q._errorSteps(Me);return}}p._pendingPullIntos.push(Be),Va(X,q),ut(p)}function bt(p,T){let q=p._controlledReadableByteStream;if(x(q))for(;Fa(q)>0;){let X=W(p);It(q,X)}}function Lt(p,T,q){if(Pt(p,T,q),q.bytesFilled0){let ne=q.byteOffset+q.bytesFilled,ue=qt(q.buffer,ne-X,ne);wt(p,ue,0,ue.byteLength)}q.bytesFilled-=X,It(p._controlledReadableByteStream,q),Ot(p)}function di(p,T){let q=p._pendingPullIntos.peek();Rt(p),p._controlledReadableByteStream._state==="closed"?bt(p):Lt(p,T,q),ut(p)}function W(p){return p._pendingPullIntos.shift()}function Z(p){let T=p._controlledReadableByteStream;return T._state!=="readable"||p._closeRequested||!p._started?!1:!!(Le(T)&&Se(T)>0||x(T)&&Fa(T)>0||$e(p)>0)}function ie(p){p._pullAlgorithm=void 0,p._cancelAlgorithm=void 0}function pe(p){let T=p._controlledReadableByteStream;if(!(p._closeRequested||T._state!=="readable")){if(p._queueTotalSize>0){p._closeRequested=!0;return}if(p._pendingPullIntos.length>0&&p._pendingPullIntos.peek().bytesFilled>0){let q=new TypeError("Insufficient bytes to fill elements in the given buffer");throw we(p,q),q}ie(p),ea(T)}}function ye(p,T){let q=p._controlledReadableByteStream;if(p._closeRequested||q._state!=="readable")return;let X=T.buffer,ne=T.byteOffset,ue=T.byteLength,ge=X;if(p._pendingPullIntos.length>0){let Be=p._pendingPullIntos.peek();et(Be.buffer),Be.buffer=Be.buffer}if(Rt(p),Le(q))if(Se(q)===0)wt(p,ge,ne,ue);else{p._pendingPullIntos.length>0&&W(p);let Be=new Uint8Array(ge,ne,ue);ae(q,Be,!1)}else x(q)?(wt(p,ge,ne,ue),Ot(p)):wt(p,ge,ne,ue);ut(p)}function we(p,T){let q=p._controlledReadableByteStream;q._state==="readable"&&(Bt(p),er(p),ie(p),Uc(q,T))}function Ie(p){if(p._byobRequest===null&&p._pendingPullIntos.length>0){let T=p._pendingPullIntos.peek(),q=new Uint8Array(T.buffer,T.byteOffset+T.bytesFilled,T.byteLength-T.bytesFilled),X=Object.create(Cr.prototype);Gt(X,p,q),p._byobRequest=X}return p._byobRequest}function $e(p){let T=p._controlledReadableByteStream._state;return T==="errored"?null:T==="closed"?0:p._strategyHWM-p._queueTotalSize}function je(p,T){let q=p._pendingPullIntos.peek();if(p._controlledReadableByteStream._state==="closed"){if(T!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(T===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(q.bytesFilled+T>q.byteLength)throw new RangeError("bytesWritten out of range")}q.buffer=q.buffer,di(p,T)}function Wt(p,T){let q=p._pendingPullIntos.peek();if(p._controlledReadableByteStream._state==="closed"){if(T.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(T.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(q.byteOffset+q.bytesFilled!==T.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(q.bufferByteLength!==T.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(q.bytesFilled+T.byteLength>q.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let X=T.byteLength;q.buffer=T.buffer,di(p,X)}function ir(p,T,q,X,ne,ue,ge){T._controlledReadableByteStream=p,T._pullAgain=!1,T._pulling=!1,T._byobRequest=null,T._queue=T._queueTotalSize=void 0,er(T),T._closeRequested=!1,T._started=!1,T._strategyHWM=ue,T._pullAlgorithm=X,T._cancelAlgorithm=ne,T._autoAllocateChunkSize=ge,T._pendingPullIntos=new h,p._readableStreamController=T;let Be=q();B(w(Be),()=>{T._started=!0,ut(T)},Me=>{we(T,Me)})}function tr(p,T,q){let X=Object.create(pt.prototype),ne=()=>{},ue=()=>w(void 0),ge=()=>w(void 0);T.start!==void 0&&(ne=()=>T.start(X)),T.pull!==void 0&&(ue=()=>T.pull(X)),T.cancel!==void 0&&(ge=Me=>T.cancel(Me));let Be=T.autoAllocateChunkSize;if(Be===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");ir(p,X,ne,ue,ge,q,Be)}function Gt(p,T,q){p._associatedReadableByteStreamController=T,p._view=q}function hr(p){return new TypeError(`ReadableStreamBYOBRequest.prototype.${p} can only be used on a ReadableStreamBYOBRequest`)}function Qt(p){return new TypeError(`ReadableByteStreamController.prototype.${p} can only be used on a ReadableByteStreamController`)}function Ma(p){return new F(p)}function Va(p,T){p._reader._readIntoRequests.push(T)}function qs(p,T,q){let X=p._reader._readIntoRequests.shift();q?X._closeSteps(T):X._chunkSteps(T)}function Fa(p){return p._reader._readIntoRequests.length}function x(p){let T=p._reader;return!(T===void 0||!H(T))}class F{constructor(T){if($(T,1,"ReadableStreamBYOBReader"),se(T,"First parameter"),bn(T))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!st(T._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");U(this,T),this._readIntoRequests=new h}get closed(){return H(this)?this._closedPromise:m(le("closed"))}cancel(T=void 0){return H(this)?this._ownerReadableStream===void 0?m(v("cancel")):j(this,T):m(le("cancel"))}read(T){if(!H(this))return m(le("read"));if(!ArrayBuffer.isView(T))return m(new TypeError("view must be an array buffer view"));if(T.byteLength===0)return m(new TypeError("view must have non-zero byteLength"));if(T.buffer.byteLength===0)return m(new TypeError("view's buffer must have non-zero byteLength"));if(et(T.buffer),this._ownerReadableStream===void 0)return m(v("read from"));let q,X,ne=I((ue,ge)=>{q=ue,X=ge});return ee(this,T,{_chunkSteps:ue=>q({value:ue,done:!1}),_closeSteps:ue=>q({value:ue,done:!0}),_errorSteps:ue=>X(ue)}),ne}releaseLock(){if(!H(this))throw le("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");M(this)}}}Object.defineProperties(F.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(F.prototype,t.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function H(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_readIntoRequests")?!1:p instanceof F}function ee(p,T,q){let X=p._ownerReadableStream;X._disturbed=!0,X._state==="errored"?q._errorSteps(X._storedError):At(X._readableStreamController,T,q)}function le(p){return new TypeError(`ReadableStreamBYOBReader.prototype.${p} can only be used on a ReadableStreamBYOBReader`)}function he(p,T){let{highWaterMark:q}=p;if(q===void 0)return T;if(Ct(q)||q<0)throw new RangeError("Invalid highWaterMark");return q}function Ee(p){let{size:T}=p;return T||(()=>1)}function _e(p,T){ce(p,T);let q=p?.highWaterMark,X=p?.size;return{highWaterMark:q===void 0?void 0:_(q),size:X===void 0?void 0:it(X,`${T} has member 'size' that`)}}function it(p,T){return Ve(p,T),q=>_(p(q))}function jt(p,T){ce(p,T);let q=p?.abort,X=p?.close,ne=p?.start,ue=p?.type,ge=p?.write;return{abort:q===void 0?void 0:fr(q,p,`${T} has member 'abort' that`),close:X===void 0?void 0:ar(X,p,`${T} has member 'close' that`),start:ne===void 0?void 0:kr(ne,p,`${T} has member 'start' that`),write:ge===void 0?void 0:pi(ge,p,`${T} has member 'write' that`),type:ue}}function fr(p,T,q){return Ve(p,q),X=>C(p,T,[X])}function ar(p,T,q){return Ve(p,q),()=>C(p,T,[])}function kr(p,T,q){return Ve(p,q),X=>P(p,T,[X])}function pi(p,T,q){return Ve(p,q),(X,ne)=>C(p,T,[X,ne])}function dr(p,T){if(!gi(p))throw new TypeError(`${T} is not a WritableStream.`)}function _r(p){if(typeof p!="object"||p===null)return!1;try{return typeof p.aborted=="boolean"}catch{return!1}}let yi=typeof AbortController=="function";function $r(){if(yi)return new AbortController}class tn{constructor(T={},q={}){T===void 0?T=null:k(T,"First parameter");let X=_e(q,"Second parameter"),ne=jt(T,"First parameter");if(yc(this),ne.type!==void 0)throw new RangeError("Invalid type is specified");let ue=Ee(X),ge=he(X,1);Ky(this,ne,ge,ue)}get locked(){if(!gi(this))throw Wa("locked");return mi(this)}abort(T=void 0){return gi(this)?mi(this)?m(new TypeError("Cannot abort a stream that already has a writer")):Ka(this,T):m(Wa("abort"))}close(){return gi(this)?mi(this)?m(new TypeError("Cannot close a stream that already has a writer")):Hr(this)?m(new TypeError("Cannot close an already-closing stream")):gc(this):m(Wa("close"))}getWriter(){if(!gi(this))throw Wa("getWriter");return pc(this)}}Object.defineProperties(tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,t.toStringTag,{value:"WritableStream",configurable:!0});function pc(p){return new Xi(p)}function ky(p,T,q,X,ne=1,ue=()=>1){let ge=Object.create(tn.prototype);yc(ge);let Be=Object.create(vi.prototype);return Sc(ge,Be,p,T,q,X,ne,ue),ge}function yc(p){p._state="writable",p._storedError=void 0,p._writer=void 0,p._writableStreamController=void 0,p._writeRequests=new h,p._inFlightWriteRequest=void 0,p._closeRequest=void 0,p._inFlightCloseRequest=void 0,p._pendingAbortRequest=void 0,p._backpressure=!1}function gi(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_writableStreamController")?!1:p instanceof tn}function mi(p){return p._writer!==void 0}function Ka(p,T){var q;if(p._state==="closed"||p._state==="errored")return w(void 0);p._writableStreamController._abortReason=T,(q=p._writableStreamController._abortController)===null||q===void 0||q.abort();let X=p._state;if(X==="closed"||X==="errored")return w(void 0);if(p._pendingAbortRequest!==void 0)return p._pendingAbortRequest._promise;let ne=!1;X==="erroring"&&(ne=!0,T=void 0);let ue=I((ge,Be)=>{p._pendingAbortRequest={_promise:void 0,_resolve:ge,_reject:Be,_reason:T,_wasAlreadyErroring:ne}});return p._pendingAbortRequest._promise=ue,ne||Ms(p,T),ue}function gc(p){let T=p._state;if(T==="closed"||T==="errored")return m(new TypeError(`The stream (in ${T} state) is not in the writable state and cannot be closed`));let q=I((ne,ue)=>{let ge={_resolve:ne,_reject:ue};p._closeRequest=ge}),X=p._writer;return X!==void 0&&p._backpressure&&T==="writable"&&Qs(X),$y(p._writableStreamController),q}function Py(p){return I((T,q)=>{let X={_resolve:T,_reject:q};p._writeRequests.push(X)})}function js(p,T){if(p._state==="writable"){Ms(p,T);return}Vs(p)}function Ms(p,T){let q=p._writableStreamController;p._state="erroring",p._storedError=T;let X=p._writer;X!==void 0&&vc(X,T),!Dy(p)&&q._started&&Vs(p)}function Vs(p){p._state="errored",p._writableStreamController[oe]();let T=p._storedError;if(p._writeRequests.forEach(ne=>{ne._reject(T)}),p._writeRequests=new h,p._pendingAbortRequest===void 0){$a(p);return}let q=p._pendingAbortRequest;if(p._pendingAbortRequest=void 0,q._wasAlreadyErroring){q._reject(T),$a(p);return}let X=p._writableStreamController[re](q._reason);B(X,()=>{q._resolve(),$a(p)},ne=>{q._reject(ne),$a(p)})}function Ny(p){p._inFlightWriteRequest._resolve(void 0),p._inFlightWriteRequest=void 0}function Oy(p,T){p._inFlightWriteRequest._reject(T),p._inFlightWriteRequest=void 0,js(p,T)}function Ly(p){p._inFlightCloseRequest._resolve(void 0),p._inFlightCloseRequest=void 0,p._state==="erroring"&&(p._storedError=void 0,p._pendingAbortRequest!==void 0&&(p._pendingAbortRequest._resolve(),p._pendingAbortRequest=void 0)),p._state="closed";let T=p._writer;T!==void 0&&Ic(T)}function Uy(p,T){p._inFlightCloseRequest._reject(T),p._inFlightCloseRequest=void 0,p._pendingAbortRequest!==void 0&&(p._pendingAbortRequest._reject(T),p._pendingAbortRequest=void 0),js(p,T)}function Hr(p){return!(p._closeRequest===void 0&&p._inFlightCloseRequest===void 0)}function Dy(p){return!(p._inFlightWriteRequest===void 0&&p._inFlightCloseRequest===void 0)}function xy(p){p._inFlightCloseRequest=p._closeRequest,p._closeRequest=void 0}function qy(p){p._inFlightWriteRequest=p._writeRequests.shift()}function $a(p){p._closeRequest!==void 0&&(p._closeRequest._reject(p._storedError),p._closeRequest=void 0);let T=p._writer;T!==void 0&&Ws(T,p._storedError)}function Fs(p,T){let q=p._writer;q!==void 0&&T!==p._backpressure&&(T?Yy(q):Qs(q)),p._backpressure=T}class Xi{constructor(T){if($(T,1,"WritableStreamDefaultWriter"),dr(T,"First parameter"),mi(T))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=T,T._writer=this;let q=T._state;if(q==="writable")!Hr(T)&&T._backpressure?Qa(this):Rc(this),Ga(this);else if(q==="erroring")Gs(this,T._storedError),Ga(this);else if(q==="closed")Rc(this),Qy(this);else{let X=T._storedError;Gs(this,X),Tc(this,X)}}get closed(){return Dn(this)?this._closedPromise:m(xn("closed"))}get desiredSize(){if(!Dn(this))throw xn("desiredSize");if(this._ownerWritableStream===void 0)throw Yi("desiredSize");return Fy(this)}get ready(){return Dn(this)?this._readyPromise:m(xn("ready"))}abort(T=void 0){return Dn(this)?this._ownerWritableStream===void 0?m(Yi("abort")):jy(this,T):m(xn("abort"))}close(){if(!Dn(this))return m(xn("close"));let T=this._ownerWritableStream;return T===void 0?m(Yi("close")):Hr(T)?m(new TypeError("Cannot close an already-closing stream")):mc(this)}releaseLock(){if(!Dn(this))throw xn("releaseLock");this._ownerWritableStream!==void 0&&bc(this)}write(T=void 0){return Dn(this)?this._ownerWritableStream===void 0?m(Yi("write to")):_c(this,T):m(xn("write"))}}Object.defineProperties(Xi.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(Xi.prototype,t.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Dn(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_ownerWritableStream")?!1:p instanceof Xi}function jy(p,T){let q=p._ownerWritableStream;return Ka(q,T)}function mc(p){let T=p._ownerWritableStream;return gc(T)}function My(p){let T=p._ownerWritableStream,q=T._state;return Hr(T)||q==="closed"?w(void 0):q==="errored"?m(T._storedError):mc(p)}function Vy(p,T){p._closedPromiseState==="pending"?Ws(p,T):Xy(p,T)}function vc(p,T){p._readyPromiseState==="pending"?Ac(p,T):Zy(p,T)}function Fy(p){let T=p._ownerWritableStream,q=T._state;return q==="errored"||q==="erroring"?null:q==="closed"?0:Ec(T._writableStreamController)}function bc(p){let T=p._ownerWritableStream,q=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");vc(p,q),Vy(p,q),T._writer=void 0,p._ownerWritableStream=void 0}function _c(p,T){let q=p._ownerWritableStream,X=q._writableStreamController,ne=Hy(X,T);if(q!==p._ownerWritableStream)return m(Yi("write to"));let ue=q._state;if(ue==="errored")return m(q._storedError);if(Hr(q)||ue==="closed")return m(new TypeError("The stream is closing or closed and cannot be written to"));if(ue==="erroring")return m(q._storedError);let ge=Py(q);return zy(X,T,ne),ge}let wc={};class vi{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Ks(this))throw zs("abortReason");return this._abortReason}get signal(){if(!Ks(this))throw zs("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(T=void 0){if(!Ks(this))throw zs("error");this._controlledWritableStream._state==="writable"&&Cc(this,T)}[re](T){let q=this._abortAlgorithm(T);return Ha(this),q}[oe](){er(this)}}Object.defineProperties(vi.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(vi.prototype,t.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Ks(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_controlledWritableStream")?!1:p instanceof vi}function Sc(p,T,q,X,ne,ue,ge,Be){T._controlledWritableStream=p,p._writableStreamController=T,T._queue=void 0,T._queueTotalSize=void 0,er(T),T._abortReason=void 0,T._abortController=$r(),T._started=!1,T._strategySizeAlgorithm=Be,T._strategyHWM=ge,T._writeAlgorithm=X,T._closeAlgorithm=ne,T._abortAlgorithm=ue;let Me=Hs(T);Fs(p,Me);let ze=q(),Qe=w(ze);B(Qe,()=>{T._started=!0,za(T)},Xe=>{T._started=!0,js(p,Xe)})}function Ky(p,T,q,X){let ne=Object.create(vi.prototype),ue=()=>{},ge=()=>w(void 0),Be=()=>w(void 0),Me=()=>w(void 0);T.start!==void 0&&(ue=()=>T.start(ne)),T.write!==void 0&&(ge=ze=>T.write(ze,ne)),T.close!==void 0&&(Be=()=>T.close()),T.abort!==void 0&&(Me=ze=>T.abort(ze)),Sc(p,ne,ue,ge,Be,Me,q,X)}function Ha(p){p._writeAlgorithm=void 0,p._closeAlgorithm=void 0,p._abortAlgorithm=void 0,p._strategySizeAlgorithm=void 0}function $y(p){dt(p,wc,0),za(p)}function Hy(p,T){try{return p._strategySizeAlgorithm(T)}catch(q){return $s(p,q),1}}function Ec(p){return p._strategyHWM-p._queueTotalSize}function zy(p,T,q){try{dt(p,T,q)}catch(ne){$s(p,ne);return}let X=p._controlledWritableStream;if(!Hr(X)&&X._state==="writable"){let ne=Hs(p);Fs(X,ne)}za(p)}function za(p){let T=p._controlledWritableStream;if(!p._started||T._inFlightWriteRequest!==void 0)return;if(T._state==="erroring"){Vs(T);return}if(p._queue.length===0)return;let q=Kr(p);q===wc?Wy(p):Gy(p,q)}function $s(p,T){p._controlledWritableStream._state==="writable"&&Cc(p,T)}function Wy(p){let T=p._controlledWritableStream;xy(T),cr(p);let q=p._closeAlgorithm();Ha(p),B(q,()=>{Ly(T)},X=>{Uy(T,X)})}function Gy(p,T){let q=p._controlledWritableStream;qy(q);let X=p._writeAlgorithm(T);B(X,()=>{Ny(q);let ne=q._state;if(cr(p),!Hr(q)&&ne==="writable"){let ue=Hs(p);Fs(q,ue)}za(p)},ne=>{q._state==="writable"&&Ha(p),Oy(q,ne)})}function Hs(p){return Ec(p)<=0}function Cc(p,T){let q=p._controlledWritableStream;Ha(p),Ms(q,T)}function Wa(p){return new TypeError(`WritableStream.prototype.${p} can only be used on a WritableStream`)}function zs(p){return new TypeError(`WritableStreamDefaultController.prototype.${p} can only be used on a WritableStreamDefaultController`)}function xn(p){return new TypeError(`WritableStreamDefaultWriter.prototype.${p} can only be used on a WritableStreamDefaultWriter`)}function Yi(p){return new TypeError("Cannot "+p+" a stream using a released writer")}function Ga(p){p._closedPromise=I((T,q)=>{p._closedPromise_resolve=T,p._closedPromise_reject=q,p._closedPromiseState="pending"})}function Tc(p,T){Ga(p),Ws(p,T)}function Qy(p){Ga(p),Ic(p)}function Ws(p,T){p._closedPromise_reject!==void 0&&(E(p._closedPromise),p._closedPromise_reject(T),p._closedPromise_resolve=void 0,p._closedPromise_reject=void 0,p._closedPromiseState="rejected")}function Xy(p,T){Tc(p,T)}function Ic(p){p._closedPromise_resolve!==void 0&&(p._closedPromise_resolve(void 0),p._closedPromise_resolve=void 0,p._closedPromise_reject=void 0,p._closedPromiseState="resolved")}function Qa(p){p._readyPromise=I((T,q)=>{p._readyPromise_resolve=T,p._readyPromise_reject=q}),p._readyPromiseState="pending"}function Gs(p,T){Qa(p),Ac(p,T)}function Rc(p){Qa(p),Qs(p)}function Ac(p,T){p._readyPromise_reject!==void 0&&(E(p._readyPromise),p._readyPromise_reject(T),p._readyPromise_resolve=void 0,p._readyPromise_reject=void 0,p._readyPromiseState="rejected")}function Yy(p){Qa(p)}function Zy(p,T){Gs(p,T)}function Qs(p){p._readyPromise_resolve!==void 0&&(p._readyPromise_resolve(void 0),p._readyPromise_resolve=void 0,p._readyPromise_reject=void 0,p._readyPromiseState="fulfilled")}let Bc=typeof DOMException<"u"?DOMException:void 0;function Jy(p){if(!(typeof p=="function"||typeof p=="object"))return!1;try{return new p,!0}catch{return!1}}function eg(){let p=function(T,q){this.message=T||"",this.name=q||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return p.prototype=Object.create(Error.prototype),Object.defineProperty(p.prototype,"constructor",{value:p,writable:!0,configurable:!0}),p}let tg=Jy(Bc)?Bc:eg();function kc(p,T,q,X,ne,ue){let ge=me(p),Be=pc(T);p._disturbed=!0;let Me=!1,ze=w(void 0);return I((Qe,Xe)=>{let Mt;if(ue!==void 0){if(Mt=()=>{let Ne=new tg("Aborted","AbortError"),Ge=[];X||Ge.push(()=>T._state==="writable"?Ka(T,Ne):w(void 0)),ne||Ge.push(()=>p._state==="readable"?Pr(p,Ne):w(void 0)),wr(()=>Promise.all(Ge.map(yt=>yt())),!0,Ne)},ue.aborted){Mt();return}ue.addEventListener("abort",Mt)}function Nr(){return I((Ne,Ge)=>{function yt(pr){pr?Ne():S(wi(),yt,Ge)}yt(!1)})}function wi(){return Me?w(!0):S(Be._readyPromise,()=>I((Ne,Ge)=>{Ke(ge,{_chunkSteps:yt=>{ze=S(_c(Be,yt),void 0,i),Ne(!1)},_closeSteps:()=>Ne(!0),_errorSteps:Ge})}))}if(rn(p,ge._closedPromise,Ne=>{X?Tr(!0,Ne):wr(()=>Ka(T,Ne),!0,Ne)}),rn(T,Be._closedPromise,Ne=>{ne?Tr(!0,Ne):wr(()=>Pr(p,Ne),!0,Ne)}),Xt(p,ge._closedPromise,()=>{q?Tr():wr(()=>My(Be))}),Hr(T)||T._state==="closed"){let Ne=new TypeError("the destination writable stream closed before all data could be piped to it");ne?Tr(!0,Ne):wr(()=>Pr(p,Ne),!0,Ne)}E(Nr());function _n(){let Ne=ze;return S(ze,()=>Ne!==ze?_n():void 0)}function rn(Ne,Ge,yt){Ne._state==="errored"?yt(Ne._storedError):f(Ge,yt)}function Xt(Ne,Ge,yt){Ne._state==="closed"?yt():A(Ge,yt)}function wr(Ne,Ge,yt){if(Me)return;Me=!0,T._state==="writable"&&!Hr(T)?A(_n(),pr):pr();function pr(){B(Ne(),()=>jn(Ge,yt),wn=>jn(!0,wn))}}function Tr(Ne,Ge){Me||(Me=!0,T._state==="writable"&&!Hr(T)?A(_n(),()=>jn(Ne,Ge)):jn(Ne,Ge))}function jn(Ne,Ge){bc(Be),M(ge),ue!==void 0&&ue.removeEventListener("abort",Mt),Ne?Xe(Ge):Qe(void 0)}})}class bi{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Xa(this))throw Ja("desiredSize");return Xs(this)}close(){if(!Xa(this))throw Ja("close");if(!_i(this))throw new TypeError("The stream is not in a state that permits close");Ji(this)}enqueue(T=void 0){if(!Xa(this))throw Ja("enqueue");if(!_i(this))throw new TypeError("The stream is not in a state that permits enqueue");return Za(this,T)}error(T=void 0){if(!Xa(this))throw Ja("error");gn(this,T)}[be](T){er(this);let q=this._cancelAlgorithm(T);return Ya(this),q}[Ce](T){let q=this._controlledReadableStream;if(this._queue.length>0){let X=cr(this);this._closeRequested&&this._queue.length===0?(Ya(this),ea(q)):Zi(this),T._chunkSteps(X)}else Te(q,T),Zi(this)}}Object.defineProperties(bi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(bi.prototype,t.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Xa(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_controlledReadableStream")?!1:p instanceof bi}function Zi(p){if(!Pc(p))return;if(p._pulling){p._pullAgain=!0;return}p._pulling=!0;let T=p._pullAlgorithm();B(T,()=>{p._pulling=!1,p._pullAgain&&(p._pullAgain=!1,Zi(p))},q=>{gn(p,q)})}function Pc(p){let T=p._controlledReadableStream;return!_i(p)||!p._started?!1:!!(bn(T)&&Se(T)>0||Xs(p)>0)}function Ya(p){p._pullAlgorithm=void 0,p._cancelAlgorithm=void 0,p._strategySizeAlgorithm=void 0}function Ji(p){if(!_i(p))return;let T=p._controlledReadableStream;p._closeRequested=!0,p._queue.length===0&&(Ya(p),ea(T))}function Za(p,T){if(!_i(p))return;let q=p._controlledReadableStream;if(bn(q)&&Se(q)>0)ae(q,T,!1);else{let X;try{X=p._strategySizeAlgorithm(T)}catch(ne){throw gn(p,ne),ne}try{dt(p,T,X)}catch(ne){throw gn(p,ne),ne}}Zi(p)}function gn(p,T){let q=p._controlledReadableStream;q._state==="readable"&&(er(p),Ya(p),Uc(q,T))}function Xs(p){let T=p._controlledReadableStream._state;return T==="errored"?null:T==="closed"?0:p._strategyHWM-p._queueTotalSize}function rg(p){return!Pc(p)}function _i(p){let T=p._controlledReadableStream._state;return!p._closeRequested&&T==="readable"}function Nc(p,T,q,X,ne,ue,ge){T._controlledReadableStream=p,T._queue=void 0,T._queueTotalSize=void 0,er(T),T._started=!1,T._closeRequested=!1,T._pullAgain=!1,T._pulling=!1,T._strategySizeAlgorithm=ge,T._strategyHWM=ue,T._pullAlgorithm=X,T._cancelAlgorithm=ne,p._readableStreamController=T;let Be=q();B(w(Be),()=>{T._started=!0,Zi(T)},Me=>{gn(T,Me)})}function ng(p,T,q,X){let ne=Object.create(bi.prototype),ue=()=>{},ge=()=>w(void 0),Be=()=>w(void 0);T.start!==void 0&&(ue=()=>T.start(ne)),T.pull!==void 0&&(ge=()=>T.pull(ne)),T.cancel!==void 0&&(Be=Me=>T.cancel(Me)),Nc(p,ne,ue,ge,Be,q,X)}function Ja(p){return new TypeError(`ReadableStreamDefaultController.prototype.${p} can only be used on a ReadableStreamDefaultController`)}function ig(p,T){return st(p._readableStreamController)?og(p):ag(p)}function ag(p,T){let q=me(p),X=!1,ne=!1,ue=!1,ge=!1,Be,Me,ze,Qe,Xe,Mt=I(Xt=>{Xe=Xt});function Nr(){return X?(ne=!0,w(void 0)):(X=!0,Ke(q,{_chunkSteps:Xt=>{R(()=>{ne=!1;let wr=Xt,Tr=Xt;ue||Za(ze._readableStreamController,wr),ge||Za(Qe._readableStreamController,Tr),X=!1,ne&&Nr()})},_closeSteps:()=>{X=!1,ue||Ji(ze._readableStreamController),ge||Ji(Qe._readableStreamController),(!ue||!ge)&&Xe(void 0)},_errorSteps:()=>{X=!1}}),w(void 0))}function wi(Xt){if(ue=!0,Be=Xt,ge){let wr=_t([Be,Me]),Tr=Pr(p,wr);Xe(Tr)}return Mt}function _n(Xt){if(ge=!0,Me=Xt,ue){let wr=_t([Be,Me]),Tr=Pr(p,wr);Xe(Tr)}return Mt}function rn(){}return ze=Ys(rn,Nr,wi),Qe=Ys(rn,Nr,_n),f(q._closedPromise,Xt=>{gn(ze._readableStreamController,Xt),gn(Qe._readableStreamController,Xt),(!ue||!ge)&&Xe(void 0)}),[ze,Qe]}function og(p){let T=me(p),q=!1,X=!1,ne=!1,ue=!1,ge=!1,Be,Me,ze,Qe,Xe,Mt=I(Ne=>{Xe=Ne});function Nr(Ne){f(Ne._closedPromise,Ge=>{Ne===T&&(we(ze._readableStreamController,Ge),we(Qe._readableStreamController,Ge),(!ue||!ge)&&Xe(void 0))})}function wi(){H(T)&&(M(T),T=me(p),Nr(T)),Ke(T,{_chunkSteps:Ne=>{R(()=>{X=!1,ne=!1;let Ge=Ne,yt=Ne;if(!ue&&!ge)try{yt=lr(Ne)}catch(pr){we(ze._readableStreamController,pr),we(Qe._readableStreamController,pr),Xe(Pr(p,pr));return}ue||ye(ze._readableStreamController,Ge),ge||ye(Qe._readableStreamController,yt),q=!1,X?rn():ne&&Xt()})},_closeSteps:()=>{q=!1,ue||pe(ze._readableStreamController),ge||pe(Qe._readableStreamController),ze._readableStreamController._pendingPullIntos.length>0&&je(ze._readableStreamController,0),Qe._readableStreamController._pendingPullIntos.length>0&&je(Qe._readableStreamController,0),(!ue||!ge)&&Xe(void 0)},_errorSteps:()=>{q=!1}})}function _n(Ne,Ge){Oe(T)&&(M(T),T=Ma(p),Nr(T));let yt=Ge?Qe:ze,pr=Ge?ze:Qe;ee(T,Ne,{_chunkSteps:wn=>{R(()=>{X=!1,ne=!1;let Si=Ge?ge:ue;if(Ge?ue:ge)Si||Wt(yt._readableStreamController,wn);else{let Ei;try{Ei=lr(wn)}catch(Js){we(yt._readableStreamController,Js),we(pr._readableStreamController,Js),Xe(Pr(p,Js));return}Si||Wt(yt._readableStreamController,wn),ye(pr._readableStreamController,Ei)}q=!1,X?rn():ne&&Xt()})},_closeSteps:wn=>{q=!1;let Si=Ge?ge:ue,Ei=Ge?ue:ge;Si||pe(yt._readableStreamController),Ei||pe(pr._readableStreamController),wn!==void 0&&(Si||Wt(yt._readableStreamController,wn),!Ei&&pr._readableStreamController._pendingPullIntos.length>0&&je(pr._readableStreamController,0)),(!Si||!Ei)&&Xe(void 0)},_errorSteps:()=>{q=!1}})}function rn(){if(q)return X=!0,w(void 0);q=!0;let Ne=Ie(ze._readableStreamController);return Ne===null?wi():_n(Ne._view,!1),w(void 0)}function Xt(){if(q)return ne=!0,w(void 0);q=!0;let Ne=Ie(Qe._readableStreamController);return Ne===null?wi():_n(Ne._view,!0),w(void 0)}function wr(Ne){if(ue=!0,Be=Ne,ge){let Ge=_t([Be,Me]),yt=Pr(p,Ge);Xe(yt)}return Mt}function Tr(Ne){if(ge=!0,Me=Ne,ue){let Ge=_t([Be,Me]),yt=Pr(p,Ge);Xe(yt)}return Mt}function jn(){}return ze=Lc(jn,rn,wr),Qe=Lc(jn,Xt,Tr),Nr(T),[ze,Qe]}function sg(p,T){ce(p,T);let q=p,X=q?.autoAllocateChunkSize,ne=q?.cancel,ue=q?.pull,ge=q?.start,Be=q?.type;return{autoAllocateChunkSize:X===void 0?void 0:z(X,`${T} has member 'autoAllocateChunkSize' that`),cancel:ne===void 0?void 0:ug(ne,q,`${T} has member 'cancel' that`),pull:ue===void 0?void 0:lg(ue,q,`${T} has member 'pull' that`),start:ge===void 0?void 0:cg(ge,q,`${T} has member 'start' that`),type:Be===void 0?void 0:hg(Be,`${T} has member 'type' that`)}}function ug(p,T,q){return Ve(p,q),X=>C(p,T,[X])}function lg(p,T,q){return Ve(p,q),X=>C(p,T,[X])}function cg(p,T,q){return Ve(p,q),X=>P(p,T,[X])}function hg(p,T){if(p=`${p}`,p!=="bytes")throw new TypeError(`${T} '${p}' is not a valid enumeration value for ReadableStreamType`);return p}function fg(p,T){ce(p,T);let q=p?.mode;return{mode:q===void 0?void 0:dg(q,`${T} has member 'mode' that`)}}function dg(p,T){if(p=`${p}`,p!=="byob")throw new TypeError(`${T} '${p}' is not a valid enumeration value for ReadableStreamReaderMode`);return p}function pg(p,T){ce(p,T);let q=p?.preventCancel;return{preventCancel:Boolean(q)}}function Oc(p,T){ce(p,T);let q=p?.preventAbort,X=p?.preventCancel,ne=p?.preventClose,ue=p?.signal;return ue!==void 0&&yg(ue,`${T} has member 'signal' that`),{preventAbort:Boolean(q),preventCancel:Boolean(X),preventClose:Boolean(ne),signal:ue}}function yg(p,T){if(!_r(p))throw new TypeError(`${T} is not an AbortSignal.`)}function gg(p,T){ce(p,T);let q=p?.readable;V(q,"readable","ReadableWritablePair"),se(q,`${T} has member 'readable' that`);let X=p?.writable;return V(X,"writable","ReadableWritablePair"),dr(X,`${T} has member 'writable' that`),{readable:q,writable:X}}class mn{constructor(T={},q={}){T===void 0?T=null:k(T,"First parameter");let X=_e(q,"Second parameter"),ne=sg(T,"First parameter");if(Zs(this),ne.type==="bytes"){if(X.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let ue=he(X,0);tr(this,ne,ue)}else{let ue=Ee(X),ge=he(X,1);ng(this,ne,ge,ue)}}get locked(){if(!vn(this))throw qn("locked");return bn(this)}cancel(T=void 0){return vn(this)?bn(this)?m(new TypeError("Cannot cancel a stream that already has a reader")):Pr(this,T):m(qn("cancel"))}getReader(T=void 0){if(!vn(this))throw qn("getReader");return fg(T,"First parameter").mode===void 0?me(this):Ma(this)}pipeThrough(T,q={}){if(!vn(this))throw qn("pipeThrough");$(T,1,"pipeThrough");let X=gg(T,"First parameter"),ne=Oc(q,"Second parameter");if(bn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(mi(X.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let ue=kc(this,X.writable,ne.preventClose,ne.preventAbort,ne.preventCancel,ne.signal);return E(ue),X.readable}pipeTo(T,q={}){if(!vn(this))return m(qn("pipeTo"));if(T===void 0)return m("Parameter 1 is required in 'pipeTo'.");if(!gi(T))return m(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let X;try{X=Oc(q,"Second parameter")}catch(ne){return m(ne)}return bn(this)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):mi(T)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):kc(this,T,X.preventClose,X.preventAbort,X.preventCancel,X.signal)}tee(){if(!vn(this))throw qn("tee");let T=ig(this);return _t(T)}values(T=void 0){if(!vn(this))throw qn("values");let q=pg(T,"First parameter");return Je(this,q.preventCancel)}}Object.defineProperties(mn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,t.toStringTag,{value:"ReadableStream",configurable:!0}),typeof t.asyncIterator=="symbol"&&Object.defineProperty(mn.prototype,t.asyncIterator,{value:mn.prototype.values,writable:!0,configurable:!0});function Ys(p,T,q,X=1,ne=()=>1){let ue=Object.create(mn.prototype);Zs(ue);let ge=Object.create(bi.prototype);return Nc(ue,ge,p,T,q,X,ne),ue}function Lc(p,T,q){let X=Object.create(mn.prototype);Zs(X);let ne=Object.create(pt.prototype);return ir(X,ne,p,T,q,0,void 0),X}function Zs(p){p._state="readable",p._reader=void 0,p._storedError=void 0,p._disturbed=!1}function vn(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_readableStreamController")?!1:p instanceof mn}function bn(p){return p._reader!==void 0}function Pr(p,T){if(p._disturbed=!0,p._state==="closed")return w(void 0);if(p._state==="errored")return m(p._storedError);ea(p);let q=p._reader;q!==void 0&&H(q)&&(q._readIntoRequests.forEach(ne=>{ne._closeSteps(void 0)}),q._readIntoRequests=new h);let X=p._readableStreamController[be](T);return b(X,i)}function ea(p){p._state="closed";let T=p._reader;T!==void 0&&(te(T),Oe(T)&&(T._readRequests.forEach(q=>{q._closeSteps()}),T._readRequests=new h))}function Uc(p,T){p._state="errored",p._storedError=T;let q=p._reader;q!==void 0&&(K(q,T),Oe(q)?(q._readRequests.forEach(X=>{X._errorSteps(T)}),q._readRequests=new h):(q._readIntoRequests.forEach(X=>{X._errorSteps(T)}),q._readIntoRequests=new h))}function qn(p){return new TypeError(`ReadableStream.prototype.${p} can only be used on a ReadableStream`)}function Dc(p,T){ce(p,T);let q=p?.highWaterMark;return V(q,"highWaterMark","QueuingStrategyInit"),{highWaterMark:_(q)}}let xc=p=>p.byteLength;try{Object.defineProperty(xc,"name",{value:"size",configurable:!0})}catch{}class eo{constructor(T){$(T,1,"ByteLengthQueuingStrategy"),T=Dc(T,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=T.highWaterMark}get highWaterMark(){if(!jc(this))throw qc("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!jc(this))throw qc("size");return xc}}Object.defineProperties(eo.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(eo.prototype,t.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function qc(p){return new TypeError(`ByteLengthQueuingStrategy.prototype.${p} can only be used on a ByteLengthQueuingStrategy`)}function jc(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_byteLengthQueuingStrategyHighWaterMark")?!1:p instanceof eo}let Mc=()=>1;try{Object.defineProperty(Mc,"name",{value:"size",configurable:!0})}catch{}class to{constructor(T){$(T,1,"CountQueuingStrategy"),T=Dc(T,"First parameter"),this._countQueuingStrategyHighWaterMark=T.highWaterMark}get highWaterMark(){if(!Fc(this))throw Vc("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Fc(this))throw Vc("size");return Mc}}Object.defineProperties(to.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(to.prototype,t.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Vc(p){return new TypeError(`CountQueuingStrategy.prototype.${p} can only be used on a CountQueuingStrategy`)}function Fc(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_countQueuingStrategyHighWaterMark")?!1:p instanceof to}function mg(p,T){ce(p,T);let q=p?.flush,X=p?.readableType,ne=p?.start,ue=p?.transform,ge=p?.writableType;return{flush:q===void 0?void 0:vg(q,p,`${T} has member 'flush' that`),readableType:X,start:ne===void 0?void 0:bg(ne,p,`${T} has member 'start' that`),transform:ue===void 0?void 0:_g(ue,p,`${T} has member 'transform' that`),writableType:ge}}function vg(p,T,q){return Ve(p,q),X=>C(p,T,[X])}function bg(p,T,q){return Ve(p,q),X=>P(p,T,[X])}function _g(p,T,q){return Ve(p,q),(X,ne)=>C(p,T,[X,ne])}class ro{constructor(T={},q={},X={}){T===void 0&&(T=null);let ne=_e(q,"Second parameter"),ue=_e(X,"Third parameter"),ge=mg(T,"First parameter");if(ge.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(ge.writableType!==void 0)throw new RangeError("Invalid writableType specified");let Be=he(ue,0),Me=Ee(ue),ze=he(ne,1),Qe=Ee(ne),Xe,Mt=I(Nr=>{Xe=Nr});wg(this,Mt,ze,Qe,Be,Me),Eg(this,ge),ge.start!==void 0?Xe(ge.start(this._transformStreamController)):Xe(void 0)}get readable(){if(!Kc(this))throw Wc("readable");return this._readable}get writable(){if(!Kc(this))throw Wc("writable");return this._writable}}Object.defineProperties(ro.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(ro.prototype,t.toStringTag,{value:"TransformStream",configurable:!0});function wg(p,T,q,X,ne,ue){function ge(){return T}function Be(Mt){return Ig(p,Mt)}function Me(Mt){return Rg(p,Mt)}function ze(){return Ag(p)}p._writable=ky(ge,Be,ze,Me,q,X);function Qe(){return Bg(p)}function Xe(Mt){return io(p,Mt),w(void 0)}p._readable=Ys(ge,Qe,Xe,ne,ue),p._backpressure=void 0,p._backpressureChangePromise=void 0,p._backpressureChangePromise_resolve=void 0,ao(p,!0),p._transformStreamController=void 0}function Kc(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_transformStreamController")?!1:p instanceof ro}function no(p,T){gn(p._readable._readableStreamController,T),io(p,T)}function io(p,T){$c(p._transformStreamController),$s(p._writable._writableStreamController,T),p._backpressure&&ao(p,!1)}function ao(p,T){p._backpressureChangePromise!==void 0&&p._backpressureChangePromise_resolve(),p._backpressureChangePromise=I(q=>{p._backpressureChangePromise_resolve=q}),p._backpressure=T}class ta{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!oo(this))throw so("desiredSize");let T=this._controlledTransformStream._readable._readableStreamController;return Xs(T)}enqueue(T=void 0){if(!oo(this))throw so("enqueue");Hc(this,T)}error(T=void 0){if(!oo(this))throw so("error");Cg(this,T)}terminate(){if(!oo(this))throw so("terminate");Tg(this)}}Object.defineProperties(ta.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof t.toStringTag=="symbol"&&Object.defineProperty(ta.prototype,t.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function oo(p){return!u(p)||!Object.prototype.hasOwnProperty.call(p,"_controlledTransformStream")?!1:p instanceof ta}function Sg(p,T,q,X){T._controlledTransformStream=p,p._transformStreamController=T,T._transformAlgorithm=q,T._flushAlgorithm=X}function Eg(p,T){let q=Object.create(ta.prototype),X=ue=>{try{return Hc(q,ue),w(void 0)}catch(ge){return m(ge)}},ne=()=>w(void 0);T.transform!==void 0&&(X=ue=>T.transform(ue,q)),T.flush!==void 0&&(ne=()=>T.flush(q)),Sg(p,q,X,ne)}function $c(p){p._transformAlgorithm=void 0,p._flushAlgorithm=void 0}function Hc(p,T){let q=p._controlledTransformStream,X=q._readable._readableStreamController;if(!_i(X))throw new TypeError("Readable side is not in a state that permits enqueue");try{Za(X,T)}catch(ne){throw io(q,ne),q._readable._storedError}rg(X)!==q._backpressure&&ao(q,!0)}function Cg(p,T){no(p._controlledTransformStream,T)}function zc(p,T){let q=p._transformAlgorithm(T);return b(q,void 0,X=>{throw no(p._controlledTransformStream,X),X})}function Tg(p){let T=p._controlledTransformStream,q=T._readable._readableStreamController;Ji(q);let X=new TypeError("TransformStream terminated");io(T,X)}function Ig(p,T){let q=p._transformStreamController;if(p._backpressure){let X=p._backpressureChangePromise;return b(X,()=>{let ne=p._writable;if(ne._state==="erroring")throw ne._storedError;return zc(q,T)})}return zc(q,T)}function Rg(p,T){return no(p,T),w(void 0)}function Ag(p){let T=p._readable,q=p._transformStreamController,X=q._flushAlgorithm();return $c(q),b(X,()=>{if(T._state==="errored")throw T._storedError;Ji(T._readableStreamController)},ne=>{throw no(p,ne),T._storedError})}function Bg(p){return ao(p,!1),p._backpressureChangePromise}function so(p){return new TypeError(`TransformStreamDefaultController.prototype.${p} can only be used on a TransformStreamDefaultController`)}function Wc(p){return new TypeError(`TransformStream.prototype.${p} can only be used on a TransformStream`)}r.ByteLengthQueuingStrategy=eo,r.CountQueuingStrategy=to,r.ReadableByteStreamController=pt,r.ReadableStream=mn,r.ReadableStreamBYOBReader=F,r.ReadableStreamBYOBRequest=Cr,r.ReadableStreamDefaultController=bi,r.ReadableStreamDefaultReader=qe,r.TransformStream=ro,r.TransformStreamDefaultController=ta,r.WritableStream=tn,r.WritableStreamDefaultController=vi,r.WritableStreamDefaultWriter=Xi,Object.defineProperty(r,"__esModule",{value:!0})})}),c_=Ue(()=>{if(!globalThis.ReadableStream)try{let e=Mi("process"),{emitWarning:n}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,Mi("stream/web")),e.emitWarning=n}catch(r){throw e.emitWarning=n,r}}catch{Object.assign(globalThis,l_())}try{let{Blob:e}=Mi("buffer");e&&!e.prototype.stream&&(e.prototype.stream=function(n){let r=0,t=this;return new ReadableStream({type:"bytes",async pull(i){let o=await t.slice(r,Math.min(t.size,r+65536)).arrayBuffer();r+=o.byteLength,i.enqueue(new Uint8Array(o)),r===t.size&&i.close()}})})}catch{}}),h_=Ue(e=>{e.read=function(n,r,t,i,o){var l,u,s=o*8-i-1,a=(1<>1,c=-7,g=t?o-1:0,I=t?-1:1,w=n[r+g];for(g+=I,l=w&(1<<-c)-1,w>>=-c,c+=s;c>0;l=l*256+n[r+g],g+=I,c-=8);for(u=l&(1<<-c)-1,l>>=-c,c+=i;c>0;u=u*256+n[r+g],g+=I,c-=8);if(l===0)l=1-y;else{if(l===a)return u?NaN:(w?-1:1)*(1/0);u=u+Math.pow(2,i),l=l-y}return(w?-1:1)*u*Math.pow(2,l-i)},e.write=function(n,r,t,i,o,l){var u,s,a,y=l*8-o-1,c=(1<>1,I=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?0:l-1,m=i?1:-1,S=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=c):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+g>=1?r+=I/a:r+=I*Math.pow(2,1-g),r*a>=2&&(u++,a/=2),u+g>=c?(s=0,u=c):u+g>=1?(s=(r*a-1)*Math.pow(2,o),u=u+g):(s=r*Math.pow(2,g-1)*Math.pow(2,o),u=0));o>=8;n[t+w]=s&255,w+=m,s/=256,o-=8);for(u=u<0;n[t+w]=u&255,w+=m,u/=256,y-=8);n[t+w-m]|=S*128}}),f_=Ue((e,n)=>{"use strict";n.exports=t;var r=h_();function t(v){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(v)?v:new Uint8Array(v||0),this.pos=0,this.type=0,this.length=this.buf.length}t.Varint=0,t.Fixed64=1,t.Bytes=2,t.Fixed32=5;var i=(1<<16)*(1<<16),o=1/i,l=12,u=typeof TextDecoder>"u"?null:new TextDecoder("utf8");t.prototype={destroy:function(){this.buf=null},readFields:function(v,N,L){for(L=L||this.length;this.pos>3,Y=this.pos;this.type=O&7,v(K,N,this),this.pos===Y&&this.skip(O)}return N},readMessage:function(v,N){return this.readFields(v,N,this.readVarint()+this.pos)},readFixed32:function(){var v=C(this.buf,this.pos);return this.pos+=4,v},readSFixed32:function(){var v=h(this.buf,this.pos);return this.pos+=4,v},readFixed64:function(){var v=C(this.buf,this.pos)+C(this.buf,this.pos+4)*i;return this.pos+=8,v},readSFixed64:function(){var v=C(this.buf,this.pos)+h(this.buf,this.pos+4)*i;return this.pos+=8,v},readFloat:function(){var v=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,v},readDouble:function(){var v=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,v},readVarint:function(v){var N=this.buf,L,O;return O=N[this.pos++],L=O&127,O<128||(O=N[this.pos++],L|=(O&127)<<7,O<128)||(O=N[this.pos++],L|=(O&127)<<14,O<128)||(O=N[this.pos++],L|=(O&127)<<21,O<128)?L:(O=N[this.pos],L|=(O&15)<<28,s(L,v,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var v=this.readVarint();return v%2===1?(v+1)/-2:v/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var v=this.readVarint()+this.pos,N=this.pos;return this.pos=v,v-N>=l&&u?j(this.buf,N,v):U(this.buf,N,v)},readBytes:function(){var v=this.readVarint()+this.pos,N=this.buf.subarray(this.pos,v);return this.pos=v,N},readPackedVarint:function(v,N){if(this.type!==t.Bytes)return v.push(this.readVarint(N));var L=a(this);for(v=v||[];this.pos127;);else if(N===t.Bytes)this.pos=this.readVarint()+this.pos;else if(N===t.Fixed32)this.pos+=4;else if(N===t.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+N)},writeTag:function(v,N){this.writeVarint(v<<3|N)},realloc:function(v){for(var N=this.length||16;N268435455||v<0){c(v,this);return}this.realloc(4),this.buf[this.pos++]=v&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=v>>>7&127)))},writeSVarint:function(v){this.writeVarint(v<0?-v*2-1:v*2)},writeBoolean:function(v){this.writeVarint(Boolean(v))},writeString:function(v){v=String(v),this.realloc(v.length*4),this.pos++;var N=this.pos;this.pos=M(this.buf,v,this.pos);var L=this.pos-N;L>=128&&w(N,L,this),this.pos=N-1,this.writeVarint(L),this.pos+=L},writeFloat:function(v){this.realloc(4),r.write(this.buf,v,this.pos,!0,23,4),this.pos+=4},writeDouble:function(v){this.realloc(8),r.write(this.buf,v,this.pos,!0,52,8),this.pos+=8},writeBytes:function(v){var N=v.length;this.writeVarint(N),this.realloc(N);for(var L=0;L=128&&w(L,O,this),this.pos=L-1,this.writeVarint(O),this.pos+=O},writeMessage:function(v,N,L){this.writeTag(v,t.Bytes),this.writeRawMessage(N,L)},writePackedVarint:function(v,N){N.length&&this.writeMessage(v,m,N)},writePackedSVarint:function(v,N){N.length&&this.writeMessage(v,S,N)},writePackedBoolean:function(v,N){N.length&&this.writeMessage(v,f,N)},writePackedFloat:function(v,N){N.length&&this.writeMessage(v,B,N)},writePackedDouble:function(v,N){N.length&&this.writeMessage(v,A,N)},writePackedFixed32:function(v,N){N.length&&this.writeMessage(v,b,N)},writePackedSFixed32:function(v,N){N.length&&this.writeMessage(v,E,N)},writePackedFixed64:function(v,N){N.length&&this.writeMessage(v,R,N)},writePackedSFixed64:function(v,N){N.length&&this.writeMessage(v,P,N)},writeBytesField:function(v,N){this.writeTag(v,t.Bytes),this.writeBytes(N)},writeFixed32Field:function(v,N){this.writeTag(v,t.Fixed32),this.writeFixed32(N)},writeSFixed32Field:function(v,N){this.writeTag(v,t.Fixed32),this.writeSFixed32(N)},writeFixed64Field:function(v,N){this.writeTag(v,t.Fixed64),this.writeFixed64(N)},writeSFixed64Field:function(v,N){this.writeTag(v,t.Fixed64),this.writeSFixed64(N)},writeVarintField:function(v,N){this.writeTag(v,t.Varint),this.writeVarint(N)},writeSVarintField:function(v,N){this.writeTag(v,t.Varint),this.writeSVarint(N)},writeStringField:function(v,N){this.writeTag(v,t.Bytes),this.writeString(N)},writeFloatField:function(v,N){this.writeTag(v,t.Fixed32),this.writeFloat(N)},writeDoubleField:function(v,N){this.writeTag(v,t.Fixed64),this.writeDouble(N)},writeBooleanField:function(v,N){this.writeVarintField(v,Boolean(N))}};function s(v,N,L){var O=L.buf,K,Y;if(Y=O[L.pos++],K=(Y&112)>>4,Y<128||(Y=O[L.pos++],K|=(Y&127)<<3,Y<128)||(Y=O[L.pos++],K|=(Y&127)<<10,Y<128)||(Y=O[L.pos++],K|=(Y&127)<<17,Y<128)||(Y=O[L.pos++],K|=(Y&127)<<24,Y<128)||(Y=O[L.pos++],K|=(Y&1)<<31,Y<128))return y(v,K,N);throw new Error("Expected varint not more than 10 bytes")}function a(v){return v.type===t.Bytes?v.readVarint()+v.pos:v.pos+1}function y(v,N,L){return L?N*4294967296+(v>>>0):(N>>>0)*4294967296+(v>>>0)}function c(v,N){var L,O;if(v>=0?(L=v%4294967296|0,O=v/4294967296|0):(L=~(-v%4294967296),O=~(-v/4294967296),L^4294967295?L=L+1|0:(L=0,O=O+1|0)),v>=18446744073709552e3||v<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");N.realloc(10),g(L,O,N),I(O,N)}function g(v,N,L){L.buf[L.pos++]=v&127|128,v>>>=7,L.buf[L.pos++]=v&127|128,v>>>=7,L.buf[L.pos++]=v&127|128,v>>>=7,L.buf[L.pos++]=v&127|128,v>>>=7,L.buf[L.pos]=v&127}function I(v,N){var L=(v&7)<<4;N.buf[N.pos++]|=L|((v>>>=3)?128:0),v&&(N.buf[N.pos++]=v&127|((v>>>=7)?128:0),v&&(N.buf[N.pos++]=v&127|((v>>>=7)?128:0),v&&(N.buf[N.pos++]=v&127|((v>>>=7)?128:0),v&&(N.buf[N.pos++]=v&127|((v>>>=7)?128:0),v&&(N.buf[N.pos++]=v&127)))))}function w(v,N,L){var O=N<=16383?1:N<=2097151?2:N<=268435455?3:Math.floor(Math.log(N)/(Math.LN2*7));L.realloc(O);for(var K=L.pos-1;K>=v;K--)L.buf[K+O]=L.buf[K]}function m(v,N){for(var L=0;L>>8,v[L+2]=N>>>16,v[L+3]=N>>>24}function h(v,N){return(v[N]|v[N+1]<<8|v[N+2]<<16)+(v[N+3]<<24)}function U(v,N,L){for(var O="",K=N;K239?4:Y>223?3:Y>191?2:1;if(K+re>L)break;var oe,be,Ce;re===1?Y<128&&(te=Y):re===2?(oe=v[K+1],(oe&192)===128&&(te=(Y&31)<<6|oe&63,te<=127&&(te=null))):re===3?(oe=v[K+1],be=v[K+2],(oe&192)===128&&(be&192)===128&&(te=(Y&15)<<12|(oe&63)<<6|be&63,(te<=2047||te>=55296&&te<=57343)&&(te=null))):re===4&&(oe=v[K+1],be=v[K+2],Ce=v[K+3],(oe&192)===128&&(be&192)===128&&(Ce&192)===128&&(te=(Y&15)<<18|(oe&63)<<12|(be&63)<<6|Ce&63,(te<=65535||te>=1114112)&&(te=null))),te===null?(te=65533,re=1):te>65535&&(te-=65536,O+=String.fromCharCode(te>>>10&1023|55296),te=56320|te&1023),O+=String.fromCharCode(te),K+=re}return O}function j(v,N,L){return u.decode(v.subarray(N,L))}function M(v,N,L){for(var O=0,K,Y;O55295&&K<57344)if(Y)if(K<56320){v[L++]=239,v[L++]=191,v[L++]=189,Y=K;continue}else K=Y-55296<<10|K-56320|65536,Y=null;else{K>56319||O+1===N.length?(v[L++]=239,v[L++]=191,v[L++]=189):Y=K;continue}else Y&&(v[L++]=239,v[L++]=191,v[L++]=189,Y=null);K<128?v[L++]=K:(K<2048?v[L++]=K>>6|192:(K<65536?v[L++]=K>>12|224:(v[L++]=K>>18|240,v[L++]=K>>12&63|128),v[L++]=K>>6&63|128),v[L++]=K&63|128)}return L}}),d_=Ue(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(u){var s=u+48;return s+=9-u>>>8&-48+65-10,String.fromCharCode(s)}function r(u){var s=u+48;return s+=9-u>>>8&-48+97-10,String.fromCharCode(s)}var t=256;function i(u){var s=t;return s+=(47-u&u-58)>>8&-t+u-48,s+=(64-u&u-71)>>8&-t+u-65+10,s+=(96-u&u-103)>>8&-t+u-97+10,s}function o(u,s){s===void 0&&(s=!1);for(var a=s?r:n,y="",c=0;c>>4),y+=a(u[c]&15);return y}e.encode=o;function l(u){if(u.length===0)return new Uint8Array(0);if(u.length%2!==0)throw new Error("hex: input string must be divisible by two");for(var s=new Uint8Array(u.length/2),a=0,y=0;y{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(u,s){var a=u>>>16&65535,y=u&65535,c=s>>>16&65535,g=s&65535;return y*g+(a*g+y*c<<16>>>0)|0}e.mul=Math.imul||n;function r(u,s){return u+s|0}e.add=r;function t(u,s){return u-s|0}e.sub=t;function i(u,s){return u<>>32-s}e.rotl=i;function o(u,s){return u<<32-s|u>>>s}e.rotr=o;function l(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}e.isInteger=Number.isInteger||l,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(u){return e.isInteger(u)&&u>=-e.MAX_SAFE_INTEGER&&u<=e.MAX_SAFE_INTEGER}}),y_=Ue(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=p_();function r(L,O){return O===void 0&&(O=0),(L[O+0]<<8|L[O+1])<<16>>16}e.readInt16BE=r;function t(L,O){return O===void 0&&(O=0),(L[O+0]<<8|L[O+1])>>>0}e.readUint16BE=t;function i(L,O){return O===void 0&&(O=0),(L[O+1]<<8|L[O])<<16>>16}e.readInt16LE=i;function o(L,O){return O===void 0&&(O=0),(L[O+1]<<8|L[O])>>>0}e.readUint16LE=o;function l(L,O,K){return O===void 0&&(O=new Uint8Array(2)),K===void 0&&(K=0),O[K+0]=L>>>8,O[K+1]=L>>>0,O}e.writeUint16BE=l,e.writeInt16BE=l;function u(L,O,K){return O===void 0&&(O=new Uint8Array(2)),K===void 0&&(K=0),O[K+0]=L>>>0,O[K+1]=L>>>8,O}e.writeUint16LE=u,e.writeInt16LE=u;function s(L,O){return O===void 0&&(O=0),L[O]<<24|L[O+1]<<16|L[O+2]<<8|L[O+3]}e.readInt32BE=s;function a(L,O){return O===void 0&&(O=0),(L[O]<<24|L[O+1]<<16|L[O+2]<<8|L[O+3])>>>0}e.readUint32BE=a;function y(L,O){return O===void 0&&(O=0),L[O+3]<<24|L[O+2]<<16|L[O+1]<<8|L[O]}e.readInt32LE=y;function c(L,O){return O===void 0&&(O=0),(L[O+3]<<24|L[O+2]<<16|L[O+1]<<8|L[O])>>>0}e.readUint32LE=c;function g(L,O,K){return O===void 0&&(O=new Uint8Array(4)),K===void 0&&(K=0),O[K+0]=L>>>24,O[K+1]=L>>>16,O[K+2]=L>>>8,O[K+3]=L>>>0,O}e.writeUint32BE=g,e.writeInt32BE=g;function I(L,O,K){return O===void 0&&(O=new Uint8Array(4)),K===void 0&&(K=0),O[K+0]=L>>>0,O[K+1]=L>>>8,O[K+2]=L>>>16,O[K+3]=L>>>24,O}e.writeUint32LE=I,e.writeInt32LE=I;function w(L,O){O===void 0&&(O=0);var K=s(L,O),Y=s(L,O+4);return K*4294967296+Y-(Y>>31)*4294967296}e.readInt64BE=w;function m(L,O){O===void 0&&(O=0);var K=a(L,O),Y=a(L,O+4);return K*4294967296+Y}e.readUint64BE=m;function S(L,O){O===void 0&&(O=0);var K=y(L,O),Y=y(L,O+4);return Y*4294967296+K-(K>>31)*4294967296}e.readInt64LE=S;function B(L,O){O===void 0&&(O=0);var K=c(L,O),Y=c(L,O+4);return Y*4294967296+K}e.readUint64LE=B;function A(L,O,K){return O===void 0&&(O=new Uint8Array(8)),K===void 0&&(K=0),g(L/4294967296>>>0,O,K),g(L>>>0,O,K+4),O}e.writeUint64BE=A,e.writeInt64BE=A;function f(L,O,K){return O===void 0&&(O=new Uint8Array(8)),K===void 0&&(K=0),I(L>>>0,O,K),I(L/4294967296>>>0,O,K+4),O}e.writeUint64LE=f,e.writeInt64LE=f;function b(L,O,K){if(K===void 0&&(K=0),L%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(L/8>O.length-K)throw new Error("readUintBE: array is too short for the given bitLength");for(var Y=0,te=1,re=L/8+K-1;re>=K;re--)Y+=O[re]*te,te*=256;return Y}e.readUintBE=b;function E(L,O,K){if(K===void 0&&(K=0),L%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(L/8>O.length-K)throw new Error("readUintLE: array is too short for the given bitLength");for(var Y=0,te=1,re=K;re=Y;re--)K[re]=O/te&255,te*=256;return K}e.writeUintBE=R;function P(L,O,K,Y){if(K===void 0&&(K=new Uint8Array(L/8)),Y===void 0&&(Y=0),L%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(O))throw new Error("writeUintLE value must be an integer");for(var te=1,re=Y;re{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(r){for(var t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=y_(),r=g_();e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var t=function(){function u(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(s,a){if(a===void 0&&(a=s.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var y=0;if(this._bytesHashed+=a,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=s[y++],a--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(a>=this.blockSize&&(y=o(this._temp,this._state,s,y,a),a%=this.blockSize);a>0;)this._buffer[this._bufferLength++]=s[y++],a--;return this},u.prototype.finish=function(s){if(!this._finished){var a=this._bytesHashed,y=this._bufferLength,c=a/536870912|0,g=a<<3,I=a%64<56?64:128;this._buffer[y]=128;for(var w=y+1;w0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(s){return this._state.set(s.state),this._bufferLength=s.bufferLength,s.buffer&&this._buffer.set(s.buffer),this._bytesHashed=s.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(s){r.wipe(s.state),s.buffer&&r.wipe(s.buffer),s.bufferLength=0,s.bytesHashed=0},u}();e.SHA256=t;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(u,s,a,y,c){for(;c>=64;){for(var g=s[0],I=s[1],w=s[2],m=s[3],S=s[4],B=s[5],A=s[6],f=s[7],b=0;b<16;b++){var E=y+b*4;u[b]=n.readUint32BE(a,E)}for(var b=16;b<64;b++){var R=u[b-2],P=(R>>>17|R<<32-17)^(R>>>19|R<<32-19)^R>>>10;R=u[b-15];var C=(R>>>7|R<<32-7)^(R>>>18|R<<32-18)^R>>>3;u[b]=(P+u[b-7]|0)+(C+u[b-16]|0)}for(var b=0;b<64;b++){var P=(((S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&B^~S&A)|0)+(f+(i[b]+u[b]|0)|0)|0,C=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&I^g&w^I&w)|0;f=A,A=B,B=S,S=m+P|0,m=w,w=I,I=g,g=P+C|0}s[0]+=g,s[1]+=I,s[2]+=w,s[3]+=m,s[4]+=S,s[5]+=B,s[6]+=A,s[7]+=f,y+=64,c-=64}return y}function l(u){var s=new t;s.update(u);var a=s.digest();return s.clean(),a}e.hash=l}),Fe=Ue((e,n)=>{n.exports={options:{usePureJavaScript:!1}}}),v_=Ue((e,n)=>{var r={};n.exports=r;var t={};r.encode=function(o,l,u){if(typeof l!="string")throw new TypeError('"alphabet" must be a string.');if(u!==void 0&&typeof u!="number")throw new TypeError('"maxline" must be a number.');var s="";if(!(o instanceof Uint8Array))s=i(o,l);else{var a=0,y=l.length,c=l.charAt(0),g=[0];for(a=0;a0;)g.push(w%y),w=w/y|0}for(a=0;o[a]===0&&a=0;--a)s+=l[g[a]]}if(u){var m=new RegExp(".{1,"+u+"}","g");s=s.match(m).join(`\r -`)}return s},r.decode=function(o,l){if(typeof o!="string")throw new TypeError('"input" must be a string.');if(typeof l!="string")throw new TypeError('"alphabet" must be a string.');var u=t[l];if(!u){u=t[l]=[];for(var s=0;s>=8;for(;w>0;)c.push(w&255),w>>=8}for(var m=0;o[m]===y&&m0;)y.push(g%s),g=g/s|0}var I="";for(u=0;o.at(u)===0&&u=0;--u)I+=l[y[u]];return I}}),Ze=Ue((e,n)=>{var r=Fe(),t=v_(),i=n.exports=r.util=r.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){i.nextTick=process.nextTick,typeof setImmediate=="function"?i.setImmediate=setImmediate:i.setImmediate=i.nextTick;return}if(typeof setImmediate=="function"){i.setImmediate=function(){return setImmediate.apply(void 0,arguments)},i.nextTick=function(h){return setImmediate(h)};return}if(i.setImmediate=function(h){setTimeout(h,0)},typeof window<"u"&&typeof window.postMessage=="function"){let h=function(U){if(U.source===window&&U.data===b){U.stopPropagation();var j=E.slice();E.length=0,j.forEach(function(M){M()})}};var f=h,b="forge.setImmediate",E=[];i.setImmediate=function(U){E.push(U),E.length===1&&window.postMessage(b,"*")},window.addEventListener("message",h,!0)}if(typeof MutationObserver<"u"){var R=Date.now(),P=!0,C=document.createElement("div"),E=[];new MutationObserver(function(){var U=E.slice();E.length=0,U.forEach(function(j){j()})}).observe(C,{attributes:!0});var d=i.setImmediate;i.setImmediate=function(U){Date.now()-R>15?(R=Date.now(),d(U)):(E.push(U),E.length===1&&C.setAttribute("a",P=!P))}}i.nextTick=i.setImmediate})(),i.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,i.globalScope=function(){return i.isNodejs?global:typeof self>"u"?window:self}(),i.isArray=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},i.isArrayBuffer=function(f){return typeof ArrayBuffer<"u"&&f instanceof ArrayBuffer},i.isArrayBufferView=function(f){return f&&i.isArrayBuffer(f.buffer)&&f.byteLength!==void 0};function o(f){if(!(f===8||f===16||f===24||f===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+f)}i.ByteBuffer=l;function l(f){if(this.data="",this.read=0,typeof f=="string")this.data=f;else if(i.isArrayBuffer(f)||i.isArrayBufferView(f))if(typeof Buffer<"u"&&f instanceof Buffer)this.data=f.toString("binary");else{var b=new Uint8Array(f);try{this.data=String.fromCharCode.apply(null,b)}catch{for(var E=0;Eu&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(f){return this.putBytes(String.fromCharCode(f))},i.ByteStringBuffer.prototype.fillWithByte=function(f,b){f=String.fromCharCode(f);for(var E=this.data;b>0;)b&1&&(E+=f),b>>>=1,b>0&&(f+=f);return this.data=E,this._optimizeConstructedString(b),this},i.ByteStringBuffer.prototype.putBytes=function(f){return this.data+=f,this._optimizeConstructedString(f.length),this},i.ByteStringBuffer.prototype.putString=function(f){return this.putBytes(i.encodeUtf8(f))},i.ByteStringBuffer.prototype.putInt16=function(f){return this.putBytes(String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},i.ByteStringBuffer.prototype.putInt24=function(f){return this.putBytes(String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},i.ByteStringBuffer.prototype.putInt32=function(f){return this.putBytes(String.fromCharCode(f>>24&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},i.ByteStringBuffer.prototype.putInt16Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>24&255))},i.ByteStringBuffer.prototype.putInt=function(f,b){o(b);var E="";do b-=8,E+=String.fromCharCode(f>>b&255);while(b>0);return this.putBytes(E)},i.ByteStringBuffer.prototype.putSignedInt=function(f,b){return f<0&&(f+=2<0);return b},i.ByteStringBuffer.prototype.getSignedInt=function(f){var b=this.getInt(f),E=2<=E&&(b-=E<<1),b},i.ByteStringBuffer.prototype.getBytes=function(f){var b;return f?(f=Math.min(this.length(),f),b=this.data.slice(this.read,this.read+f),this.read+=f):f===0?b="":(b=this.read===0?this.data:this.data.slice(this.read),this.clear()),b},i.ByteStringBuffer.prototype.bytes=function(f){return typeof f>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+f)},i.ByteStringBuffer.prototype.at=function(f){return this.data.charCodeAt(this.read+f)},i.ByteStringBuffer.prototype.setAt=function(f,b){return this.data=this.data.substr(0,this.read+f)+String.fromCharCode(b)+this.data.substr(this.read+f+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var f=i.createBuffer(this.data);return f.read=this.read,f},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(f){var b=Math.max(0,this.length()-f);return this.data=this.data.substr(this.read,b),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var f="",b=this.read;b=f)return this;b=Math.max(b||this.growSize,f);var E=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),R=new Uint8Array(this.length()+b);return R.set(E),this.data=new DataView(R.buffer),this},i.DataBuffer.prototype.putByte=function(f){return this.accommodate(1),this.data.setUint8(this.write++,f),this},i.DataBuffer.prototype.fillWithByte=function(f,b){this.accommodate(b);for(var E=0;E>8&65535),this.data.setInt8(this.write,f>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(f){return this.accommodate(4),this.data.setInt32(this.write,f),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(f){return this.accommodate(2),this.data.setInt16(this.write,f,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(f){return this.accommodate(3),this.data.setInt8(this.write,f>>16&255),this.data.setInt16(this.write,f>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(f){return this.accommodate(4),this.data.setInt32(this.write,f,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(f,b){o(b),this.accommodate(b/8);do b-=8,this.data.setInt8(this.write++,f>>b&255);while(b>0);return this},i.DataBuffer.prototype.putSignedInt=function(f,b){return o(b),this.accommodate(b/8),f<0&&(f+=2<0);return b},i.DataBuffer.prototype.getSignedInt=function(f){var b=this.getInt(f),E=2<=E&&(b-=E<<1),b},i.DataBuffer.prototype.getBytes=function(f){var b;return f?(f=Math.min(this.length(),f),b=this.data.slice(this.read,this.read+f),this.read+=f):f===0?b="":(b=this.read===0?this.data:this.data.slice(this.read),this.clear()),b},i.DataBuffer.prototype.bytes=function(f){return typeof f>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+f)},i.DataBuffer.prototype.at=function(f){return this.data.getUint8(this.read+f)},i.DataBuffer.prototype.setAt=function(f,b){return this.data.setUint8(f,b),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var f=new Uint8Array(this.data.buffer,this.read),b=new Uint8Array(f.byteLength);b.set(f),this.data=new DataView(b),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(f){return this.write=Math.max(0,this.length()-f),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var f="",b=this.read;b0;)b&1&&(E+=f),b>>>=1,b>0&&(f+=f);return E},i.xorBytes=function(f,b,E){for(var R="",P="",C="",d=0,h=0;E>0;--E,++d)P=f.charCodeAt(d)^b.charCodeAt(d),h>=10&&(R+=C,C="",h=0),C+=String.fromCharCode(P),++h;return R+=C,R},i.hexToBytes=function(f){var b="",E=0;for(f.length&!0&&(E=1,b+=String.fromCharCode(parseInt(f[0],16)));E>24&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255)};var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],c="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(f,b){for(var E="",R="",P,C,d,h=0;h>2),E+=a.charAt((P&3)<<4|C>>4),isNaN(C)?E+="==":(E+=a.charAt((C&15)<<2|d>>6),E+=isNaN(d)?"=":a.charAt(d&63)),b&&E.length>b&&(R+=E.substr(0,b)+`\r -`,E=E.substr(b));return R+=E,R},i.decode64=function(f){f=f.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",E,R,P,C,d=0;d>4),P!==64&&(b+=String.fromCharCode((R&15)<<4|P>>2),C!==64&&(b+=String.fromCharCode((P&3)<<6|C)));return b},i.encodeUtf8=function(f){return unescape(encodeURIComponent(f))},i.decodeUtf8=function(f){return decodeURIComponent(escape(f))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:t.encode,decode:t.decode}},i.binary.raw.encode=function(f){return String.fromCharCode.apply(null,f)},i.binary.raw.decode=function(f,b,E){var R=b;R||(R=new Uint8Array(f.length)),E=E||0;for(var P=E,C=0;C>2),E+=a.charAt((P&3)<<4|C>>4),isNaN(C)?E+="==":(E+=a.charAt((C&15)<<2|d>>6),E+=isNaN(d)?"=":a.charAt(d&63)),b&&E.length>b&&(R+=E.substr(0,b)+`\r -`,E=E.substr(b));return R+=E,R},i.binary.base64.decode=function(f,b,E){var R=b;R||(R=new Uint8Array(Math.ceil(f.length/4)*3)),f=f.replace(/[^A-Za-z0-9\+\/\=]/g,""),E=E||0;for(var P,C,d,h,U=0,j=E;U>4,d!==64&&(R[j++]=(C&15)<<4|d>>2,h!==64&&(R[j++]=(d&3)<<6|h));return b?j-E:R.subarray(0,j)},i.binary.base58.encode=function(f,b){return i.binary.baseN.encode(f,c,b)},i.binary.base58.decode=function(f,b){return i.binary.baseN.decode(f,c,b)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(f,b,E){f=i.encodeUtf8(f);var R=b;R||(R=new Uint8Array(f.length)),E=E||0;for(var P=E,C=0;C"u"&&(E=["web","flash"]);var P,C=!1,d=null;for(var h in E){P=E[h];try{if(P==="flash"||P==="both"){if(b[0]===null)throw new Error("Flash local storage not available.");R=f.apply(this,b),C=P==="flash"}(P==="web"||P==="both")&&(b[0]=localStorage,R=f.apply(this,b),C=!0)}catch(U){d=U}if(C)break}if(!C)throw d;return R};i.setItem=function(f,b,E,R,P){A(w,arguments,P)},i.getItem=function(f,b,E,R){return A(m,arguments,R)},i.removeItem=function(f,b,E,R){A(S,arguments,R)},i.clearItems=function(f,b,E){A(B,arguments,E)},i.isEmpty=function(f){for(var b in f)if(f.hasOwnProperty(b))return!1;return!0},i.format=function(f){for(var b=/%./g,E,R,P=0,C=[],d=0;E=b.exec(f);){R=f.substring(d,b.lastIndex-2),R.length>0&&C.push(R),d=b.lastIndex;var h=E[0][1];switch(h){case"s":case"o":P");break;case"%":C.push("%");break;default:C.push("<%"+h+"?>")}}return C.push(f.substring(d)),C.join("")},i.formatNumber=function(f,b,E,R){var P=f,C=isNaN(b=Math.abs(b))?2:b,d=E===void 0?",":E,h=R===void 0?".":R,U=P<0?"-":"",j=parseInt(P=Math.abs(+P||0).toFixed(C),10)+"",M=j.length>3?j.length%3:0;return U+(M?j.substr(0,M)+h:"")+j.substr(M).replace(/(\d{3})(?=\d)/g,"$1"+h)+(C?d+Math.abs(P-j).toFixed(C).slice(2):"")},i.formatSize=function(f){return f>=1073741824?f=i.formatNumber(f/1073741824,2,".","")+" GiB":f>=1048576?f=i.formatNumber(f/1048576,2,".","")+" MiB":f>=1024?f=i.formatNumber(f/1024,0)+" KiB":f=i.formatNumber(f,0)+" bytes",f},i.bytesFromIP=function(f){return f.indexOf(".")!==-1?i.bytesFromIPv4(f):f.indexOf(":")!==-1?i.bytesFromIPv6(f):null},i.bytesFromIPv4=function(f){if(f=f.split("."),f.length!==4)return null;for(var b=i.createBuffer(),E=0;EE[R].end-E[R].start&&(R=E.length-1))}b.push(C)}if(E.length>0){var U=E[R];U.end-U.start>0&&(b.splice(U.start,U.end-U.start+1,""),U.start===0&&b.unshift(""),U.end===7&&b.push(""))}return b.join(":")},i.estimateCores=function(f,b){if(typeof f=="function"&&(b=f,f={}),f=f||{},"cores"in i&&!f.update)return b(null,i.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,b(null,i.cores);if(typeof Worker>"u")return i.cores=1,b(null,i.cores);if(typeof Blob>"u")return i.cores=2,b(null,i.cores);var E=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(d){for(var h=Date.now(),U=h+4;Date.now()L.st&&M.stM.st&&L.st{var r=Fe();Ze(),n.exports=r.cipher=r.cipher||{},r.cipher.algorithms=r.cipher.algorithms||{},r.cipher.createCipher=function(i,o){var l=i;if(typeof l=="string"&&(l=r.cipher.getAlgorithm(l),l&&(l=l())),!l)throw new Error("Unsupported algorithm: "+i);return new r.cipher.BlockCipher({algorithm:l,key:o,decrypt:!1})},r.cipher.createDecipher=function(i,o){var l=i;if(typeof l=="string"&&(l=r.cipher.getAlgorithm(l),l&&(l=l())),!l)throw new Error("Unsupported algorithm: "+i);return new r.cipher.BlockCipher({algorithm:l,key:o,decrypt:!0})},r.cipher.registerAlgorithm=function(i,o){i=i.toUpperCase(),r.cipher.algorithms[i]=o},r.cipher.getAlgorithm=function(i){return i=i.toUpperCase(),i in r.cipher.algorithms?r.cipher.algorithms[i]:null};var t=r.cipher.BlockCipher=function(i){this.algorithm=i.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=i.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=i.decrypt,this.algorithm.initialize(i)};t.prototype.start=function(i){i=i||{};var o={};for(var l in i)o[l]=i[l];o.decrypt=this._decrypt,this._finish=!1,this._input=r.util.createBuffer(),this.output=i.output||r.util.createBuffer(),this.mode.start(o)},t.prototype.update=function(i){for(i&&this._input.putBuffer(i);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},t.prototype.finish=function(i){i&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(l){return i(this.blockSize,l,!1)},this.mode.unpad=function(l){return i(this.blockSize,l,!0)});var o={};return o.decrypt=this._decrypt,o.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,o)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,o))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,o))}}),Yp=Ue((e,n)=>{var r=Fe();Ze(),r.cipher=r.cipher||{};var t=n.exports=r.cipher.modes=r.cipher.modes||{};t.ecb=function(u){u=u||{},this.name="ECB",this.cipher=u.cipher,this.blockSize=u.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(u){},t.ecb.prototype.encrypt=function(u,s,a){if(u.length()0))return!0;for(var y=0;y0))return!0;for(var y=0;y0)return!1;var a=u.length(),y=u.at(a-1);return y>this.blockSize<<2?!1:(u.truncate(y),!0)},t.cbc=function(u){u=u||{},this.name="CBC",this.cipher=u.cipher,this.blockSize=u.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(u){if(u.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in u)this._iv=i(u.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},t.cbc.prototype.encrypt=function(u,s,a){if(u.length()0))return!0;for(var y=0;y0))return!0;for(var y=0;y0)return!1;var a=u.length(),y=u.at(a-1);return y>this.blockSize<<2?!1:(u.truncate(y),!0)},t.cfb=function(u){u=u||{},this.name="CFB",this.cipher=u.cipher,this.blockSize=u.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(u){if(!("iv"in u))throw new Error("Invalid IV parameter.");this._iv=i(u.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(u,s,a){var y=u.length();if(y===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&y>=this.blockSize){for(var c=0;c0&&(g=this.blockSize-g),this._partialOutput.clear();for(var c=0;c0)u.read-=this.blockSize;else for(var c=0;c0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return s.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;s.putBytes(this._partialOutput.getBytes(y-this._partialBytes)),this._partialBytes=0},t.cfb.prototype.decrypt=function(u,s,a){var y=u.length();if(y===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&y>=this.blockSize){for(var c=0;c0&&(g=this.blockSize-g),this._partialOutput.clear();for(var c=0;c0)u.read-=this.blockSize;else for(var c=0;c0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return s.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;s.putBytes(this._partialOutput.getBytes(y-this._partialBytes)),this._partialBytes=0},t.ofb=function(u){u=u||{},this.name="OFB",this.cipher=u.cipher,this.blockSize=u.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(u){if(!("iv"in u))throw new Error("Invalid IV parameter.");this._iv=i(u.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(u,s,a){var y=u.length();if(u.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&y>=this.blockSize){for(var c=0;c0&&(g=this.blockSize-g),this._partialOutput.clear();for(var c=0;c0)u.read-=this.blockSize;else for(var c=0;c0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return s.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;s.putBytes(this._partialOutput.getBytes(y-this._partialBytes)),this._partialBytes=0},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(u){u=u||{},this.name="CTR",this.cipher=u.cipher,this.blockSize=u.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(u){if(!("iv"in u))throw new Error("Invalid IV parameter.");this._iv=i(u.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(u,s,a){var y=u.length();if(y===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&y>=this.blockSize)for(var c=0;c0&&(g=this.blockSize-g),this._partialOutput.clear();for(var c=0;c0&&(u.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return s.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;s.putBytes(this._partialOutput.getBytes(y-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(u){u=u||{},this.name="GCM",this.cipher=u.cipher,this.blockSize=u.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(u){if(!("iv"in u))throw new Error("Invalid IV parameter.");var s=r.util.createBuffer(u.iv);this._cipherLength=0;var a;if("additionalData"in u?a=r.util.createBuffer(u.additionalData):a=r.util.createBuffer(),"tagLength"in u?this._tagLength=u.tagLength:this._tagLength=128,this._tag=null,u.decrypt&&(this._tag=r.util.createBuffer(u.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var y=s.length();if(y===12)this._j0=[s.getInt32(),s.getInt32(),s.getInt32(),1];else{for(this._j0=[0,0,0,0];s.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[s.getInt32(),s.getInt32(),s.getInt32(),s.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(l(y*8)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,a=r.util.createBuffer(a),this._aDataLength=l(a.length()*8);var c=a.length()%this.blockSize;for(c&&a.fillWithByte(0,this.blockSize-c),this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])},t.gcm.prototype.encrypt=function(u,s,a){var y=u.length();if(y===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&y>=this.blockSize){for(var c=0;c0&&(g=this.blockSize-g),this._partialOutput.clear();for(var c=0;c0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return u.read-=this.blockSize,s.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;s.putBytes(this._partialOutput.getBytes(y-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},t.gcm.prototype.decrypt=function(u,s,a){var y=u.length();if(y0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=u.getInt32(),this._hashBlock[1]=u.getInt32(),this._hashBlock[2]=u.getInt32(),this._hashBlock[3]=u.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var c=0;c0;--y)s[y]=u[y]>>>1|(u[y-1]&1)<<31;s[0]=u[0]>>>1,a&&(s[0]^=this._R)},t.gcm.prototype.tableMultiply=function(u){for(var s=[0,0,0,0],a=0;a<32;++a){var y=a/8|0,c=u[y]>>>(7-a%8)*4&15,g=this._m[a][c];s[0]^=g[0],s[1]^=g[1],s[2]^=g[2],s[3]^=g[3]}return s},t.gcm.prototype.ghash=function(u,s,a){return s[0]^=a[0],s[1]^=a[1],s[2]^=a[2],s[3]^=a[3],this.tableMultiply(s)},t.gcm.prototype.generateHashTable=function(u,s){for(var a=8/s,y=4*a,c=16*a,g=new Array(c),I=0;I>>1,c=new Array(a);c[y]=u.slice(0);for(var g=y>>>1;g>0;)this.pow(c[2*g],c[g]=[]),g>>=1;for(g=2;g4){var a=u;u=r.util.createBuffer();for(var y=0;y{var r=Fe();ic(),Yp(),Ze(),n.exports=r.aes=r.aes||{},r.aes.startEncrypting=function(m,S,B,A){var f=w({key:m,output:B,decrypt:!1,mode:A});return f.start(S),f},r.aes.createEncryptionCipher=function(m,S){return w({key:m,output:null,decrypt:!1,mode:S})},r.aes.startDecrypting=function(m,S,B,A){var f=w({key:m,output:B,decrypt:!0,mode:A});return f.start(S),f},r.aes.createDecryptionCipher=function(m,S){return w({key:m,output:null,decrypt:!0,mode:S})},r.aes.Algorithm=function(m,S){i||c();var B=this;B.name=m,B.mode=new S({blockSize:16,cipher:{encrypt:function(A,f){return I(B._w,A,f,!1)},decrypt:function(A,f){return I(B._w,A,f,!0)}}}),B._init=!1},r.aes.Algorithm.prototype.initialize=function(m){if(!this._init){var S=m.key,B;if(typeof S=="string"&&(S.length===16||S.length===24||S.length===32))S=r.util.createBuffer(S);else if(r.util.isArray(S)&&(S.length===16||S.length===24||S.length===32)){B=S,S=r.util.createBuffer();for(var A=0;A>>2;for(var A=0;A>8^R&255^99,l[B]=R,u[R]=B,P=m[R],f=m[B],b=m[f],E=m[b],C=P<<24^R<<16^R<<8^(R^P),d=(f^b^E)<<24^(B^E)<<16^(B^b^E)<<8^(B^f^E);for(var h=0;h<4;++h)a[h][B]=C,y[h][R]=d,C=C<<24|C>>>8,d=d<<24|d>>>8;B===0?B=A=1:(B=f^m[m[m[f^E]]],A^=m[m[A]])}}function g(m,S){for(var B=m.slice(0),A,f=1,b=B.length,E=b+6+1,R=o*E,P=b;P>>16&255]<<24^l[A>>>8&255]<<16^l[A&255]<<8^l[A>>>24]^s[f]<<24,f++):b>6&&P%b===4&&(A=l[A>>>24]<<24^l[A>>>16&255]<<16^l[A>>>8&255]<<8^l[A&255]),B[P]=B[P-b]^A;if(S){var C,d=y[0],h=y[1],U=y[2],j=y[3],M=B.slice(0);R=B.length;for(var P=0,v=R-o;P>>24]]^h[l[C>>>16&255]]^U[l[C>>>8&255]]^j[l[C&255]];B=M}return B}function I(m,S,B,A){var f=m.length/4-1,b,E,R,P,C;A?(b=y[0],E=y[1],R=y[2],P=y[3],C=u):(b=a[0],E=a[1],R=a[2],P=a[3],C=l);var d,h,U,j,M,v,N;d=S[0]^m[0],h=S[A?3:1]^m[1],U=S[2]^m[2],j=S[A?1:3]^m[3];for(var L=3,O=1;O>>24]^E[h>>>16&255]^R[U>>>8&255]^P[j&255]^m[++L],v=b[h>>>24]^E[U>>>16&255]^R[j>>>8&255]^P[d&255]^m[++L],N=b[U>>>24]^E[j>>>16&255]^R[d>>>8&255]^P[h&255]^m[++L],j=b[j>>>24]^E[d>>>16&255]^R[h>>>8&255]^P[U&255]^m[++L],d=M,h=v,U=N;B[0]=C[d>>>24]<<24^C[h>>>16&255]<<16^C[U>>>8&255]<<8^C[j&255]^m[++L],B[A?3:1]=C[h>>>24]<<24^C[U>>>16&255]<<16^C[j>>>8&255]<<8^C[d&255]^m[++L],B[2]=C[U>>>24]<<24^C[j>>>16&255]<<16^C[d>>>8&255]<<8^C[h&255]^m[++L],B[A?1:3]=C[j>>>24]<<24^C[d>>>16&255]<<16^C[h>>>8&255]<<8^C[U&255]^m[++L]}function w(m){m=m||{};var S=(m.mode||"CBC").toUpperCase(),B="AES-"+S,A;m.decrypt?A=r.cipher.createDecipher(B,m.key):A=r.cipher.createCipher(B,m.key);var f=A.start;return A.start=function(b,E){var R=null;E instanceof r.util.ByteBuffer&&(R=E,E={}),E=E||{},E.output=R,E.iv=b,f.call(A,E)},A}}),fi=Ue((e,n)=>{var r=Fe();r.pki=r.pki||{};var t=n.exports=r.pki.oids=r.oids=r.oids||{};function i(l,u){t[l]=u,t[u]=l}function o(l,u){t[l]=u}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("1.3.14.3.2.29","sha1WithRSASignature"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("2.16.840.1.101.3.4.2.4","sha224"),i("2.16.840.1.101.3.4.2.5","sha512-224"),i("2.16.840.1.101.3.4.2.6","sha512-256"),i("1.2.840.113549.2.2","md2"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.4","surname"),i("2.5.4.5","serialNumber"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.12","title"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("2.5.4.42","givenName"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")}),en=Ue((e,n)=>{var r=Fe();Ze(),fi();var t=n.exports=r.asn1=r.asn1||{};t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.create=function(s,a,y,c,g){if(r.util.isArray(c)){for(var I=[],w=0;wa){var c=new Error("Too few bytes to parse DER.");throw c.available=s.length(),c.remaining=a,c.requested=y,c}}var o=function(s,a){var y=s.getByte();if(a--,y!==128){var c,g=y&128;if(!g)c=y;else{var I=y&127;i(s,a,I),c=s.getInt(I<<3)}if(c<0)throw new Error("Negative length: "+c);return c}};t.fromDer=function(s,a){a===void 0&&(a={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof a=="boolean"&&(a={strict:a,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in a||(a.strict=!0),"parseAllBytes"in a||(a.parseAllBytes=!0),"decodeBitStrings"in a||(a.decodeBitStrings=!0),typeof s=="string"&&(s=r.util.createBuffer(s));var y=s.length(),c=l(s,s.length(),0,a);if(a.parseAllBytes&&s.length()!==0){var g=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw g.byteCount=y,g.remaining=s.length(),g}return c};function l(s,a,y,c){var g;i(s,a,2);var I=s.getByte();a--;var w=I&192,m=I&31;g=s.length();var S=o(s,a);if(a-=g-s.length(),S!==void 0&&S>a){if(c.strict){var B=new Error("Too few bytes to read ASN.1 value.");throw B.available=s.length(),B.remaining=a,B.requested=S,B}S=a}var A,f,b=(I&32)===32;if(b)if(A=[],S===void 0)for(;;){if(i(s,a,2),s.bytes(2)===String.fromCharCode(0,0)){s.getBytes(2),a-=2;break}g=s.length(),A.push(l(s,a,y+1,c)),a-=g-s.length()}else for(;S>0;)g=s.length(),A.push(l(s,S,y+1,c)),a-=g-s.length(),S-=g-s.length();if(A===void 0&&w===t.Class.UNIVERSAL&&m===t.Type.BITSTRING&&(f=s.bytes(S)),A===void 0&&c.decodeBitStrings&&w===t.Class.UNIVERSAL&&m===t.Type.BITSTRING&&S>1){var E=s.read,R=a,P=0;if(m===t.Type.BITSTRING&&(i(s,a,1),P=s.getByte(),a--),P===0)try{g=s.length();var C={strict:!0,decodeBitStrings:!0},d=l(s,a,y+1,C),h=g-s.length();a-=h,m==t.Type.BITSTRING&&h++;var U=d.tagClass;h===S&&(U===t.Class.UNIVERSAL||U===t.Class.CONTEXT_SPECIFIC)&&(A=[d])}catch{}A===void 0&&(s.read=E,a=R)}if(A===void 0){if(S===void 0){if(c.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");S=a}if(m===t.Type.BMPSTRING)for(A="";S>0;S-=2)i(s,a,2),A+=String.fromCharCode(s.getInt16()),a-=2;else A=s.getBytes(S),a-=S}var j=f===void 0?null:{bitStringContents:f};return t.create(w,m,b,A,j)}t.toDer=function(s){var a=r.util.createBuffer(),y=s.tagClass|s.type,c=r.util.createBuffer(),g=!1;if("bitStringContents"in s&&(g=!0,s.original&&(g=t.equals(s,s.original))),g)c.putBytes(s.bitStringContents);else if(s.composed){s.constructed?y|=32:c.putByte(0);for(var I=0;I1&&(s.value.charCodeAt(0)===0&&(s.value.charCodeAt(1)&128)===0||s.value.charCodeAt(0)===255&&(s.value.charCodeAt(1)&128)===128)?c.putBytes(s.value.substr(1)):c.putBytes(s.value);if(a.putByte(y),c.length()<=127)a.putByte(c.length()&127);else{var w=c.length(),m="";do m+=String.fromCharCode(w&255),w=w>>>8;while(w>0);a.putByte(m.length|128);for(var I=m.length-1;I>=0;--I)a.putByte(m.charCodeAt(I))}return a.putBuffer(c),a},t.oidToDer=function(s){var a=s.split("."),y=r.util.createBuffer();y.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var c,g,I,w,m=2;m>>7,c||(w|=128),g.push(w),c=!1;while(I>0);for(var S=g.length-1;S>=0;--S)y.putByte(g[S])}return y},t.derToOid=function(s){var a;typeof s=="string"&&(s=r.util.createBuffer(s));var y=s.getByte();a=Math.floor(y/40)+"."+y%40;for(var c=0;s.length()>0;)y=s.getByte(),c=c<<7,y&128?c+=y&127:(a+="."+(c+y),c=0);return a},t.utcTimeToDate=function(s){var a=new Date,y=parseInt(s.substr(0,2),10);y=y>=50?1900+y:2e3+y;var c=parseInt(s.substr(2,2),10)-1,g=parseInt(s.substr(4,2),10),I=parseInt(s.substr(6,2),10),w=parseInt(s.substr(8,2),10),m=0;if(s.length>11){var S=s.charAt(10),B=10;S!=="+"&&S!=="-"&&(m=parseInt(s.substr(10,2),10),B+=2)}if(a.setUTCFullYear(y,c,g),a.setUTCHours(I,w,m,0),B&&(S=s.charAt(B),S==="+"||S==="-")){var A=parseInt(s.substr(B+1,2),10),f=parseInt(s.substr(B+4,2),10),b=A*60+f;b*=6e4,S==="+"?a.setTime(+a-b):a.setTime(+a+b)}return a},t.generalizedTimeToDate=function(s){var a=new Date,y=parseInt(s.substr(0,4),10),c=parseInt(s.substr(4,2),10)-1,g=parseInt(s.substr(6,2),10),I=parseInt(s.substr(8,2),10),w=parseInt(s.substr(10,2),10),m=parseInt(s.substr(12,2),10),S=0,B=0,A=!1;s.charAt(s.length-1)==="Z"&&(A=!0);var f=s.length-5,b=s.charAt(f);if(b==="+"||b==="-"){var E=parseInt(s.substr(f+1,2),10),R=parseInt(s.substr(f+4,2),10);B=E*60+R,B*=6e4,b==="+"&&(B*=-1),A=!0}return s.charAt(14)==="."&&(S=parseFloat(s.substr(14),10)*1e3),A?(a.setUTCFullYear(y,c,g),a.setUTCHours(I,w,m,S),a.setTime(+a+B)):(a.setFullYear(y,c,g),a.setHours(I,w,m,S)),a},t.dateToUtcTime=function(s){if(typeof s=="string")return s;var a="",y=[];y.push((""+s.getUTCFullYear()).substr(2)),y.push(""+(s.getUTCMonth()+1)),y.push(""+s.getUTCDate()),y.push(""+s.getUTCHours()),y.push(""+s.getUTCMinutes()),y.push(""+s.getUTCSeconds());for(var c=0;c=-128&&s<128)return a.putSignedInt(s,8);if(s>=-32768&&s<32768)return a.putSignedInt(s,16);if(s>=-8388608&&s<8388608)return a.putSignedInt(s,24);if(s>=-2147483648&&s<2147483648)return a.putSignedInt(s,32);var y=new Error("Integer too large; max is 32-bits.");throw y.integer=s,y},t.derToInteger=function(s){typeof s=="string"&&(s=r.util.createBuffer(s));var a=s.length()*8;if(a>32)throw new Error("Integer too large; max is 32-bits.");return s.getSignedInt(a)},t.validate=function(s,a,y,c){var g=!1;if((s.tagClass===a.tagClass||typeof a.tagClass>"u")&&(s.type===a.type||typeof a.type>"u"))if(s.constructed===a.constructed||typeof a.constructed>"u"){if(g=!0,a.value&&r.util.isArray(a.value))for(var I=0,w=0;g&&w0&&(c+=` -`);for(var g="",I=0;I1?c+="0x"+r.util.bytesToHex(s.value.slice(1)):c+="(none)",s.value.length>0){var B=s.value.charCodeAt(0);B==1?c+=" (1 unused bit shown)":B>1&&(c+=" ("+B+" unused bits shown)")}}else if(s.type===t.Type.OCTETSTRING)u.test(s.value)||(c+="("+s.value+") "),c+="0x"+r.util.bytesToHex(s.value);else if(s.type===t.Type.UTF8)try{c+=r.util.decodeUtf8(s.value)}catch(A){if(A.message==="URI malformed")c+="0x"+r.util.bytesToHex(s.value)+" (malformed UTF8)";else throw A}else s.type===t.Type.PRINTABLESTRING||s.type===t.Type.IA5String?c+=s.value:u.test(s.value)?c+="0x"+r.util.bytesToHex(s.value):s.value.length===0?c+="[null]":c+=s.value}return c}}),yn=Ue((e,n)=>{var r=Fe();n.exports=r.md=r.md||{},r.md.algorithms=r.md.algorithms||{}}),Da=Ue((e,n)=>{var r=Fe();yn(),Ze();var t=n.exports=r.hmac=r.hmac||{};t.create=function(){var i=null,o=null,l=null,u=null,s={};return s.start=function(a,y){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in r.md.algorithms)o=r.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else o=a;if(y===null)y=i;else{if(typeof y=="string")y=r.util.createBuffer(y);else if(r.util.isArray(y)){var c=y;y=r.util.createBuffer();for(var g=0;go.blockLength&&(o.start(),o.update(y.bytes()),y=o.digest()),l=r.util.createBuffer(),u=r.util.createBuffer(),I=y.length();for(var g=0;g{var r=Fe();yn(),Ze();var t=n.exports=r.md5=r.md5||{};r.md.md5=r.md.algorithms.md5=t,t.create=function(){s||a();var c=null,g=r.util.createBuffer(),I=new Array(16),w={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return w.start=function(){w.messageLength=0,w.fullMessageLength=w.messageLength64=[];for(var m=w.messageLengthSize/4,S=0;S>>0,B>>>0];for(var A=w.fullMessageLength.length-1;A>=0;--A)w.fullMessageLength[A]+=B[1],B[1]=B[0]+(w.fullMessageLength[A]/4294967296>>>0),w.fullMessageLength[A]=w.fullMessageLength[A]>>>0,B[0]=B[1]/4294967296>>>0;return g.putBytes(m),y(c,I,g),(g.read>2048||g.length()===0)&&g.compact(),w},w.digest=function(){var m=r.util.createBuffer();m.putBytes(g.bytes());var S=w.fullMessageLength[w.fullMessageLength.length-1]+w.messageLengthSize,B=S&w.blockLength-1;m.putBytes(i.substr(0,w.blockLength-B));for(var A,f=0,b=w.fullMessageLength.length-1;b>=0;--b)A=w.fullMessageLength[b]*8+f,f=A/4294967296>>>0,m.putInt32Le(A>>>0);var E={h0:c.h0,h1:c.h1,h2:c.h2,h3:c.h3};y(E,I,m);var R=r.util.createBuffer();return R.putInt32Le(E.h0),R.putInt32Le(E.h1),R.putInt32Le(E.h2),R.putInt32Le(E.h3),R},w};var i=null,o=null,l=null,u=null,s=!1;function a(){i=String.fromCharCode(128),i+=r.util.fillString(String.fromCharCode(0),64),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],l=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],u=new Array(64);for(var c=0;c<64;++c)u[c]=Math.floor(Math.abs(Math.sin(c+1))*4294967296);s=!0}function y(c,g,I){for(var w,m,S,B,A,f,b,E,R=I.length();R>=64;){for(m=c.h0,S=c.h1,B=c.h2,A=c.h3,E=0;E<16;++E)g[E]=I.getInt32Le(),f=A^S&(B^A),w=m+f+u[E]+g[E],b=l[E],m=A,A=B,B=S,S+=w<>>32-b;for(;E<32;++E)f=B^A&(S^B),w=m+f+u[E]+g[o[E]],b=l[E],m=A,A=B,B=S,S+=w<>>32-b;for(;E<48;++E)f=S^B^A,w=m+f+u[E]+g[o[E]],b=l[E],m=A,A=B,B=S,S+=w<>>32-b;for(;E<64;++E)f=B^(S|~A),w=m+f+u[E]+g[o[E]],b=l[E],m=A,A=B,B=S,S+=w<>>32-b;c.h0=c.h0+m|0,c.h1=c.h1+S|0,c.h2=c.h2+B|0,c.h3=c.h3+A|0,R-=64}}}),Qi=Ue((e,n)=>{var r=Fe();Ze();var t=n.exports=r.pem=r.pem||{};t.encode=function(l,u){u=u||{};var s="-----BEGIN "+l.type+`-----\r -`,a;if(l.procType&&(a={name:"Proc-Type",values:[String(l.procType.version),l.procType.type]},s+=i(a)),l.contentDomain&&(a={name:"Content-Domain",values:[l.contentDomain]},s+=i(a)),l.dekInfo&&(a={name:"DEK-Info",values:[l.dekInfo.algorithm]},l.dekInfo.parameters&&a.values.push(l.dekInfo.parameters),s+=i(a)),l.headers)for(var y=0;y65&&g!==-1){var I=u[g];I===","?(++g,u=u.substr(0,g)+`\r - `+u.substr(g)):u=u.substr(0,g)+`\r -`+I+u.substr(g+1),c=y-g-1,g=-1,++y}else(u[y]===" "||u[y]===" "||u[y]===",")&&(g=y);return u}function o(l){return l.replace(/^\s+/,"")}}),Ps=Ue((e,n)=>{var r=Fe();ic(),Yp(),Ze(),n.exports=r.des=r.des||{},r.des.startEncrypting=function(m,S,B,A){var f=w({key:m,output:B,decrypt:!1,mode:A||(S===null?"ECB":"CBC")});return f.start(S),f},r.des.createEncryptionCipher=function(m,S){return w({key:m,output:null,decrypt:!1,mode:S})},r.des.startDecrypting=function(m,S,B,A){var f=w({key:m,output:B,decrypt:!0,mode:A||(S===null?"ECB":"CBC")});return f.start(S),f},r.des.createDecryptionCipher=function(m,S){return w({key:m,output:null,decrypt:!0,mode:S})},r.des.Algorithm=function(m,S){var B=this;B.name=m,B.mode=new S({blockSize:8,cipher:{encrypt:function(A,f){return I(B._keys,A,f,!1)},decrypt:function(A,f){return I(B._keys,A,f,!0)}}}),B._init=!1},r.des.Algorithm.prototype.initialize=function(m){if(!this._init){var S=r.util.createBuffer(m.key);if(this.name.indexOf("3DES")===0&&S.length()!==24)throw new Error("Invalid Triple-DES key size: "+S.length()*8);this._keys=g(S),this._init=!0}},t("DES-ECB",r.cipher.modes.ecb),t("DES-CBC",r.cipher.modes.cbc),t("DES-CFB",r.cipher.modes.cfb),t("DES-OFB",r.cipher.modes.ofb),t("DES-CTR",r.cipher.modes.ctr),t("3DES-ECB",r.cipher.modes.ecb),t("3DES-CBC",r.cipher.modes.cbc),t("3DES-CFB",r.cipher.modes.cfb),t("3DES-OFB",r.cipher.modes.ofb),t("3DES-CTR",r.cipher.modes.ctr);function t(m,S){var B=function(){return new r.des.Algorithm(m,S)};r.cipher.registerAlgorithm(m,B)}var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],l=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],s=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],a=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],y=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],c=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function g(m){for(var S=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],B=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],A=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],f=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],b=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],E=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],R=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],P=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],C=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],d=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],U=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],j=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],M=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=m.length()>8?3:1,N=[],L=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],O=0,K,Y=0;Y>>4^re)&252645135,re^=K,te^=K<<4,K=(re>>>-16^te)&65535,te^=K,re^=K<<-16,K=(te>>>2^re)&858993459,re^=K,te^=K<<2,K=(re>>>-16^te)&65535,te^=K,re^=K<<-16,K=(te>>>1^re)&1431655765,re^=K,te^=K<<1,K=(re>>>8^te)&16711935,te^=K,re^=K<<8,K=(te>>>1^re)&1431655765,re^=K,te^=K<<1,K=te<<8|re>>>20&240,te=re<<24|re<<8&16711680|re>>>8&65280|re>>>24&240,re=K;for(var oe=0;oe>>26,re=re<<2|re>>>26):(te=te<<1|te>>>27,re=re<<1|re>>>27),te&=-15,re&=-15;var be=S[te>>>28]|B[te>>>24&15]|A[te>>>20&15]|f[te>>>16&15]|b[te>>>12&15]|E[te>>>8&15]|R[te>>>4&15],Ce=P[re>>>28]|C[re>>>24&15]|d[re>>>20&15]|h[re>>>16&15]|U[re>>>12&15]|j[re>>>8&15]|M[re>>>4&15];K=(Ce>>>16^be)&65535,N[O++]=be^K,N[O++]=Ce^K<<16}}return N}function I(m,S,B,A){var f=m.length===32?3:9,b;f===3?b=A?[30,-2,-2]:[0,32,2]:b=A?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var E,R=S[0],P=S[1];E=(R>>>4^P)&252645135,P^=E,R^=E<<4,E=(R>>>16^P)&65535,P^=E,R^=E<<16,E=(P>>>2^R)&858993459,R^=E,P^=E<<2,E=(P>>>8^R)&16711935,R^=E,P^=E<<8,E=(R>>>1^P)&1431655765,P^=E,R^=E<<1,R=R<<1|R>>>31,P=P<<1|P>>>31;for(var C=0;C>>4|P<<28)^m[U+1];E=R,R=P,P=E^(o[j>>>24&63]|u[j>>>16&63]|a[j>>>8&63]|c[j&63]|i[M>>>24&63]|l[M>>>16&63]|s[M>>>8&63]|y[M&63])}E=R,R=P,P=E}R=R>>>1|R<<31,P=P>>>1|P<<31,E=(R>>>1^P)&1431655765,P^=E,R^=E<<1,E=(P>>>8^R)&16711935,R^=E,P^=E<<8,E=(P>>>2^R)&858993459,R^=E,P^=E<<2,E=(R>>>16^P)&65535,P^=E,R^=E<<16,E=(R>>>4^P)&252645135,P^=E,R^=E<<4,B[0]=R,B[1]=P}function w(m){m=m||{};var S=(m.mode||"CBC").toUpperCase(),B="DES-"+S,A;m.decrypt?A=r.cipher.createDecipher(B,m.key):A=r.cipher.createCipher(B,m.key);var f=A.start;return A.start=function(b,E){var R=null;E instanceof r.util.ByteBuffer&&(R=E,E={}),E=E||{},E.output=R,E.iv=b,f.call(A,E)},A}}),oc=Ue((e,n)=>{var r=Fe();Da(),yn(),Ze();var t=r.pkcs5=r.pkcs5||{},i;r.util.isNodejs&&!r.options.usePureJavaScript&&(i=Mi("crypto")),n.exports=r.pbkdf2=t.pbkdf2=function(o,l,u,s,a,y){if(typeof a=="function"&&(y=a,a=null),r.util.isNodejs&&!r.options.usePureJavaScript&&i.pbkdf2&&(a===null||typeof a!="object")&&(i.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!="string"&&(a="sha1"),o=Buffer.from(o,"binary"),l=Buffer.from(l,"binary"),y?i.pbkdf2Sync.length===4?i.pbkdf2(o,l,u,s,function(C,d){if(C)return y(C);y(null,d.toString("binary"))}):i.pbkdf2(o,l,u,s,a,function(C,d){if(C)return y(C);y(null,d.toString("binary"))}):i.pbkdf2Sync.length===4?i.pbkdf2Sync(o,l,u,s).toString("binary"):i.pbkdf2Sync(o,l,u,s,a).toString("binary");if((typeof a>"u"||a===null)&&(a="sha1"),typeof a=="string"){if(!(a in r.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=r.md[a].create()}var c=a.digestLength;if(s>4294967295*c){var g=new Error("Derived key is too long.");if(y)return y(g);throw g}var I=Math.ceil(s/c),w=s-(I-1)*c,m=r.hmac.create();m.start(a,o);var S="",B,A,f;if(!y){for(var b=1;b<=I;++b){m.start(null,null),m.update(l),m.update(r.util.int32ToBytes(b)),B=f=m.digest().getBytes();for(var E=2;E<=u;++E)m.start(null,null),m.update(f),A=m.digest().getBytes(),B=r.util.xorBytes(B,A,c),f=A;S+=bI)return y(null,S);m.start(null,null),m.update(l),m.update(r.util.int32ToBytes(b)),B=f=m.digest().getBytes(),E=2,P()}function P(){if(E<=u)return m.start(null,null),m.update(f),A=m.digest().getBytes(),B=r.util.xorBytes(B,A,c),f=A,++E,r.util.setImmediate(P);S+=b{var r=Fe();yn(),Ze();var t=n.exports=r.sha256=r.sha256||{};r.md.sha256=r.md.algorithms.sha256=t,t.create=function(){o||u();var a=null,y=r.util.createBuffer(),c=new Array(64),g={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return g.start=function(){g.messageLength=0,g.fullMessageLength=g.messageLength64=[];for(var I=g.messageLengthSize/4,w=0;w>>0,m>>>0];for(var S=g.fullMessageLength.length-1;S>=0;--S)g.fullMessageLength[S]+=m[1],m[1]=m[0]+(g.fullMessageLength[S]/4294967296>>>0),g.fullMessageLength[S]=g.fullMessageLength[S]>>>0,m[0]=m[1]/4294967296>>>0;return y.putBytes(I),s(a,c,y),(y.read>2048||y.length()===0)&&y.compact(),g},g.digest=function(){var I=r.util.createBuffer();I.putBytes(y.bytes());var w=g.fullMessageLength[g.fullMessageLength.length-1]+g.messageLengthSize,m=w&g.blockLength-1;I.putBytes(i.substr(0,g.blockLength-m));for(var S,B,A=g.fullMessageLength[0]*8,f=0;f>>0,A+=B,I.putInt32(A>>>0),A=S>>>0;I.putInt32(A);var b={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,h4:a.h4,h5:a.h5,h6:a.h6,h7:a.h7};s(b,c,I);var E=r.util.createBuffer();return E.putInt32(b.h0),E.putInt32(b.h1),E.putInt32(b.h2),E.putInt32(b.h3),E.putInt32(b.h4),E.putInt32(b.h5),E.putInt32(b.h6),E.putInt32(b.h7),E},g};var i=null,o=!1,l=null;function u(){i=String.fromCharCode(128),i+=r.util.fillString(String.fromCharCode(0),64),l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0}function s(a,y,c){for(var g,I,w,m,S,B,A,f,b,E,R,P,C,d,h,U=c.length();U>=64;){for(A=0;A<16;++A)y[A]=c.getInt32();for(;A<64;++A)g=y[A-2],g=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,I=y[A-15],I=(I>>>7|I<<25)^(I>>>18|I<<14)^I>>>3,y[A]=g+y[A-7]+I+y[A-16]|0;for(f=a.h0,b=a.h1,E=a.h2,R=a.h3,P=a.h4,C=a.h5,d=a.h6,h=a.h7,A=0;A<64;++A)m=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),S=d^P&(C^d),w=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),B=f&b|E&(f^b),g=h+m+S+l[A]+y[A],I=w+B,h=d,d=C,C=P,P=R+g>>>0,R=E,E=b,b=f,f=g+I>>>0;a.h0=a.h0+f|0,a.h1=a.h1+b|0,a.h2=a.h2+E|0,a.h3=a.h3+R|0,a.h4=a.h4+P|0,a.h5=a.h5+C|0,a.h6=a.h6+d|0,a.h7=a.h7+h|0,U-=64}}}),Jp=Ue((e,n)=>{var r=Fe();Ze();var t=null;r.util.isNodejs&&!r.options.usePureJavaScript&&!process.versions["node-webkit"]&&(t=Mi("crypto"));var i=n.exports=r.prng=r.prng||{};i.create=function(o){for(var l={plugin:o,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},u=o.md,s=new Array(32),a=0;a<32;++a)s[a]=u.create();l.pools=s,l.pool=0,l.generate=function(w,m){if(!m)return l.generateSync(w);var S=l.plugin.cipher,B=l.plugin.increment,A=l.plugin.formatKey,f=l.plugin.formatSeed,b=r.util.createBuffer();l.key=null,E();function E(R){if(R)return m(R);if(b.length()>=w)return m(null,b.getBytes(w));if(l.generated>1048575&&(l.key=null),l.key===null)return r.util.nextTick(function(){y(E)});var P=S(l.key,l.seed);l.generated+=P.length,b.putBytes(P),l.key=A(S(l.key,B(l.seed))),l.seed=f(S(l.key,l.seed)),r.util.setImmediate(E)}},l.generateSync=function(w){var m=l.plugin.cipher,S=l.plugin.increment,B=l.plugin.formatKey,A=l.plugin.formatSeed;l.key=null;for(var f=r.util.createBuffer();f.length()1048575&&(l.key=null),l.key===null&&c();var b=m(l.key,l.seed);l.generated+=b.length,f.putBytes(b),l.key=B(m(l.key,S(l.seed))),l.seed=A(m(l.key,l.seed))}return f.getBytes(w)};function y(w){if(l.pools[0].messageLength>=32)return g(),w();var m=32-l.pools[0].messageLength<<5;l.seedFile(m,function(S,B){if(S)return w(S);l.collect(B),g(),w()})}function c(){if(l.pools[0].messageLength>=32)return g();var w=32-l.pools[0].messageLength<<5;l.collect(l.seedFileSync(w)),g()}function g(){l.reseeds=l.reseeds===4294967295?0:l.reseeds+1;var w=l.plugin.md.create();w.update(l.keyBytes);for(var m=1,S=0;S<32;++S)l.reseeds%m===0&&(w.update(l.pools[S].digest().getBytes()),l.pools[S].start()),m=m<<1;l.keyBytes=w.digest().getBytes(),w.start(),w.update(l.keyBytes);var B=w.digest().getBytes();l.key=l.plugin.formatKey(l.keyBytes),l.seed=l.plugin.formatSeed(B),l.generated=0}function I(w){var m=null,S=r.util.globalScope,B=S.crypto||S.msCrypto;B&&B.getRandomValues&&(m=function(h){return B.getRandomValues(h)});var A=r.util.createBuffer();if(m)for(;A.length()>16),P+=(R&32767)<<16,P+=R>>15,P=(P&2147483647)+(P>>31),d=P&4294967295;for(var E=0;E<3;++E)C=d>>>(E<<3),C^=Math.floor(Math.random()*256),A.putByte(C&255)}return A.getBytes(w)}return t?(l.seedFile=function(w,m){t.randomBytes(w,function(S,B){if(S)return m(S);m(null,B.toString())})},l.seedFileSync=function(w){return t.randomBytes(w).toString()}):(l.seedFile=function(w,m){try{m(null,I(w))}catch(S){m(S)}},l.seedFileSync=I),l.collect=function(w){for(var m=w.length,S=0;S>B&255);l.collect(S)},l.registerWorker=function(w){if(w===self)l.seedFile=function(S,B){function A(f){var b=f.data;b.forge&&b.forge.prng&&(self.removeEventListener("message",A),B(b.forge.prng.err,b.forge.prng.bytes))}self.addEventListener("message",A),self.postMessage({forge:{prng:{needed:S}}})};else{var m=function(S){var B=S.data;B.forge&&B.forge.prng&&l.seedFile(B.forge.prng.needed,function(A,f){w.postMessage({forge:{prng:{err:A,bytes:f}}})})};w.addEventListener("message",m)}},l}}),Fr=Ue((e,n)=>{var r=Fe();hi(),Zp(),Jp(),Ze(),function(){if(r.random&&r.random.getBytes){n.exports=r.random;return}(function(t){var i={},o=new Array(4),l=r.util.createBuffer();i.formatKey=function(w){var m=r.util.createBuffer(w);return w=new Array(4),w[0]=m.getInt32(),w[1]=m.getInt32(),w[2]=m.getInt32(),w[3]=m.getInt32(),r.aes._expandKey(w,!1)},i.formatSeed=function(w){var m=r.util.createBuffer(w);return w=new Array(4),w[0]=m.getInt32(),w[1]=m.getInt32(),w[2]=m.getInt32(),w[3]=m.getInt32(),w},i.cipher=function(w,m){return r.aes._updateBlock(w,m,o,!1),l.putInt32(o[0]),l.putInt32(o[1]),l.putInt32(o[2]),l.putInt32(o[3]),l.getBytes()},i.increment=function(w){return++w[3],w},i.md=r.md.sha256;function u(){var w=r.prng.create(i);return w.getBytes=function(m,S){return w.generate(m,S)},w.getBytesSync=function(m){return w.generate(m)},w}var s=u(),a=null,y=r.util.globalScope,c=y.crypto||y.msCrypto;if(c&&c.getRandomValues&&(a=function(w){return c.getRandomValues(w)}),r.options.usePureJavaScript||!r.util.isNodejs&&!a){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var g="";for(var I in navigator)try{typeof navigator[I]=="string"&&(g+=navigator[I])}catch{}s.collect(g),g=null}t&&(t().mousemove(function(w){s.collectInt(w.clientX,16),s.collectInt(w.clientY,16)}),t().keypress(function(w){s.collectInt(w.charCode,8)}))}if(!r.random)r.random=s;else for(var I in s)r.random[I]=s[I];r.random.createInstance=u,n.exports=r.random})(typeof jQuery<"u"?jQuery:null)}()}),ey=Ue((e,n)=>{var r=Fe();Ze();var t=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],o=function(s,a){return s<>16-a},l=function(s,a){return(s&65535)>>a|s<<16-a&65535};n.exports=r.rc2=r.rc2||{},r.rc2.expandKey=function(s,a){typeof s=="string"&&(s=r.util.createBuffer(s)),a=a||128;var y=s,c=s.length(),g=a,I=Math.ceil(g/8),w=255>>(g&7),m;for(m=c;m<128;m++)y.putByte(t[y.at(m-1)+y.at(m-c)&255]);for(y.setAt(128-I,t[y.at(128-I)&w]),m=127-I;m>=0;m--)y.setAt(m,t[y.at(m+1)^y.at(m+I)]);return y};var u=function(s,a,y){var c=!1,g=null,I=null,w=null,m,S,B,A,f=[];for(s=r.rc2.expandKey(s,a),B=0;B<64;B++)f.push(s.getInt16Le());y?(m=function(R){for(B=0;B<4;B++)R[B]+=f[A]+(R[(B+3)%4]&R[(B+2)%4])+(~R[(B+3)%4]&R[(B+1)%4]),R[B]=o(R[B],i[B]),A++},S=function(R){for(B=0;B<4;B++)R[B]+=f[R[(B+3)%4]&63]}):(m=function(R){for(B=3;B>=0;B--)R[B]=l(R[B],i[B]),R[B]-=f[A]+(R[(B+3)%4]&R[(B+2)%4])+(~R[(B+3)%4]&R[(B+1)%4]),A--},S=function(R){for(B=3;B>=0;B--)R[B]-=f[R[(B+3)%4]&63]});var b=function(R){var P=[];for(B=0;B<4;B++){var C=g.getInt16Le();w!==null&&(y?C^=w.getInt16Le():w.putInt16Le(C)),P.push(C&65535)}A=y?0:63;for(var d=0;d=8;)b([[5,m],[1,S],[6,m],[1,S],[5,m]])},finish:function(R){var P=!0;if(y)if(R)P=R(8,g,!y);else{var C=g.length()===8?8:8-g.length();g.fillWithByte(C,C)}if(P&&(c=!0,E.update()),!y&&(P=g.length()===0,P))if(R)P=R(8,I,!y);else{var d=I.length(),h=I.at(d-1);h>d?P=!1:I.truncate(h)}return P}},E};r.rc2.startEncrypting=function(s,a,y){var c=r.rc2.createEncryptionCipher(s,128);return c.start(a,y),c},r.rc2.createEncryptionCipher=function(s,a){return u(s,a,!0)},r.rc2.startDecrypting=function(s,a,y){var c=r.rc2.createDecryptionCipher(s,128);return c.start(a,y),c},r.rc2.createDecryptionCipher=function(s,a){return u(s,a,!1)}}),Ns=Ue((e,n)=>{var r=Fe();n.exports=r.jsbn=r.jsbn||{};var t,i=0xdeadbeefcafe,o=(i&16777215)==15715070;function l(x,F,H){this.data=[],x!=null&&(typeof x=="number"?this.fromNumber(x,F,H):F==null&&typeof x!="string"?this.fromString(x,256):this.fromString(x,F))}r.jsbn.BigInteger=l;function u(){return new l(null)}function s(x,F,H,ee,le,he){for(;--he>=0;){var Ee=F*this.data[x++]+H.data[ee]+le;le=Math.floor(Ee/67108864),H.data[ee++]=Ee&67108863}return le}function a(x,F,H,ee,le,he){for(var Ee=F&32767,_e=F>>15;--he>=0;){var it=this.data[x]&32767,jt=this.data[x++]>>15,fr=_e*it+jt*Ee;it=Ee*it+((fr&32767)<<15)+H.data[ee]+(le&1073741823),le=(it>>>30)+(fr>>>15)+_e*jt+(le>>>30),H.data[ee++]=it&1073741823}return le}function y(x,F,H,ee,le,he){for(var Ee=F&16383,_e=F>>14;--he>=0;){var it=this.data[x]&16383,jt=this.data[x++]>>14,fr=_e*it+jt*Ee;it=Ee*it+((fr&16383)<<14)+H.data[ee]+le,le=(it>>28)+(fr>>14)+_e*jt,H.data[ee++]=it&268435455}return le}typeof navigator>"u"?(l.prototype.am=y,t=28):o&&navigator.appName=="Microsoft Internet Explorer"?(l.prototype.am=a,t=30):o&&navigator.appName!="Netscape"?(l.prototype.am=s,t=26):(l.prototype.am=y,t=28),l.prototype.DB=t,l.prototype.DM=(1<=0;--F)x.data[F]=this.data[F];x.t=this.t,x.s=this.s}function f(x){this.t=1,this.s=x<0?-1:0,x>0?this.data[0]=x:x<-1?this.data[0]=x+this.DV:this.t=0}function b(x){var F=u();return F.fromInt(x),F}function E(x,F){var H;if(F==16)H=4;else if(F==8)H=3;else if(F==256)H=8;else if(F==2)H=1;else if(F==32)H=5;else if(F==4)H=2;else{this.fromRadix(x,F);return}this.t=0,this.s=0;for(var ee=x.length,le=!1,he=0;--ee>=0;){var Ee=H==8?x[ee]&255:B(x,ee);if(Ee<0){x.charAt(ee)=="-"&&(le=!0);continue}le=!1,he==0?this.data[this.t++]=Ee:he+H>this.DB?(this.data[this.t-1]|=(Ee&(1<>this.DB-he):this.data[this.t-1]|=Ee<=this.DB&&(he-=this.DB)}H==8&&(x[0]&128)!=0&&(this.s=-1,he>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==x;)--this.t}function P(x){if(this.s<0)return"-"+this.negate().toString(x);var F;if(x==16)F=4;else if(x==8)F=3;else if(x==2)F=1;else if(x==32)F=5;else if(x==4)F=2;else return this.toRadix(x);var H=(1<0)for(_e>_e)>0&&(le=!0,he=S(ee));Ee>=0;)_e>(_e+=this.DB-F)):(ee=this.data[Ee]>>(_e-=F)&H,_e<=0&&(_e+=this.DB,--Ee)),ee>0&&(le=!0),le&&(he+=S(ee));return le?he:"0"}function C(){var x=u();return l.ZERO.subTo(this,x),x}function d(){return this.s<0?this.negate():this}function h(x){var F=this.s-x.s;if(F!=0)return F;var H=this.t;if(F=H-x.t,F!=0)return this.s<0?-F:F;for(;--H>=0;)if((F=this.data[H]-x.data[H])!=0)return F;return 0}function U(x){var F=1,H;return(H=x>>>16)!=0&&(x=H,F+=16),(H=x>>8)!=0&&(x=H,F+=8),(H=x>>4)!=0&&(x=H,F+=4),(H=x>>2)!=0&&(x=H,F+=2),(H=x>>1)!=0&&(x=H,F+=1),F}function j(){return this.t<=0?0:this.DB*(this.t-1)+U(this.data[this.t-1]^this.s&this.DM)}function M(x,F){var H;for(H=this.t-1;H>=0;--H)F.data[H+x]=this.data[H];for(H=x-1;H>=0;--H)F.data[H]=0;F.t=this.t+x,F.s=this.s}function v(x,F){for(var H=x;H=0;--_e)F.data[_e+he+1]=this.data[_e]>>ee|Ee,Ee=(this.data[_e]&le)<=0;--_e)F.data[_e]=0;F.data[he]=Ee,F.t=this.t+he+1,F.s=this.s,F.clamp()}function L(x,F){F.s=this.s;var H=Math.floor(x/this.DB);if(H>=this.t){F.t=0;return}var ee=x%this.DB,le=this.DB-ee,he=(1<>ee;for(var Ee=H+1;Ee>ee;ee>0&&(F.data[this.t-H-1]|=(this.s&he)<>=this.DB;if(x.t>=this.DB;ee+=this.s}else{for(ee+=this.s;H>=this.DB;ee-=x.s}F.s=ee<0?-1:0,ee<-1?F.data[H++]=this.DV+ee:ee>0&&(F.data[H++]=ee),F.t=H,F.clamp()}function K(x,F){var H=this.abs(),ee=x.abs(),le=H.t;for(F.t=le+ee.t;--le>=0;)F.data[le]=0;for(le=0;le=0;)x.data[H]=0;for(H=0;H=F.DV&&(x.data[H+F.t]-=F.DV,x.data[H+F.t+1]=1)}x.t>0&&(x.data[x.t-1]+=F.am(H,F.data[H],x,2*H,0,1)),x.s=0,x.clamp()}function te(x,F,H){var ee=x.abs();if(!(ee.t<=0)){var le=this.abs();if(le.t0?(ee.lShiftTo(it,he),le.lShiftTo(it,H)):(ee.copyTo(he),le.copyTo(H));var jt=he.t,fr=he.data[jt-1];if(fr!=0){var ar=fr*(1<1?he.data[jt-2]>>this.F2:0),kr=this.FV/ar,pi=(1<=0&&(H.data[H.t++]=1,H.subTo($r,H)),l.ONE.dlShiftTo(jt,$r),$r.subTo(he,he);he.t=0;){var tn=H.data[--_r]==fr?this.DM:Math.floor(H.data[_r]*kr+(H.data[_r-1]+dr)*pi);if((H.data[_r]+=he.am(0,tn,H,yi,0,jt))0&&H.rShiftTo(it,H),Ee<0&&l.ZERO.subTo(H,H)}}}function re(x){var F=u();return this.abs().divRemTo(x,null,F),this.s<0&&F.compareTo(l.ZERO)>0&&x.subTo(F,F),F}function oe(x){this.m=x}function be(x){return x.s<0||x.compareTo(this.m)>=0?x.mod(this.m):x}function Ce(x){return x}function ke(x){x.divRemTo(this.m,null,x)}function fe(x,F,H){x.multiplyTo(F,H),this.reduce(H)}function Pe(x,F){x.squareTo(F),this.reduce(F)}oe.prototype.convert=be,oe.prototype.revert=Ce,oe.prototype.reduce=ke,oe.prototype.mulTo=fe,oe.prototype.sqrTo=Pe;function ce(){if(this.t<1)return 0;var x=this.data[0];if((x&1)==0)return 0;var F=x&3;return F=F*(2-(x&15)*F)&15,F=F*(2-(x&255)*F)&255,F=F*(2-((x&65535)*F&65535))&65535,F=F*(2-x*F%this.DV)%this.DV,F>0?this.DV-F:-F}function Ve(x){this.m=x,this.mp=x.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(F,F),F}function k(x){var F=u();return x.copyTo(F),this.reduce(F),F}function $(x){for(;x.t<=this.mt2;)x.data[x.t++]=0;for(var F=0;F>15)*this.mpl&this.um)<<15)&x.DM;for(H=F+this.m.t,x.data[H]+=this.m.am(0,ee,x,F,0,this.m.t);x.data[H]>=x.DV;)x.data[H]-=x.DV,x.data[++H]++}x.clamp(),x.drShiftTo(this.m.t,x),x.compareTo(this.m)>=0&&x.subTo(this.m,x)}function V(x,F){x.squareTo(F),this.reduce(F)}function _(x,F,H){x.multiplyTo(F,H),this.reduce(H)}Ve.prototype.convert=De,Ve.prototype.revert=k,Ve.prototype.reduce=$,Ve.prototype.mulTo=_,Ve.prototype.sqrTo=V;function D(){return(this.t>0?this.data[0]&1:this.s)==0}function G(x,F){if(x>4294967295||x<1)return l.ONE;var H=u(),ee=u(),le=F.convert(this),he=U(x)-1;for(le.copyTo(H);--he>=0;)if(F.sqrTo(H,ee),(x&1<0)F.mulTo(ee,le,H);else{var Ee=H;H=ee,ee=Ee}return F.revert(H)}function z(x,F){var H;return x<256||F.isEven()?H=new oe(F):H=new Ve(F),this.exp(x,H)}l.prototype.copyTo=A,l.prototype.fromInt=f,l.prototype.fromString=E,l.prototype.clamp=R,l.prototype.dlShiftTo=M,l.prototype.drShiftTo=v,l.prototype.lShiftTo=N,l.prototype.rShiftTo=L,l.prototype.subTo=O,l.prototype.multiplyTo=K,l.prototype.squareTo=Y,l.prototype.divRemTo=te,l.prototype.invDigit=ce,l.prototype.isEven=D,l.prototype.exp=G,l.prototype.toString=P,l.prototype.negate=C,l.prototype.abs=d,l.prototype.compareTo=h,l.prototype.bitLength=j,l.prototype.mod=re,l.prototype.modPowInt=z,l.ZERO=b(0),l.ONE=b(1);function se(){var x=u();return this.copyTo(x),x}function me(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function ae(){return this.t==0?this.s:this.data[0]<<16>>16}function Se(x){return Math.floor(Math.LN2*this.DB/Math.log(x))}function Le(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function qe(x){if(x==null&&(x=10),this.signum()==0||x<2||x>36)return"0";var F=this.chunkSize(x),H=Math.pow(x,F),ee=b(H),le=u(),he=u(),Ee="";for(this.divRemTo(ee,le,he);le.signum()>0;)Ee=(H+he.intValue()).toString(x).substr(1)+Ee,le.divRemTo(ee,le,he);return he.intValue().toString(x)+Ee}function Oe(x,F){this.fromInt(0),F==null&&(F=10);for(var H=this.chunkSize(F),ee=Math.pow(F,H),le=!1,he=0,Ee=0,_e=0;_e=H&&(this.dMultiply(ee),this.dAddOffset(Ee,0),he=0,Ee=0)}he>0&&(this.dMultiply(Math.pow(F,he)),this.dAddOffset(Ee,0)),le&&l.ZERO.subTo(this,this)}function Ke(x,F,H){if(typeof F=="number")if(x<2)this.fromInt(1);else for(this.fromNumber(x,H),this.testBit(x-1)||this.bitwiseTo(l.ONE.shiftLeft(x-1),Ct,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(F);)this.dAddOffset(2,0),this.bitLength()>x&&this.subTo(l.ONE.shiftLeft(x-1),this);else{var ee=new Array,le=x&7;ee.length=(x>>3)+1,F.nextBytes(ee),le>0?ee[0]&=(1<0)for(H>H)!=(this.s&this.DM)>>H&&(F[le++]=ee|this.s<=0;)H<8?(ee=(this.data[x]&(1<>(H+=this.DB-8)):(ee=this.data[x]>>(H-=8)&255,H<=0&&(H+=this.DB,--x)),(ee&128)!=0&&(ee|=-256),le==0&&(this.s&128)!=(ee&128)&&++le,(le>0||ee!=this.s)&&(F[le++]=ee);return F}function gt(x){return this.compareTo(x)==0}function ft(x){return this.compareTo(x)<0?this:x}function ot(x){return this.compareTo(x)>0?this:x}function Je(x,F,H){var ee,le,he=Math.min(x.t,this.t);for(ee=0;ee>=16,F+=16),(x&255)==0&&(x>>=8,F+=8),(x&15)==0&&(x>>=4,F+=4),(x&3)==0&&(x>>=2,F+=2),(x&1)==0&&++F,F}function Kr(){for(var x=0;x=this.t?this.s!=0:(this.data[F]&1<>=this.DB;if(x.t>=this.DB;ee+=this.s}else{for(ee+=this.s;H>=this.DB;ee+=x.s}F.s=ee<0?-1:0,ee>0?F.data[H++]=ee:ee<-1&&(F.data[H++]=this.DV+ee),F.t=H,F.clamp()}function vt(x){var F=u();return this.addTo(x,F),F}function wt(x){var F=u();return this.subTo(x,F),F}function kt(x){var F=u();return this.multiplyTo(x,F),F}function Pt(x){var F=u();return this.divRemTo(x,F,null),F}function Nt(x){var F=u();return this.divRemTo(x,null,F),F}function Rt(x){var F=u(),H=u();return this.divRemTo(x,F,H),new Array(F,H)}function Ot(x){this.data[this.t]=this.am(0,x-1,this,0,0,this.t),++this.t,this.clamp()}function At(x,F){if(x!=0){for(;this.t<=F;)this.data[this.t++]=0;for(this.data[F]+=x;this.data[F]>=this.DV;)this.data[F]-=this.DV,++F>=this.t&&(this.data[this.t++]=0),++this.data[F]}}function bt(){}function Lt(x){return x}function di(x,F,H){x.multiplyTo(F,H)}function W(x,F){x.squareTo(F)}bt.prototype.convert=Lt,bt.prototype.revert=Lt,bt.prototype.mulTo=di,bt.prototype.sqrTo=W;function Z(x){return this.exp(x,new bt)}function ie(x,F,H){var ee=Math.min(this.t+x.t,F);for(H.s=0,H.t=ee;ee>0;)H.data[--ee]=0;var le;for(le=H.t-this.t;ee=0;)H.data[ee]=0;for(ee=Math.max(F-this.t,0);ee2*this.m.t)return x.mod(this.m);if(x.compareTo(this.m)<0)return x;var F=u();return x.copyTo(F),this.reduce(F),F}function Ie(x){return x}function $e(x){for(x.drShiftTo(this.m.t-1,this.r2),x.t>this.m.t+1&&(x.t=this.m.t+1,x.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);x.compareTo(this.r2)<0;)x.dAddOffset(1,this.m.t+1);for(x.subTo(this.r2,x);x.compareTo(this.m)>=0;)x.subTo(this.m,x)}function je(x,F){x.squareTo(F),this.reduce(F)}function Wt(x,F,H){x.multiplyTo(F,H),this.reduce(H)}ye.prototype.convert=we,ye.prototype.revert=Ie,ye.prototype.reduce=$e,ye.prototype.mulTo=Wt,ye.prototype.sqrTo=je;function ir(x,F){var H=x.bitLength(),ee,le=b(1),he;if(H<=0)return le;H<18?ee=1:H<48?ee=3:H<144?ee=4:H<768?ee=5:ee=6,H<8?he=new oe(F):F.isEven()?he=new ye(F):he=new Ve(F);var Ee=new Array,_e=3,it=ee-1,jt=(1<1){var fr=u();for(he.sqrTo(Ee[1],fr);_e<=jt;)Ee[_e]=u(),he.mulTo(fr,Ee[_e-2],Ee[_e]),_e+=2}var ar=x.t-1,kr,pi=!0,dr=u(),_r;for(H=U(x.data[ar])-1;ar>=0;){for(H>=it?kr=x.data[ar]>>H-it&jt:(kr=(x.data[ar]&(1<0&&(kr|=x.data[ar-1]>>this.DB+H-it)),_e=ee;(kr&1)==0;)kr>>=1,--_e;if((H-=_e)<0&&(H+=this.DB,--ar),pi)Ee[kr].copyTo(le),pi=!1;else{for(;_e>1;)he.sqrTo(le,dr),he.sqrTo(dr,le),_e-=2;_e>0?he.sqrTo(le,dr):(_r=le,le=dr,dr=_r),he.mulTo(dr,Ee[kr],le)}for(;ar>=0&&(x.data[ar]&1<0&&(F.rShiftTo(he,F),H.rShiftTo(he,H));F.signum()>0;)(le=F.getLowestSetBit())>0&&F.rShiftTo(le,F),(le=H.getLowestSetBit())>0&&H.rShiftTo(le,H),F.compareTo(H)>=0?(F.subTo(H,F),F.rShiftTo(1,F)):(H.subTo(F,H),H.rShiftTo(1,H));return he>0&&H.lShiftTo(he,H),H}function Gt(x){if(x<=0)return 0;var F=this.DV%x,H=this.s<0?x-1:0;if(this.t>0)if(F==0)H=this.data[0]%x;else for(var ee=this.t-1;ee>=0;--ee)H=(F*H+this.data[ee])%x;return H}function hr(x){var F=x.isEven();if(this.isEven()&&F||x.signum()==0)return l.ZERO;for(var H=x.clone(),ee=this.clone(),le=b(1),he=b(0),Ee=b(0),_e=b(1);H.signum()!=0;){for(;H.isEven();)H.rShiftTo(1,H),F?((!le.isEven()||!he.isEven())&&(le.addTo(this,le),he.subTo(x,he)),le.rShiftTo(1,le)):he.isEven()||he.subTo(x,he),he.rShiftTo(1,he);for(;ee.isEven();)ee.rShiftTo(1,ee),F?((!Ee.isEven()||!_e.isEven())&&(Ee.addTo(this,Ee),_e.subTo(x,_e)),Ee.rShiftTo(1,Ee)):_e.isEven()||_e.subTo(x,_e),_e.rShiftTo(1,_e);H.compareTo(ee)>=0?(H.subTo(ee,H),F&&le.subTo(Ee,le),he.subTo(_e,he)):(ee.subTo(H,ee),F&&Ee.subTo(le,Ee),_e.subTo(he,_e))}if(ee.compareTo(l.ONE)!=0)return l.ZERO;if(_e.compareTo(x)>=0)return _e.subtract(x);if(_e.signum()<0)_e.addTo(x,_e);else return _e;return _e.signum()<0?_e.add(x):_e}var Qt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Ma=(1<<26)/Qt[Qt.length-1];function Va(x){var F,H=this.abs();if(H.t==1&&H.data[0]<=Qt[Qt.length-1]){for(F=0;F=0);var _e=he.modPow(ee,this);if(_e.compareTo(l.ONE)!=0&&_e.compareTo(F)!=0){for(var it=1;it++{var r=Fe();yn(),Ze();var t=n.exports=r.sha1=r.sha1||{};r.md.sha1=r.md.algorithms.sha1=t,t.create=function(){o||l();var s=null,a=r.util.createBuffer(),y=new Array(80),c={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return c.start=function(){c.messageLength=0,c.fullMessageLength=c.messageLength64=[];for(var g=c.messageLengthSize/4,I=0;I>>0,w>>>0];for(var m=c.fullMessageLength.length-1;m>=0;--m)c.fullMessageLength[m]+=w[1],w[1]=w[0]+(c.fullMessageLength[m]/4294967296>>>0),c.fullMessageLength[m]=c.fullMessageLength[m]>>>0,w[0]=w[1]/4294967296>>>0;return a.putBytes(g),u(s,y,a),(a.read>2048||a.length()===0)&&a.compact(),c},c.digest=function(){var g=r.util.createBuffer();g.putBytes(a.bytes());var I=c.fullMessageLength[c.fullMessageLength.length-1]+c.messageLengthSize,w=I&c.blockLength-1;g.putBytes(i.substr(0,c.blockLength-w));for(var m,S,B=c.fullMessageLength[0]*8,A=0;A>>0,B+=S,g.putInt32(B>>>0),B=m>>>0;g.putInt32(B);var f={h0:s.h0,h1:s.h1,h2:s.h2,h3:s.h3,h4:s.h4};u(f,y,g);var b=r.util.createBuffer();return b.putInt32(f.h0),b.putInt32(f.h1),b.putInt32(f.h2),b.putInt32(f.h3),b.putInt32(f.h4),b},c};var i=null,o=!1;function l(){i=String.fromCharCode(128),i+=r.util.fillString(String.fromCharCode(0),64),o=!0}function u(s,a,y){for(var c,g,I,w,m,S,B,A,f=y.length();f>=64;){for(g=s.h0,I=s.h1,w=s.h2,m=s.h3,S=s.h4,A=0;A<16;++A)c=y.getInt32(),a[A]=c,B=m^I&(w^m),c=(g<<5|g>>>27)+B+S+1518500249+c,S=m,m=w,w=(I<<30|I>>>2)>>>0,I=g,g=c;for(;A<20;++A)c=a[A-3]^a[A-8]^a[A-14]^a[A-16],c=c<<1|c>>>31,a[A]=c,B=m^I&(w^m),c=(g<<5|g>>>27)+B+S+1518500249+c,S=m,m=w,w=(I<<30|I>>>2)>>>0,I=g,g=c;for(;A<32;++A)c=a[A-3]^a[A-8]^a[A-14]^a[A-16],c=c<<1|c>>>31,a[A]=c,B=I^w^m,c=(g<<5|g>>>27)+B+S+1859775393+c,S=m,m=w,w=(I<<30|I>>>2)>>>0,I=g,g=c;for(;A<40;++A)c=a[A-6]^a[A-16]^a[A-28]^a[A-32],c=c<<2|c>>>30,a[A]=c,B=I^w^m,c=(g<<5|g>>>27)+B+S+1859775393+c,S=m,m=w,w=(I<<30|I>>>2)>>>0,I=g,g=c;for(;A<60;++A)c=a[A-6]^a[A-16]^a[A-28]^a[A-32],c=c<<2|c>>>30,a[A]=c,B=I&w|m&(I^w),c=(g<<5|g>>>27)+B+S+2400959708+c,S=m,m=w,w=(I<<30|I>>>2)>>>0,I=g,g=c;for(;A<80;++A)c=a[A-6]^a[A-16]^a[A-28]^a[A-32],c=c<<2|c>>>30,a[A]=c,B=I^w^m,c=(g<<5|g>>>27)+B+S+3395469782+c,S=m,m=w,w=(I<<30|I>>>2)>>>0,I=g,g=c;s.h0=s.h0+g|0,s.h1=s.h1+I|0,s.h2=s.h2+w|0,s.h3=s.h3+m|0,s.h4=s.h4+S|0,f-=64}}}),ty=Ue((e,n)=>{var r=Fe();Ze(),Fr(),xa();var t=n.exports=r.pkcs1=r.pkcs1||{};t.encode_rsa_oaep=function(o,l,u){var s,a,y,c;typeof u=="string"?(s=u,a=arguments[3]||void 0,y=arguments[4]||void 0):u&&(s=u.label||void 0,a=u.seed||void 0,y=u.md||void 0,u.mgf1&&u.mgf1.md&&(c=u.mgf1.md)),y?y.start():y=r.md.sha1.create(),c||(c=y);var g=Math.ceil(o.n.bitLength()/8),I=g-2*y.digestLength-2;if(l.length>I){var w=new Error("RSAES-OAEP input message length is too long.");throw w.length=l.length,w.maxLength=I,w}s||(s=""),y.update(s,"raw");for(var m=y.digest(),S="",B=I-l.length,A=0;A>24&255,y>>16&255,y>>8&255,y&255);u.start(),u.update(o+c),s+=u.digest().getBytes()}return s.substring(0,l)}}),ry=Ue((e,n)=>{var r=Fe();Ze(),Ns(),Fr(),function(){if(r.prime){n.exports=r.prime;return}var t=n.exports=r.prime=r.prime||{},i=r.jsbn.BigInteger,o=[6,4,2,4,2,4,6,2],l=new i(null);l.fromInt(30);var u=function(w,m){return w|m};t.generateProbablePrime=function(w,m,S){typeof m=="function"&&(S=m,m={}),m=m||{};var B=m.algorithm||"PRIMEINC";typeof B=="string"&&(B={name:B}),B.options=B.options||{};var A=m.prng||r.random,f={nextBytes:function(b){for(var E=A.getBytesSync(b.length),R=0;Rm&&(w=g(m,S)),w.isProbablePrime(A))return b(null,w);w.dAddOffset(o[B++%8],0)}while(f<0||+new Date-E"u")return a(w,m,S,B);var A=g(w,m),f=S.workers,b=S.workLoad||100,E=b*30/8,R=S.workerScript||"forge/prime.worker.js";if(f===-1)return r.util.estimateCores(function(C,d){C&&(d=2),f=d-1,P()});P();function P(){f=Math.max(1,f);for(var C=[],d=0;dw&&(A=g(w,m));var L=A.toString(16);M.target.postMessage({hex:L,workLoad:b}),A.dAddOffset(E,0)}}}}function g(w,m){var S=new i(w,m),B=w-1;return S.testBit(B)||S.bitwiseTo(i.ONE.shiftLeft(B),u,S),S.dAddOffset(31-S.mod(l).byteValue(),0),S}function I(w){return w<=100?27:w<=150?18:w<=200?15:w<=250?12:w<=300?9:w<=350?8:w<=400?7:w<=500?6:w<=600?5:w<=800?4:w<=1250?3:2}}()}),Os=Ue((e,n)=>{var r=Fe();en(),Ns(),fi(),ty(),ry(),Fr(),Ze(),typeof t>"u"&&(t=r.jsbn.BigInteger);var t,i=r.util.isNodejs?Mi("crypto"):null,o=r.asn1,l=r.util;r.pki=r.pki||{},n.exports=r.pki.rsa=r.rsa=r.rsa||{};var u=r.pki,s=[6,4,2,4,2,4,6,2],a={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},y={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},c={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},g=r.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},I={name:"DigestInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},w=function(d){var h;if(d.algorithm in u.oids)h=u.oids[d.algorithm];else{var U=new Error("Unknown message digest algorithm.");throw U.algorithm=d.algorithm,U}var j=o.oidToDer(h).getBytes(),M=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),v=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);v.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,j)),v.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var N=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,d.digest().getBytes());return M.value.push(v),M.value.push(N),o.toDer(M).getBytes()},m=function(d,h,U){if(U)return d.modPow(h.e,h.n);if(!h.p||!h.q)return d.modPow(h.d,h.n);h.dP||(h.dP=h.d.mod(h.p.subtract(t.ONE))),h.dQ||(h.dQ=h.d.mod(h.q.subtract(t.ONE))),h.qInv||(h.qInv=h.q.modInverse(h.p));var j;do j=new t(r.util.bytesToHex(r.random.getBytes(h.n.bitLength()/8)),16);while(j.compareTo(h.n)>=0||!j.gcd(h.n).equals(t.ONE));d=d.multiply(j.modPow(h.e,h.n)).mod(h.n);for(var M=d.mod(h.p).modPow(h.dP,h.p),v=d.mod(h.q).modPow(h.dQ,h.q);M.compareTo(v)<0;)M=M.add(h.p);var N=M.subtract(v).multiply(h.qInv).mod(h.p).multiply(h.q).add(v);return N=N.multiply(j.modInverse(h.n)).mod(h.n),N};u.rsa.encrypt=function(d,h,U){var j=U,M,v=Math.ceil(h.n.bitLength()/8);U!==!1&&U!==!0?(j=U===2,M=S(d,h,U)):(M=r.util.createBuffer(),M.putBytes(d));for(var N=new t(M.toHex(),16),L=m(N,h,j),O=L.toString(16),K=r.util.createBuffer(),Y=v-Math.ceil(O.length/2);Y>0;)K.putByte(0),--Y;return K.putBytes(r.util.hexToBytes(O)),K.getBytes()},u.rsa.decrypt=function(d,h,U,j){var M=Math.ceil(h.n.bitLength()/8);if(d.length!==M){var v=new Error("Encrypted message length is invalid.");throw v.length=d.length,v.expected=M,v}var N=new t(r.util.createBuffer(d).toHex(),16);if(N.compareTo(h.n)>=0)throw new Error("Encrypted message is invalid.");for(var L=m(N,h,U),O=L.toString(16),K=r.util.createBuffer(),Y=M-Math.ceil(O.length/2);Y>0;)K.putByte(0),--Y;return K.putBytes(r.util.hexToBytes(O)),j!==!1?B(K.getBytes(),h,U):K.getBytes()},u.rsa.createKeyPairGenerationState=function(d,h,U){typeof d=="string"&&(d=parseInt(d,10)),d=d||2048,U=U||{};var j=U.prng||r.random,M={nextBytes:function(L){for(var O=j.getBytesSync(L.length),K=0;K>1,pBits:d-(d>>1),pqState:0,num:null,keys:null},N.e.fromInt(N.eInt);else throw new Error("Invalid key generation algorithm: "+v);return N},u.rsa.stepKeyPairGenerationState=function(d,h){"algorithm"in d||(d.algorithm="PRIMEINC");var U=new t(null);U.fromInt(30);for(var j=0,M=function(te,re){return te|re},v=+new Date,N,L=0;d.keys===null&&(h<=0||LO?d.pqState=0:d.num.isProbablePrime(b(d.num.bitLength()))?++d.pqState:d.num.dAddOffset(s[j++%8],0):d.pqState===2?d.pqState=d.num.subtract(t.ONE).gcd(d.e).compareTo(t.ONE)===0?3:0:d.pqState===3&&(d.pqState=0,d.p===null?d.p=d.num:d.q=d.num,d.p!==null&&d.q!==null&&++d.state,d.num=null)}else if(d.state===1)d.p.compareTo(d.q)<0&&(d.num=d.p,d.p=d.q,d.q=d.num),++d.state;else if(d.state===2)d.p1=d.p.subtract(t.ONE),d.q1=d.q.subtract(t.ONE),d.phi=d.p1.multiply(d.q1),++d.state;else if(d.state===3)d.phi.gcd(d.e).compareTo(t.ONE)===0?++d.state:(d.p=null,d.q=null,d.state=0);else if(d.state===4)d.n=d.p.multiply(d.q),d.n.bitLength()===d.bits?++d.state:(d.q=null,d.state=0);else if(d.state===5){var Y=d.e.modInverse(d.phi);d.keys={privateKey:u.rsa.setPrivateKey(d.n,d.e,Y,d.p,d.q,Y.mod(d.p1),Y.mod(d.q1),d.q.modInverse(d.p)),publicKey:u.rsa.setPublicKey(d.n,d.e)}}N=+new Date,L+=N-v,v=N}return d.keys!==null},u.rsa.generateKeyPair=function(d,h,U,j){if(arguments.length===1?typeof d=="object"?(U=d,d=void 0):typeof d=="function"&&(j=d,d=void 0):arguments.length===2?typeof d=="number"?typeof h=="function"?(j=h,h=void 0):typeof h!="number"&&(U=h,h=void 0):(U=d,j=h,d=void 0,h=void 0):arguments.length===3&&(typeof h=="number"?typeof U=="function"&&(j=U,U=void 0):(j=U,U=h,h=void 0)),U=U||{},d===void 0&&(d=U.bits||2048),h===void 0&&(h=U.e||65537),!r.options.usePureJavaScript&&!U.prng&&d>=256&&d<=16384&&(h===65537||h===3)){if(j){if(E("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:d,publicExponent:h,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(L,O,K){if(L)return j(L);j(null,{privateKey:u.privateKeyFromPem(K),publicKey:u.publicKeyFromPem(O)})});if(R("generateKey")&&R("exportKey"))return l.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:d,publicExponent:C(h),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(L){return l.globalScope.crypto.subtle.exportKey("pkcs8",L.privateKey)}).then(void 0,function(L){j(L)}).then(function(L){if(L){var O=u.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(L)));j(null,{privateKey:O,publicKey:u.setRsaPublicKey(O.n,O.e)})}});if(P("generateKey")&&P("exportKey")){var M=l.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:d,publicExponent:C(h),hash:{name:"SHA-256"}},!0,["sign","verify"]);M.oncomplete=function(L){var O=L.target.result,K=l.globalScope.msCrypto.subtle.exportKey("pkcs8",O.privateKey);K.oncomplete=function(Y){var te=Y.target.result,re=u.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(te)));j(null,{privateKey:re,publicKey:u.setRsaPublicKey(re.n,re.e)})},K.onerror=function(Y){j(Y)}},M.onerror=function(L){j(L)};return}}else if(E("generateKeyPairSync")){var v=i.generateKeyPairSync("rsa",{modulusLength:d,publicExponent:h,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(v.privateKey),publicKey:u.publicKeyFromPem(v.publicKey)}}}var N=u.rsa.createKeyPairGenerationState(d,h,U);if(!j)return u.rsa.stepKeyPairGenerationState(N,0),N.keys;A(N,U,j)},u.setRsaPublicKey=u.rsa.setPublicKey=function(d,h){var U={n:d,e:h};return U.encrypt=function(j,M,v){if(typeof M=="string"?M=M.toUpperCase():M===void 0&&(M="RSAES-PKCS1-V1_5"),M==="RSAES-PKCS1-V1_5")M={encode:function(L,O,K){return S(L,O,2).getBytes()}};else if(M==="RSA-OAEP"||M==="RSAES-OAEP")M={encode:function(L,O){return r.pkcs1.encode_rsa_oaep(O,L,v)}};else if(["RAW","NONE","NULL",null].indexOf(M)!==-1)M={encode:function(L){return L}};else if(typeof M=="string")throw new Error('Unsupported encryption scheme: "'+M+'".');var N=M.encode(j,U,!0);return u.rsa.encrypt(N,U,!0)},U.verify=function(j,M,v,N){typeof v=="string"?v=v.toUpperCase():v===void 0&&(v="RSASSA-PKCS1-V1_5"),N===void 0&&(N={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in N||(N._parseAllDigestBytes=!0),v==="RSASSA-PKCS1-V1_5"?v={verify:function(O,K){K=B(K,U,!0);var Y=o.fromDer(K,{parseAllBytes:N._parseAllDigestBytes}),te={},re=[];if(!o.validate(Y,I,te,re)){var oe=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw oe.errors=re,oe}var be=o.derToOid(te.algorithmIdentifier);if(!(be===r.oids.md2||be===r.oids.md5||be===r.oids.sha1||be===r.oids.sha224||be===r.oids.sha256||be===r.oids.sha384||be===r.oids.sha512||be===r.oids["sha512-224"]||be===r.oids["sha512-256"])){var oe=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw oe.oid=be,oe}if((be===r.oids.md2||be===r.oids.md5)&&!("parameters"in te))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return O===te.digest}}:(v==="NONE"||v==="NULL"||v===null)&&(v={verify:function(O,K){return K=B(K,U,!0),O===K}});var L=u.rsa.decrypt(M,U,!0,!1);return v.verify(j,L,U.n.bitLength())},U},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(d,h,U,j,M,v,N,L){var O={n:d,e:h,d:U,p:j,q:M,dP:v,dQ:N,qInv:L};return O.decrypt=function(K,Y,te){typeof Y=="string"?Y=Y.toUpperCase():Y===void 0&&(Y="RSAES-PKCS1-V1_5");var re=u.rsa.decrypt(K,O,!1,!1);if(Y==="RSAES-PKCS1-V1_5")Y={decode:B};else if(Y==="RSA-OAEP"||Y==="RSAES-OAEP")Y={decode:function(oe,be){return r.pkcs1.decode_rsa_oaep(be,oe,te)}};else if(["RAW","NONE","NULL",null].indexOf(Y)!==-1)Y={decode:function(oe){return oe}};else throw new Error('Unsupported encryption scheme: "'+Y+'".');return Y.decode(re,O,!1)},O.sign=function(K,Y){var te=!1;typeof Y=="string"&&(Y=Y.toUpperCase()),Y===void 0||Y==="RSASSA-PKCS1-V1_5"?(Y={encode:w},te=1):(Y==="NONE"||Y==="NULL"||Y===null)&&(Y={encode:function(){return K}},te=1);var re=Y.encode(K,O.n.bitLength());return u.rsa.encrypt(re,O,te)},O},u.wrapRsaPrivateKey=function(d){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(d).getBytes())])},u.privateKeyFromAsn1=function(d){var h={},U=[];if(o.validate(d,a,h,U)&&(d=o.fromDer(r.util.createBuffer(h.privateKey))),h={},U=[],!o.validate(d,y,h,U)){var j=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw j.errors=U,j}var M,v,N,L,O,K,Y,te;return M=r.util.createBuffer(h.privateKeyModulus).toHex(),v=r.util.createBuffer(h.privateKeyPublicExponent).toHex(),N=r.util.createBuffer(h.privateKeyPrivateExponent).toHex(),L=r.util.createBuffer(h.privateKeyPrime1).toHex(),O=r.util.createBuffer(h.privateKeyPrime2).toHex(),K=r.util.createBuffer(h.privateKeyExponent1).toHex(),Y=r.util.createBuffer(h.privateKeyExponent2).toHex(),te=r.util.createBuffer(h.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new t(M,16),new t(v,16),new t(N,16),new t(L,16),new t(O,16),new t(K,16),new t(Y,16),new t(te,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(d){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.qInv))])},u.publicKeyFromAsn1=function(d){var h={},U=[];if(o.validate(d,g,h,U)){var j=o.derToOid(h.publicKeyOid);if(j!==u.oids.rsaEncryption){var M=new Error("Cannot read public key. Unknown OID.");throw M.oid=j,M}d=h.rsaPublicKey}if(U=[],!o.validate(d,c,h,U)){var M=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw M.errors=U,M}var v=r.util.createBuffer(h.publicKeyModulus).toHex(),N=r.util.createBuffer(h.publicKeyExponent).toHex();return u.setRsaPublicKey(new t(v,16),new t(N,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(d){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(d)])])},u.publicKeyToRSAPublicKey=function(d){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f(d.e))])};function S(d,h,U){var j=r.util.createBuffer(),M=Math.ceil(h.n.bitLength()/8);if(d.length>M-11){var v=new Error("Message is too long for PKCS#1 v1.5 padding.");throw v.length=d.length,v.max=M-11,v}j.putByte(0),j.putByte(U);var N=M-3-d.length,L;if(U===0||U===1){L=U===0?0:255;for(var O=0;O0;){for(var K=0,Y=r.random.getBytes(N),O=0;O"u")throw new Error("Encryption block is invalid.");var O=0;if(L===0){O=M-3-j;for(var K=0;K1;){if(v.getByte()!==255){--v.read;break}++O}else if(L===2)for(O=0;v.length()>1;){if(v.getByte()===0){--v.read;break}++O}var Y=v.getByte();if(Y!==0||O!==M-3-v.length())throw new Error("Encryption block is invalid.");return v.getBytes()}function A(d,h,U){typeof h=="function"&&(U=h,h={}),h=h||{};var j={algorithm:{name:h.algorithm||"PRIMEINC",options:{workers:h.workers||2,workLoad:h.workLoad||100,workerScript:h.workerScript}}};"prng"in h&&(j.prng=h.prng),M();function M(){v(d.pBits,function(L,O){if(L)return U(L);if(d.p=O,d.q!==null)return N(L,d.q);v(d.qBits,N)})}function v(L,O){r.prime.generateProbablePrime(L,j,O)}function N(L,O){if(L)return U(L);if(d.q=O,d.p.compareTo(d.q)<0){var K=d.p;d.p=d.q,d.q=K}if(d.p.subtract(t.ONE).gcd(d.e).compareTo(t.ONE)!==0){d.p=null,M();return}if(d.q.subtract(t.ONE).gcd(d.e).compareTo(t.ONE)!==0){d.q=null,v(d.qBits,N);return}if(d.p1=d.p.subtract(t.ONE),d.q1=d.q.subtract(t.ONE),d.phi=d.p1.multiply(d.q1),d.phi.gcd(d.e).compareTo(t.ONE)!==0){d.p=d.q=null,M();return}if(d.n=d.p.multiply(d.q),d.n.bitLength()!==d.bits){d.q=null,v(d.qBits,N);return}var Y=d.e.modInverse(d.phi);d.keys={privateKey:u.rsa.setPrivateKey(d.n,d.e,Y,d.p,d.q,Y.mod(d.p1),Y.mod(d.q1),d.q.modInverse(d.p)),publicKey:u.rsa.setPublicKey(d.n,d.e)},U(null,d.keys)}}function f(d){var h=d.toString(16);h[0]>="8"&&(h="00"+h);var U=r.util.hexToBytes(h);return U.length>1&&(U.charCodeAt(0)===0&&(U.charCodeAt(1)&128)===0||U.charCodeAt(0)===255&&(U.charCodeAt(1)&128)===128)?U.substr(1):U}function b(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}function E(d){return r.util.isNodejs&&typeof i[d]=="function"}function R(d){return typeof l.globalScope<"u"&&typeof l.globalScope.crypto=="object"&&typeof l.globalScope.crypto.subtle=="object"&&typeof l.globalScope.crypto.subtle[d]=="function"}function P(d){return typeof l.globalScope<"u"&&typeof l.globalScope.msCrypto=="object"&&typeof l.globalScope.msCrypto.subtle=="object"&&typeof l.globalScope.msCrypto.subtle[d]=="function"}function C(d){for(var h=r.util.hexToBytes(d.toString(16)),U=new Uint8Array(h.length),j=0;j{var r=Fe();hi(),en(),Ps(),yn(),fi(),oc(),Qi(),Fr(),ey(),Os(),Ze(),typeof t>"u"&&(t=r.jsbn.BigInteger);var t,i=r.asn1,o=r.pki=r.pki||{};n.exports=o.pbe=r.pbe=r.pbe||{};var l=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},s={name:"PBES2Algorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},a={name:"pkcs-12PbeParams",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"iterations"}]};o.encryptPrivateKeyInfo=function(w,m,S){S=S||{},S.saltSize=S.saltSize||8,S.count=S.count||2048,S.algorithm=S.algorithm||"aes128",S.prfAlgorithm=S.prfAlgorithm||"sha1";var B=r.random.getBytesSync(S.saltSize),A=S.count,f=i.integerToDer(A),b,E,R;if(S.algorithm.indexOf("aes")===0||S.algorithm==="des"){var P,C,d;switch(S.algorithm){case"aes128":b=16,P=16,C=l["aes128-CBC"],d=r.aes.createEncryptionCipher;break;case"aes192":b=24,P=16,C=l["aes192-CBC"],d=r.aes.createEncryptionCipher;break;case"aes256":b=32,P=16,C=l["aes256-CBC"],d=r.aes.createEncryptionCipher;break;case"des":b=8,P=8,C=l.desCBC,d=r.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=S.algorithm,h}var U="hmacWith"+S.prfAlgorithm.toUpperCase(),j=g(U),M=r.pkcs5.pbkdf2(m,B,A,b,j),v=r.random.getBytesSync(P),N=d(M);N.start(v),N.update(i.toDer(w)),N.finish(),R=N.output.getBytes();var L=I(B,f,b,U);E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(l.pkcs5PBES2).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(l.pkcs5PBKDF2).getBytes()),L]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(C).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,v)])])])}else if(S.algorithm==="3des"){b=24;var O=new r.util.ByteBuffer(B),M=o.pbe.generatePkcs12Key(m,O,1,A,b),v=o.pbe.generatePkcs12Key(m,O,2,A,b),N=r.des.createEncryptionCipher(M);N.start(v),N.update(i.toDer(w)),N.finish(),R=N.output.getBytes(),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(l["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,B),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,f.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=S.algorithm,h}var K=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[E,i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,R)]);return K},o.decryptPrivateKeyInfo=function(w,m){var S=null,B={},A=[];if(!i.validate(w,u,B,A)){var f=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=A,f}var b=i.derToOid(B.encryptionOid),E=o.pbe.getCipher(b,B.encryptionParams,m),R=r.util.createBuffer(B.encryptedData);return E.update(R),E.finish()&&(S=i.fromDer(E.output)),S},o.encryptedPrivateKeyToPem=function(w,m){var S={type:"ENCRYPTED PRIVATE KEY",body:i.toDer(w).getBytes()};return r.pem.encode(S,{maxline:m})},o.encryptedPrivateKeyFromPem=function(w){var m=r.pem.decode(w)[0];if(m.type!=="ENCRYPTED PRIVATE KEY"){var S=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw S.headerType=m.type,S}if(m.procType&&m.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return i.fromDer(m.body)},o.encryptRsaPrivateKey=function(w,m,S){if(S=S||{},!S.legacy){var B=o.wrapRsaPrivateKey(o.privateKeyToAsn1(w));return B=o.encryptPrivateKeyInfo(B,m,S),o.encryptedPrivateKeyToPem(B)}var A,f,b,E;switch(S.algorithm){case"aes128":A="AES-128-CBC",b=16,f=r.random.getBytesSync(16),E=r.aes.createEncryptionCipher;break;case"aes192":A="AES-192-CBC",b=24,f=r.random.getBytesSync(16),E=r.aes.createEncryptionCipher;break;case"aes256":A="AES-256-CBC",b=32,f=r.random.getBytesSync(16),E=r.aes.createEncryptionCipher;break;case"3des":A="DES-EDE3-CBC",b=24,f=r.random.getBytesSync(8),E=r.des.createEncryptionCipher;break;case"des":A="DES-CBC",b=8,f=r.random.getBytesSync(8),E=r.des.createEncryptionCipher;break;default:var R=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+S.algorithm+'".');throw R.algorithm=S.algorithm,R}var P=r.pbe.opensslDeriveBytes(m,f.substr(0,8),b),C=E(P);C.start(f),C.update(i.toDer(o.privateKeyToAsn1(w))),C.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:A,parameters:r.util.bytesToHex(f).toUpperCase()},body:C.output.getBytes()};return r.pem.encode(d)},o.decryptRsaPrivateKey=function(w,m){var S=null,B=r.pem.decode(w)[0];if(B.type!=="ENCRYPTED PRIVATE KEY"&&B.type!=="PRIVATE KEY"&&B.type!=="RSA PRIVATE KEY"){var A=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw A.headerType=A,A}if(B.procType&&B.procType.type==="ENCRYPTED"){var f,b;switch(B.dekInfo.algorithm){case"DES-CBC":f=8,b=r.des.createDecryptionCipher;break;case"DES-EDE3-CBC":f=24,b=r.des.createDecryptionCipher;break;case"AES-128-CBC":f=16,b=r.aes.createDecryptionCipher;break;case"AES-192-CBC":f=24,b=r.aes.createDecryptionCipher;break;case"AES-256-CBC":f=32,b=r.aes.createDecryptionCipher;break;case"RC2-40-CBC":f=5,b=function(d){return r.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":f=8,b=function(d){return r.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":f=16,b=function(d){return r.rc2.createDecryptionCipher(d,128)};break;default:var A=new Error('Could not decrypt private key; unsupported encryption algorithm "'+B.dekInfo.algorithm+'".');throw A.algorithm=B.dekInfo.algorithm,A}var E=r.util.hexToBytes(B.dekInfo.parameters),R=r.pbe.opensslDeriveBytes(m,E.substr(0,8),f),P=b(R);if(P.start(E),P.update(r.util.createBuffer(B.body)),P.finish())S=P.output.getBytes();else return S}else S=B.body;return B.type==="ENCRYPTED PRIVATE KEY"?S=o.decryptPrivateKeyInfo(i.fromDer(S),m):S=i.fromDer(S),S!==null&&(S=o.privateKeyFromAsn1(S)),S},o.pbe.generatePkcs12Key=function(w,m,S,B,A,f){var b,E;if(typeof f>"u"||f===null){if(!("sha1"in r.md))throw new Error('"sha1" hash algorithm unavailable.');f=r.md.sha1.create()}var R=f.digestLength,P=f.blockLength,C=new r.util.ByteBuffer,d=new r.util.ByteBuffer;if(w!=null){for(E=0;E=0;E--)fe=fe>>8,fe+=oe.at(E)+ke.at(E),ke.setAt(E,fe&255);Ce.putBuffer(ke)}O=Ce,C.putBuffer(te)}return C.truncate(C.length()-A),C},o.pbe.getCipher=function(w,m,S){switch(w){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(w,m,S);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(w,m,S);default:var B=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw B.oid=w,B.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],B}},o.pbe.getCipherForPBES2=function(w,m,S){var B={},A=[];if(!i.validate(m,s,B,A)){var f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=A,f}if(w=i.derToOid(B.kdfOid),w!==o.oids.pkcs5PBKDF2){var f=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw f.oid=w,f.supportedOids=["pkcs5PBKDF2"],f}if(w=i.derToOid(B.encOid),w!==o.oids["aes128-CBC"]&&w!==o.oids["aes192-CBC"]&&w!==o.oids["aes256-CBC"]&&w!==o.oids["des-EDE3-CBC"]&&w!==o.oids.desCBC){var f=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw f.oid=w,f.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],f}var b=B.kdfSalt,E=r.util.createBuffer(B.kdfIterationCount);E=E.getInt(E.length()<<3);var R,P;switch(o.oids[w]){case"aes128-CBC":R=16,P=r.aes.createDecryptionCipher;break;case"aes192-CBC":R=24,P=r.aes.createDecryptionCipher;break;case"aes256-CBC":R=32,P=r.aes.createDecryptionCipher;break;case"des-EDE3-CBC":R=24,P=r.des.createDecryptionCipher;break;case"desCBC":R=8,P=r.des.createDecryptionCipher;break}var C=c(B.prfOid),d=r.pkcs5.pbkdf2(S,b,E,R,C),h=B.encIv,U=P(d);return U.start(h),U},o.pbe.getCipherForPKCS12PBE=function(w,m,S){var B={},A=[];if(!i.validate(m,a,B,A)){var f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=A,f}var b=r.util.createBuffer(B.salt),E=r.util.createBuffer(B.iterations);E=E.getInt(E.length()<<3);var R,P,C;switch(w){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:R=24,P=8,C=r.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:R=5,P=8,C=function(M,v){var N=r.rc2.createDecryptionCipher(M,40);return N.start(v,null),N};break;default:var f=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw f.oid=w,f}var d=c(B.prfOid),h=o.pbe.generatePkcs12Key(S,b,1,E,R,d);d.start();var U=o.pbe.generatePkcs12Key(S,b,2,E,P,d);return C(h,U)},o.pbe.opensslDeriveBytes=function(w,m,S,B){if(typeof B>"u"||B===null){if(!("md5"in r.md))throw new Error('"md5" hash algorithm unavailable.');B=r.md.md5.create()}m===null&&(m="");for(var A=[y(B,w+m)],f=16,b=1;f{var r=Fe();en(),Ze();var t=r.asn1,i=n.exports=r.pkcs7asn1=r.pkcs7asn1||{};r.pkcs7=r.pkcs7||{},r.pkcs7.asn1=i;var o={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=o;var l={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(l)},i.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"}].concat(l)};var u={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}}),ay=Ue((e,n)=>{var r=Fe();Ze(),r.mgf=r.mgf||{};var t=n.exports=r.mgf.mgf1=r.mgf1=r.mgf1||{};t.create=function(i){var o={generate:function(l,u){for(var s=new r.util.ByteBuffer,a=Math.ceil(u/i.digestLength),y=0;y{var r=Fe();ay(),n.exports=r.mgf=r.mgf||{},r.mgf.mgf1=r.mgf1}),sc=Ue((e,n)=>{var r=Fe();Fr(),Ze();var t=n.exports=r.pss=r.pss||{};t.create=function(i){arguments.length===3&&(i={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var o=i.md,l=i.mgf,u=o.digestLength,s=i.salt||null;typeof s=="string"&&(s=r.util.createBuffer(s));var a;if("saltLength"in i)a=i.saltLength;else if(s!==null)a=s.length();else throw new Error("Salt length not specified or specific salt not given.");if(s!==null&&s.length()!==a)throw new Error("Given salt length does not match length of given salt.");var y=i.prng||r.random,c={};return c.encode=function(g,I){var w,m=I-1,S=Math.ceil(m/8),B=g.digest().getBytes();if(S>8*S-m&255;return d=String.fromCharCode(d.charCodeAt(0)&~h)+d.substr(1),d+b+String.fromCharCode(188)},c.verify=function(g,I,w){var m,S=w-1,B=Math.ceil(S/8);if(I=I.substr(-B),B>8*B-S&255;if((f.charCodeAt(0)&E)!==0)throw new Error("Bits beyond keysize not zero as expected.");var R=l.generate(b,A),P="";for(m=0;m{var r=Fe();hi(),en(),Ps(),yn(),b_(),fi(),Qi(),sc(),Os(),Ze();var t=r.asn1,i=n.exports=r.pki=r.pki||{},o=i.oids,l={};l.CN=o.commonName,l.commonName="CN",l.C=o.countryName,l.countryName="C",l.L=o.localityName,l.localityName="L",l.ST=o.stateOrProvinceName,l.stateOrProvinceName="ST",l.O=o.organizationName,l.organizationName="O",l.OU=o.organizationalUnitName,l.organizationalUnitName="OU",l.E=o.emailAddress,l.emailAddress="E";var u=r.pki.rsa.publicKeyValidator,s={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},a={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},y={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},c={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[y,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};i.RDNAttributesAsArray=function(C,d){for(var h=[],U,j,M,v=0;v2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(L.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(v.validity.notBefore=L[0],v.validity.notAfter=L[1],v.tbsCertificate=h.tbsCertificate,d){v.md=w({signatureOid:v.signatureOid,type:"certificate"});var O=t.toDer(v.tbsCertificate);v.md.update(O.getBytes())}var K=r.md.sha1.create(),Y=t.toDer(h.certIssuer);K.update(Y.getBytes()),v.issuer.getField=function(oe){return g(v.issuer,oe)},v.issuer.addField=function(oe){B([oe]),v.issuer.attributes.push(oe)},v.issuer.attributes=i.RDNAttributesAsArray(h.certIssuer),h.certIssuerUniqueId&&(v.issuer.uniqueId=h.certIssuerUniqueId),v.issuer.hash=K.digest().toHex();var te=r.md.sha1.create(),re=t.toDer(h.certSubject);return te.update(re.getBytes()),v.subject.getField=function(oe){return g(v.subject,oe)},v.subject.addField=function(oe){B([oe]),v.subject.attributes.push(oe)},v.subject.attributes=i.RDNAttributesAsArray(h.certSubject),h.certSubjectUniqueId&&(v.subject.uniqueId=h.certSubjectUniqueId),v.subject.hash=te.digest().toHex(),h.certExtensions?v.extensions=i.certificateExtensionsFromAsn1(h.certExtensions):v.extensions=[],v.publicKey=i.publicKeyFromAsn1(h.subjectPublicKeyInfo),v},i.certificateExtensionsFromAsn1=function(C){for(var d=[],h=0;h1&&(U=h.value.charCodeAt(1),j=h.value.length>2?h.value.charCodeAt(2):0),d.digitalSignature=(U&128)===128,d.nonRepudiation=(U&64)===64,d.keyEncipherment=(U&32)===32,d.dataEncipherment=(U&16)===16,d.keyAgreement=(U&8)===8,d.keyCertSign=(U&4)===4,d.cRLSign=(U&2)===2,d.encipherOnly=(U&1)===1,d.decipherOnly=(j&128)===128}else if(d.name==="basicConstraints"){var h=t.fromDer(d.value);h.value.length>0&&h.value[0].type===t.Type.BOOLEAN?d.cA=h.value[0].value.charCodeAt(0)!==0:d.cA=!1;var M=null;h.value.length>0&&h.value[0].type===t.Type.INTEGER?M=h.value[0].value:h.value.length>1&&(M=h.value[1].value),M!==null&&(d.pathLenConstraint=t.derToInteger(M))}else if(d.name==="extKeyUsage")for(var h=t.fromDer(d.value),v=0;v1&&(U=h.value.charCodeAt(1)),d.client=(U&128)===128,d.server=(U&64)===64,d.email=(U&32)===32,d.objsign=(U&16)===16,d.reserved=(U&8)===8,d.sslCA=(U&4)===4,d.emailCA=(U&2)===2,d.objCA=(U&1)===1}else if(d.name==="subjectAltName"||d.name==="issuerAltName"){d.altNames=[];for(var L,h=t.fromDer(d.value),O=0;O"u"&&(d.type&&d.type in i.oids?d.name=i.oids[d.type]:d.shortName&&d.shortName in l&&(d.name=i.oids[l[d.shortName]])),typeof d.type>"u")if(d.name&&d.name in i.oids)d.type=i.oids[d.name];else{var U=new Error("Attribute type not specified.");throw U.attribute=d,U}if(typeof d.shortName>"u"&&d.name&&d.name in l&&(d.shortName=l[d.name]),d.type===o.extensionRequest&&(d.valueConstructed=!0,d.valueTagClass=t.Type.SEQUENCE,!d.value&&d.extensions)){d.value=[];for(var j=0;j"u"){var U=new Error("Attribute value not specified.");throw U.attribute=d,U}}}function A(C,d){if(d=d||{},typeof C.name>"u"&&C.id&&C.id in i.oids&&(C.name=i.oids[C.id]),typeof C.id>"u")if(C.name&&C.name in i.oids)C.id=i.oids[C.name];else{var h=new Error("Extension ID not specified.");throw h.extension=C,h}if(typeof C.value<"u")return C;if(C.name==="keyUsage"){var U=0,j=0,M=0;C.digitalSignature&&(j|=128,U=7),C.nonRepudiation&&(j|=64,U=6),C.keyEncipherment&&(j|=32,U=5),C.dataEncipherment&&(j|=16,U=4),C.keyAgreement&&(j|=8,U=3),C.keyCertSign&&(j|=4,U=2),C.cRLSign&&(j|=2,U=1),C.encipherOnly&&(j|=1,U=0),C.decipherOnly&&(M|=128,U=7);var v=String.fromCharCode(U);M!==0?v+=String.fromCharCode(j)+String.fromCharCode(M):j!==0&&(v+=String.fromCharCode(j)),C.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,v)}else if(C.name==="basicConstraints")C.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),C.cA&&C.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in C&&C.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(C.pathLenConstraint).getBytes()));else if(C.name==="extKeyUsage"){C.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var N=C.value.value;for(var L in C)C[L]===!0&&(L in o?N.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(o[L]).getBytes())):L.indexOf(".")!==-1&&N.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(L).getBytes())))}else if(C.name==="nsCertType"){var U=0,j=0;C.client&&(j|=128,U=7),C.server&&(j|=64,U=6),C.email&&(j|=32,U=5),C.objsign&&(j|=16,U=4),C.reserved&&(j|=8,U=3),C.sslCA&&(j|=4,U=2),C.emailCA&&(j|=2,U=1),C.objCA&&(j|=1,U=0);var v=String.fromCharCode(U);j!==0&&(v+=String.fromCharCode(j)),C.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,v)}else if(C.name==="subjectAltName"||C.name==="issuerAltName"){C.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var O,K=0;K128)throw new Error('Invalid "nsComment" content.');C.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,C.comment)}else if(C.name==="subjectKeyIdentifier"&&d.cert){var Y=d.cert.generateSubjectKeyIdentifier();C.subjectKeyIdentifier=Y.toHex(),C.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,Y.getBytes())}else if(C.name==="authorityKeyIdentifier"&&d.cert){C.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var N=C.value.value;if(C.keyIdentifier){var te=C.keyIdentifier===!0?d.cert.generateSubjectKeyIdentifier().getBytes():C.keyIdentifier;N.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,te))}if(C.authorityCertIssuer){var re=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[S(C.authorityCertIssuer===!0?d.cert.issuer:C.authorityCertIssuer)])];N.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,re))}if(C.serialNumber){var oe=r.util.hexToBytes(C.serialNumber===!0?d.cert.serialNumber:C.serialNumber);N.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,oe))}}else if(C.name==="cRLDistributionPoints"){C.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var N=C.value.value,be=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),Ce=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]),O,K=0;K"u"){var h=new Error("Extension value not specified.");throw h.extension=C,h}return C}function f(C,d){switch(C){case o["RSASSA-PSS"]:var h=[];return d.hash.algorithmOid!==void 0&&h.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),d.mgf.algorithmOid!==void 0&&h.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])])),d.saltLength!==void 0&&h.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,h);default:return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}}function b(C){var d=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(C.attributes.length===0)return d;for(var h=C.attributes,U=0;U=E&&C0&&U.value.push(i.certificateExtensionsToAsn1(C.extensions)),U},i.getCertificationRequestInfo=function(C){var d=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(C.version).getBytes()),S(C.subject),i.publicKeyToAsn1(C.publicKey),b(C)]);return d},i.distinguishedNameToAsn1=function(C){return S(C)},i.certificateToAsn1=function(C){var d=C.tbsCertificate||i.getTBSCertificate(C);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[d,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(C.signatureOid).getBytes()),f(C.signatureOid,C.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+C.signature)])},i.certificateExtensionsToAsn1=function(C){var d=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),h=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);d.value.push(h);for(var U=0;U"u"&&(j=new Date);var M=!0,v=null,N=0;do{var L=d.shift(),O=null,K=!1;if(j&&(jL.validity.notAfter)&&(v={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:L.validity.notBefore,notAfter:L.validity.notAfter,now:j}),v===null){if(O=d[0]||C.getIssuer(L),O===null&&L.isIssuer(L)&&(K=!0,O=L),O){var Y=O;r.util.isArray(Y)||(Y=[Y]);for(var te=!1;!te&&Y.length>0;){O=Y.shift();try{te=O.verify(L)}catch{}}te||(v={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}v===null&&(!O||K)&&!C.hasCertificate(L)&&(v={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(v===null&&O&&!L.isIssuer(O)&&(v={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),v===null)for(var re={keyUsage:!0,basicConstraints:!0},oe=0;v===null&&oeCe.pathLenConstraint&&(v={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}}var Pe=v===null?!0:v.error,ce=h.verify?h.verify(Pe,N,U):Pe;if(ce===!0)v=null;else throw Pe===!0&&(v={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(ce||ce===0)&&(typeof ce=="object"&&!r.util.isArray(ce)?(ce.message&&(v.message=ce.message),ce.error&&(v.error=ce.error)):typeof ce=="string"&&(v.error=ce)),v;M=!1,++N}while(d.length>0);return!0}}),oy=Ue((e,n)=>{var r=Fe();en(),Da(),fi(),iy(),ny(),Fr(),Os(),xa(),Ze(),uc();var t=r.asn1,i=r.pki,o=n.exports=r.pkcs12=r.pkcs12||{},l={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},l,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},s={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},a={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},y={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function c(B,A,f,b){for(var E=[],R=0;R=0&&E.push(C)}}return E}o.pkcs12FromAsn1=function(B,A,f){typeof A=="string"?(f=A,A=!0):A===void 0&&(A=!0);var b={},E=[];if(!t.validate(B,u,b,E)){var R=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw R.errors=R,R}var P={version:b.version.charCodeAt(0),safeContents:[],getBags:function(O){var K={},Y;return"localKeyId"in O?Y=O.localKeyId:"localKeyIdHex"in O&&(Y=r.util.hexToBytes(O.localKeyIdHex)),Y===void 0&&!("friendlyName"in O)&&"bagType"in O&&(K[O.bagType]=c(P.safeContents,null,null,O.bagType)),Y!==void 0&&(K.localKeyId=c(P.safeContents,"localKeyId",Y,O.bagType)),"friendlyName"in O&&(K.friendlyName=c(P.safeContents,"friendlyName",O.friendlyName,O.bagType)),K},getBagsByFriendlyName:function(O,K){return c(P.safeContents,"friendlyName",O,K)},getBagsByLocalKeyId:function(O,K){return c(P.safeContents,"localKeyId",O,K)}};if(b.version.charCodeAt(0)!==3){var R=new Error("PKCS#12 PFX of version other than 3 not supported.");throw R.version=b.version.charCodeAt(0),R}if(t.derToOid(b.contentType)!==i.oids.data){var R=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw R.oid=t.derToOid(b.contentType),R}var C=b.content.value[0];if(C.tagClass!==t.Class.UNIVERSAL||C.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(C=g(C),b.mac){var d=null,h=0,U=t.derToOid(b.macAlgorithm);switch(U){case i.oids.sha1:d=r.md.sha1.create(),h=20;break;case i.oids.sha256:d=r.md.sha256.create(),h=32;break;case i.oids.sha384:d=r.md.sha384.create(),h=48;break;case i.oids.sha512:d=r.md.sha512.create(),h=64;break;case i.oids.md5:d=r.md.md5.create(),h=16;break}if(d===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+U);var j=new r.util.ByteBuffer(b.macSalt),M="macIterations"in b?parseInt(r.util.bytesToHex(b.macIterations),16):1,v=o.generateKey(f,j,3,M,h,d),N=r.hmac.create();N.start(d,v),N.update(C.value);var L=N.getMac();if(L.getBytes()!==b.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return I(P,C.value,A,f),P};function g(B){if(B.composed||B.constructed){for(var A=r.util.createBuffer(),f=0;f0&&(R=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d));var h=[],U=[];A!==null&&(r.util.isArray(A)?U=A:U=[A]);for(var j=[],M=0;M0){var O=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,j),K=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(i.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(O).getBytes())])]);h.push(K)}var Y=null;if(B!==null){var te=i.wrapRsaPrivateKey(i.privateKeyToAsn1(B));f===null?Y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(i.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[te]),R]):Y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(te,f,b)]),R]);var re=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[Y]),oe=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(i.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(re).getBytes())])]);h.push(oe)}var be=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,h),Ce;if(b.useMac){var C=r.md.sha1.create(),ke=new r.util.ByteBuffer(r.random.getBytes(b.saltSize)),fe=b.count,B=o.generateKey(f,ke,3,fe,20),Pe=r.hmac.create();Pe.start(C,B),Pe.update(t.toDer(be).getBytes());var ce=Pe.getMac();Ce=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(i.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,ce.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,ke.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(fe).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(i.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(be).getBytes())])]),Ce])},o.generateKey=r.pbe.generatePkcs12Key}),sy=Ue((e,n)=>{var r=Fe();en(),fi(),ny(),Qi(),oc(),oy(),sc(),Os(),Ze(),uc();var t=r.asn1,i=n.exports=r.pki=r.pki||{};i.pemToDer=function(o){var l=r.pem.decode(o)[0];if(l.procType&&l.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return r.util.createBuffer(l.body)},i.privateKeyFromPem=function(o){var l=r.pem.decode(o)[0];if(l.type!=="PRIVATE KEY"&&l.type!=="RSA PRIVATE KEY"){var u=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw u.headerType=l.type,u}if(l.procType&&l.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var s=t.fromDer(l.body);return i.privateKeyFromAsn1(s)},i.privateKeyToPem=function(o,l){var u={type:"RSA PRIVATE KEY",body:t.toDer(i.privateKeyToAsn1(o)).getBytes()};return r.pem.encode(u,{maxline:l})},i.privateKeyInfoToPem=function(o,l){var u={type:"PRIVATE KEY",body:t.toDer(o).getBytes()};return r.pem.encode(u,{maxline:l})}}),uy=Ue((e,n)=>{var r=Fe();en(),Da(),ac(),Qi(),sy(),Fr(),xa(),Ze();var t=function(k,$,V,_){var D=r.util.createBuffer(),G=k.length>>1,z=G+(k.length&1),se=k.substr(0,z),me=k.substr(G,z),Te=r.util.createBuffer(),ae=r.hmac.create();V=$+V;var Se=Math.ceil(_/16),Le=Math.ceil(_/20);ae.start("MD5",se);var qe=r.util.createBuffer();Te.putBytes(V);for(var Oe=0;Oe0&&(a.queue(k,a.createAlert(k,{level:a.Alert.Level.warning,description:a.Alert.Description.no_renegotiation})),a.flush(k)),k.process()},a.parseHelloMessage=function(k,$,V){var _=null,D=k.entity===a.ConnectionEnd.client;if(V<38)k.error(k,{message:D?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});else{var G=$.fragment,z=G.length();if(_={version:{major:G.getByte(),minor:G.getByte()},random:r.util.createBuffer(G.getBytes(32)),session_id:u(G,1),extensions:[]},D?(_.cipher_suite=G.getBytes(2),_.compression_method=G.getByte()):(_.cipher_suites=u(G,2),_.compression_methods=u(G,1)),z=V-(z-G.length()),z>0){for(var se=u(G,2);se.length()>0;)_.extensions.push({type:[se.getByte(),se.getByte()],data:u(se,2)});if(!D)for(var me=0;me<_.extensions.length;++me){var Te=_.extensions[me];if(Te.type[0]===0&&Te.type[1]===0)for(var ae=u(Te.data,2);ae.length()>0;){var Se=ae.getByte();if(Se!==0)break;k.session.extensions.server_name.serverNameList.push(u(ae,2).getBytes())}}}if(k.session.version&&(_.version.major!==k.session.version.major||_.version.minor!==k.session.version.minor))return k.error(k,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});if(D)k.session.cipherSuite=a.getCipherSuite(_.cipher_suite);else for(var Le=r.util.createBuffer(_.cipher_suites.bytes());Le.length()>0&&(k.session.cipherSuite=a.getCipherSuite(Le.getBytes(2)),k.session.cipherSuite===null););if(k.session.cipherSuite===null)return k.error(k,{message:"No cipher suites in common.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure},cipherSuite:r.util.bytesToHex(_.cipher_suite)});D?k.session.compressionMethod=_.compression_method:k.session.compressionMethod=a.CompressionMethod.none}return _},a.createSecurityParameters=function(k,$){var V=k.entity===a.ConnectionEnd.client,_=$.random.bytes(),D=V?k.session.sp.client_random:_,G=V?_:a.createRandom().getBytes();k.session.sp={entity:k.entity,prf_algorithm:a.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:k.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:D,server_random:G}},a.handleServerHello=function(k,$,V){var _=a.parseHelloMessage(k,$,V);if(!k.fail){if(_.version.minor<=k.version.minor)k.version.minor=_.version.minor;else return k.error(k,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});k.session.version=k.version;var D=_.session_id.bytes();D.length>0&&D===k.session.id?(k.expect=m,k.session.resuming=!0,k.session.sp.server_random=_.random.bytes()):(k.expect=c,k.session.resuming=!1,a.createSecurityParameters(k,_)),k.session.id=D,k.process()}},a.handleClientHello=function(k,$,V){var _=a.parseHelloMessage(k,$,V);if(!k.fail){var D=_.session_id.bytes(),G=null;if(k.sessionCache&&(G=k.sessionCache.getSession(D),G===null?D="":(G.version.major!==_.version.major||G.version.minor>_.version.minor)&&(G=null,D="")),D.length===0&&(D=r.random.getBytes(32)),k.session.id=D,k.session.clientHelloVersion=_.version,k.session.sp={},G)k.version=k.session.version=G.version,k.session.sp=G.sp;else{for(var z,se=1;se0;)G=u(D.certificate_list,3),z=r.asn1.fromDer(G),G=r.pki.certificateFromAsn1(z,!0),se.push(G)}catch(Te){return k.error(k,{message:"Could not parse certificate list.",cause:Te,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate}})}var me=k.entity===a.ConnectionEnd.client;(me||k.verifyClient===!0)&&se.length===0?k.error(k,{message:me?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}}):se.length===0?k.expect=me?g:E:(me?k.session.serverCertificate=se[0]:k.session.clientCertificate=se[0],a.verifyCertificateChain(k,se)&&(k.expect=me?g:E)),k.process()},a.handleServerKeyExchange=function(k,$,V){if(V>0)return k.error(k,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});k.expect=I,k.process()},a.handleClientKeyExchange=function(k,$,V){if(V<48)return k.error(k,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});var _=$.fragment,D={enc_pre_master_secret:u(_,2).getBytes()},G=null;if(k.getPrivateKey)try{G=k.getPrivateKey(k,k.session.serverCertificate),G=r.pki.privateKeyFromPem(G)}catch(me){k.error(k,{message:"Could not get private key.",cause:me,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}if(G===null)return k.error(k,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}});try{var z=k.session.sp;z.pre_master_secret=G.decrypt(D.enc_pre_master_secret);var se=k.session.clientHelloVersion;if(se.major!==z.pre_master_secret.charCodeAt(0)||se.minor!==z.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{z.pre_master_secret=r.random.getBytes(48)}k.expect=P,k.session.clientCertificate!==null&&(k.expect=R),k.process()},a.handleCertificateRequest=function(k,$,V){if(V<3)return k.error(k,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var _=$.fragment,D={certificate_types:u(_,1),certificate_authorities:u(_,2)};k.session.certificateRequest=D,k.expect=w,k.process()},a.handleCertificateVerify=function(k,$,V){if(V<2)return k.error(k,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var _=$.fragment;_.read-=4;var D=_.bytes();_.read+=4;var G={signature:u(_,2).getBytes()},z=r.util.createBuffer();z.putBuffer(k.session.md5.digest()),z.putBuffer(k.session.sha1.digest()),z=z.getBytes();try{var se=k.session.clientCertificate;if(!se.publicKey.verify(z,G.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");k.session.md5.update(D),k.session.sha1.update(D)}catch{return k.error(k,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure}})}k.expect=P,k.process()},a.handleServerHelloDone=function(k,$,V){if(V>0)return k.error(k,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.record_overflow}});if(k.serverCertificate===null){var _={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.insufficient_security}},D=0,G=k.verify(k,_.alert.description,D,[]);if(G!==!0)return(G||G===0)&&(typeof G=="object"&&!r.util.isArray(G)?(G.message&&(_.message=G.message),G.alert&&(_.alert.description=G.alert)):typeof G=="number"&&(_.alert.description=G)),k.error(k,_)}k.session.certificateRequest!==null&&($=a.createRecord(k,{type:a.ContentType.handshake,data:a.createCertificate(k)}),a.queue(k,$)),$=a.createRecord(k,{type:a.ContentType.handshake,data:a.createClientKeyExchange(k)}),a.queue(k,$),k.expect=A;var z=function(se,me){se.session.certificateRequest!==null&&se.session.clientCertificate!==null&&a.queue(se,a.createRecord(se,{type:a.ContentType.handshake,data:a.createCertificateVerify(se,me)})),a.queue(se,a.createRecord(se,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),se.state.pending=a.createConnectionState(se),se.state.current.write=se.state.pending.write,a.queue(se,a.createRecord(se,{type:a.ContentType.handshake,data:a.createFinished(se)})),se.expect=m,a.flush(se),se.process()};if(k.session.certificateRequest===null||k.session.clientCertificate===null)return z(k,null);a.getClientSignature(k,z)},a.handleChangeCipherSpec=function(k,$){if($.fragment.getByte()!==1)return k.error(k,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var V=k.entity===a.ConnectionEnd.client;(k.session.resuming&&V||!k.session.resuming&&!V)&&(k.state.pending=a.createConnectionState(k)),k.state.current.read=k.state.pending.read,(!k.session.resuming&&V||k.session.resuming&&!V)&&(k.state.pending=null),k.expect=V?S:C,k.process()},a.handleFinished=function(k,$,V){var _=$.fragment;_.read-=4;var D=_.bytes();_.read+=4;var G=$.fragment.getBytes();_=r.util.createBuffer(),_.putBuffer(k.session.md5.digest()),_.putBuffer(k.session.sha1.digest());var z=k.entity===a.ConnectionEnd.client,se=z?"server finished":"client finished",me=k.session.sp,Te=12,ae=t;if(_=ae(me.master_secret,se,_.getBytes(),Te),_.getBytes()!==G)return k.error(k,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decrypt_error}});k.session.md5.update(D),k.session.sha1.update(D),(k.session.resuming&&z||!k.session.resuming&&!z)&&(a.queue(k,a.createRecord(k,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),k.state.current.write=k.state.pending.write,k.state.pending=null,a.queue(k,a.createRecord(k,{type:a.ContentType.handshake,data:a.createFinished(k)}))),k.expect=z?B:d,k.handshaking=!1,++k.handshakes,k.peerCertificate=z?k.session.serverCertificate:k.session.clientCertificate,a.flush(k),k.isConnected=!0,k.connected(k),k.process()},a.handleAlert=function(k,$){var V=$.fragment,_={level:V.getByte(),description:V.getByte()},D;switch(_.description){case a.Alert.Description.close_notify:D="Connection closed.";break;case a.Alert.Description.unexpected_message:D="Unexpected message.";break;case a.Alert.Description.bad_record_mac:D="Bad record MAC.";break;case a.Alert.Description.decryption_failed:D="Decryption failed.";break;case a.Alert.Description.record_overflow:D="Record overflow.";break;case a.Alert.Description.decompression_failure:D="Decompression failed.";break;case a.Alert.Description.handshake_failure:D="Handshake failure.";break;case a.Alert.Description.bad_certificate:D="Bad certificate.";break;case a.Alert.Description.unsupported_certificate:D="Unsupported certificate.";break;case a.Alert.Description.certificate_revoked:D="Certificate revoked.";break;case a.Alert.Description.certificate_expired:D="Certificate expired.";break;case a.Alert.Description.certificate_unknown:D="Certificate unknown.";break;case a.Alert.Description.illegal_parameter:D="Illegal parameter.";break;case a.Alert.Description.unknown_ca:D="Unknown certificate authority.";break;case a.Alert.Description.access_denied:D="Access denied.";break;case a.Alert.Description.decode_error:D="Decode error.";break;case a.Alert.Description.decrypt_error:D="Decrypt error.";break;case a.Alert.Description.export_restriction:D="Export restriction.";break;case a.Alert.Description.protocol_version:D="Unsupported protocol version.";break;case a.Alert.Description.insufficient_security:D="Insufficient security.";break;case a.Alert.Description.internal_error:D="Internal error.";break;case a.Alert.Description.user_canceled:D="User canceled.";break;case a.Alert.Description.no_renegotiation:D="Renegotiation not supported.";break;default:D="Unknown error.";break}if(_.description===a.Alert.Description.close_notify)return k.close();k.error(k,{message:D,send:!1,origin:k.entity===a.ConnectionEnd.client?"server":"client",alert:_}),k.process()},a.handleHandshake=function(k,$){var V=$.fragment,_=V.getByte(),D=V.getInt24();if(D>V.length())return k.fragmented=$,$.fragment=r.util.createBuffer(),V.read-=4,k.process();k.fragmented=null,V.read-=4;var G=V.bytes(D+4);V.read+=4,_ in Ce[k.entity][k.expect]?(k.entity===a.ConnectionEnd.server&&!k.open&&!k.fail&&(k.handshaking=!0,k.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:r.md.md5.create(),sha1:r.md.sha1.create()}),_!==a.HandshakeType.hello_request&&_!==a.HandshakeType.certificate_verify&&_!==a.HandshakeType.finished&&(k.session.md5.update(G),k.session.sha1.update(G)),Ce[k.entity][k.expect][_](k,$,D)):a.handleUnexpected(k,$)},a.handleApplicationData=function(k,$){k.data.putBuffer($.fragment),k.dataReady(k),k.process()},a.handleHeartbeat=function(k,$){var V=$.fragment,_=V.getByte(),D=V.getInt16(),G=V.getBytes(D);if(_===a.HeartbeatMessageType.heartbeat_request){if(k.handshaking||D>G.length)return k.process();a.queue(k,a.createRecord(k,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_response,G)})),a.flush(k)}else if(_===a.HeartbeatMessageType.heartbeat_response){if(G!==k.expectedHeartbeatPayload)return k.process();k.heartbeatReceived&&k.heartbeatReceived(k,r.util.createBuffer(G))}k.process()};var y=0,c=1,g=2,I=3,w=4,m=5,S=6,B=7,A=8,f=0,b=1,E=2,R=3,P=4,C=5,d=6,h=a.handleUnexpected,U=a.handleChangeCipherSpec,j=a.handleAlert,M=a.handleHandshake,v=a.handleApplicationData,N=a.handleHeartbeat,L=[];L[a.ConnectionEnd.client]=[[h,j,M,h,N],[h,j,M,h,N],[h,j,M,h,N],[h,j,M,h,N],[h,j,M,h,N],[U,j,h,h,N],[h,j,M,h,N],[h,j,M,v,N],[h,j,M,h,N]],L[a.ConnectionEnd.server]=[[h,j,M,h,N],[h,j,M,h,N],[h,j,M,h,N],[h,j,M,h,N],[U,j,h,h,N],[h,j,M,h,N],[h,j,M,v,N],[h,j,M,h,N]];var O=a.handleHelloRequest,K=a.handleServerHello,Y=a.handleCertificate,te=a.handleServerKeyExchange,re=a.handleCertificateRequest,oe=a.handleServerHelloDone,be=a.handleFinished,Ce=[];Ce[a.ConnectionEnd.client]=[[h,h,K,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,Y,te,re,oe,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,h,te,re,oe,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,h,h,re,oe,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,h,h,h,oe,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,be],[O,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[O,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]];var ke=a.handleClientHello,fe=a.handleClientKeyExchange,Pe=a.handleCertificateVerify;Ce[a.ConnectionEnd.server]=[[h,ke,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,Y,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,fe,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,Pe,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,be],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h],[h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h]],a.generateKeys=function(k,$){var V=t,_=$.client_random+$.server_random;k.session.resuming||($.master_secret=V($.pre_master_secret,"master secret",_,48).bytes(),$.pre_master_secret=null),_=$.server_random+$.client_random;var D=2*$.mac_key_length+2*$.enc_key_length,G=k.version.major===a.Versions.TLS_1_0.major&&k.version.minor===a.Versions.TLS_1_0.minor;G&&(D+=2*$.fixed_iv_length);var z=V($.master_secret,"key expansion",_,D),se={client_write_MAC_key:z.getBytes($.mac_key_length),server_write_MAC_key:z.getBytes($.mac_key_length),client_write_key:z.getBytes($.enc_key_length),server_write_key:z.getBytes($.enc_key_length)};return G&&(se.client_write_IV=z.getBytes($.fixed_iv_length),se.server_write_IV=z.getBytes($.fixed_iv_length)),se},a.createConnectionState=function(k){var $=k.entity===a.ConnectionEnd.client,V=function(){var G={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(z){return!0},compressionState:null,compressFunction:function(z){return!0},updateSequenceNumber:function(){G.sequenceNumber[1]===4294967295?(G.sequenceNumber[1]=0,++G.sequenceNumber[0]):++G.sequenceNumber[1]}};return G},_={read:V(),write:V()};if(_.read.update=function(G,z){return _.read.cipherFunction(z,_.read)?_.read.compressFunction(G,z,_.read)||G.error(G,{message:"Could not decompress record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decompression_failure}}):G.error(G,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_record_mac}}),!G.fail},_.write.update=function(G,z){return _.write.compressFunction(G,z,_.write)?_.write.cipherFunction(z,_.write)||G.error(G,{message:"Could not encrypt record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):G.error(G,{message:"Could not compress record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}),!G.fail},k.session){var D=k.session.sp;switch(k.session.cipherSuite.initSecurityParameters(D),D.keys=a.generateKeys(k,D),_.read.macKey=$?D.keys.server_write_MAC_key:D.keys.client_write_MAC_key,_.write.macKey=$?D.keys.client_write_MAC_key:D.keys.server_write_MAC_key,k.session.cipherSuite.initConnectionState(_,k,D),D.compression_algorithm){case a.CompressionMethod.none:break;case a.CompressionMethod.deflate:_.read.compressFunction=l,_.write.compressFunction=o;break;default:throw new Error("Unsupported compression algorithm.")}}return _},a.createRandom=function(){var k=new Date,$=+k+k.getTimezoneOffset()*6e4,V=r.util.createBuffer();return V.putInt32($),V.putBytes(r.random.getBytes(28)),V},a.createRecord=function(k,$){if(!$.data)return null;var V={type:$.type,version:{major:k.version.major,minor:k.version.minor},length:$.data.length(),fragment:$.data};return V},a.createAlert=function(k,$){var V=r.util.createBuffer();return V.putByte($.level),V.putByte($.description),a.createRecord(k,{type:a.ContentType.alert,data:V})},a.createClientHello=function(k){k.session.clientHelloVersion={major:k.version.major,minor:k.version.minor};for(var $=r.util.createBuffer(),V=0;V0&&(Se+=2);var Le=k.session.id,qe=Le.length+1+2+4+28+2+D+1+z+Se,Oe=r.util.createBuffer();return Oe.putByte(a.HandshakeType.client_hello),Oe.putInt24(qe),Oe.putByte(k.version.major),Oe.putByte(k.version.minor),Oe.putBytes(k.session.sp.client_random),s(Oe,1,r.util.createBuffer(Le)),s(Oe,2,$),s(Oe,1,G),Se>0&&s(Oe,2,se),Oe},a.createServerHello=function(k){var $=k.session.id,V=$.length+1+2+4+28+2+1,_=r.util.createBuffer();return _.putByte(a.HandshakeType.server_hello),_.putInt24(V),_.putByte(k.version.major),_.putByte(k.version.minor),_.putBytes(k.session.sp.server_random),s(_,1,r.util.createBuffer($)),_.putByte(k.session.cipherSuite.id[0]),_.putByte(k.session.cipherSuite.id[1]),_.putByte(k.session.compressionMethod),_},a.createCertificate=function(k){var $=k.entity===a.ConnectionEnd.client,V=null;if(k.getCertificate){var _;$?_=k.session.certificateRequest:_=k.session.extensions.server_name.serverNameList,V=k.getCertificate(k,_)}var D=r.util.createBuffer();if(V!==null)try{r.util.isArray(V)||(V=[V]);for(var G=null,z=0;z0&&(V.putByte(a.HandshakeType.server_key_exchange),V.putInt24($)),V},a.getClientSignature=function(k,$){var V=r.util.createBuffer();V.putBuffer(k.session.md5.digest()),V.putBuffer(k.session.sha1.digest()),V=V.getBytes(),k.getSignature=k.getSignature||function(_,D,G){var z=null;if(_.getPrivateKey)try{z=_.getPrivateKey(_,_.session.clientCertificate),z=r.pki.privateKeyFromPem(z)}catch(se){_.error(_,{message:"Could not get private key.",cause:se,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}z===null?_.error(_,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):D=z.sign(D,null),G(_,D)},k.getSignature(k,V,$)},a.createCertificateVerify=function(k,$){var V=$.length+2,_=r.util.createBuffer();return _.putByte(a.HandshakeType.certificate_verify),_.putInt24(V),_.putInt16($.length),_.putBytes($),_},a.createCertificateRequest=function(k){var $=r.util.createBuffer();$.putByte(1);var V=r.util.createBuffer();for(var _ in k.caStore.certs){var D=k.caStore.certs[_],G=r.pki.distinguishedNameToAsn1(D.subject),z=r.asn1.toDer(G);V.putInt16(z.length()),V.putBuffer(z)}var se=1+$.length()+2+V.length(),me=r.util.createBuffer();return me.putByte(a.HandshakeType.certificate_request),me.putInt24(se),s(me,1,$),s(me,2,V),me},a.createServerHelloDone=function(k){var $=r.util.createBuffer();return $.putByte(a.HandshakeType.server_hello_done),$.putInt24(0),$},a.createChangeCipherSpec=function(){var k=r.util.createBuffer();return k.putByte(1),k},a.createFinished=function(k){var $=r.util.createBuffer();$.putBuffer(k.session.md5.digest()),$.putBuffer(k.session.sha1.digest());var V=k.entity===a.ConnectionEnd.client,_=k.session.sp,D=12,G=t,z=V?"client finished":"server finished";$=G(_.master_secret,z,$.getBytes(),D);var se=r.util.createBuffer();return se.putByte(a.HandshakeType.finished),se.putInt24($.length()),se.putBuffer($),se},a.createHeartbeat=function(k,$,V){typeof V>"u"&&(V=$.length);var _=r.util.createBuffer();_.putByte(k),_.putInt16(V),_.putBytes($);var D=_.length(),G=Math.max(16,D-V-3);return _.putBytes(r.random.getBytes(G)),_},a.queue=function(k,$){if(!!$&&!($.fragment.length()===0&&($.type===a.ContentType.handshake||$.type===a.ContentType.alert||$.type===a.ContentType.change_cipher_spec))){if($.type===a.ContentType.handshake){var V=$.fragment.bytes();k.session.md5.update(V),k.session.sha1.update(V),V=null}var _;if($.fragment.length()<=a.MaxFragment)_=[$];else{_=[];for(var D=$.fragment.bytes();D.length>a.MaxFragment;)_.push(a.createRecord(k,{type:$.type,data:r.util.createBuffer(D.slice(0,a.MaxFragment))})),D=D.slice(a.MaxFragment);D.length>0&&_.push(a.createRecord(k,{type:$.type,data:r.util.createBuffer(D)}))}for(var G=0;G<_.length&&!k.fail;++G){var z=_[G],se=k.state.current.write;se.update(k,z)&&k.records.push(z)}}},a.flush=function(k){for(var $=0;$0&&(z=V.order[0]),z!==null&&z in V.cache){G=V.cache[z],delete V.cache[z];for(var se in V.order)if(V.order[se]===z){V.order.splice(se,1);break}}return G},V.setSession=function(D,G){if(V.order.length===V.capacity){var z=V.order.shift();delete V.cache[z]}var z=r.util.bytesToHex(D);V.order.push(z),V.cache[z]=G}}return V},a.createConnection=function(k){var $=null;k.caStore?r.util.isArray(k.caStore)?$=r.pki.createCaStore(k.caStore):$=k.caStore:$=r.pki.createCaStore();var V=k.cipherSuites||null;if(V===null){V=[];for(var _ in a.CipherSuites)V.push(a.CipherSuites[_])}var D=k.server?a.ConnectionEnd.server:a.ConnectionEnd.client,G=k.sessionCache?a.createSessionCache(k.sessionCache):null,z={version:{major:a.Version.major,minor:a.Version.minor},entity:D,sessionId:k.sessionId,caStore:$,sessionCache:G,cipherSuites:V,connected:k.connected,virtualHost:k.virtualHost||null,verifyClient:k.verifyClient||!1,verify:k.verify||function(ae,Se,Le,qe){return Se},verifyOptions:k.verifyOptions||{},getCertificate:k.getCertificate||null,getPrivateKey:k.getPrivateKey||null,getSignature:k.getSignature||null,input:r.util.createBuffer(),tlsData:r.util.createBuffer(),data:r.util.createBuffer(),tlsDataReady:k.tlsDataReady,dataReady:k.dataReady,heartbeatReceived:k.heartbeatReceived,closed:k.closed,error:function(ae,Se){Se.origin=Se.origin||(ae.entity===a.ConnectionEnd.client?"client":"server"),Se.send&&(a.queue(ae,a.createAlert(ae,Se.alert)),a.flush(ae));var Le=Se.fatal!==!1;Le&&(ae.fail=!0),k.error(ae,Se),Le&&ae.close(!1)},deflate:k.deflate||null,inflate:k.inflate||null};z.reset=function(ae){z.version={major:a.Version.major,minor:a.Version.minor},z.record=null,z.session=null,z.peerCertificate=null,z.state={pending:null,current:null},z.expect=z.entity===a.ConnectionEnd.client?y:f,z.fragmented=null,z.records=[],z.open=!1,z.handshakes=0,z.handshaking=!1,z.isConnected=!1,z.fail=!(ae||typeof ae>"u"),z.input.clear(),z.tlsData.clear(),z.data.clear(),z.state.current=a.createConnectionState(z)},z.reset();var se=function(ae,Se){var Le=Se.type-a.ContentType.change_cipher_spec,qe=L[ae.entity][ae.expect];Le in qe?qe[Le](ae,Se):a.handleUnexpected(ae,Se)},me=function(ae){var Se=0,Le=ae.input,qe=Le.length();if(qe<5)Se=5-qe;else{ae.record={type:Le.getByte(),version:{major:Le.getByte(),minor:Le.getByte()},length:Le.getInt16(),fragment:r.util.createBuffer(),ready:!1};var Oe=ae.record.version.major===ae.version.major;Oe&&ae.session&&ae.session.version&&(Oe=ae.record.version.minor===ae.version.minor),Oe||ae.error(ae,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}})}return Se},Te=function(ae){var Se=0,Le=ae.input,qe=Le.length();if(qe0&&(z.sessionCache&&(Se=z.sessionCache.getSession(ae)),Se===null&&(ae="")),ae.length===0&&z.sessionCache&&(Se=z.sessionCache.getSession(),Se!==null&&(ae=Se.id)),z.session={id:ae,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:r.md.md5.create(),sha1:r.md.sha1.create()},Se&&(z.version=Se.version,z.session.sp=Se.sp),z.session.sp.client_random=a.createRandom().getBytes(),z.open=!0,a.queue(z,a.createRecord(z,{type:a.ContentType.handshake,data:a.createClientHello(z)})),a.flush(z)}},z.process=function(ae){var Se=0;return ae&&z.input.putBytes(ae),z.fail||(z.record!==null&&z.record.ready&&z.record.fragment.isEmpty()&&(z.record=null),z.record===null&&(Se=me(z)),!z.fail&&z.record!==null&&!z.record.ready&&(Se=Te(z)),!z.fail&&z.record!==null&&z.record.ready&&se(z,z.record)),Se},z.prepare=function(ae){return a.queue(z,a.createRecord(z,{type:a.ContentType.application_data,data:r.util.createBuffer(ae)})),a.flush(z)},z.prepareHeartbeatRequest=function(ae,Se){return ae instanceof r.util.ByteBuffer&&(ae=ae.bytes()),typeof Se>"u"&&(Se=ae.length),z.expectedHeartbeatPayload=ae,a.queue(z,a.createRecord(z,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_request,ae,Se)})),a.flush(z)},z.close=function(ae){if(!z.fail&&z.sessionCache&&z.session){var Se={id:z.session.id,version:z.session.version,sp:z.session.sp};Se.sp.keys=null,z.sessionCache.setSession(Se.id,Se)}z.open&&(z.open=!1,z.input.clear(),(z.isConnected||z.handshaking)&&(z.isConnected=z.handshaking=!1,a.queue(z,a.createAlert(z,{level:a.Alert.Level.warning,description:a.Alert.Description.close_notify})),a.flush(z)),z.closed(z)),z.reset(ae)},z},n.exports=r.tls=r.tls||{};for(De in a)typeof a[De]!="function"&&(r.tls[De]=a[De]);var De;r.tls.prf_tls1=t,r.tls.hmac_sha1=i,r.tls.createSessionCache=a.createSessionCache,r.tls.createConnection=a.createConnection}),__=Ue((e,n)=>{var r=Fe();hi(),uy();var t=n.exports=r.tls;t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(y){y.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,y.cipher_type=t.CipherType.block,y.enc_key_length=16,y.block_length=16,y.fixed_iv_length=16,y.record_iv_length=16,y.mac_algorithm=t.MACAlgorithm.hmac_sha1,y.mac_length=20,y.mac_key_length=20},initConnectionState:i},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(y){y.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,y.cipher_type=t.CipherType.block,y.enc_key_length=32,y.block_length=16,y.fixed_iv_length=16,y.record_iv_length=16,y.mac_algorithm=t.MACAlgorithm.hmac_sha1,y.mac_length=20,y.mac_key_length=20},initConnectionState:i};function i(y,c,g){var I=c.entity===r.tls.ConnectionEnd.client;y.read.cipherState={init:!1,cipher:r.cipher.createDecipher("AES-CBC",I?g.keys.server_write_key:g.keys.client_write_key),iv:I?g.keys.server_write_IV:g.keys.client_write_IV},y.write.cipherState={init:!1,cipher:r.cipher.createCipher("AES-CBC",I?g.keys.client_write_key:g.keys.server_write_key),iv:I?g.keys.client_write_IV:g.keys.server_write_IV},y.read.cipherFunction=s,y.write.cipherFunction=o,y.read.macLength=y.write.macLength=g.mac_length,y.read.macFunction=y.write.macFunction=t.hmac_sha1}function o(y,c){var g=!1,I=c.macFunction(c.macKey,c.sequenceNumber,y);y.fragment.putBytes(I),c.updateSequenceNumber();var w;y.version.minor===t.Versions.TLS_1_0.minor?w=c.cipherState.init?null:c.cipherState.iv:w=r.random.getBytesSync(16),c.cipherState.init=!0;var m=c.cipherState.cipher;return m.start({iv:w}),y.version.minor>=t.Versions.TLS_1_1.minor&&m.output.putBytes(w),m.update(y.fragment),m.finish(l)&&(y.fragment=m.output,y.length=y.fragment.length(),g=!0),g}function l(y,c,g){if(!g){var I=y-c.length()%y;c.fillWithByte(I-1,I)}return!0}function u(y,c,g){var I=!0;if(g){for(var w=c.length(),m=c.last(),S=w-1-m;S=m?(y.fragment=w.output.getBytes(B-m),S=w.output.getBytes(m)):y.fragment=w.output.getBytes(),y.fragment=r.util.createBuffer(y.fragment),y.length=y.fragment.length();var A=c.macFunction(c.macKey,c.sequenceNumber,y);return c.updateSequenceNumber(),g=a(c.macKey,S,A)&&g,g}function a(y,c,g){var I=r.hmac.create();return I.start("SHA1",y),I.update(c),c=I.digest().getBytes(),I.start(null,null),I.update(g),g=I.digest().getBytes(),c===g}}),ly=Ue((e,n)=>{var r=Fe();yn(),Ze();var t=n.exports=r.sha512=r.sha512||{};r.md.sha512=r.md.algorithms.sha512=t;var i=r.sha384=r.sha512.sha384=r.sha512.sha384||{};i.create=function(){return t.create("SHA-384")},r.md.sha384=r.md.algorithms.sha384=i,r.sha512.sha256=r.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},r.md["sha512/256"]=r.md.algorithms["sha512/256"]=r.sha512.sha256,r.sha512.sha224=r.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},r.md["sha512/224"]=r.md.algorithms["sha512/224"]=r.sha512.sha224,t.create=function(c){if(l||a(),typeof c>"u"&&(c="SHA-512"),!(c in s))throw new Error("Invalid SHA-512 algorithm: "+c);for(var g=s[c],I=null,w=r.util.createBuffer(),m=new Array(80),S=0;S<80;++S)m[S]=new Array(2);var B=64;switch(c){case"SHA-384":B=48;break;case"SHA-512/256":B=32;break;case"SHA-512/224":B=28;break}var A={algorithm:c.replace("-","").toLowerCase(),blockLength:128,digestLength:B,messageLength:0,fullMessageLength:null,messageLengthSize:16};return A.start=function(){A.messageLength=0,A.fullMessageLength=A.messageLength128=[];for(var f=A.messageLengthSize/4,b=0;b>>0,E>>>0];for(var R=A.fullMessageLength.length-1;R>=0;--R)A.fullMessageLength[R]+=E[1],E[1]=E[0]+(A.fullMessageLength[R]/4294967296>>>0),A.fullMessageLength[R]=A.fullMessageLength[R]>>>0,E[0]=E[1]/4294967296>>>0;return w.putBytes(f),y(I,m,w),(w.read>2048||w.length()===0)&&w.compact(),A},A.digest=function(){var f=r.util.createBuffer();f.putBytes(w.bytes());var b=A.fullMessageLength[A.fullMessageLength.length-1]+A.messageLengthSize,E=b&A.blockLength-1;f.putBytes(o.substr(0,A.blockLength-E));for(var R,P,C=A.fullMessageLength[0]*8,d=0;d>>0,C+=P,f.putInt32(C>>>0),C=R>>>0;f.putInt32(C);for(var h=new Array(I.length),d=0;d=128;){for(fe=0;fe<16;++fe)g[fe][0]=I.getInt32()>>>0,g[fe][1]=I.getInt32()>>>0;for(;fe<80;++fe)Ve=g[fe-2],Pe=Ve[0],ce=Ve[1],w=((Pe>>>19|ce<<13)^(ce>>>29|Pe<<3)^Pe>>>6)>>>0,m=((Pe<<13|ce>>>19)^(ce<<3|Pe>>>29)^(Pe<<26|ce>>>6))>>>0,k=g[fe-15],Pe=k[0],ce=k[1],S=((Pe>>>1|ce<<31)^(Pe>>>8|ce<<24)^Pe>>>7)>>>0,B=((Pe<<31|ce>>>1)^(Pe<<24|ce>>>8)^(Pe<<25|ce>>>7))>>>0,De=g[fe-7],$=g[fe-16],ce=m+De[1]+B+$[1],g[fe][0]=w+De[0]+S+$[0]+(ce/4294967296>>>0)>>>0,g[fe][1]=ce>>>0;for(h=c[0][0],U=c[0][1],j=c[1][0],M=c[1][1],v=c[2][0],N=c[2][1],L=c[3][0],O=c[3][1],K=c[4][0],Y=c[4][1],te=c[5][0],re=c[5][1],oe=c[6][0],be=c[6][1],Ce=c[7][0],ke=c[7][1],fe=0;fe<80;++fe)b=((K>>>14|Y<<18)^(K>>>18|Y<<14)^(Y>>>9|K<<23))>>>0,E=((K<<18|Y>>>14)^(K<<14|Y>>>18)^(Y<<23|K>>>9))>>>0,R=(oe^K&(te^oe))>>>0,P=(be^Y&(re^be))>>>0,A=((h>>>28|U<<4)^(U>>>2|h<<30)^(U>>>7|h<<25))>>>0,f=((h<<4|U>>>28)^(U<<30|h>>>2)^(U<<25|h>>>7))>>>0,C=(h&j|v&(h^j))>>>0,d=(U&M|N&(U^M))>>>0,ce=ke+E+P+u[fe][1]+g[fe][1],w=Ce+b+R+u[fe][0]+g[fe][0]+(ce/4294967296>>>0)>>>0,m=ce>>>0,ce=f+d,S=A+C+(ce/4294967296>>>0)>>>0,B=ce>>>0,Ce=oe,ke=be,oe=te,be=re,te=K,re=Y,ce=O+m,K=L+w+(ce/4294967296>>>0)>>>0,Y=ce>>>0,L=v,O=N,v=j,N=M,j=h,M=U,ce=m+B,h=w+S+(ce/4294967296>>>0)>>>0,U=ce>>>0;ce=c[0][1]+U,c[0][0]=c[0][0]+h+(ce/4294967296>>>0)>>>0,c[0][1]=ce>>>0,ce=c[1][1]+M,c[1][0]=c[1][0]+j+(ce/4294967296>>>0)>>>0,c[1][1]=ce>>>0,ce=c[2][1]+N,c[2][0]=c[2][0]+v+(ce/4294967296>>>0)>>>0,c[2][1]=ce>>>0,ce=c[3][1]+O,c[3][0]=c[3][0]+L+(ce/4294967296>>>0)>>>0,c[3][1]=ce>>>0,ce=c[4][1]+Y,c[4][0]=c[4][0]+K+(ce/4294967296>>>0)>>>0,c[4][1]=ce>>>0,ce=c[5][1]+re,c[5][0]=c[5][0]+te+(ce/4294967296>>>0)>>>0,c[5][1]=ce>>>0,ce=c[6][1]+be,c[6][0]=c[6][0]+oe+(ce/4294967296>>>0)>>>0,c[6][1]=ce>>>0,ce=c[7][1]+ke,c[7][0]=c[7][0]+Ce+(ce/4294967296>>>0)>>>0,c[7][1]=ce>>>0,V-=128}}}),w_=Ue(e=>{var n=Fe();en();var r=n.asn1;e.privateKeyValidator={name:"PrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},e.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}}),S_=Ue((e,n)=>{var r=Fe();Ns(),Fr(),ly(),Ze();var t=w_(),i=t.publicKeyValidator,o=t.privateKeyValidator;typeof l>"u"&&(l=r.jsbn.BigInteger);var l,u=r.util.ByteBuffer,s=typeof Buffer>"u"?Uint8Array:Buffer;r.pki=r.pki||{},n.exports=r.pki.ed25519=r.ed25519=r.ed25519||{};var a=r.ed25519;a.constants={},a.constants.PUBLIC_KEY_BYTE_LENGTH=32,a.constants.PRIVATE_KEY_BYTE_LENGTH=64,a.constants.SEED_BYTE_LENGTH=32,a.constants.SIGN_BYTE_LENGTH=64,a.constants.HASH_BYTE_LENGTH=64,a.generateKeyPair=function(k){k=k||{};var $=k.seed;if($===void 0)$=r.random.getBytesSync(a.constants.SEED_BYTE_LENGTH);else if(typeof $=="string"){if($.length!==a.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+a.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!($ instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');$=y({message:$,encoding:"binary"});for(var V=new s(a.constants.PUBLIC_KEY_BYTE_LENGTH),_=new s(a.constants.PRIVATE_KEY_BYTE_LENGTH),D=0;D<32;++D)_[D]=$[D];return b(V,_),{publicKey:V,privateKey:_}},a.privateKeyFromAsn1=function(k){var $={},V=[],_=r.asn1.validate(k,o,$,V);if(!_){var D=new Error("Invalid Key.");throw D.errors=V,D}var G=r.asn1.derToOid($.privateKeyOid),z=r.oids.EdDSA25519;if(G!==z)throw new Error('Invalid OID "'+G+'"; OID must be "'+z+'".');var se=$.privateKey,me=y({message:r.asn1.fromDer(se).value,encoding:"binary"});return{privateKeyBytes:me}},a.publicKeyFromAsn1=function(k){var $={},V=[],_=r.asn1.validate(k,i,$,V);if(!_){var D=new Error("Invalid Key.");throw D.errors=V,D}var G=r.asn1.derToOid($.publicKeyOid),z=r.oids.EdDSA25519;if(G!==z)throw new Error('Invalid OID "'+G+'"; OID must be "'+z+'".');var se=$.ed25519PublicKey;if(se.length!==a.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return y({message:se,encoding:"binary"})},a.publicKeyFromPrivateKey=function(k){k=k||{};var $=y({message:k.privateKey,encoding:"binary"});if($.length!==a.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+a.constants.PRIVATE_KEY_BYTE_LENGTH);for(var V=new s(a.constants.PUBLIC_KEY_BYTE_LENGTH),_=0;_=0};function y(k){var $=k.message;if($ instanceof Uint8Array||$ instanceof s)return $;var V=k.encoding;if($===void 0)if(k.md)$=k.md.digest().getBytes(),V="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof $=="string"&&!V)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof $=="string"){if(typeof Buffer<"u")return Buffer.from($,V);$=new u($,V)}else if(!($ instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var _=new s($.length()),D=0;D<_.length;++D)_[D]=$.at(D);return _}var c=fe(),g=fe([1]),I=fe([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),w=fe([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=fe([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),S=fe([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),B=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),A=fe([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function f(k,$){var V=r.md.sha512.create(),_=new u(k);V.update(_.getBytes($),"binary");var D=V.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(D,"binary");for(var G=new s(a.constants.HASH_BYTE_LENGTH),z=0;z<64;++z)G[z]=D.charCodeAt(z);return G}function b(k,$){var V=[fe(),fe(),fe(),fe()],_,D=f($,32);for(D[0]&=248,D[31]&=127,D[31]|=64,re(V,D),U(k,V),_=0;_<32;++_)$[_+32]=k[_];return 0}function E(k,$,V,_){var D,G,z=new Float64Array(64),se=[fe(),fe(),fe(),fe()],me=f(_,32);me[0]&=248,me[31]&=127,me[31]|=64;var Te=V+64;for(D=0;D=32;--_){for(V=0,D=_-32,G=_-12;D>8,$[D]-=V*256;$[D]+=V,$[_]=0}for(V=0,D=0;D<32;++D)$[D]+=V-($[31]>>4)*B[D],V=$[D]>>8,$[D]&=255;for(D=0;D<32;++D)$[D]-=V*B[D];for(_=0;_<32;++_)$[_+1]+=$[_]>>8,k[_]=$[_]&255}function C(k){for(var $=new Float64Array(64),V=0;V<64;++V)$[V]=k[V],k[V]=0;P(k,$)}function d(k,$){var V=fe(),_=fe(),D=fe(),G=fe(),z=fe(),se=fe(),me=fe(),Te=fe(),ae=fe();ce(V,k[1],k[0]),ce(ae,$[1],$[0]),De(V,V,ae),Pe(_,k[0],k[1]),Pe(ae,$[0],$[1]),De(_,_,ae),De(D,k[3],$[3]),De(D,D,w),De(G,k[2],$[2]),Pe(G,G,G),ce(z,_,V),ce(se,G,D),Pe(me,G,D),Pe(Te,_,V),De(k[0],z,se),De(k[1],Te,me),De(k[2],me,se),De(k[3],z,Te)}function h(k,$,V){for(var _=0;_<4;++_)ke(k[_],$[_],V)}function U(k,$){var V=fe(),_=fe(),D=fe();be(D,$[2]),De(V,$[0],D),De(_,$[1],D),j(k,_),k[31]^=Y(V)<<7}function j(k,$){var V,_,D,G=fe(),z=fe();for(V=0;V<16;++V)z[V]=$[V];for(Ce(z),Ce(z),Ce(z),_=0;_<2;++_){for(G[0]=z[0]-65517,V=1;V<15;++V)G[V]=z[V]-65535-(G[V-1]>>16&1),G[V-1]&=65535;G[15]=z[15]-32767-(G[14]>>16&1),D=G[15]>>16&1,G[14]&=65535,ke(z,G,1-D)}for(V=0;V<16;V++)k[2*V]=z[V]&255,k[2*V+1]=z[V]>>8}function M(k,$){var V=fe(),_=fe(),D=fe(),G=fe(),z=fe(),se=fe(),me=fe();return oe(k[2],g),v(k[1],$),Ve(D,k[1]),De(G,D,I),ce(D,D,k[2]),Pe(G,k[2],G),Ve(z,G),Ve(se,z),De(me,se,z),De(V,me,D),De(V,V,G),N(V,V),De(V,V,D),De(V,V,G),De(V,V,G),De(k[0],V,G),Ve(_,k[0]),De(_,_,G),L(_,D)&&De(k[0],k[0],A),Ve(_,k[0]),De(_,_,G),L(_,D)?-1:(Y(k[0])===$[31]>>7&&ce(k[0],c,k[0]),De(k[3],k[0],k[1]),0)}function v(k,$){var V;for(V=0;V<16;++V)k[V]=$[2*V]+($[2*V+1]<<8);k[15]&=32767}function N(k,$){var V=fe(),_;for(_=0;_<16;++_)V[_]=$[_];for(_=250;_>=0;--_)Ve(V,V),_!==1&&De(V,V,$);for(_=0;_<16;++_)k[_]=V[_]}function L(k,$){var V=new s(32),_=new s(32);return j(V,k),j(_,$),O(V,0,_,0)}function O(k,$,V,_){return K(k,$,V,_,32)}function K(k,$,V,_,D){var G,z=0;for(G=0;G>>8)-1}function Y(k){var $=new s(32);return j($,k),$[0]&1}function te(k,$,V){var _,D;for(oe(k[0],c),oe(k[1],g),oe(k[2],g),oe(k[3],c),D=255;D>=0;--D)_=V[D/8|0]>>(D&7)&1,h(k,$,_),d($,k),d(k,k),h(k,$,_)}function re(k,$){var V=[fe(),fe(),fe(),fe()];oe(V[0],m),oe(V[1],S),oe(V[2],g),De(V[3],m,S),te(k,V,$)}function oe(k,$){var V;for(V=0;V<16;V++)k[V]=$[V]|0}function be(k,$){var V=fe(),_;for(_=0;_<16;++_)V[_]=$[_];for(_=253;_>=0;--_)Ve(V,V),_!==2&&_!==4&&De(V,V,$);for(_=0;_<16;++_)k[_]=V[_]}function Ce(k){var $,V,_=1;for($=0;$<16;++$)V=k[$]+_+65535,_=Math.floor(V/65536),k[$]=V-_*65536;k[0]+=_-1+37*(_-1)}function ke(k,$,V){for(var _,D=~(V-1),G=0;G<16;++G)_=D&(k[G]^$[G]),k[G]^=_,$[G]^=_}function fe(k){var $,V=new Float64Array(16);if(k)for($=0;${var r=Fe();Ze(),Fr(),Ns(),n.exports=r.kem=r.kem||{};var t=r.jsbn.BigInteger;r.kem.rsa={},r.kem.rsa.create=function(o,l){l=l||{};var u=l.prng||r.random,s={};return s.encrypt=function(a,y){var c=Math.ceil(a.n.bitLength()/8),g;do g=new t(r.util.bytesToHex(u.getBytesSync(c)),16).mod(a.n);while(g.compareTo(t.ONE)<=0);g=r.util.hexToBytes(g.toString(16));var I=c-g.length;I>0&&(g=r.util.fillString(String.fromCharCode(0),I)+g);var w=a.encrypt(g,"NONE"),m=o.generate(g,y);return{encapsulation:w,key:m}},s.decrypt=function(a,y,c){var g=a.decrypt(y,"NONE");return o.generate(g,c)},s},r.kem.kdf1=function(o,l){i(this,o,0,l||o.digestLength)},r.kem.kdf2=function(o,l){i(this,o,1,l||o.digestLength)};function i(o,l,u,s){o.generate=function(a,y){for(var c=new r.util.ByteBuffer,g=Math.ceil(y/s)+u,I=new r.util.ByteBuffer,w=u;w{var r=Fe();Ze(),n.exports=r.log=r.log||{},r.log.levels=["none","error","warning","info","debug","verbose","max"];var t={},i=[],o=null;for(r.log.LEVEL_LOCKED=1<<1,r.log.NO_LEVEL_CHECK=1<<2,r.log.INTERPOLATE=1<<3,s=0;s"u"||m?w.flags|=r.log.LEVEL_LOCKED:w.flags&=~r.log.LEVEL_LOCKED},r.log.addLogger=function(w){i.push(w)},typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(y={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},c=function(w,m){r.log.prepareStandard(m);var S=y[m.level],B=[m.standard];B=B.concat(m.arguments.slice()),S.apply(console,B)},a=r.log.makeLogger(c)):(c=function(w,m){r.log.prepareStandardFull(m),console.log(m.standardFull)},a=r.log.makeLogger(c)),r.log.setLevel(a,"debug"),r.log.addLogger(a),o=a):console={log:function(){}};var a,y,c;o!==null&&typeof window<"u"&&window.location&&(g=new URL(window.location.href).searchParams,g.has("console.level")&&r.log.setLevel(o,g.get("console.level").slice(-1)[0]),g.has("console.lock")&&(I=g.get("console.lock").slice(-1)[0],I=="true"&&r.log.lock(o)));var g,I;r.log.consoleLogger=o}),T_=Ue((e,n)=>{n.exports=yn(),ac(),xa(),Zp(),ly()}),I_=Ue((e,n)=>{var r=Fe();hi(),en(),Ps(),fi(),Qi(),iy(),Fr(),Ze(),uc();var t=r.asn1,i=n.exports=r.pkcs7=r.pkcs7||{};i.messageFromPem=function(m){var S=r.pem.decode(m)[0];if(S.type!=="PKCS7"){var B=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw B.headerType=S.type,B}if(S.procType&&S.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var A=t.fromDer(S.body);return i.messageFromAsn1(A)},i.messageToPem=function(m,S){var B={type:"PKCS7",body:t.toDer(m.toAsn1()).getBytes()};return r.pem.encode(B,{maxline:S})},i.messageFromAsn1=function(m){var S={},B=[];if(!t.validate(m,i.asn1.contentInfoValidator,S,B)){var A=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw A.errors=B,A}var f=t.derToOid(S.contentType),b;switch(f){case r.pki.oids.envelopedData:b=i.createEnvelopedData();break;case r.pki.oids.encryptedData:b=i.createEncryptedData();break;case r.pki.oids.signedData:b=i.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+f+" is not (yet) supported.")}return b.fromAsn1(S.content.value[0]),b},i.createSignedData=function(){var m=null;return m={type:r.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(A){if(I(m,A,i.asn1.signedDataValidator),m.certificates=[],m.crls=[],m.digestAlgorithmIdentifiers=[],m.contentInfo=null,m.signerInfos=[],m.rawCapture.certificates)for(var f=m.rawCapture.certificates.value,b=0;b0&&E.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,A)),b.length>0&&E.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,b)),E.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,m.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(m.type).getBytes()),E])},addSigner:function(A){var f=A.issuer,b=A.serialNumber;if(A.certificate){var E=A.certificate;typeof E=="string"&&(E=r.pki.certificateFromPem(E)),f=E.issuer.attributes,b=E.serialNumber}var R=A.key;if(!R)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof R=="string"&&(R=r.pki.privateKeyFromPem(R));var P=A.digestAlgorithm||r.pki.oids.sha1;switch(P){case r.pki.oids.sha1:case r.pki.oids.sha256:case r.pki.oids.sha384:case r.pki.oids.sha512:case r.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+P)}var C=A.authenticatedAttributes||[];if(C.length>0){for(var d=!1,h=!1,U=0;U0){for(var B=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),A=0;A=B&&f{var r=Fe();hi(),Da(),ac(),xa(),Ze();var t=n.exports=r.ssh=r.ssh||{};t.privateKeyToPutty=function(u,s,a){a=a||"",s=s||"";var y="ssh-rsa",c=s===""?"none":"aes256-cbc",g="PuTTY-User-Key-File-2: "+y+`\r -`;g+="Encryption: "+c+`\r -`,g+="Comment: "+a+`\r -`;var I=r.util.createBuffer();o(I,y),i(I,u.e),i(I,u.n);var w=r.util.encode64(I.bytes(),64),m=Math.floor(w.length/66)+1;g+="Public-Lines: "+m+`\r -`,g+=w;var S=r.util.createBuffer();i(S,u.d),i(S,u.p),i(S,u.q),i(S,u.qInv);var B;if(!s)B=r.util.encode64(S.bytes(),64);else{var A=S.length()+16-1;A-=A%16;var f=l(S.bytes());f.truncate(f.length()-A+S.length()),S.putBuffer(f);var b=r.util.createBuffer();b.putBuffer(l("\0\0\0\0",s)),b.putBuffer(l("\0\0\0",s));var E=r.aes.createEncryptionCipher(b.truncate(8),"CBC");E.start(r.util.createBuffer().fillWithByte(0,16)),E.update(S.copy()),E.finish();var R=E.output;R.truncate(16),B=r.util.encode64(R.bytes(),64)}m=Math.floor(B.length/66)+1,g+=`\r -Private-Lines: `+m+`\r -`,g+=B;var P=l("putty-private-key-file-mac-key",s),C=r.util.createBuffer();o(C,y),o(C,c),o(C,a),C.putInt32(I.length()),C.putBuffer(I),C.putInt32(S.length()),C.putBuffer(S);var d=r.hmac.create();return d.start("sha1",P),d.update(C.bytes()),g+=`\r -Private-MAC: `+d.digest().toHex()+`\r -`,g},t.publicKeyToOpenSSH=function(u,s){var a="ssh-rsa";s=s||"";var y=r.util.createBuffer();return o(y,a),i(y,u.e),i(y,u.n),a+" "+r.util.encode64(y.bytes())+" "+s},t.privateKeyToOpenSSH=function(u,s){return s?r.pki.encryptRsaPrivateKey(u,s,{legacy:!0,algorithm:"aes128"}):r.pki.privateKeyToPem(u)},t.getPublicKeyFingerprint=function(u,s){s=s||{};var a=s.md||r.md.md5.create(),y="ssh-rsa",c=r.util.createBuffer();o(c,y),i(c,u.e),i(c,u.n),a.start(),a.update(c.getBytes());var g=a.digest();if(s.encoding==="hex"){var I=g.toHex();return s.delimiter?I.match(/.{2}/g).join(s.delimiter):I}else{if(s.encoding==="binary")return g.getBytes();if(s.encoding)throw new Error('Unknown encoding "'+s.encoding+'".')}return g};function i(u,s){var a=s.toString(16);a[0]>="8"&&(a="00"+a);var y=r.util.hexToBytes(a);u.putInt32(y.length),u.putBytes(y)}function o(u,s){u.putInt32(s.length),u.putString(s)}function l(){for(var u=r.md.sha1.create(),s=arguments.length,a=0;a{n.exports=Fe(),hi(),__(),en(),ic(),Ps(),S_(),Da(),E_(),C_(),T_(),ay(),oc(),Qi(),ty(),oy(),I_(),sy(),ry(),Jp(),sc(),Fr(),ey(),R_(),uy(),Ze()});function A_(e,n){return hy(n,(r,t)=>`${e}/${t}`)}function hy(e,n=(r,t)=>`${r}: ${t}`){return Object.entries(e).reduce((r,[t,i])=>(r[t]=n(t,i),r),{})}var Ls={Itero:"https://itero.plasmo.com"},B_={Base:"/api/chrome-policy",Hash:"/api/chrome-policy/hash"},RS=A_(Ls.Itero,B_),AS=Gi(c_(),1),Gf=65536;async function*Wu(e,n=!0){for(let r of e)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(n){let t=r.byteOffset,i=r.byteOffset+r.byteLength;for(;t!==i;){let o=Math.min(i-t,Gf),l=r.buffer.slice(t,t+o);t+=l.byteLength,yield new Uint8Array(l)}}else yield r;else{let t=0,i=r;for(;t!==i.size;){let o=await i.slice(t,Math.min(i.size,t+Gf)).arrayBuffer();t+=o.byteLength,yield new Uint8Array(o)}}}var Rn,Go,Ni,Gu,Qo,fy=(Qo=class{constructor(e=[],n={}){if(si(this,Rn,[]),si(this,Go,""),si(this,Ni,0),si(this,Gu,"transparent"),typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&typeof n!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");n===null&&(n={});let r=new TextEncoder;for(let i of e){let o;ArrayBuffer.isView(i)?o=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):i instanceof ArrayBuffer?o=new Uint8Array(i.slice(0)):i instanceof Qo?o=i:o=r.encode(`${i}`),Pn(this,Ni,zt(this,Ni)+(ArrayBuffer.isView(o)?o.byteLength:o.size)),zt(this,Rn).push(o)}Pn(this,Gu,`${n.endings===void 0?"transparent":n.endings}`);let t=n.type===void 0?"":String(n.type);Pn(this,Go,/^[\x20-\x7E]*$/.test(t)?t:"")}get size(){return zt(this,Ni)}get type(){return zt(this,Go)}async text(){let e=new TextDecoder,n="";for await(let r of Wu(zt(this,Rn),!1))n+=e.decode(r,{stream:!0});return n+=e.decode(),n}async arrayBuffer(){let e=new Uint8Array(this.size),n=0;for await(let r of Wu(zt(this,Rn),!1))e.set(r,n),n+=r.length;return e.buffer}stream(){let e=Wu(zt(this,Rn),!0);return new globalThis.ReadableStream({type:"bytes",async pull(n){let r=await e.next();r.done?n.close():n.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,n=this.size,r=""){let{size:t}=this,i=e<0?Math.max(t+e,0):Math.min(e,t),o=n<0?Math.max(t+n,0):Math.min(n,t),l=Math.max(o-i,0),u=zt(this,Rn),s=[],a=0;for(let c of u){if(a>=l)break;let g=ArrayBuffer.isView(c)?c.byteLength:c.size;if(i&&g<=i)i-=g,o-=g;else{let I;ArrayBuffer.isView(c)?(I=c.subarray(i,Math.min(g,o)),a+=I.byteLength):(I=c.slice(i,Math.min(g,o)),a+=I.size),o-=g,s.push(I),i=0}}let y=new Qo([],{type:String(r).toLowerCase()});return Pn(y,Ni,l),Pn(y,Rn,s),y}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},Rn=new WeakMap,Go=new WeakMap,Ni=new WeakMap,Gu=new WeakMap,Qo);Object.defineProperties(fy.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});var k_=fy,rs=k_,P_=(0,t_.createRequire)("/"),N_;try{N_=P_("worker_threads").Worker}catch{}var Dt=Uint8Array,br=Uint16Array,Us=Uint32Array,Ds=new Dt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xs=new Dt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gl=new Dt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dy=function(e,n){for(var r=new br(31),t=0;t<31;++t)r[t]=n+=1<>>1|(nt&21845)<<1,sn=(sn&52428)>>>2|(sn&13107)<<2,sn=(sn&61680)>>>4|(sn&3855)<<4,vl[nt]=((sn&65280)>>>8|(sn&255)<<8)>>>1;var sn,nt,Zr=function(e,n,r){for(var t=e.length,i=0,o=new br(n);i>>s]=a}else for(u=new br(t),i=0;i>>15-e[i]);return u},Ln=new Dt(288);for(nt=0;nt<144;++nt)Ln[nt]=8;var nt;for(nt=144;nt<256;++nt)Ln[nt]=9;var nt;for(nt=256;nt<280;++nt)Ln[nt]=7;var nt;for(nt=280;nt<288;++nt)Ln[nt]=8;var nt,Ra=new Dt(32);for(nt=0;nt<32;++nt)Ra[nt]=5;var nt,L_=Zr(Ln,9,0),U_=Zr(Ln,9,1),D_=Zr(Ra,5,0),x_=Zr(Ra,5,1),Qu=function(e){for(var n=e[0],r=1;rn&&(n=e[r]);return n},Dr=function(e,n,r){var t=n/8|0;return(e[t]|e[t+1]<<8)>>(n&7)&r},Xu=function(e,n){var r=n/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(n&7)},lc=function(e){return(e+7)/8|0},qa=function(e,n,r){(n==null||n<0)&&(n=0),(r==null||r>e.length)&&(r=e.length);var t=new(e.BYTES_PER_ELEMENT==2?br:e.BYTES_PER_ELEMENT==4?Us:Dt)(r-n);return t.set(e.subarray(n,r)),t},q_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],mr=function(e,n,r){var t=new Error(n||q_[e]);if(t.code=e,Error.captureStackTrace&&Error.captureStackTrace(t,mr),!r)throw t;return t},j_=function(e,n,r){var t=e.length;if(!t||r&&r.f&&!r.l)return n||new Dt(0);var i=!n||r,o=!r||r.i;r||(r={}),n||(n=new Dt(t*3));var l=function(fe){var Pe=n.length;if(fe>Pe){var ce=new Dt(Math.max(Pe*2,fe));ce.set(n),n=ce}},u=r.f||0,s=r.p||0,a=r.b||0,y=r.l,c=r.d,g=r.m,I=r.n,w=t*8;do{if(!y){u=Dr(e,s,1);var m=Dr(e,s+1,3);if(s+=3,m)if(m==1)y=U_,c=x_,g=9,I=5;else if(m==2){var S=Dr(e,s,31)+257,B=Dr(e,s+10,15)+4,A=S+Dr(e,s+5,31)+1;s+=14;for(var f=new Dt(A),b=new Dt(19),E=0;E>>4;if(h<16)f[E++]=h;else{var U=0,j=0;for(h==16?(j=3+Dr(e,s,3),s+=2,U=f[E-1]):h==17?(j=3+Dr(e,s,7),s+=3):h==18&&(j=11+Dr(e,s,127),s+=7);j--;)f[E++]=U}}var M=f.subarray(0,S),v=f.subarray(S);g=Qu(M),I=Qu(v),y=Zr(M,g,1),c=Zr(v,I,1)}else mr(1);else{var h=lc(s)+4,N=e[h-4]|e[h-3]<<8,L=h+N;if(L>t){o&&mr(0);break}i&&l(a+N),n.set(e.subarray(h,L),a),r.b=a+=N,r.p=s=L*8,r.f=u;continue}if(s>w){o&&mr(0);break}}i&&l(a+131072);for(var O=(1<>>4;if(s+=U&15,s>w){o&&mr(0);break}if(U||mr(2),te<256)n[a++]=te;else if(te==256){Y=s,y=null;break}else{var re=te-254;if(te>264){var E=te-257,oe=Ds[E];re=Dr(e,s,(1<>>4;be||mr(3),s+=be&15;var v=O_[Ce];if(Ce>3){var oe=xs[Ce];v+=Xu(e,s)&(1<w){o&&mr(0);break}i&&l(a+131072);for(var ke=a+re;a>>8},da=function(e,n,r){r<<=n&7;var t=n/8|0;e[t]|=r,e[t+1]|=r>>>8,e[t+2]|=r>>>16},Yu=function(e,n){for(var r=[],t=0;tg&&(g=o[t].s);var I=new br(g+1),w=bl(r[y-1],I,0);if(w>n){var t=0,m=0,S=w-n,B=1<n)m+=B-(1<>>=S;m>0;){var f=o[t].s;I[f]=0&&m;--t){var b=o[t].s;I[b]==n&&(--I[b],++m)}w=n}return[new Dt(I),w]},bl=function(e,n,r){return e.s==-1?Math.max(bl(e.l,n,r+1),bl(e.r,n,r+1)):n[e.s]=r},Xf=function(e){for(var n=e.length;n&&!e[--n];);for(var r=new br(++n),t=0,i=e[0],o=1,l=function(s){r[t++]=s},u=1;u<=n;++u)if(e[u]==i&&u!=n)++o;else{if(!i&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(i),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(i);o=1,i=e[u]}return[r.subarray(0,t),n]},pa=function(e,n){for(var r=0,t=0;t>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o4&&!h[gl[j-1]];--j);var M=a+5<<3,v=pa(i,Ln)+pa(o,Ra)+l,N=pa(i,g)+pa(o,m)+l+14+3*j+pa(P,h)+(2*P[16]+3*P[17]+7*P[18]);if(M<=v&&M<=N)return _l(n,y,e.subarray(s,s+a));var L,O,K,Y;if(un(n,y,1+(N15&&(un(n,y,be[C]>>>5&127),y+=be[C]>>>12)}}else L=L_,O=Ln,K=D_,Y=Ra;for(var C=0;C255){var Ce=t[C]>>>18&31;da(n,y,L[Ce+257]),y+=O[Ce+257],Ce>7&&(un(n,y,t[C]>>>23&31),y+=Ds[Ce]);var ke=t[C]&31;da(n,y,K[ke]),y+=Y[ke],ke>3&&(da(n,y,t[C]>>>5&8191),y+=xs[ke])}else da(n,y,L[t[C]]),y+=O[t[C]];return da(n,y,L[256]),y+O[256]},M_=new Us([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),cc=new Dt(0),V_=function(e,n,r,t,i,o){var l=e.length,u=new Dt(t+l+5*(1+Math.ceil(l/7e3))+i),s=u.subarray(t,u.length-i),a=0;if(!n||l<8)for(var y=0;y<=l;y+=65535){var c=y+65535;c>=l&&(s[a>>3]=o),a=_l(s,a+1,e.subarray(y,c))}else{for(var g=M_[n-1],I=g>>>13,w=g&8191,m=(1<7e3||h>24576)&&L>423){a=Yf(e,s,0,E,R,P,d,h,j,y-j,a),h=C=d=0,j=y;for(var O=0;O<286;++O)R[O]=0;for(var O=0;O<30;++O)P[O]=0}var K=2,Y=0,te=w,re=v-N&32767;if(L>2&&M==b(y-re))for(var oe=Math.min(I,L)-1,be=Math.min(32767,y),Ce=Math.min(258,L);re<=be&&--te&&v!=N;){if(e[y+K]==e[y+K-re]){for(var ke=0;keK){if(K=ke,Y=re,ke>oe)break;for(var fe=Math.min(re,ke-2),Pe=0,O=0;OPe&&(Pe=De,N=ce)}}}v=N,N=S[v],re+=v-N+32768&32767}if(Y){E[h++]=268435456|ml[K]<<18|Qf[Y];var k=ml[K]&31,$=Qf[Y]&31;d+=Ds[k]+xs[$],++R[257+k],++P[$],U=y+K,++C}else E[h++]=e[y],++R[e[y]]}}a=Yf(e,s,o,E,R,P,d,h,j,y-j,a),!o&&a&7&&(a=_l(s,a+1,cc))}return qa(u,0,t+lc(a)+i)},F_=function(){for(var e=new Int32Array(256),n=0;n<256;++n){for(var r=n,t=9;--t;)r=(r&1&&-306674912)^r>>>1;e[n]=r}return e}(),K_=function(){var e=-1;return{p:function(n){for(var r=e,t=0;t>>8;e=r},d:function(){return~e}}},$_=function(e,n,r,t,i){return V_(e,n.level==null?6:n.level,n.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+n.mem,r,t,!i)},my=function(e,n){var r={};for(var t in e)r[t]=e[t];for(var t in n)r[t]=n[t];return r},Xr=function(e,n){return e[n]|e[n+1]<<8},jr=function(e,n){return(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24)>>>0},Zu=function(e,n){return jr(e,n)+jr(e,n+4)*4294967296},Zt=function(e,n,r){for(;r;++n)e[n]=r,r>>>=8};function H_(e,n){return $_(e,n||{},0,0)}function z_(e,n){return j_(e,n)}var vy=function(e,n,r,t){for(var i in e){var o=e[i],l=n+i,u=t;Array.isArray(o)&&(u=my(t,o[1]),o=o[0]),o instanceof Dt?r[l]=[o,u]:(r[l+="/"]=[new Dt(0),u],vy(o,l,r,t))}},Zf=typeof TextEncoder<"u"&&new TextEncoder,wl=typeof TextDecoder<"u"&&new TextDecoder,W_=0;try{wl.decode(cc,{stream:!0}),W_=1}catch{}var G_=function(e){for(var n="",r=0;;){var t=e[r++],i=(t>127)+(t>223)+(t>239);if(r+i>e.length)return[n,qa(e,r-1)];i?i==3?(t=((t&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|t>>10,56320|t&1023)):i&1?n+=String.fromCharCode((t&31)<<6|e[r++]&63):n+=String.fromCharCode((t&15)<<12|(e[r++]&63)<<6|e[r++]&63):n+=String.fromCharCode(t)}};function Sl(e,n){if(n){for(var r=new Dt(e.length),t=0;t>1)),l=0,u=function(c){o[l++]=c},t=0;to.length){var s=new Dt(l+8+(i-t<<1));s.set(o),o=s}var a=e.charCodeAt(t);a<128||n?u(a):a<2048?(u(192|a>>6),u(128|a&63)):a>55295&&a<57344?(a=65536+(a&1023<<10)|e.charCodeAt(++t)&1023,u(240|a>>18),u(128|a>>12&63),u(128|a>>6&63),u(128|a&63)):(u(224|a>>12),u(128|a>>6&63),u(128|a&63))}return qa(o,0,l)}function hc(e,n){if(n){for(var r="",t=0;t65535&&mr(9),n+=t+4}return n},Jf=function(e,n,r,t,i,o,l,u){var s=t.length,a=r.extra,y=u&&u.length,c=El(a);Zt(e,n,l!=null?33639248:67324752),n+=4,l!=null&&(e[n++]=20,e[n++]=r.os),e[n]=20,n+=2,e[n++]=r.flag<<1|(o<0&&8),e[n++]=i&&8,e[n++]=r.compression&255,e[n++]=r.compression>>8;var g=new Date(r.mtime==null?Date.now():r.mtime),I=g.getFullYear()-1980;if((I<0||I>119)&&mr(10),Zt(e,n,I<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>>1),n+=4,o!=-1&&(Zt(e,n,r.crc),Zt(e,n+4,o<0?-o-2:o),Zt(e,n+8,r.size)),Zt(e,n+12,s),Zt(e,n+14,c),n+=16,l!=null&&(Zt(e,n,y),Zt(e,n+6,r.attrs),Zt(e,n+10,l),n+=14),e.set(t,n),n+=s,c)for(var w in a){var m=a[w],S=m.length;Zt(e,n,+w),Zt(e,n+2,S),e.set(m,n+4),n+=4+S}return y&&(e.set(u,n),n+=y),n},Z_=function(e,n,r,t,i){Zt(e,n,101010256),Zt(e,n+8,r),Zt(e,n+10,r),Zt(e,n+12,t),Zt(e,n+16,i)};function J_(e,n){n||(n={});var r={},t=[];vy(e,"",r,n);var i=0,o=0;for(var l in r){var u=r[l],s=u[0],a=u[1],y=a.level==0?0:8,c=Sl(l),g=c.length,I=a.comment,w=I&&Sl(I),m=w&&w.length,S=El(a.extra);g>65535&&mr(11);var B=y?H_(s,a):s,A=B.length,f=K_();f.p(s),t.push(my(a,{size:s.length,crc:f.d(),c:B,f:c,m:w,u:g!=l.length||w&&I.length!=m,o:i,compression:y})),i+=30+g+S+A,o+=76+2*(g+S)+(m||0)+A}for(var b=new Dt(o+22),E=i,R=o-i,P=0;P65558)&&mr(13);var i=Xr(e,t+8);if(!i)return{};var o=jr(e,t+16),l=o==4294967295||i==65535;if(l){var u=jr(e,t-12);l=jr(e,u)==101075792,l&&(i=jr(e,u+32),o=jr(e,u+48))}for(var s=n&&n.filter,a=0;a=0,Il=Bn.indexOf("Macintosh")>=0,sw=(Bn.indexOf("Macintosh")>=0||Bn.indexOf("iPad")>=0||Bn.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ns=Bn.indexOf("Linux")>=0,_y=!0,Ju=navigator.language,Rl=Ju):typeof Sr=="object"?(Tl=Sr.platform==="win32",Il=Sr.platform==="darwin",ns=Sr.platform==="linux",iw=ns&&!!Sr.env.SNAP&&!!Sr.env.SNAP_REVISION,ow=wy,uw=!!Sr.env.CI||!!Sr.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ju=Cl,Rl=Cl,aw=!0):console.error("Unable to resolve platform.");var Ey={[1]:"Mac",[2]:"Linux",[3]:"Windows"};function lw(e){switch(e){case 0:return"Web";case 1:case 2:case 3:return Ey[e];default:nw(e)}}var is=0;Il?is=1:Tl?is=3:ns&&(is=2);var kS=Object.values(Ey),PS=lw(is),NS=_y&&typeof On.importScripts=="function",Jr=Bn,An=Rl,td;(e=>{function n(){return An}e.value=n;function r(){return An.length===2?An==="en":An.length>=3?An[0]==="e"&&An[1]==="n"&&An[2]==="-":!1}e.isDefaultVariant=r;function t(){return An==="en"}e.isDefault=t})(td||(td={}));var OS=(()=>{if(typeof On.postMessage=="function"&&!On.importScripts){let e=[];On.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let t=0,i=e.length;t{let t=++n;e.push({id:t,callback:r}),On.postMessage({vscodeScheduleAsyncWork:t},"*")}}return e=>setTimeout(e)})(),cw=!!(Jr&&Jr.indexOf("Chrome")>=0),LS=!!(Jr&&Jr.indexOf("Firefox")>=0),US=!!(!cw&&Jr&&Jr.indexOf("Safari")>=0),DS=!!(Jr&&Jr.indexOf("Edg/")>=0),xS=!!(Jr&&Jr.indexOf("Android")>=0),rd=Gi(f_()),Cy=class{static read(e,n){return e.readFields(Cy._readField,{sha256_with_rsa:[],sha256_with_ecdsa:[],signed_header_data:null},n)}static _readField(e,n,r){var t,i;!n||!r||(e===2?(t=n.sha256_with_rsa)==null||t.push(va.read(r,r.readVarint()+r.pos)):e===3?(i=n.sha256_with_ecdsa)==null||i.push(va.read(r,r.readVarint()+r.pos)):e===1e4&&(n.signed_header_data=r.readBytes()))}static write(e,n){if(!(!e||!n)){if(e.sha256_with_rsa)for(var r=0;rdw(e,n),mw=Gi(d_()),vw=Gi(m_()),bw=Gi(cy()),_w={0:"a",1:"b",2:"c",3:"d",4:"e",5:"f",6:"g",7:"h",8:"i",9:"j",a:"k",b:"l",c:"m",d:"n",e:"o",f:"p",g:"q",h:"r",i:"s",j:"t",k:"u",l:"v",m:"w",n:"x",o:"y",p:"z"},ww=e=>e.replace(/[0-9a-f]/gi,n=>_w[n]),Sw=e=>ww(mw.encode(vw.hash(bw.default.util.binary.base64.decode(e)),!0).slice(0,32)),Ew=(e,n,r)=>` - - - - -`,Cw=e=>`${Ls.Itero}/api/ext/update/${e}`,Tw=e=>`${Ls.Itero}/api/ext/install/${e}`,Iw=Gi(cy()),{pki:fn,asn1:nd}=Iw.default,Rw=(e="")=>new Promise((n,r)=>{try{if(e){let t=fn.privateKeyFromPem(e),i=fn.rsa.setPublicKey(t.n,t.e);n({privateKey:t,publicKey:i})}else fn.rsa.generateKeyPair({bits:2048,workers:2},(t,i)=>{n(i)})}catch(t){r(t)}}),Aw=e=>{let n=fn.privateKeyToAsn1(e),r=fn.wrapRsaPrivateKey(n);return fn.privateKeyInfoToPem(r)},Bw=async(e="")=>{let{publicKey:n,privateKey:r}=await Rw(e);return{text:{public:()=>kw(fn.publicKeyToPem(n)),private:()=>Aw(r)},binary:{public:()=>Buffer.from(nd.toDer(fn.publicKeyToAsn1(n)).getBytes(),"binary"),private:()=>Buffer.from(nd.toDer(fn.privateKeyToAsn1(r)).getBytes(),"binary")}}},kw=(e,n=!1)=>{let r=n?"PRIVATE":"PUBLIC";return e.replace(`-----BEGIN ${r} KEY-----`,"").replace(`-----END ${r} KEY-----`,"").replace(/\n|\r/g,"").trim()},Pw=(e,n)=>{if(!e.icons)return null;let r=["128","64","48","16"].find(s=>s in e.icons);if(!r)return null;let t=e.icons[r],i=(0,r_.extname)(t).slice(1);if(!rw.has(i))return null;let o=by[i],l=Buffer.from(n[t]),u=new rs([l],{type:o});return{path:t,type:o,blob:u}},rl=/__MSG_(?.*)__/gm,Nw=e=>new Promise((n,r)=>{let t=ew(e);if(!t["manifest.json"]){r(new Error("manifest.json not found in zip"));return}let i=JSON.parse(hc(t["manifest.json"]));n({unzip:t,manifestData:i})}),Li,Ui,Xn,Ow=class{constructor(){si(this,Li,void 0),this.loadManifest=async e=>{let{unzip:n,manifestData:r}=await Nw(e);Pn(this,Li,n),this.manifest=r,this.displayManifest=this.getDisplayManifest(),this.iconData=Pw(this.manifest,n)},si(this,Ui,void 0),si(this,Xn,void 0),this.loadKey=async(e="")=>{Pn(this,Ui,await Bw(e));let n=zt(this,Ui).text.public();this.manifest.key=n,Pn(this,Xn,Sw(this.manifest.key)),this.manifest.update_url=Cw(zt(this,Xn))},this.generateResources=async()=>{if(!zt(this,Ui)||!zt(this,Xn)||!this.manifest.key)throw new Error("Key not loaded");zt(this,Li)["manifest.json"]=Sl(JSON.stringify(this.manifest));let e=Buffer.from(J_(zt(this,Li))),n=gw(zt(this,Ui),Buffer.from(e));return{icon:this.iconData.blob,crx:new rs([n],{type:"application/x-chrome-extension"}),zip:new rs([e],{type:"application/zip"}),xml:new rs([Ew(zt(this,Xn),Tw(zt(this,Xn)),this.manifest.version)],{type:"text/xml"})}}}get submitManifest(){return{...this.manifest,...this.displayManifest}}getDisplayManifest(){let e={name:this.manifest.name,version:this.manifest.version,description:this.manifest.description||"",version_name:this.manifest.version_name||""};if(this.manifest.default_locale){let n=this.manifest.default_locale,r=JSON.parse(hc(zt(this,Li)[`_locales/${n}/messages.json`]));e.name=e.name.replace(rl,(t,i)=>r[i].message),e.description=e.description.replace(rl,(t,i)=>r[i].message),e.version_name=e.version_name.replace(rl,(t,i)=>r[i].message)}return e}};Li=new WeakMap,Ui=new WeakMap,Xn=new WeakMap;var Iy=typeof globalThis.process<"u"?globalThis.process.argv:[],Lw=typeof globalThis.process<"u"?globalThis.process.env:{},Uw=new Set(Iy),Ry=e=>Uw.has(e),qS=Iy.filter(e=>e.startsWith("--")&&e.includes("=")).map(e=>e.split("=")).reduce((e,[n,r])=>(e[n]=r,e),{}),jS=Ry("--dry-run"),Dw=Ry("--verbose")||Lw.VERBOSE==="true",xw=(e="",...n)=>console.log(e.padEnd(9),"|",...n),qw=0,jw=(...e)=>Dw&&xw(`\u{1F7E1} ${qw++}`,...e),Mw=async(e,n)=>{let r=Buffer.from(await n.arrayBuffer());return vr.put(e,{headers:{"Content-Type":n.type},body:r})},Vw={privateKey:"",token:"",userId:""},fc=hy(Vw,e=>`Missing ${e}`),Fw=Object.keys(fc),Kw=class{options={};constructor(e){for(let n of Fw){if(!e[n])throw new Error(fc[n]);this.options[n]=e[n]}}async submit({filePath:e=""}){let n=await(0,e_.readFile)(e),r=new Ow;await r.loadManifest(n),await r.loadKey(this.options.privateKey);let{version:t,...i}=await vr.post(`${Ls.Itero}/api/submit`,{json:{iconContentType:r.iconData.type,manifest:r.submitManifest,token:this.options.token,userId:this.options.userId}}).json();jw(`New version: ${t}`),r.manifest.version=t;let o=await r.generateResources(),l={xml:i.uploadXmlUrl,crx:i.crxFileUrl,zip:i.zipUrl,icon:i.iconUrl};await Promise.all(Object.entries(l).map(([u,s])=>Mw(s,o[u])))}},Aa="itero",$w=Cs(Aa);function Hw(e){return pn(this,null,function*(){var n=e,{zip:r,dryRun:t}=n,i=bs(n,["zip","dryRun"]);let o=new Kw(vs({},i));if($w("Updating extension to Itero TestBed"),t)return!0;try{return yield o.submit({filePath:r}),Es({market:Aa,zip:r}),!0}catch(l){throw Ts(l,Aa)}})}function zw(e){return pn(this,null,function*(){return e.zip=Oa(e),e.verbose&&La(Aa),Ua({market:Aa,options:e,errorMap:fc}),Hw(e)})}var Ww={packageId:"No package ID is provided, e.g. https://addons.opera.com/developer/package/PACKAGE_ID",sessionid:`No "sessionid" is provided. If you have a hard time obtaining it, run: + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,l="secret must be a string or buffer",u="key must be a string or a buffer",d="key must be a string, a buffer or an object",h=typeof o.createPublicKey=="function";h&&(u+=" or a KeyObject",l+="or a KeyObject");function c(w){if(!n.isBuffer(w)&&typeof w!="string"&&(!h||typeof w!="object"||typeof w.type!="string"||typeof w.asymmetricKeyType!="string"||typeof w.export!="function"))throw M(u)}function p(w){if(!n.isBuffer(w)&&typeof w!="string"&&typeof w!="object")throw M(d)}function m(w){if(!n.isBuffer(w)){if(typeof w=="string")return w;if(!h||typeof w!="object"||w.type!=="secret"||typeof w.export!="function")throw M(l)}}function O(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function g(w){w=w.toString();var C=4-w.length%4;if(C!==4)for(var U=0;U{var r=require("buffer").Buffer;t.exports=function(n){return typeof n=="string"?n:typeof n=="number"||r.isBuffer(n)?n.toString():JSON.stringify(n)}}),Tf=W((e,t)=>{var r=Ur().Buffer,n=_l(),o=wl(),i=require("stream"),s=Sl(),a=require("util");function l(c,p){return r.from(c,p).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(c,p,m){m=m||"utf8";var O=l(s(c),"binary"),g=l(s(p),m);return a.format("%s.%s",O,g)}function d(c){var p=c.header,m=c.payload,O=c.secret||c.privateKey,g=c.encoding,M=o(p.alg),I=u(p,m,g),S=M.sign(I,O);return a.format("%s.%s",I,S)}function h(c){var p=c.secret||c.privateKey||c.key,m=new n(p);this.readable=!0,this.header=c.header,this.encoding=c.encoding,this.secret=this.privateKey=this.key=m,this.payload=new n(c.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a.inherits(h,i),h.prototype.sign=function(){try{var c=d({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",c),this.emit("data",c),this.emit("end"),this.readable=!1,c}catch(p){this.readable=!1,this.emit("error",p),this.emit("close")}},h.sign=d,t.exports=h}),Of=W((e,t)=>{var r=Ur().Buffer,n=_l(),o=wl(),i=require("stream"),s=Sl(),a=require("util"),l=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function u(S){return Object.prototype.toString.call(S)==="[object Object]"}function d(S){if(u(S))return S;try{return JSON.parse(S)}catch{return}}function h(S){var y=S.split(".",1)[0];return d(r.from(y,"base64").toString("binary"))}function c(S){return S.split(".",2).join(".")}function p(S){return S.split(".")[2]}function m(S,y){y=y||"utf8";var _=S.split(".")[1];return r.from(_,"base64").toString(y)}function O(S){return l.test(S)&&!!h(S)}function g(S,y,_){if(!y){var v=new Error("Missing algorithm parameter for jws.verify");throw v.code="MISSING_ALGORITHM",v}S=s(S);var R=p(S),$=c(S),x=o(y);return x.verify($,R,_)}function M(S,y){if(y=y||{},S=s(S),!O(S))return null;var _=h(S);if(!_)return null;var v=m(S);return(_.typ==="JWT"||y.json)&&(v=JSON.parse(v,y.encoding)),{header:_,payload:v,signature:p(S)}}function I(S){S=S||{};var y=S.secret||S.publicKey||S.key,_=new n(y);this.readable=!0,this.algorithm=S.algorithm,this.encoding=S.encoding,this.secret=this.publicKey=this.key=_,this.signature=new n(S.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a.inherits(I,i),I.prototype.verify=function(){try{var S=g(this.signature.buffer,this.algorithm,this.key.buffer),y=M(this.signature.buffer,this.encoding);return this.emit("done",S,y),this.emit("data",S),this.emit("end"),this.readable=!1,S}catch(_){this.readable=!1,this.emit("error",_),this.emit("close")}},I.decode=M,I.isValid=O,I.verify=g,t.exports=I}),xi=W(e=>{var t=Tf(),r=Of(),n=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.ALGORITHMS=n,e.sign=t.sign,e.verify=r.verify,e.decode=r.decode,e.isValid=r.isValid,e.createSign=function(o){return new t(o)},e.createVerify=function(o){return new r(o)}}),El=W((e,t)=>{var r=xi();t.exports=function(n,o){o=o||{};var i=r.decode(n,o);if(!i)return null;var s=i.payload;if(typeof s=="string")try{var a=JSON.parse(s);a!==null&&typeof a=="object"&&(s=a)}catch{}return o.complete===!0?{header:i.header,payload:s,signature:i.signature}:s}}),ro=W((e,t)=>{var r=function(n,o){Error.call(this,n),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=n,o&&(this.inner=o)};r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,t.exports=r}),Tl=W((e,t)=>{var r=ro(),n=function(o,i){r.call(this,o),this.name="NotBeforeError",this.date=i};n.prototype=Object.create(r.prototype),n.prototype.constructor=n,t.exports=n}),Ol=W((e,t)=>{var r=ro(),n=function(o,i){r.call(this,o),this.name="TokenExpiredError",this.expiredAt=i};n.prototype=Object.create(r.prototype),n.prototype.constructor=n,t.exports=n}),Rf=W((e,t)=>{var r=1e3,n=r*60,o=n*60,i=o*24,s=i*7,a=i*365.25;t.exports=function(c,p){p=p||{};var m=typeof c;if(m==="string"&&c.length>0)return l(c);if(m==="number"&&isFinite(c))return p.long?d(c):u(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function l(c){if(c=String(c),!(c.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(p){var m=parseFloat(p[1]),O=(p[2]||"ms").toLowerCase();switch(O){case"years":case"year":case"yrs":case"yr":case"y":return m*a;case"weeks":case"week":case"w":return m*s;case"days":case"day":case"d":return m*i;case"hours":case"hour":case"hrs":case"hr":case"h":return m*o;case"minutes":case"minute":case"mins":case"min":case"m":return m*n;case"seconds":case"second":case"secs":case"sec":case"s":return m*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(c){var p=Math.abs(c);return p>=i?Math.round(c/i)+"d":p>=o?Math.round(c/o)+"h":p>=n?Math.round(c/n)+"m":p>=r?Math.round(c/r)+"s":c+"ms"}function d(c){var p=Math.abs(c);return p>=i?h(c,p,i,"day"):p>=o?h(c,p,o,"hour"):p>=n?h(c,p,n,"minute"):p>=r?h(c,p,r,"second"):c+" ms"}function h(c,p,m,O){var g=p>=m*1.5;return Math.round(c/m)+" "+O+(g?"s":"")}}),Rl=W((e,t)=>{var r=Rf();t.exports=function(n,o){var i=o||Math.floor(Date.now()/1e3);if(typeof n=="string"){var s=r(n);return typeof s>"u"?void 0:Math.floor(i+s/1e3)}else return typeof n=="number"?i+n:void 0}}),Pf=W((e,t)=>{e=t.exports=K;var r;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?r=function(){var f=Array.prototype.slice.call(arguments,0);f.unshift("SEMVER"),console.log.apply(console,f)}:r=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=e.re=[],a=e.src=[],l=0,u=l++;a[u]="0|[1-9]\\d*";var d=l++;a[d]="[0-9]+";var h=l++;a[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var c=l++;a[c]="("+a[u]+")\\.("+a[u]+")\\.("+a[u]+")";var p=l++;a[p]="("+a[d]+")\\.("+a[d]+")\\.("+a[d]+")";var m=l++;a[m]="(?:"+a[u]+"|"+a[h]+")";var O=l++;a[O]="(?:"+a[d]+"|"+a[h]+")";var g=l++;a[g]="(?:-("+a[m]+"(?:\\."+a[m]+")*))";var M=l++;a[M]="(?:-?("+a[O]+"(?:\\."+a[O]+")*))";var I=l++;a[I]="[0-9A-Za-z-]+";var S=l++;a[S]="(?:\\+("+a[I]+"(?:\\."+a[I]+")*))";var y=l++,_="v?"+a[c]+a[g]+"?"+a[S]+"?";a[y]="^"+_+"$";var v="[v=\\s]*"+a[p]+a[M]+"?"+a[S]+"?",R=l++;a[R]="^"+v+"$";var $=l++;a[$]="((?:<|>)?=?)";var x=l++;a[x]=a[d]+"|x|X|\\*";var q=l++;a[q]=a[u]+"|x|X|\\*";var N=l++;a[N]="[v=\\s]*("+a[q]+")(?:\\.("+a[q]+")(?:\\.("+a[q]+")(?:"+a[g]+")?"+a[S]+"?)?)?";var J=l++;a[J]="[v=\\s]*("+a[x]+")(?:\\.("+a[x]+")(?:\\.("+a[x]+")(?:"+a[M]+")?"+a[S]+"?)?)?";var j=l++;a[j]="^"+a[$]+"\\s*"+a[N]+"$";var w=l++;a[w]="^"+a[$]+"\\s*"+a[J]+"$";var C=l++;a[C]="(?:^|[^\\d])(\\d{1,"+i+"})(?:\\.(\\d{1,"+i+"}))?(?:\\.(\\d{1,"+i+"}))?(?:$|[^\\d])";var U=l++;a[U]="(?:~>?)";var A=l++;a[A]="(\\s*)"+a[U]+"\\s+",s[A]=new RegExp(a[A],"g");var H="$1~",Z=l++;a[Z]="^"+a[U]+a[N]+"$";var te=l++;a[te]="^"+a[U]+a[J]+"$";var Y=l++;a[Y]="(?:\\^)";var re=l++;a[re]="(\\s*)"+a[Y]+"\\s+",s[re]=new RegExp(a[re],"g");var be="$1^",Pe=l++;a[Pe]="^"+a[Y]+a[N]+"$";var Ie=l++;a[Ie]="^"+a[Y]+a[J]+"$";var $e=l++;a[$e]="^"+a[$]+"\\s*("+v+")$|^$";var qe=l++;a[qe]="^"+a[$]+"\\s*("+_+")$|^$";var Xe=l++;a[Xe]="(\\s*)"+a[$]+"\\s*("+v+"|"+a[N]+")",s[Xe]=new RegExp(a[Xe],"g");var fo="$1$2$3",Fr=l++;a[Fr]="^\\s*("+a[N]+")\\s+-\\s+("+a[N]+")\\s*$";var Wr=l++;a[Wr]="^\\s*("+a[J]+")\\s+-\\s+("+a[J]+")\\s*$";var Vr=l++;for(a[Vr]="(<|>)?=?\\s*\\*",Ze=0;Zen)return null;var P=E.loose?s[R]:s[y];if(!P.test(f))return null;try{return new K(f,E)}catch{return null}}e.valid=Q;function Q(f,E){var P=k(f,E);return P?P.version:null}e.clean=ee;function ee(f,E){var P=k(f.trim().replace(/^[=v]+/,""),E);return P?P.version:null}e.SemVer=K;function K(f,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),f instanceof K){if(f.loose===E.loose)return f;f=f.version}else if(typeof f!="string")throw new TypeError("Invalid Version: "+f);if(f.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof K))return new K(f,E);r("SemVer",f,E),this.options=E,this.loose=!!E.loose;var P=f.trim().match(E.loose?s[R]:s[y]);if(!P)throw new TypeError("Invalid Version: "+f);if(this.raw=f,this.major=+P[1],this.minor=+P[2],this.patch=+P[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");P[4]?this.prerelease=P[4].split(".").map(function(B){if(/^[0-9]+$/.test(B)){var D=+B;if(D>=0&&D=0;)typeof this.prerelease[P]=="number"&&(this.prerelease[P]++,P=-2);P===-1&&this.prerelease.push(0)}E&&(this.prerelease[0]===E?isNaN(this.prerelease[1])&&(this.prerelease=[E,0]):this.prerelease=[E,0]);break;default:throw new Error("invalid increment argument: "+f)}return this.format(),this.raw=this.version,this},e.inc=xe;function xe(f,E,P,B){typeof P=="string"&&(B=P,P=void 0);try{return new K(f,P).inc(E,B).version}catch{return null}}e.diff=Me;function Me(f,E){if(po(f,E))return null;var P=k(f),B=k(E),D="";if(P.prerelease.length||B.prerelease.length){D="pre";var F="prerelease"}for(var G in P)if((G==="major"||G==="minor"||G==="patch")&&P[G]!==B[G])return D+G;return F}e.compareIdentifiers=Jt;var is=/^[0-9]+$/;function Jt(f,E){var P=is.test(f),B=is.test(E);return P&&B&&(f=+f,E=+E),f===E?0:P&&!B?-1:B&&!P?1:f0}e.lt=Gr;function Gr(f,E,P){return at(f,E,P)<0}e.eq=po;function po(f,E,P){return at(f,E,P)===0}e.neq=ss;function ss(f,E,P){return at(f,E,P)!==0}e.gte=mo;function mo(f,E,P){return at(f,E,P)>=0}e.lte=yo;function yo(f,E,P){return at(f,E,P)<=0}e.cmp=Jr;function Jr(f,E,P,B){switch(E){case"===":return typeof f=="object"&&(f=f.version),typeof P=="object"&&(P=P.version),f===P;case"!==":return typeof f=="object"&&(f=f.version),typeof P=="object"&&(P=P.version),f!==P;case"":case"=":case"==":return po(f,P,B);case"!=":return ss(f,P,B);case">":return mr(f,P,B);case">=":return mo(f,P,B);case"<":return Gr(f,P,B);case"<=":return yo(f,P,B);default:throw new TypeError("Invalid operator: "+E)}}e.Comparator=Le;function Le(f,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),f instanceof Le){if(f.loose===!!E.loose)return f;f=f.value}if(!(this instanceof Le))return new Le(f,E);r("comparator",f,E),this.options=E,this.loose=!!E.loose,this.parse(f),this.semver===yr?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var yr={};Le.prototype.parse=function(f){var E=this.options.loose?s[$e]:s[qe],P=f.match(E);if(!P)throw new TypeError("Invalid comparator: "+f);this.operator=P[1],this.operator==="="&&(this.operator=""),P[2]?this.semver=new K(P[2],this.options.loose):this.semver=yr},Le.prototype.toString=function(){return this.value},Le.prototype.test=function(f){return r("Comparator.test",f,this.options.loose),this.semver===yr?!0:(typeof f=="string"&&(f=new K(f,this.options)),Jr(f,this.operator,this.semver,this.options))},Le.prototype.intersects=function(f,E){if(!(f instanceof Le))throw new TypeError("a Comparator is required");(!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1});var P;if(this.operator==="")return P=new fe(f.value,E),Kr(this.value,P,E);if(f.operator==="")return P=new fe(this.value,E),Kr(f.semver,P,E);var B=(this.operator===">="||this.operator===">")&&(f.operator===">="||f.operator===">"),D=(this.operator==="<="||this.operator==="<")&&(f.operator==="<="||f.operator==="<"),F=this.semver.version===f.semver.version,G=(this.operator===">="||this.operator==="<=")&&(f.operator===">="||f.operator==="<="),ie=Jr(this.semver,"<",f.semver,E)&&(this.operator===">="||this.operator===">")&&(f.operator==="<="||f.operator==="<"),oe=Jr(this.semver,">",f.semver,E)&&(this.operator==="<="||this.operator==="<")&&(f.operator===">="||f.operator===">");return B||D||F&&G||ie||oe},e.Range=fe;function fe(f,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),f instanceof fe)return f.loose===!!E.loose&&f.includePrerelease===!!E.includePrerelease?f:new fe(f.raw,E);if(f instanceof Le)return new fe(f.value,E);if(!(this instanceof fe))return new fe(f,E);if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=f,this.set=f.split(/\s*\|\|\s*/).map(function(P){return this.parseRange(P.trim())},this).filter(function(P){return P.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+f);this.format()}fe.prototype.format=function(){return this.range=this.set.map(function(f){return f.join(" ").trim()}).join("||").trim(),this.range},fe.prototype.toString=function(){return this.range},fe.prototype.parseRange=function(f){var E=this.options.loose;f=f.trim();var P=E?s[Wr]:s[Fr];f=f.replace(P,mc),r("hyphen replace",f),f=f.replace(s[Xe],fo),r("comparator trim",f,s[Xe]),f=f.replace(s[A],H),f=f.replace(s[re],be),f=f.split(/\s+/).join(" ");var B=E?s[$e]:s[qe],D=f.split(" ").map(function(F){return ac(F,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(D=D.filter(function(F){return!!F.match(B)})),D=D.map(function(F){return new Le(F,this.options)},this),D},fe.prototype.intersects=function(f,E){if(!(f instanceof fe))throw new TypeError("a Range is required");return this.set.some(function(P){return P.every(function(B){return f.set.some(function(D){return D.every(function(F){return B.intersects(F,E)})})})})},e.toComparators=sc;function sc(f,E){return new fe(f,E).set.map(function(P){return P.map(function(B){return B.value}).join(" ").trim().split(" ")})}function ac(f,E){return r("comp",f,E),f=cc(f,E),r("caret",f),f=lc(f,E),r("tildes",f),f=dc(f,E),r("xrange",f),f=pc(f,E),r("stars",f),f}function Te(f){return!f||f.toLowerCase()==="x"||f==="*"}function lc(f,E){return f.trim().split(/\s+/).map(function(P){return uc(P,E)}).join(" ")}function uc(f,E){var P=E.loose?s[te]:s[Z];return f.replace(P,function(B,D,F,G,ie){r("tilde",f,B,D,F,G,ie);var oe;return Te(D)?oe="":Te(F)?oe=">="+D+".0.0 <"+(+D+1)+".0.0":Te(G)?oe=">="+D+"."+F+".0 <"+D+"."+(+F+1)+".0":ie?(r("replaceTilde pr",ie),oe=">="+D+"."+F+"."+G+"-"+ie+" <"+D+"."+(+F+1)+".0"):oe=">="+D+"."+F+"."+G+" <"+D+"."+(+F+1)+".0",r("tilde return",oe),oe})}function cc(f,E){return f.trim().split(/\s+/).map(function(P){return hc(P,E)}).join(" ")}function hc(f,E){r("caret",f,E);var P=E.loose?s[Ie]:s[Pe];return f.replace(P,function(B,D,F,G,ie){r("caret",f,B,D,F,G,ie);var oe;return Te(D)?oe="":Te(F)?oe=">="+D+".0.0 <"+(+D+1)+".0.0":Te(G)?D==="0"?oe=">="+D+"."+F+".0 <"+D+"."+(+F+1)+".0":oe=">="+D+"."+F+".0 <"+(+D+1)+".0.0":ie?(r("replaceCaret pr",ie),D==="0"?F==="0"?oe=">="+D+"."+F+"."+G+"-"+ie+" <"+D+"."+F+"."+(+G+1):oe=">="+D+"."+F+"."+G+"-"+ie+" <"+D+"."+(+F+1)+".0":oe=">="+D+"."+F+"."+G+"-"+ie+" <"+(+D+1)+".0.0"):(r("no pr"),D==="0"?F==="0"?oe=">="+D+"."+F+"."+G+" <"+D+"."+F+"."+(+G+1):oe=">="+D+"."+F+"."+G+" <"+D+"."+(+F+1)+".0":oe=">="+D+"."+F+"."+G+" <"+(+D+1)+".0.0"),r("caret return",oe),oe})}function dc(f,E){return r("replaceXRanges",f,E),f.split(/\s+/).map(function(P){return fc(P,E)}).join(" ")}function fc(f,E){f=f.trim();var P=E.loose?s[w]:s[j];return f.replace(P,function(B,D,F,G,ie,oe){r("xRange",f,B,D,F,G,ie,oe);var et=Te(F),tt=et||Te(G),Ne=tt||Te(ie),Ce=Ne;return D==="="&&Ce&&(D=""),et?D===">"||D==="<"?B="<0.0.0":B="*":D&&Ce?(tt&&(G=0),ie=0,D===">"?(D=">=",tt?(F=+F+1,G=0,ie=0):(G=+G+1,ie=0)):D==="<="&&(D="<",tt?F=+F+1:G=+G+1),B=D+F+"."+G+"."+ie):tt?B=">="+F+".0.0 <"+(+F+1)+".0.0":Ne&&(B=">="+F+"."+G+".0 <"+F+"."+(+G+1)+".0"),r("xRange return",B),B})}function pc(f,E){return r("replaceStars",f,E),f.trim().replace(s[Vr],"")}function mc(f,E,P,B,D,F,G,ie,oe,et,tt,Ne,Ce){return Te(P)?E="":Te(B)?E=">="+P+".0.0":Te(D)?E=">="+P+"."+B+".0":E=">="+E,Te(oe)?ie="":Te(et)?ie="<"+(+oe+1)+".0.0":Te(tt)?ie="<"+oe+"."+(+et+1)+".0":Ne?ie="<="+oe+"."+et+"."+tt+"-"+Ne:ie="<="+ie,(E+" "+ie).trim()}fe.prototype.test=function(f){if(!f)return!1;typeof f=="string"&&(f=new K(f,this.options));for(var E=0;E0){var D=f[B].semver;if(D.major===E.major&&D.minor===E.minor&&D.patch===E.patch)return!0}return!1}return!0}e.satisfies=Kr;function Kr(f,E,P){try{E=new fe(E,P)}catch{return!1}return E.test(f)}e.maxSatisfying=gc;function gc(f,E,P){var B=null,D=null;try{var F=new fe(E,P)}catch{return null}return f.forEach(function(G){F.test(G)&&(!B||D.compare(G)===-1)&&(B=G,D=new K(B,P))}),B}e.minSatisfying=bc;function bc(f,E,P){var B=null,D=null;try{var F=new fe(E,P)}catch{return null}return f.forEach(function(G){F.test(G)&&(!B||D.compare(G)===1)&&(B=G,D=new K(B,P))}),B}e.minVersion=vc;function vc(f,E){f=new fe(f,E);var P=new K("0.0.0");if(f.test(P)||(P=new K("0.0.0-0"),f.test(P)))return P;P=null;for(var B=0;B":G.prerelease.length===0?G.patch++:G.prerelease.push(0),G.raw=G.format();case"":case">=":(!P||mr(P,G))&&(P=G);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+F.operator)}})}return P&&f.test(P)?P:null}e.validRange=_c;function _c(f,E){try{return new fe(f,E).range||"*"}catch{return null}}e.ltr=wc;function wc(f,E,P){return go(f,E,"<",P)}e.gtr=Sc;function Sc(f,E,P){return go(f,E,">",P)}e.outside=go;function go(f,E,P,B){f=new K(f,B),E=new fe(E,B);var D,F,G,ie,oe;switch(P){case">":D=mr,F=yo,G=Gr,ie=">",oe=">=";break;case"<":D=Gr,F=mo,G=mr,ie="<",oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kr(f,E,B))return!1;for(var et=0;et=0.0.0")),Ne=Ne||mt,Ce=Ce||mt,D(mt.semver,Ne.semver,B)?Ne=mt:G(mt.semver,Ce.semver,B)&&(Ce=mt)}),Ne.operator===ie||Ne.operator===oe||(!Ce.operator||Ce.operator===ie)&&F(f,Ce.semver)||Ce.operator===oe&&G(f,Ce.semver))return!1}return!0}e.prerelease=Ec;function Ec(f,E){var P=k(f,E);return P&&P.prerelease.length?P.prerelease:null}e.intersects=Tc;function Tc(f,E,P){return f=new fe(f,P),E=new fe(E,P),f.intersects(E)}e.coerce=Oc;function Oc(f){if(f instanceof K)return f;if(typeof f!="string")return null;var E=f.match(s[C]);return E==null?null:k(E[1]+"."+(E[2]||"0")+"."+(E[3]||"0"))}}),Pl=W((e,t)=>{var r=Pf();t.exports=r.satisfies(process.version,"^6.12.0 || >=8.0.0")}),xf=W((e,t)=>{var r=ro(),n=Tl(),o=Ol(),i=El(),s=Rl(),a=Pl(),l=xi(),u=["RS256","RS384","RS512","ES256","ES384","ES512"],d=["RS256","RS384","RS512"],h=["HS256","HS384","HS512"];a&&(u.splice(3,0,"PS256","PS384","PS512"),d.splice(3,0,"PS256","PS384","PS512")),t.exports=function(c,p,m,O){typeof m=="function"&&!O&&(O=m,m={}),m||(m={}),m=Object.assign({},m);var g;if(O?g=O:g=function(v,R){if(v)throw v;return R},m.clockTimestamp&&typeof m.clockTimestamp!="number")return g(new r("clockTimestamp must be a number"));if(m.nonce!==void 0&&(typeof m.nonce!="string"||m.nonce.trim()===""))return g(new r("nonce must be a non-empty string"));var M=m.clockTimestamp||Math.floor(Date.now()/1e3);if(!c)return g(new r("jwt must be provided"));if(typeof c!="string")return g(new r("jwt must be a string"));var I=c.split(".");if(I.length!==3)return g(new r("jwt malformed"));var S;try{S=i(c,{complete:!0})}catch(v){return g(v)}if(!S)return g(new r("invalid token"));var y=S.header,_;if(typeof p=="function"){if(!O)return g(new r("verify must be called asynchronous if secret or public key is provided as a callback"));_=p}else _=function(v,R){return R(null,p)};return _(y,function(v,R){if(v)return g(new r("error in secret or public key callback: "+v.message));var $=I[2].trim()!=="";if(!$&&R)return g(new r("jwt signature is required"));if($&&!R)return g(new r("secret or public key must be provided"));if(!$&&!m.algorithms&&(m.algorithms=["none"]),m.algorithms||(m.algorithms=~R.toString().indexOf("BEGIN CERTIFICATE")||~R.toString().indexOf("BEGIN PUBLIC KEY")?u:~R.toString().indexOf("BEGIN RSA PUBLIC KEY")?d:h),!~m.algorithms.indexOf(S.header.alg))return g(new r("invalid algorithm"));var x;try{x=l.verify(c,S.header.alg,R)}catch(A){return g(A)}if(!x)return g(new r("invalid signature"));var q=S.payload;if(typeof q.nbf<"u"&&!m.ignoreNotBefore){if(typeof q.nbf!="number")return g(new r("invalid nbf value"));if(q.nbf>M+(m.clockTolerance||0))return g(new n("jwt not active",new Date(q.nbf*1e3)))}if(typeof q.exp<"u"&&!m.ignoreExpiration){if(typeof q.exp!="number")return g(new r("invalid exp value"));if(M>=q.exp+(m.clockTolerance||0))return g(new o("jwt expired",new Date(q.exp*1e3)))}if(m.audience){var N=Array.isArray(m.audience)?m.audience:[m.audience],J=Array.isArray(q.aud)?q.aud:[q.aud],j=J.some(function(A){return N.some(function(H){return H instanceof RegExp?H.test(A):H===A})});if(!j)return g(new r("jwt audience invalid. expected: "+N.join(" or ")))}if(m.issuer){var w=typeof m.issuer=="string"&&q.iss!==m.issuer||Array.isArray(m.issuer)&&m.issuer.indexOf(q.iss)===-1;if(w)return g(new r("jwt issuer invalid. expected: "+m.issuer))}if(m.subject&&q.sub!==m.subject)return g(new r("jwt subject invalid. expected: "+m.subject));if(m.jwtid&&q.jti!==m.jwtid)return g(new r("jwt jwtid invalid. expected: "+m.jwtid));if(m.nonce&&q.nonce!==m.nonce)return g(new r("jwt nonce invalid. expected: "+m.nonce));if(m.maxAge){if(typeof q.iat!="number")return g(new r("iat required when maxAge is specified"));var C=s(m.maxAge,q.iat);if(typeof C>"u")return g(new r('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(M>=C+(m.clockTolerance||0))return g(new o("maxAge exceeded",new Date(C*1e3)))}if(m.complete===!0){var U=S.signature;return g(null,{header:y,payload:q,signature:U})}return g(null,q)})}}),kf=W((e,t)=>{var r=1/0,n=9007199254740991,o=17976931348623157e292,i=0/0,s="[object Arguments]",a="[object Function]",l="[object GeneratorFunction]",u="[object String]",d="[object Symbol]",h=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,O=/^(?:0|[1-9]\d*)$/,g=parseInt;function M(k,Q){for(var ee=-1,K=k?k.length:0,xe=Array(K);++ee-1&&k%1==0&&k-1:!!xe&&S(k,Q,ee)>-1}function Z(k){return re(k)&&x.call(k,"callee")&&(!N.call(k,"callee")||q.call(k)==s)}var te=Array.isArray;function Y(k){return k!=null&&Pe(k.length)&&!be(k)}function re(k){return $e(k)&&Y(k)}function be(k){var Q=Ie(k)?q.call(k):"";return Q==a||Q==l}function Pe(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=n}function Ie(k){var Q=typeof k;return!!k&&(Q=="object"||Q=="function")}function $e(k){return!!k&&typeof k=="object"}function qe(k){return typeof k=="string"||!te(k)&&$e(k)&&q.call(k)==u}function Xe(k){return typeof k=="symbol"||$e(k)&&q.call(k)==d}function fo(k){if(!k)return k===0?k:0;if(k=Wr(k),k===r||k===-r){var Q=k<0?-1:1;return Q*o}return k===k?k:0}function Fr(k){var Q=fo(k),ee=Q%1;return Q===Q?ee?Q-ee:Q:0}function Wr(k){if(typeof k=="number")return k;if(Xe(k))return i;if(Ie(k)){var Q=typeof k.valueOf=="function"?k.valueOf():k;k=Ie(Q)?Q+"":Q}if(typeof k!="string")return k===0?k:+k;k=k.replace(h,"");var ee=p.test(k);return ee||m.test(k)?g(k.slice(2),ee?2:8):c.test(k)?i:+k}function Vr(k){return Y(k)?w(k):C(k)}function Ze(k){return k?v(k,Vr(k)):[]}t.exports=H}),Af=W((e,t)=>{var r="[object Boolean]",n=Object.prototype,o=n.toString;function i(a){return a===!0||a===!1||s(a)&&o.call(a)==r}function s(a){return!!a&&typeof a=="object"}t.exports=i}),qf=W((e,t)=>{var r=1/0,n=17976931348623157e292,o=0/0,i="[object Symbol]",s=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,d=parseInt,h=Object.prototype,c=h.toString;function p(y){return typeof y=="number"&&y==I(y)}function m(y){var _=typeof y;return!!y&&(_=="object"||_=="function")}function O(y){return!!y&&typeof y=="object"}function g(y){return typeof y=="symbol"||O(y)&&c.call(y)==i}function M(y){if(!y)return y===0?y:0;if(y=S(y),y===r||y===-r){var _=y<0?-1:1;return _*n}return y===y?y:0}function I(y){var _=M(y),v=_%1;return _===_?v?_-v:_:0}function S(y){if(typeof y=="number")return y;if(g(y))return o;if(m(y)){var _=typeof y.valueOf=="function"?y.valueOf():y;y=m(_)?_+"":_}if(typeof y!="string")return y===0?y:+y;y=y.replace(s,"");var v=l.test(y);return v||u.test(y)?d(y.slice(2),v?2:8):a.test(y)?o:+y}t.exports=p}),Cf=W((e,t)=>{var r="[object Number]",n=Object.prototype,o=n.toString;function i(a){return!!a&&typeof a=="object"}function s(a){return typeof a=="number"||i(a)&&o.call(a)==r}t.exports=s}),jf=W((e,t)=>{var r="[object Object]";function n(m){var O=!1;if(m!=null&&typeof m.toString!="function")try{O=!!(m+"")}catch{}return O}function o(m,O){return function(g){return m(O(g))}}var i=Function.prototype,s=Object.prototype,a=i.toString,l=s.hasOwnProperty,u=a.call(Object),d=s.toString,h=o(Object.getPrototypeOf,Object);function c(m){return!!m&&typeof m=="object"}function p(m){if(!c(m)||d.call(m)!=r||n(m))return!1;var O=h(m);if(O===null)return!0;var g=l.call(O,"constructor")&&O.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}t.exports=p}),If=W((e,t)=>{var r="[object String]",n=Object.prototype,o=n.toString,i=Array.isArray;function s(l){return!!l&&typeof l=="object"}function a(l){return typeof l=="string"||!i(l)&&s(l)&&o.call(l)==r}t.exports=a}),$f=W((e,t)=>{var r="Expected a function",n=1/0,o=17976931348623157e292,i=0/0,s="[object Symbol]",a=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt,c=Object.prototype,p=c.toString;function m(v,R){var $;if(typeof R!="function")throw new TypeError(r);return v=y(v),function(){return--v>0&&($=R.apply(this,arguments)),v<=1&&(R=void 0),$}}function O(v){return m(2,v)}function g(v){var R=typeof v;return!!v&&(R=="object"||R=="function")}function M(v){return!!v&&typeof v=="object"}function I(v){return typeof v=="symbol"||M(v)&&p.call(v)==s}function S(v){if(!v)return v===0?v:0;if(v=_(v),v===n||v===-n){var R=v<0?-1:1;return R*o}return v===v?v:0}function y(v){var R=S(v),$=R%1;return R===R?$?R-$:R:0}function _(v){if(typeof v=="number")return v;if(I(v))return i;if(g(v)){var R=typeof v.valueOf=="function"?v.valueOf():v;v=g(R)?R+"":R}if(typeof v!="string")return v===0?v:+v;v=v.replace(a,"");var $=u.test(v);return $||d.test(v)?h(v.slice(2),$?2:8):l.test(v)?i:+v}t.exports=O}),Mf=W((e,t)=>{var r=Rl(),n=Pl(),o=xi(),i=kf(),s=Af(),a=qf(),l=Cf(),u=jf(),d=If(),h=$f(),c=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];n&&c.splice(3,0,"PS256","PS384","PS512");var p={expiresIn:{isValid:function(y){return a(y)||d(y)&&y},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(y){return a(y)||d(y)&&y},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(y){return d(y)||Array.isArray(y)},message:'"audience" must be a string or array'},algorithm:{isValid:i.bind(null,c),message:'"algorithm" must be a valid string enum value'},header:{isValid:u,message:'"header" must be an object'},encoding:{isValid:d,message:'"encoding" must be a string'},issuer:{isValid:d,message:'"issuer" must be a string'},subject:{isValid:d,message:'"subject" must be a string'},jwtid:{isValid:d,message:'"jwtid" must be a string'},noTimestamp:{isValid:s,message:'"noTimestamp" must be a boolean'},keyid:{isValid:d,message:'"keyid" must be a string'},mutatePayload:{isValid:s,message:'"mutatePayload" must be a boolean'}},m={iat:{isValid:l,message:'"iat" should be a number of seconds'},exp:{isValid:l,message:'"exp" should be a number of seconds'},nbf:{isValid:l,message:'"nbf" should be a number of seconds'}};function O(y,_,v,R){if(!u(v))throw new Error('Expected "'+R+'" to be a plain object.');Object.keys(v).forEach(function($){var x=y[$];if(!x){if(!_)throw new Error('"'+$+'" is not allowed in "'+R+'"');return}if(!x.isValid(v[$]))throw new Error(x.message)})}function g(y){return O(p,!1,y,"options")}function M(y){return O(m,!0,y,"payload")}var I={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},S=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];t.exports=function(y,_,v,R){typeof v=="function"?(R=v,v={}):v=v||{};var $=typeof y=="object"&&!Buffer.isBuffer(y),x=Object.assign({alg:v.algorithm||"HS256",typ:$?"JWT":void 0,kid:v.keyid},v.header);function q(w){if(R)return R(w);throw w}if(!_&&v.algorithm!=="none")return q(new Error("secretOrPrivateKey must have a value"));if(typeof y>"u")return q(new Error("payload is required"));if($){try{M(y)}catch(w){return q(w)}v.mutatePayload||(y=Object.assign({},y))}else{var N=S.filter(function(w){return typeof v[w]<"u"});if(N.length>0)return q(new Error("invalid "+N.join(",")+" option for "+typeof y+" payload"))}if(typeof y.exp<"u"&&typeof v.expiresIn<"u")return q(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof y.nbf<"u"&&typeof v.notBefore<"u")return q(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{g(v)}catch(w){return q(w)}var J=y.iat||Math.floor(Date.now()/1e3);if(v.noTimestamp?delete y.iat:$&&(y.iat=J),typeof v.notBefore<"u"){try{y.nbf=r(v.notBefore,J)}catch(w){return q(w)}if(typeof y.nbf>"u")return q(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof v.expiresIn<"u"&&typeof y=="object"){try{y.exp=r(v.expiresIn,J)}catch(w){return q(w)}if(typeof y.exp>"u")return q(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(I).forEach(function(w){var C=I[w];if(typeof v[w]<"u"){if(typeof y[C]<"u")return q(new Error('Bad "options.'+w+'" option. The payload already has an "'+C+'" property.'));y[C]=v[w]}});var j=v.encoding||"utf8";if(typeof R=="function")R=R&&h(R),o.createSign({header:x,privateKey:_,payload:y,encoding:j}).once("error",R).once("done",function(w){R(null,w)});else return o.sign({header:x,payload:y,secret:_,encoding:j})}}),Lf=W((e,t)=>{t.exports={decode:El(),verify:xf(),sign:Mf(),JsonWebTokenError:ro(),NotBeforeError:Tl(),TokenExpiredError:Ol()}}),xl={};Zd(xl,{BrowserName:()=>kl,marketNameMap:()=>Al,submitChrome:()=>Zm,submitEdge:()=>sy,submitFirefox:()=>Qy,submitOpera:()=>Xy,supportedBrowserSet:()=>Nf});Qu.exports=ef(xl);var kl=(e=>(e.Chrome="chrome",e.Firefox="firefox",e.Opera="opera",e.Edge="edge",e))(kl||{}),Nf=new Set(["chrome","edge","firefox"]),Al={chrome:"Chrome Web Store",edge:"Edge Add-ons",firefox:"Firefox Add-ons"},Bf=require("fs"),ql=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Uf(e){return ql.includes(e)}var zf=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...ql];function Df(e){return zf.includes(e)}var Hf=["null","undefined","string","number","bigint","boolean","symbol"];function Ff(e){return Hf.includes(e)}function pr(e){return t=>typeof t===e}var{toString:Wf}=Object.prototype,zr=e=>{let t=Wf.call(e).slice(8,-1);if(/HTML\w+Element/.test(t)&&b.domElement(e))return"HTMLElement";if(Df(t))return t},he=e=>t=>zr(t)===e;function b(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(b.observable(e))return"Observable";if(b.array(e))return"Array";if(b.buffer(e))return"Buffer";let t=zr(e);if(t)return t;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}b.undefined=pr("undefined");b.string=pr("string");var Vf=pr("number");b.number=e=>Vf(e)&&!b.nan(e);b.bigint=pr("bigint");b.function_=pr("function");b.null_=e=>e===null;b.class_=e=>b.function_(e)&&e.toString().startsWith("class ");b.boolean=e=>e===!0||e===!1;b.symbol=pr("symbol");b.numericString=e=>b.string(e)&&!b.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));b.array=(e,t)=>Array.isArray(e)?b.function_(t)?e.every(r=>t(r)):!0:!1;b.buffer=e=>e?.constructor?.isBuffer?.(e)??!1;b.blob=e=>he("Blob")(e);b.nullOrUndefined=e=>b.null_(e)||b.undefined(e);b.object=e=>!b.null_(e)&&(typeof e=="object"||b.function_(e));b.iterable=e=>b.function_(e?.[Symbol.iterator]);b.asyncIterable=e=>b.function_(e?.[Symbol.asyncIterator]);b.generator=e=>b.iterable(e)&&b.function_(e?.next)&&b.function_(e?.throw);b.asyncGenerator=e=>b.asyncIterable(e)&&b.function_(e.next)&&b.function_(e.throw);b.nativePromise=e=>he("Promise")(e);var Gf=e=>b.function_(e?.then)&&b.function_(e?.catch);b.promise=e=>b.nativePromise(e)||Gf(e);b.generatorFunction=he("GeneratorFunction");b.asyncGeneratorFunction=e=>zr(e)==="AsyncGeneratorFunction";b.asyncFunction=e=>zr(e)==="AsyncFunction";b.boundFunction=e=>b.function_(e)&&!e.hasOwnProperty("prototype");b.regExp=he("RegExp");b.date=he("Date");b.error=he("Error");b.map=e=>he("Map")(e);b.set=e=>he("Set")(e);b.weakMap=e=>he("WeakMap")(e);b.weakSet=e=>he("WeakSet")(e);b.weakRef=e=>he("WeakRef")(e);b.int8Array=he("Int8Array");b.uint8Array=he("Uint8Array");b.uint8ClampedArray=he("Uint8ClampedArray");b.int16Array=he("Int16Array");b.uint16Array=he("Uint16Array");b.int32Array=he("Int32Array");b.uint32Array=he("Uint32Array");b.float32Array=he("Float32Array");b.float64Array=he("Float64Array");b.bigInt64Array=he("BigInt64Array");b.bigUint64Array=he("BigUint64Array");b.arrayBuffer=he("ArrayBuffer");b.sharedArrayBuffer=he("SharedArrayBuffer");b.dataView=he("DataView");b.enumCase=(e,t)=>Object.values(t).includes(e);b.directInstanceOf=(e,t)=>Object.getPrototypeOf(e)===t.prototype;b.urlInstance=e=>he("URL")(e);b.urlString=e=>{if(!b.string(e))return!1;try{return new URL(e),!0}catch{return!1}};b.truthy=e=>Boolean(e);b.falsy=e=>!e;b.nan=e=>Number.isNaN(e);b.primitive=e=>b.null_(e)||Ff(typeof e);b.integer=e=>Number.isInteger(e);b.safeInteger=e=>Number.isSafeInteger(e);b.plainObject=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};b.typedArray=e=>Uf(zr(e));var Jf=e=>b.safeInteger(e)&&e>=0;b.arrayLike=e=>!b.nullOrUndefined(e)&&!b.function_(e)&&Jf(e.length);b.inRange=(e,t)=>{if(b.number(t))return e>=Math.min(0,t)&&e<=Math.max(t,0);if(b.array(t)&&t.length===2)return e>=Math.min(...t)&&e<=Math.max(...t);throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)};var Kf=1,Qf=["innerHTML","ownerDocument","style","attributes","nodeValue"];b.domElement=e=>b.object(e)&&e.nodeType===Kf&&b.string(e.nodeName)&&!b.plainObject(e)&&Qf.every(t=>t in e);b.observable=e=>e?e===e[Symbol.observable]?.()||e===e["@@observable"]?.():!1;b.nodeStream=e=>b.object(e)&&b.function_(e.pipe)&&!b.observable(e);b.infinite=e=>e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY;var Cl=e=>t=>b.integer(t)&&Math.abs(t%2)===e;b.evenInteger=Cl(0);b.oddInteger=Cl(1);b.emptyArray=e=>b.array(e)&&e.length===0;b.nonEmptyArray=e=>b.array(e)&&e.length>0;b.emptyString=e=>b.string(e)&&e.length===0;var Yf=e=>b.string(e)&&!/\S/.test(e);b.emptyStringOrWhitespace=e=>b.emptyString(e)||Yf(e);b.nonEmptyString=e=>b.string(e)&&e.length>0;b.nonEmptyStringAndNotWhitespace=e=>b.string(e)&&!b.emptyStringOrWhitespace(e);b.emptyObject=e=>b.object(e)&&!b.map(e)&&!b.set(e)&&Object.keys(e).length===0;b.nonEmptyObject=e=>b.object(e)&&!b.map(e)&&!b.set(e)&&Object.keys(e).length>0;b.emptySet=e=>b.set(e)&&e.size===0;b.nonEmptySet=e=>b.set(e)&&e.size>0;b.emptyMap=e=>b.map(e)&&e.size===0;b.nonEmptyMap=e=>b.map(e)&&e.size>0;b.propertyKey=e=>b.any([b.string,b.number,b.symbol],e);b.formData=e=>he("FormData")(e);b.urlSearchParams=e=>he("URLSearchParams")(e);var jl=(e,t,r)=>{if(!b.function_(t))throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`);if(r.length===0)throw new TypeError("Invalid number of values");return e.call(r,t)};b.any=(e,...t)=>(b.array(e)?e:[e]).some(r=>jl(Array.prototype.some,r,t));b.all=(e,...t)=>jl(Array.prototype.every,e,t);var z=(e,t,r,n={})=>{if(!e){let{multipleValues:o}=n,i=o?`received values of types ${[...new Set(r.map(s=>`\`${b(s)}\``))].join(", ")}`:`received value of type \`${b(r)}\``;throw new TypeError(`Expected value which is \`${t}\`, ${i}.`)}},L={undefined:e=>z(b.undefined(e),"undefined",e),string:e=>z(b.string(e),"string",e),number:e=>z(b.number(e),"number",e),bigint:e=>z(b.bigint(e),"bigint",e),function_:e=>z(b.function_(e),"Function",e),null_:e=>z(b.null_(e),"null",e),class_:e=>z(b.class_(e),"Class",e),boolean:e=>z(b.boolean(e),"boolean",e),symbol:e=>z(b.symbol(e),"symbol",e),numericString:e=>z(b.numericString(e),"string with a number",e),array:(e,t)=>{z(b.array(e),"Array",e),t&&e.forEach(t)},buffer:e=>z(b.buffer(e),"Buffer",e),blob:e=>z(b.blob(e),"Blob",e),nullOrUndefined:e=>z(b.nullOrUndefined(e),"null or undefined",e),object:e=>z(b.object(e),"Object",e),iterable:e=>z(b.iterable(e),"Iterable",e),asyncIterable:e=>z(b.asyncIterable(e),"AsyncIterable",e),generator:e=>z(b.generator(e),"Generator",e),asyncGenerator:e=>z(b.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>z(b.nativePromise(e),"native Promise",e),promise:e=>z(b.promise(e),"Promise",e),generatorFunction:e=>z(b.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>z(b.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>z(b.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>z(b.boundFunction(e),"Function",e),regExp:e=>z(b.regExp(e),"RegExp",e),date:e=>z(b.date(e),"Date",e),error:e=>z(b.error(e),"Error",e),map:e=>z(b.map(e),"Map",e),set:e=>z(b.set(e),"Set",e),weakMap:e=>z(b.weakMap(e),"WeakMap",e),weakSet:e=>z(b.weakSet(e),"WeakSet",e),weakRef:e=>z(b.weakRef(e),"WeakRef",e),int8Array:e=>z(b.int8Array(e),"Int8Array",e),uint8Array:e=>z(b.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>z(b.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>z(b.int16Array(e),"Int16Array",e),uint16Array:e=>z(b.uint16Array(e),"Uint16Array",e),int32Array:e=>z(b.int32Array(e),"Int32Array",e),uint32Array:e=>z(b.uint32Array(e),"Uint32Array",e),float32Array:e=>z(b.float32Array(e),"Float32Array",e),float64Array:e=>z(b.float64Array(e),"Float64Array",e),bigInt64Array:e=>z(b.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>z(b.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>z(b.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>z(b.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>z(b.dataView(e),"DataView",e),enumCase:(e,t)=>z(b.enumCase(e,t),"EnumCase",e),urlInstance:e=>z(b.urlInstance(e),"URL",e),urlString:e=>z(b.urlString(e),"string with a URL",e),truthy:e=>z(b.truthy(e),"truthy",e),falsy:e=>z(b.falsy(e),"falsy",e),nan:e=>z(b.nan(e),"NaN",e),primitive:e=>z(b.primitive(e),"primitive",e),integer:e=>z(b.integer(e),"integer",e),safeInteger:e=>z(b.safeInteger(e),"integer",e),plainObject:e=>z(b.plainObject(e),"plain object",e),typedArray:e=>z(b.typedArray(e),"TypedArray",e),arrayLike:e=>z(b.arrayLike(e),"array-like",e),domElement:e=>z(b.domElement(e),"HTMLElement",e),observable:e=>z(b.observable(e),"Observable",e),nodeStream:e=>z(b.nodeStream(e),"Node.js Stream",e),infinite:e=>z(b.infinite(e),"infinite number",e),emptyArray:e=>z(b.emptyArray(e),"empty array",e),nonEmptyArray:e=>z(b.nonEmptyArray(e),"non-empty array",e),emptyString:e=>z(b.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>z(b.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>z(b.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>z(b.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>z(b.emptyObject(e),"empty object",e),nonEmptyObject:e=>z(b.nonEmptyObject(e),"non-empty object",e),emptySet:e=>z(b.emptySet(e),"empty set",e),nonEmptySet:e=>z(b.nonEmptySet(e),"non-empty set",e),emptyMap:e=>z(b.emptyMap(e),"empty map",e),nonEmptyMap:e=>z(b.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>z(b.propertyKey(e),"PropertyKey",e),formData:e=>z(b.formData(e),"FormData",e),urlSearchParams:e=>z(b.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>z(b.evenInteger(e),"even integer",e),oddInteger:e=>z(b.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>z(b.directInstanceOf(e,t),"T",e),inRange:(e,t)=>z(b.inRange(e,t),"in range",e),any:(e,...t)=>z(b.any(e,...t),"predicate returns truthy for any value",t,{multipleValues:!0}),all:(e,...t)=>z(b.all(e,...t),"predicate returns truthy for all values",t,{multipleValues:!0})};Object.defineProperties(b,{class:{value:b.class_},function:{value:b.function_},null:{value:b.null_}});Object.defineProperties(L,{class:{value:L.class_},function:{value:L.function_},null:{value:L.null_}});var T=b,Xf=require("node:events"),Zf=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},ki=class{static fn(e){return(...t)=>new ki((r,n,o)=>{t.push(o),e(...t).then(r,n)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((t,r)=>{this._reject=r;let n=s=>{(!this._isCanceled||!i.shouldReject)&&(this._isPending=!1,t(s))},o=s=>{this._isPending=!1,r(s)},i=s=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(s)};Object.defineProperties(i,{shouldReject:{get:()=>this._rejectOnCancel,set:s=>{this._rejectOnCancel=s}}}),e(n,o,i)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let t of this._cancelHandlers)t()}catch(t){this._reject(t);return}this._rejectOnCancel&&this._reject(new Zf(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(ki.prototype,Promise.prototype);function ep(e){return T.object(e)&&"_onResponse"in e}var ge=class extends Error{constructor(e,t,r){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=t.code??"ERR_GOT_REQUEST_ERROR",this.input=t.input,ep(r)?(Object.defineProperty(this,"request",{enumerable:!1,value:r}),Object.defineProperty(this,"response",{enumerable:!1,value:r.response}),this.options=r.options):this.options=r,this.timings=this.request?.timings,T.string(t.stack)&&T.string(this.stack)){let n=this.stack.indexOf(this.message)+this.message.length,o=this.stack.slice(n).split(` +`).reverse(),i=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(` +`).reverse();for(;i.length>0&&i[0]===o[0];)o.shift();this.stack=`${this.stack.slice(0,n)}${o.reverse().join(` +`)}${i.reverse().join(` +`)}`}}},tp=class extends ge{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Hn=class extends ge{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},rp=class extends ge{constructor(e,t){super(e.message,e,t),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},sa=class extends ge{constructor(e,t){super(e.message,e,t),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},np=class extends ge{constructor(e,t,r){super(e.message,e,r),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=t}},aa=class extends ge{constructor(e,t){super(e.message,e,t),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},op=class extends ge{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},la=class extends ge{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},Il=me(require("node:process"),1),Do=require("node:buffer"),ip=require("node:stream"),ua=require("node:url"),Ho=me(require("node:http"),1),sp=require("events"),ap=require("util"),lp=me(tf(),1),up=e=>{if(e.timings)return e.timings;let t={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};e.timings=t;let r=s=>{s.once(sp.errorMonitor,()=>{t.error=Date.now(),t.phases.total=t.error-t.start})};r(e);let n=()=>{t.abort=Date.now(),t.phases.total=t.abort-t.start};e.prependOnceListener("abort",n);let o=s=>{if(t.socket=Date.now(),t.phases.wait=t.socket-t.start,ap.types.isProxy(s))return;let a=()=>{t.lookup=Date.now(),t.phases.dns=t.lookup-t.socket};s.prependOnceListener("lookup",a),(0,lp.default)(s,{connect:()=>{t.connect=Date.now(),t.lookup===void 0&&(s.removeListener("lookup",a),t.lookup=t.connect,t.phases.dns=t.lookup-t.socket),t.phases.tcp=t.connect-t.lookup},secureConnect:()=>{t.secureConnect=Date.now(),t.phases.tls=t.secureConnect-t.connect}})};e.socket?o(e.socket):e.prependOnceListener("socket",o);let i=()=>{t.upload=Date.now(),t.phases.request=t.upload-(t.secureConnect??t.connect)};return e.writableFinished?i():e.prependOnceListener("finish",i),e.prependOnceListener("response",s=>{t.response=Date.now(),t.phases.firstByte=t.response-t.upload,s.timings=t,r(s),s.prependOnceListener("end",()=>{e.off("abort",n),s.off("aborted",n),!t.phases.total&&(t.end=Date.now(),t.phases.download=t.end-t.response,t.phases.total=t.end-t.start)}),s.prependOnceListener("aborted",n)}),t},cp=up,hp=me(require("node:events"),1),gn=me(require("node:url"),1),dp=me(require("node:crypto"),1),$l=me(require("node:stream"),1),fp="text/plain",pp="us-ascii",Fo=(e,t)=>t.some(r=>r instanceof RegExp?r.test(e):r===e),mp=(e,{stripHash:t})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!r)throw new Error(`Invalid URL: ${e}`);let{type:n,data:o,hash:i}=r.groups,s=n.split(";");i=t?"":i;let a=!1;s[s.length-1]==="base64"&&(s.pop(),a=!0);let l=(s.shift()||"").toLowerCase(),u=[...s.map(d=>{let[h,c=""]=d.split("=").map(p=>p.trim());return h==="charset"&&(c=c.toLowerCase(),c===pp)?"":`${h}${c?`=${c}`:""}`}).filter(Boolean)];return a&&u.push("base64"),(u.length>0||l&&l!==fp)&&u.unshift(l),`data:${u.join(";")},${a?o.trim():o}${i?`#${i}`:""}`};function yp(e,t){if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...t},e=e.trim(),/^data:/i.test(e))return mp(e,t);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=e.startsWith("//");!r&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let n=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),t.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),t.stripAuthentication&&(n.username="",n.password=""),t.stripHash?n.hash="":t.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname){let i=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,s=0,a="";for(;;){let u=i.exec(n.pathname);if(!u)break;let d=u[0],h=u.index,c=n.pathname.slice(s,h);a+=c.replace(/\/{2,}/g,"/"),a+=d,s=h+d.length}let l=n.pathname.slice(s,n.pathname.length);a+=l.replace(/\/{2,}/g,"/"),n.pathname=a}if(n.pathname)try{n.pathname=decodeURI(n.pathname)}catch{}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let i=n.pathname.split("/"),s=i[i.length-1];Fo(s,t.removeDirectoryIndex)&&(i=i.slice(0,-1),n.pathname=i.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(let i of[...n.searchParams.keys()])Fo(i,t.removeQueryParameters)&&n.searchParams.delete(i);if(!Array.isArray(t.keepQueryParameters)&&t.removeQueryParameters===!0&&(n.search=""),Array.isArray(t.keepQueryParameters)&&t.keepQueryParameters.length>0)for(let i of[...n.searchParams.keys()])Fo(i,t.keepQueryParameters)||n.searchParams.delete(i);if(t.sortQueryParameters){n.searchParams.sort();try{n.search=decodeURIComponent(n.search)}catch{}}t.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,"")),t.removeExplicitPort&&n.port&&(n.port="");let o=e;return e=n.toString(),!t.removeSingleSlash&&n.pathname==="/"&&!o.endsWith("/")&&n.hash===""&&(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),r&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var gp=me(ul(),1),Wo=me(nf(),1),bp=require("node:stream");function hi(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t.toLowerCase(),r]))}var ca=class extends bp.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:t,body:r,url:n}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof t!="object")throw new TypeError("Argument `headers` should be an object");if(!(r instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof n!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(r),this.push(null)}}),this.statusCode=e,this.headers=hi(t),this.body=r,this.url=n}},bn=me(sf(),1),vp=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function _p(e,t){if(t._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set([...Object.keys(e),...vp]),n={};for(let o of r)o in t||(n[o]={get(){let i=e[o];return typeof i=="function"?i.bind(e):i},set(i){e[o]=i},enumerable:!0,configurable:!1});return Object.defineProperties(t,n),e.once("aborted",()=>{t.destroy(),t.emit("aborted")}),e.once("close",()=>{e.complete&&t.readable?t.once("end",()=>{t.emit("close")}):t.emit("close")}),t}var wp=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},xr=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},Sp=class{constructor(e,t){this.hooks=new Map,this.request=()=>(r,n)=>{let o;if(typeof r=="string")o=Vo(gn.default.parse(r)),r={};else if(r instanceof gn.default.URL)o=Vo(gn.default.parse(r.toString())),r={};else{let[h,...c]=(r.path??"").split("?"),p=c.length>0?`?${c.join("?")}`:"";o=Vo({...r,pathname:h,search:p})}r={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...Op(o)},r.headers=Object.fromEntries(Ep(r.headers).map(([h,c])=>[h.toLowerCase(),c]));let i=new hp.default,s=yp(gn.default.format(o),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${r.method}:${s}`;r.body&&r.method!==void 0&&["POST","PATCH","PUT"].includes(r.method)&&(r.body instanceof $l.default.Readable?r.cache=!1:a+=`:${dp.default.createHash("md5").update(r.body).digest("hex")}`);let l=!1,u=!1,d=h=>{u=!0;let c=!1,p=()=>{},m=new Promise(g=>{p=()=>{c||(c=!0,g())}}),O=async g=>{if(l){g.status=g.statusCode;let I=Wo.default.fromObject(l.cachePolicy).revalidatedPolicy(h,g);if(!I.modified){g.resume(),await new Promise(y=>{g.once("end",y)});let S=ha(I.policy.responseHeaders());g=new ca({statusCode:l.statusCode,headers:S,body:l.body,url:l.url}),g.cachePolicy=I.policy,g.fromCache=!0}}g.fromCache||(g.cachePolicy=new Wo.default(h,g,h),g.fromCache=!1);let M;h.cache&&g.cachePolicy.storable()?(M=Tp(g),(async()=>{try{let I=gp.default.buffer(g);await Promise.race([m,new Promise(v=>g.once("end",v))]);let S=await I,y={url:g.url,statusCode:g.fromCache?l.statusCode:g.statusCode,body:S,cachePolicy:g.cachePolicy.toObject()},_=h.strictTtl?g.cachePolicy.timeToLive():void 0;if(h.maxTtl&&(_=_?Math.min(_,h.maxTtl):h.maxTtl),this.hooks.size>0)for(let v of this.hooks.keys())y=await this.runHook(v,y,g);await this.cache.set(a,y,_)}catch(I){i.emit("error",new xr(I))}})()):h.cache&&l&&(async()=>{try{await this.cache.delete(a)}catch(I){i.emit("error",new xr(I))}})(),i.emit("response",M??g),typeof n=="function"&&n(M??g)};try{let g=this.cacheRequest(h,O);g.once("error",p),g.once("abort",p),i.emit("request",g)}catch(g){i.emit("error",new wp(g))}};return(async()=>{let h=async p=>{await Promise.resolve();let m=p.cache?await this.cache.get(a):void 0;if(typeof m>"u"&&!p.forceRefresh){d(p);return}let O=Wo.default.fromObject(m.cachePolicy);if(O.satisfiesWithoutRevalidation(p)&&!p.forceRefresh){let g=ha(O.responseHeaders()),M=new ca({statusCode:m.statusCode,headers:g,body:m.body,url:m.url});M.cachePolicy=O,M.fromCache=!0,i.emit("response",M),typeof n=="function"&&n(M)}else O.satisfiesWithoutRevalidation(p)&&Date.now()>=O.timeToLive()&&p.forceRefresh?(await this.cache.delete(a),p.headers=O.revalidationHeaders(p),d(p)):(l=m,p.headers=O.revalidationHeaders(p),d(p))},c=p=>i.emit("error",new xr(p));if(this.cache instanceof bn.default){let p=this.cache;p.once("error",c),i.on("error",()=>p.removeListener("error",c))}try{await h(r)}catch(p){r.automaticFailover&&!u&&d(r),i.emit("error",new xr(p))}})(),i},this.addHook=(r,n)=>{this.hooks.has(r)||this.hooks.set(r,n)},this.removeHook=r=>this.hooks.delete(r),this.getHook=r=>this.hooks.get(r),this.runHook=async(r,...n)=>this.hooks.get(r)?.(...n),t instanceof bn.default?this.cache=t:typeof t=="string"?this.cache=new bn.default({uri:t,namespace:"cacheable-request"}):this.cache=new bn.default({store:t,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},Ep=Object.entries,Tp=e=>{let t=new $l.PassThrough({autoDestroy:!1});return _p(e,t),e.pipe(t)},Op=e=>{let t={...e};return t.path=`${e.pathname||"/"}${e.search||""}`,delete t.pathname,delete t.search,t},Vo=e=>({protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}),ha=e=>{let t=[];for(let r of Object.keys(e))t[r.toLowerCase()]=e[r];return t},Rp=Sp,Pp=me(lf(),1),xp=me(ul(),1),da="abcdefghijklmnopqrstuvwxyz0123456789";function kp(){let e=16,t="";for(;e--;)t+=da[Math.random()*da.length<<0];return t}var fa=e=>String(e).replace(/\r|\n/g,(t,r,n)=>t==="\r"&&n[r+1]!==` +`||t===` +`&&n[r-1]!=="\r"?`\r +`:t),Ap=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function pa(e){if(Ap(e)!=="object")return!1;let t=Object.getPrototypeOf(e);return t==null?!0:(t.constructor&&t.constructor.toString())===Object.toString()}function ma(e,t){if(typeof t=="string"){for(let[r,n]of Object.entries(e))if(t.toLowerCase()===r.toLowerCase())return n}}var qp=e=>new Proxy(e,{get:(t,r)=>ma(t,r),has:(t,r)=>ma(t,r)!==void 0}),It=e=>typeof e=="function",Ai=e=>Boolean(e&&It(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&It(e.append)&&It(e.getAll)&&It(e.entries)&&It(e[Symbol.iterator])),ya=e=>String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),Rt=e=>Boolean(e&&typeof e=="object"&&It(e.constructor)&&e[Symbol.toStringTag]==="File"&&It(e.stream)&&e.name!=null),vr=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},de=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},_r,vt,wr,vn,Sr,Pt,Er,Tr,_n,Go,ga,Cp={enableAdditionalHeaders:!1},wn={writable:!1,configurable:!1},jp=class{constructor(e,t,r){if(_r.add(this),vt.set(this,`\r +`),wr.set(this,void 0),vn.set(this,void 0),Sr.set(this,"-".repeat(2)),Pt.set(this,new TextEncoder),Er.set(this,void 0),Tr.set(this,void 0),_n.set(this,void 0),!Ai(e))throw new TypeError("Expected first argument to be a FormData instance.");let n;if(pa(t)?r=t:n=t,n||(n=kp()),typeof n!="string")throw new TypeError("Expected boundary argument to be a string.");if(r&&!pa(r))throw new TypeError("Expected options argument to be an object.");vr(this,Tr,Array.from(e.entries()),"f"),vr(this,_n,{...Cp,...r},"f"),vr(this,wr,de(this,Pt,"f").encode(de(this,vt,"f")),"f"),vr(this,vn,de(this,wr,"f").byteLength,"f"),this.boundary=`form-data-boundary-${n}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,vr(this,Er,de(this,Pt,"f").encode(`${de(this,Sr,"f")}${this.boundary}${de(this,Sr,"f")}${de(this,vt,"f").repeat(2)}`),"f");let o={"Content-Type":this.contentType},i=de(this,_r,"m",ga).call(this);i&&(this.contentLength=i,o["Content-Length"]=i),this.headers=qp(Object.freeze(o)),Object.defineProperties(this,{boundary:wn,contentType:wn,contentLength:wn,headers:wn})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,t]of de(this,Tr,"f")){let r=Rt(t)?t:de(this,Pt,"f").encode(fa(t));yield de(this,_r,"m",Go).call(this,e,r),yield r,yield de(this,wr,"f")}yield de(this,Er,"f")}async*encode(){for(let e of this.values())Rt(e)?yield*e.stream():yield e}[(vt=new WeakMap,wr=new WeakMap,vn=new WeakMap,Sr=new WeakMap,Pt=new WeakMap,Er=new WeakMap,Tr=new WeakMap,_n=new WeakMap,_r=new WeakSet,Go=function(e,t){let r="";r+=`${de(this,Sr,"f")}${this.boundary}${de(this,vt,"f")}`,r+=`Content-Disposition: form-data; name="${ya(e)}"`,Rt(t)&&(r+=`; filename="${ya(t.name)}"${de(this,vt,"f")}`,r+=`Content-Type: ${t.type||"application/octet-stream"}`);let n=Rt(t)?t.size:t.byteLength;return de(this,_n,"f").enableAdditionalHeaders===!0&&n!=null&&!isNaN(n)&&(r+=`${de(this,vt,"f")}Content-Length: ${Rt(t)?t.size:t.byteLength}`),de(this,Pt,"f").encode(`${r}${de(this,vt,"f").repeat(2)}`)},ga=function(){let e=0;for(let[t,r]of de(this,Tr,"f")){let n=Rt(r)?r:de(this,Pt,"f").encode(fa(r)),o=Rt(n)?n.size:n.byteLength;if(o==null||isNaN(o))return;e+=de(this,_r,"m",Go).call(this,t,n).byteLength,e+=o,e+=de(this,vn,"f")}return String(e+de(this,Er,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}},Ip=require("node:buffer"),$p=require("node:util");function Ml(e){return T.nodeStream(e)&&T.function_(e.getBoundary)}async function Mp(e,t){if(t&&"content-length"in t)return Number(t["content-length"]);if(!e)return 0;if(T.string(e))return Ip.Buffer.byteLength(e);if(T.buffer(e))return e.length;if(Ml(e))return(0,$p.promisify)(e.getLength.bind(e))()}function Ll(e,t,r){let n={};for(let o of r){let i=(...s)=>{t.emit(o,...s)};n[o]=i,e.on(o,i)}return()=>{for(let[o,i]of Object.entries(n))e.off(o,i)}}var Lp=me(require("node:net"),1);function Np(){let e=[];return{once(t,r,n){t.once(r,n),e.push({origin:t,event:r,fn:n})},unhandleAll(){for(let t of e){let{origin:r,event:n,fn:o}=t;r.removeListener(n,o)}e.length=0}}}var ba=Symbol("reentry"),Bp=()=>{},Nl=class extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function Up(e,t,r){if(ba in e)return Bp;e[ba]=!0;let n=[],{once:o,unhandleAll:i}=Np(),s=(O,g,M)=>{let I=setTimeout(g,O,O,M);I.unref?.();let S=()=>{clearTimeout(I)};return n.push(S),S},{host:a,hostname:l}=r,u=(O,g)=>{e.destroy(new Nl(O,g))},d=()=>{for(let O of n)O();i()};if(e.once("error",O=>{if(d(),e.listenerCount("error")===0)throw O}),typeof t.request<"u"){let O=s(t.request,u,"request");o(e,"response",g=>{o(g,"end",O)})}if(typeof t.socket<"u"){let{socket:O}=t,g=()=>{u(O,"socket")};e.setTimeout(O,g),n.push(()=>{e.removeListener("timeout",g)})}let h=typeof t.lookup<"u",c=typeof t.connect<"u",p=typeof t.secureConnect<"u",m=typeof t.send<"u";return(h||c||p||m)&&o(e,"socket",O=>{let{socketPath:g}=e;if(O.connecting){let M=Boolean(g??Lp.default.isIP(l??a??"")!==0);if(h&&!M&&typeof O.address().address>"u"){let I=s(t.lookup,u,"lookup");o(O,"lookup",I)}if(c){let I=()=>s(t.connect,u,"connect");M?o(O,"connect",I()):o(O,"lookup",S=>{S===null&&o(O,"connect",I())})}p&&r.protocol==="https:"&&o(O,"connect",()=>{let I=s(t.secureConnect,u,"secureConnect");o(O,"secureConnect",I)})}if(m){let M=()=>s(t.send,u,"send");O.connecting?o(O,"connect",()=>{o(e,"upload-complete",M())}):o(e,"upload-complete",M())}}),typeof t.response<"u"&&o(e,"upload-complete",()=>{let O=s(t.response,u,"response");o(e,"response",O)}),typeof t.read<"u"&&o(e,"response",O=>{let g=s(t.read,u,"read");o(O,"end",g)}),d}function zp(e){e=e;let t={protocol:e.protocol,hostname:T.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return T.string(e.port)&&e.port.length>0&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username||""}:${e.password||""}`),t}var Dp=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,t){typeof e=="object"?this.weakMap.set(e,t):this.map.set(e,t)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}},Hp=({attemptCount:e,retryOptions:t,error:r,retryAfter:n,computedValue:o})=>{if(r.name==="RetryError")return 1;if(e>t.limit)return 0;let i=t.methods.includes(r.options.method),s=t.errorCodes.includes(r.code),a=r.response&&t.statusCodes.includes(r.response.statusCode);if(!i||!s&&!a)return 0;if(r.response){if(n)return n>o?0:n;if(r.response.statusCode===413)return 0}let l=Math.random()*t.noise;return Math.min(2**(e-1)*1e3,t.backoffLimit)+l},Fp=Hp,Wp=me(require("node:process"),1),Jo=require("node:util"),$t=require("node:url"),Vp=require("node:tls"),Gp=me(require("node:http"),1),Jp=me(require("node:https"),1),or=require("node:dns"),Ko=require("node:util"),Kp=me(require("node:os"),1),{Resolver:va}=or.promises,tr=Symbol("cacheableLookupCreateConnection"),Qo=Symbol("cacheableLookupInstance"),_a=Symbol("expires"),Qp=typeof or.ALL=="number",wa=e=>{if(!(e&&typeof e.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Yp=e=>{for(let t of e)t.family!==6&&(t.address=`::ffff:${t.address}`,t.family=6)},Sa=()=>{let e=!1,t=!1;for(let r of Object.values(Kp.default.networkInterfaces()))for(let n of r)if(!n.internal&&(n.family==="IPv6"?t=!0:e=!0,e&&t))return{has4:e,has6:t};return{has4:e,has6:t}},Xp=e=>Symbol.iterator in e,Sn=e=>e.catch(t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT")return[];throw t}),Ea={ttl:!0},Zp={all:!0},em={all:!0,family:4},tm={all:!0,family:6},rm=class{constructor({cache:e=new Map,maxTtl:t=1/0,fallbackDuration:r=3600,errorTtl:n=.15,resolver:o=new va,lookup:i=or.lookup}={}){if(this.maxTtl=t,this.errorTtl=n,this._cache=e,this._resolver=o,this._dnsLookup=i&&(0,Ko.promisify)(i),this.stats={cache:0,query:0},this._resolver instanceof va?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,Ko.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,Ko.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=Sa(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=r,r>0){let s=setInterval(()=>{this._hostnamesToFallback.clear()},r*1e3);s.unref&&s.unref(),this._fallbackInterval=s}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,r){if(typeof t=="function"?(r=t,t={}):typeof t=="number"&&(t={family:t}),!r)throw new Error("Callback must be a function.");this.lookupAsync(e,t).then(n=>{t.all?r(null,n):r(null,n.address,n.family,n.expires,n.ttl,n.source)},r)}async lookupAsync(e,t={}){typeof t=="number"&&(t={family:t});let r=await this.query(e);if(t.family===6){let n=r.filter(o=>o.family===6);t.hints&or.V4MAPPED&&(Qp&&t.hints&or.ALL||n.length===0)?Yp(r):r=n}else t.family===4&&(r=r.filter(n=>n.family===4));if(t.hints&or.ADDRCONFIG){let{_iface:n}=this;r=r.filter(o=>o.family===6?n.has6:n.has4)}if(r.length===0){let n=new Error(`cacheableLookup ENOTFOUND ${e}`);throw n.code="ENOTFOUND",n.hostname=e,n}return t.all?r:r[0]}async query(e){let t="cache",r=await this._cache.get(e);if(r&&this.stats.cache++,!r){let n=this._pending[e];if(n)this.stats.cache++,r=await n;else{t="query";let o=this.queryAndCache(e);this._pending[e]=o,this.stats.query++;try{r=await o}finally{delete this._pending[e]}}}return r=r.map(n=>({...n,source:t})),r}async _resolve(e){let[t,r]=await Promise.all([Sn(this._resolve4(e,Ea)),Sn(this._resolve6(e,Ea))]),n=0,o=0,i=0,s=Date.now();for(let a of t)a.family=4,a.expires=s+a.ttl*1e3,n=Math.max(n,a.ttl);for(let a of r)a.family=6,a.expires=s+a.ttl*1e3,o=Math.max(o,a.ttl);return t.length>0?r.length>0?i=Math.min(n,o):i=n:i=o,{entries:[...t,...r],cacheTtl:i}}async _lookup(e){try{let[t,r]=await Promise.all([Sn(this._dnsLookup(e,em)),Sn(this._dnsLookup(e,tm))]);return{entries:[...t,...r],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,t,r){if(this.maxTtl>0&&r>0){r=Math.min(r,this.maxTtl)*1e3,t[_a]=Date.now()+r;try{await this._cache.set(e,t,r)}catch(n){this.lookupAsync=async()=>{let o=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw o.cause=n,o}}Xp(this._cache)&&this._tick(r)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Zp);let t=await this._resolve(e);t.entries.length===0&&this._dnsLookup&&(t=await this._lookup(e),t.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let r=t.entries.length===0?this.errorTtl:t.cacheTtl;return await this._set(e,t.entries,r),t.entries}_tick(e){let t=this._nextRemovalTime;(!t||e{this._nextRemovalTime=!1;let r=1/0,n=Date.now();for(let[o,i]of this._cache){let s=i[_a];n>=s?this._cache.delete(o):s("lookup"in t||(t.lookup=this.lookup),e[tr](t,r))}uninstall(e){if(wa(e),e[tr]){if(e[Qo]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[tr],delete e[tr],delete e[Qo]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Sa(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}},nm=me(vf(),1);function om(e){let t=[],r=e.split(",");for(let n of r){let[o,...i]=n.split(";"),s=o.trim();if(s[0]!=="<"||s[s.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${s}`);let a=s.slice(1,-1),l={};if(i.length===0)throw new Error(`Unexpected end of Link header parameters: ${i.join(";")}`);for(let u of i){let d=u.trim(),h=d.indexOf("=");if(h===-1)throw new Error(`Failed to parse Link header: ${e}`);let c=d.slice(0,h).trim(),p=d.slice(h+1).trim();l[c]=p}t.push({reference:a,parameters:l})}return t}var[Ta,im]=Wp.default.versions.node.split(".").map(Number);function sm(e){for(let t in e){let r=e[t];L.any([T.string,T.number,T.boolean,T.null_,T.undefined],r)}}var am=new Map,Yo,lm=()=>Yo||(Yo=new rm,Yo),um={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:e})=>e,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(e){return e.request.options.responseType==="json"?e.body:JSON.parse(e.body)},paginate({response:e}){let t=e.headers.link;if(typeof t!="string"||t.trim()==="")return!1;let r=om(t).find(n=>n.parameters.rel==="next"||n.parameters.rel==='"next"');return r?{url:new $t.URL(r.reference,e.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},cm=e=>{let{hooks:t,retry:r}=e,n={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...r,errorCodes:[...r.errorCodes],methods:[...r.methods],statusCodes:[...r.statusCodes]},timeout:{...e.timeout},hooks:{init:[...t.init],beforeRequest:[...t.beforeRequest],beforeError:[...t.beforeError],beforeRedirect:[...t.beforeRedirect],beforeRetry:[...t.beforeRetry],afterResponse:[...t.afterResponse]},searchParams:e.searchParams?new $t.URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return n.url!==void 0&&(n.prefixUrl=""),n},hm=e=>{let{hooks:t,retry:r}=e,n={...e};return T.object(e.context)&&(n.context={...e.context}),T.object(e.cacheOptions)&&(n.cacheOptions={...e.cacheOptions}),T.object(e.https)&&(n.https={...e.https}),T.object(e.cacheOptions)&&(n.cacheOptions={...n.cacheOptions}),T.object(e.agent)&&(n.agent={...e.agent}),T.object(e.headers)&&(n.headers={...e.headers}),T.object(r)&&(n.retry={...r},T.array(r.errorCodes)&&(n.retry.errorCodes=[...r.errorCodes]),T.array(r.methods)&&(n.retry.methods=[...r.methods]),T.array(r.statusCodes)&&(n.retry.statusCodes=[...r.statusCodes])),T.object(e.timeout)&&(n.timeout={...e.timeout}),T.object(t)&&(n.hooks={...t},T.array(t.init)&&(n.hooks.init=[...t.init]),T.array(t.beforeRequest)&&(n.hooks.beforeRequest=[...t.beforeRequest]),T.array(t.beforeError)&&(n.hooks.beforeError=[...t.beforeError]),T.array(t.beforeRedirect)&&(n.hooks.beforeRedirect=[...t.beforeRedirect]),T.array(t.beforeRetry)&&(n.hooks.beforeRetry=[...t.beforeRetry]),T.array(t.afterResponse)&&(n.hooks.afterResponse=[...t.afterResponse])),T.object(e.pagination)&&(n.pagination={...e.pagination}),n},dm=e=>{let t=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(r=>typeof r=="number");if(t.length>0)return Math.min(...t)},Oa=(e,t,r)=>{let n=e.hooks?.init;if(n)for(let o of n)o(t,r)},ht=class{constructor(e,t,r){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),L.any([T.string,T.urlInstance,T.object,T.undefined],e),L.any([T.object,T.undefined],t),L.any([T.object,T.undefined],r),e instanceof ht||t instanceof ht)throw new TypeError("The defaults must be passed as the third argument");this._internals=cm(r?._internals??r??um),this._init=[...r?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(T.plainObject(e))try{this.merge(e),this.merge(t)}finally{this.url=e.url}else try{this.merge(t)}finally{if(t?.url!==void 0)if(e===void 0)this.url=t.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(n){throw n.options=this,n}}merge(e){if(e){if(e instanceof ht){for(let t of e._init)this.merge(t);return}e=hm(e),Oa(this,e,this),Oa(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let t=!1;for(let r in e)if(!(r==="mutableDefaults"||r==="handlers")&&r!=="url"){if(!(r in this))throw new Error(`Unexpected option: ${r}`);this[r]=e[r],t=!0}t&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){L.any([T.function_,T.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){L.plainObject(e);for(let t in e){if(!(t in this._internals.agent))throw new TypeError(`Unexpected agent option: ${t}`);L.any([T.object,T.undefined],e[t])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){L.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){L.plainObject(e);for(let t in e){if(!(t in this._internals.timeout))throw new Error(`Unexpected timeout option: ${t}`);L.any([T.number,T.undefined],e[t])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if(L.any([T.string,T.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:t}=this._internals.url;this._internals.url.href=e+t.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){L.any([T.string,T.buffer,T.nodeStream,T.generator,T.asyncGenerator,Ai,T.undefined],e),T.nodeStream(e)&&L.truthy(e.readable),e!==void 0&&(L.undefined(this._internals.form),L.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){L.any([T.plainObject,T.undefined],e),e!==void 0&&(L.undefined(this._internals.body),L.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(L.undefined(this._internals.body),L.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(L.any([T.string,T.urlInstance,T.undefined],e),e===void 0){this._internals.url=void 0;return}if(T.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let t=`${this.prefixUrl}${e.toString()}`,r=new $t.URL(t);if(this._internals.url=r,decodeURI(t),r.protocol==="unix:"&&(r.href=`http://unix${r.pathname}${r.search}`),r.protocol!=="http:"&&r.protocol!=="https:"){let n=new Error(`Unsupported protocol: ${r.protocol}`);throw n.code="ERR_UNSUPPORTED_PROTOCOL",n}if(this._internals.username&&(r.username=this._internals.username,this._internals.username=""),this._internals.password&&(r.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(r.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),r.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let n=/(?.+?):(?.+)/.exec(`${r.pathname}${r.search}`);if(n?.groups){let{socketPath:o,path:i}=n.groups;this._unixOptions={socketPath:o,path:i,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(L.any([T.object,T.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:t,getCookieString:r}=e;L.function_(t),L.function_(r),t.length===4&&r.length===0?(t=(0,Jo.promisify)(t.bind(e)),r=(0,Jo.promisify)(r.bind(e)),this._internals.cookieJar={setCookie:t,getCookieString:r}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){L.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){L.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new $t.URLSearchParams),this._internals.searchParams)}set searchParams(e){L.any([T.string,T.object,T.undefined],e);let t=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,t&&(t.search="");return}let r=this.searchParams,n;if(T.string(e))n=new $t.URLSearchParams(e);else if(e instanceof $t.URLSearchParams)n=e;else{sm(e),n=new $t.URLSearchParams;for(let o in e){let i=e[o];i===null?n.append(o,""):i===void 0?r.delete(o):n.append(o,i)}}if(this._merging){for(let o of n.keys())r.delete(o);for(let[o,i]of n)r.append(o,i)}else t?t.search=r.toString():this._internals.searchParams=r}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){L.any([T.function_,T.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){L.any([T.object,T.boolean,T.undefined],e),e===!0?this._internals.dnsCache=lm():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){L.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){L.object(e);for(let t in e){if(!(t in this._internals.hooks))throw new Error(`Unexpected hook event: ${t}`);let r=t,n=e[r];if(L.any([T.array,T.undefined],n),n)for(let o of n)L.function_(o);if(this._merging)n&&this._internals.hooks[r].push(...n);else{if(!n)throw new Error(`Missing hook event: ${t}`);this._internals.hooks[t]=[...n]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){L.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){L.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){L.any([T.object,T.string,T.boolean,T.undefined],e),e===!0?this._internals.cache=am:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){L.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,t=e?e.username:this._internals.username;return decodeURIComponent(t)}set username(e){L.string(e);let t=this._internals.url,r=encodeURIComponent(e);t?t.username=r:this._internals.username=r}get password(){let e=this._internals.url,t=e?e.password:this._internals.password;return decodeURIComponent(t)}set password(e){L.string(e);let t=this._internals.url,r=encodeURIComponent(e);t?t.password=r:this._internals.password=r}get http2(){return this._internals.http2}set http2(e){L.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){L.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){L.plainObject(e),this._merging?Object.assign(this._internals.headers,hi(e)):this._internals.headers=hi(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){L.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){L.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){L.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(L.plainObject(e),L.any([T.function_,T.undefined],e.calculateDelay),L.any([T.number,T.undefined],e.maxRetryAfter),L.any([T.number,T.undefined],e.limit),L.any([T.array,T.undefined],e.methods),L.any([T.array,T.undefined],e.statusCodes),L.any([T.array,T.undefined],e.errorCodes),L.any([T.number,T.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let r in e)if(!(r in this._internals.retry))throw new Error(`Unexpected retry option: ${r}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:t}=this._internals;t.methods=[...new Set(t.methods.map(r=>r.toUpperCase()))],t.statusCodes=[...new Set(t.statusCodes)],t.errorCodes=[...new Set(t.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){L.any([T.string,T.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){L.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){L.any([T.function_,T.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){L.plainObject(e),L.any([T.boolean,T.undefined],e.shared),L.any([T.number,T.undefined],e.cacheHeuristic),L.any([T.number,T.undefined],e.immutableMinTimeToLive),L.any([T.boolean,T.undefined],e.ignoreCargoCult);for(let t in e)if(!(t in this._internals.cacheOptions))throw new Error(`Cache option \`${t}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){L.plainObject(e),L.any([T.boolean,T.undefined],e.rejectUnauthorized),L.any([T.function_,T.undefined],e.checkServerIdentity),L.any([T.string,T.object,T.array,T.undefined],e.certificateAuthority),L.any([T.string,T.object,T.array,T.undefined],e.key),L.any([T.string,T.object,T.array,T.undefined],e.certificate),L.any([T.string,T.undefined],e.passphrase),L.any([T.string,T.buffer,T.array,T.undefined],e.pfx),L.any([T.array,T.undefined],e.alpnProtocols),L.any([T.string,T.undefined],e.ciphers),L.any([T.string,T.buffer,T.undefined],e.dhparam),L.any([T.string,T.undefined],e.signatureAlgorithms),L.any([T.string,T.undefined],e.minVersion),L.any([T.string,T.undefined],e.maxVersion),L.any([T.boolean,T.undefined],e.honorCipherOrder),L.any([T.number,T.undefined],e.tlsSessionLifetime),L.any([T.string,T.undefined],e.ecdhCurve),L.any([T.string,T.buffer,T.array,T.undefined],e.certificateRevocationLists);for(let t in e)if(!(t in this._internals.https))throw new Error(`HTTPS option \`${t}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");L.any([T.string,T.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){L.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){L.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){L.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){L.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){L.any([T.number,T.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){L.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,t){return(0,Jo.inspect)(this._internals,t)}createNativeRequestOptions(){let e=this._internals,t=e.url,r;t.protocol==="https:"?r=e.http2?e.agent:e.agent.https:r=e.agent.http;let{https:n}=e,{pfx:o}=n;return T.array(o)&&T.plainObject(o[0])&&(o=o.map(i=>({buf:i.buffer,passphrase:i.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:n.alpnProtocols,ca:n.certificateAuthority,cert:n.certificate,key:n.key,passphrase:n.passphrase,pfx:n.pfx,rejectUnauthorized:n.rejectUnauthorized,checkServerIdentity:n.checkServerIdentity??Vp.checkServerIdentity,ciphers:n.ciphers,honorCipherOrder:n.honorCipherOrder,minVersion:n.minVersion,maxVersion:n.maxVersion,sigalgs:n.signatureAlgorithms,sessionTimeout:n.tlsSessionLifetime,dhparam:n.dhparam,ecdhCurve:n.ecdhCurve,crl:n.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:r,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?dm(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:t}=this._internals;return!t&&e?this.getFallbackRequestFunction():t}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(Ta<15||Ta===15&&im<10){let t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw t.code="EUNSUPPORTED",t}return nm.default.auto}return Jp.default.request}return Gp.default.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}},Fn=e=>{let{statusCode:t}=e,r=e.request.options.followRedirect?299:399;return t>=200&&t<=r||t===304},Ra=class extends ge{constructor(e,t){let{options:r}=t.request;super(`${e.message} in "${r.url.toString()}"`,e,t.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},Pa=(e,t,r,n)=>{let{rawBody:o}=e;try{if(t==="text")return o.toString(n);if(t==="json")return o.length===0?"":r(o.toString(n));if(t==="buffer")return o}catch(i){throw new Ra(i,e)}throw new Ra({message:`Unknown body type '${t}'`,name:"Error"},e)};function fm(e){return e.writable&&!e.writableEnded}var pm=fm;function xa(e){return e.protocol==="unix:"||e.hostname==="unix"}var mm=T.string(Il.default.versions.brotli),ym=new Set(["GET","HEAD"]),Xo=new Dp,gm=new Set([300,301,302,303,304,307,308]),bm=["socket","connect","continue","information","upgrade"],Zo=()=>{},qi=class extends ip.Duplex{constructor(e,t,r){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=Zo,this._triggerRead=!1,this._cancelTimeouts=Zo,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=Zo,this.on("pipe",o=>{o.headers&&Object.assign(this.options.headers,o.headers)}),this.on("newListener",o=>{if(o==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new ht(e,t,r),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(o){let{options:i}=o;i&&(this.options=i),this.flush=async()=>{this.flush=async()=>{},this.destroy(o)};return}this.options.signal?.aborted&&this.destroy(new la(this)),this.options.signal?.addEventListener("abort",()=>{this.destroy(new la(this))});let{body:n}=this.options;T.nodeStream(n)&&n.once("error",o=>{this._flushed?this._beforeError(new sa(o,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new sa(o,this))}})}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:t,options:r}=this,n=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof ge||(e=new ge(e.message,e,this));let o=e;(async()=>{if(t?.readable&&!t.rawBody&&!this._request?.socket?.destroyed&&(t.setEncoding(this.readableEncoding),await this._setRawBody(t)&&(t.body=t.rawBody.toString())),this.listenerCount("retry")!==0){let i;try{let s;t&&"retry-after"in t.headers&&(s=Number(t.headers["retry-after"]),Number.isNaN(s)?(s=Date.parse(t.headers["retry-after"])-Date.now(),s<=0&&(s=1)):s*=1e3);let a=r.retry;i=await a.calculateDelay({attemptCount:n,retryOptions:a,error:o,retryAfter:s,computedValue:Fp({attemptCount:n,retryOptions:a,error:o,retryAfter:s,computedValue:a.maxRetryAfter??r.timeout.request??Number.POSITIVE_INFINITY})})}catch(s){this._error(new ge(s.message,s,this));return}if(i){if(await new Promise(s=>{let a=setTimeout(s,i);this._stopRetry=()=>{clearTimeout(a),s()}}),this.destroyed)return;try{for(let s of this.options.hooks.beforeRetry)await s(o,this.retryCount+1)}catch(s){this._error(new ge(s.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,s=>{let a=new qi(r.url,s,r);return a.retryCount=this.retryCount+1,Il.default.nextTick(()=>{a.flush()}),a});return}}this._error(o)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let t;for(;(t=e.read())!==null;){this._downloadedSize+=t.length;let r=this.downloadProgress;r.percent<1&&this.emit("downloadProgress",r),this.push(t)}}}_write(e,t,r){let n=()=>{this._writeRequest(e,t,r)};this._requestInitialized?n():this._jobs.push(n)}_final(e){let t=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(r=>{this._request._writableState?.errored||(r||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(r))})};this._requestInitialized?t():this._jobs.push(t)}_destroy(e,t){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this.options){let{body:r}=this.options;T.nodeStream(r)&&r.destroy()}this._request&&this._request.destroy(),e!==null&&!T.undefined(e)&&!(e instanceof ge)&&(e=new ge(e.message,e,this)),t(e)}pipe(e,t){return e instanceof Ho.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,t)}unpipe(e){return e instanceof Ho.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:t}=e,r=!T.undefined(e.form),n=!T.undefined(e.json),o=!T.undefined(e.body),i=ym.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=i,r||n||o){if(i)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let s=!T.string(t["content-type"]);if(o){if(Ai(e.body)){let l=new jp(e.body);s&&(t["content-type"]=l.headers["Content-Type"]),"Content-Length"in l.headers&&(t["content-length"]=l.headers["Content-Length"]),e.body=l.encode()}Ml(e.body)&&s&&(t["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(r){s&&(t["content-type"]="application/x-www-form-urlencoded");let{form:l}=e;e.form=void 0,e.body=new ua.URLSearchParams(l).toString()}else{s&&(t["content-type"]="application/json");let{json:l}=e;e.json=void 0,e.body=e.stringifyJson(l)}let a=await Mp(e.body,e.headers);T.undefined(t["content-length"])&&T.undefined(t["transfer-encoding"])&&!i&&!T.undefined(a)&&(t["content-length"]=String(a))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(t["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:t}=this,{url:r}=t;this._nativeResponse=e,t.decompress&&(e=(0,Pp.default)(e));let n=e.statusCode,o=e;o.statusMessage=o.statusMessage?o.statusMessage:Ho.default.STATUS_CODES[n],o.url=t.url.toString(),o.requestUrl=this.requestUrl,o.redirectUrls=this.redirectUrls,o.request=this,o.isFromCache=this._nativeResponse.fromCache??!1,o.ip=this.ip,o.retryCount=this.retryCount,o.ok=Fn(o),this._isFromCache=o.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=o,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",s=>{this._aborted=!0,e.destroy(),this._beforeError(new aa(s,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new aa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let i=e.headers["set-cookie"];if(T.object(t.cookieJar)&&i){let s=i.map(async a=>t.cookieJar.setCookie(a,r.toString()));t.ignoreInvalidCookies&&(s=s.map(async a=>{try{await a}catch{}}));try{await Promise.all(s)}catch(a){this._beforeError(a);return}}if(!this.isAborted){if(t.followRedirect&&e.headers.location&&gm.has(n)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=t.maxRedirects){this._beforeError(new tp(this));return}this._request=void 0;let s=new ht(void 0,void 0,this.options),a=n===303&&s.method!=="GET"&&s.method!=="HEAD",l=n!==307&&n!==308,u=s.methodRewriting&&l;(a||u)&&(s.method="GET",s.body=void 0,s.json=void 0,s.form=void 0,delete s.headers["content-length"]);try{let d=Do.Buffer.from(e.headers.location,"binary").toString(),h=new ua.URL(d,r);if(!xa(r)&&xa(h)){this._beforeError(new ge("Cannot redirect to UNIX socket",{},this));return}h.hostname!==r.hostname||h.port!==r.port?("host"in s.headers&&delete s.headers.host,"cookie"in s.headers&&delete s.headers.cookie,"authorization"in s.headers&&delete s.headers.authorization,(s.username||s.password)&&(s.username="",s.password="")):(h.username=s.username,h.password=s.password),this.redirectUrls.push(h),s.prefixUrl="",s.url=h;for(let c of s.hooks.beforeRedirect)await c(s,o);this.emit("redirect",s,o),this.options=s,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(t.isStream&&t.throwHttpErrors&&!Fn(o)){this._beforeError(new Hn(o));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let s of this._pipedServerResponses)if(!s.headersSent){for(let a in e.headers){let l=t.decompress?a!=="content-encoding":!0,u=e.headers[a];l&&s.setHeader(a,u)}s.statusCode=n}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let t=await(0,xp.buffer)(e);if(!this.isAborted)return this.response.rawBody=t,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(t){this._beforeError(t)}}_onRequest(e){let{options:t}=this,{timeout:r,url:n}=t;cp(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=Up(e,r,n);let o=t.cache?"cacheableResponse":"response";e.once(o,i=>{this._onResponse(i)}),e.once("error",i=>{this._aborted=!0,e.destroy(),i=i instanceof Nl?new np(i,this.timings,this):new ge(i.message,i,this),this._beforeError(i)}),this._unproxyEvents=Ll(e,this,bm),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((t,r)=>{super.write(e,n=>{if(n){r(n);return}t()})})}_sendBody(){let{body:e}=this.options,t=this.redirectUrls.length===0?this:this._request??this;T.nodeStream(e)?e.pipe(t):T.generator(e)||T.asyncGenerator(e)?(async()=>{try{for await(let r of e)await this._asyncWrite(r);super.end()}catch(r){this._beforeError(r)}})():T.undefined(e)?(this._cannotHaveBody||this._noPipe)&&t.end():(this._writeRequest(e,void 0,()=>{}),t.end())}_prepareCache(e){if(!Xo.has(e)){let t=new Rp((r,n)=>{let o=r._request(r,n);return T.promise(o)&&(o.once=(i,s)=>{if(i==="error")(async()=>{try{await o}catch(a){s(a)}})();else if(i==="abort")(async()=>{try{(await o).once("abort",s)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${i}`);return o}),o},e);Xo.set(e,t.request())}}async _createCacheableRequest(e,t){return new Promise((r,n)=>{Object.assign(t,zp(e));let o,i=Xo.get(t.cache)(t,async s=>{if(s._readableState.autoDestroy=!1,o){let a=()=>{s.req&&(s.complete=s.req.res.complete)};s.prependOnceListener("end",a),a(),(await o).emit("cacheableResponse",s)}r(s)});i.once("error",n),i.once("request",async s=>{o=s,r(o)})})}async _makeRequest(){let{options:e}=this,{headers:t,username:r,password:n}=e,o=e.cookieJar;for(let l in t)if(T.undefined(t[l]))delete t[l];else if(T.null_(t[l]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${l}\` header`);if(e.decompress&&T.undefined(t["accept-encoding"])&&(t["accept-encoding"]=mm?"gzip, deflate, br":"gzip, deflate"),r||n){let l=Do.Buffer.from(`${r}:${n}`).toString("base64");t.authorization=`Basic ${l}`}if(o){let l=await o.getCookieString(e.url.toString());T.nonEmptyString(l)&&(t.cookie=l)}e.prefixUrl="";let i;for(let l of e.hooks.beforeRequest){let u=await l(e);if(!T.undefined(u)){i=()=>u;break}}i||(i=e.getRequestFunction());let s=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=i,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let a=e.cache?this._createCacheableRequest:i;try{let l=a(s,this._requestOptions);T.promise(l)&&(l=await l),T.undefined(l)&&(l=e.getFallbackRequestFunction()(s,this._requestOptions),T.promise(l)&&(l=await l)),pm(l)?this._onRequest(l):this.writable?(this.once("finish",()=>{this._onResponse(l)}),this._sendBody()):this._onResponse(l)}catch(l){throw l instanceof xr?new rp(l,this):l}}async _error(e){try{if(!(e instanceof Hn&&!this.options.throwHttpErrors))for(let t of this.options.hooks.beforeError)e=await t(e)}catch(t){e=new ge(t.message,t,this)}this.destroy(e)}_writeRequest(e,t,r){!this._request||this._request.destroyed||this._request.write(e,t,n=>{if(!n&&!this._request.destroyed){this._uploadedSize+=Do.Buffer.byteLength(e,t);let o=this.uploadProgress;o.percent<1&&this.emit("uploadProgress",o)}r(n)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}},vm=class extends ge{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},_m=["request","response","redirect","uploadProgress","downloadProgress"];function ka(e){let t,r,n,o=new Xf.EventEmitter,i=new ki((a,l,u)=>{u(()=>{t.destroy()}),u.shouldReject=!1,u(()=>{l(new vm(t))});let d=h=>{u(()=>{});let c=e??new qi(void 0,void 0,n);c.retryCount=h,c._noPipe=!0,t=c,c.once("response",async O=>{let g=(O.headers["content-encoding"]??"").toLowerCase(),M=g==="gzip"||g==="deflate"||g==="br",{options:I}=c;if(M&&!I.decompress)O.body=O.rawBody;else try{O.body=Pa(O,I.responseType,I.parseJson,I.encoding)}catch(S){if(O.body=O.rawBody.toString(),Fn(O)){c._beforeError(S);return}}try{let S=I.hooks.afterResponse;for(let[y,_]of S.entries())if(O=await _(O,async v=>{throw I.merge(v),I.prefixUrl="",v.url&&(I.url=v.url),I.hooks.afterResponse=I.hooks.afterResponse.slice(0,y),new op(c)}),!(T.object(O)&&T.number(O.statusCode)&&!T.nullOrUndefined(O.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(S){c._beforeError(S);return}if(r=O,!Fn(O)){c._beforeError(new Hn(O));return}c.destroy(),a(c.options.resolveBodyOnly?O.body:O)});let p=O=>{if(i.isCanceled)return;let{options:g}=c;if(O instanceof Hn&&!g.throwHttpErrors){let{response:M}=O;c.destroy(),a(c.options.resolveBodyOnly?M.body:M);return}l(O)};c.once("error",p);let m=c.options?.body;c.once("retry",(O,g)=>{e=void 0;let M=c.options.body;if(m===M&&T.nodeStream(M)){g.message="Cannot retry with consumed body stream",p(g);return}n=c.options,d(O)}),Ll(c,o,_m),T.undefined(e)&&c.flush()};d(0)});i.on=(a,l)=>(o.on(a,l),i),i.off=(a,l)=>(o.off(a,l),i);let s=a=>{let l=(async()=>{await i;let{options:u}=r.request;return Pa(r,a,u.parseJson,u.encoding)})();return Object.defineProperties(l,Object.getOwnPropertyDescriptors(i)),l};return i.json=()=>{if(t.options){let{headers:a}=t.options;!t.writableFinished&&!("accept"in a)&&(a.accept="application/json")}return s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}var wm=async e=>new Promise(t=>{setTimeout(t,e)}),Sm=e=>T.function_(e),Em=["get","post","put","patch","head","delete"],Bl=e=>{e={options:new ht(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let t=(n,o,i=e.options)=>{let s=new qi(n,o,i),a,l=h=>(s.options=h,s._noPipe=!h.isStream,s.flush(),h.isStream?s:(a||(a=ka(s)),a)),u=0,d=h=>{let c=(e.handlers[u++]??l)(h,d);if(T.promise(c)&&!s.options.isStream&&(a||(a=ka(s)),c!==a)){let p=Object.getOwnPropertyDescriptors(a);for(let m in p)m in c&&delete p[m];Object.defineProperties(c,p),c.cancel=a.cancel}return c};return d(s.options)};t.extend=(...n)=>{let o=new ht(void 0,void 0,e.options),i=[...e.handlers],s;for(let a of n)Sm(a)?(o.merge(a.defaults.options),i.push(...a.defaults.handlers),s=a.defaults.mutableDefaults):(o.merge(a),a.handlers&&i.push(...a.handlers),s=a.mutableDefaults);return Bl({options:o,handlers:i,mutableDefaults:Boolean(s)})};let r=async function*(n,o){let i=new ht(n,o,e.options);i.resolveBodyOnly=!1;let{pagination:s}=i;L.function_(s.transform),L.function_(s.shouldContinue),L.function_(s.filter),L.function_(s.paginate),L.number(s.countLimit),L.number(s.requestLimit),L.number(s.backoff);let a=[],{countLimit:l}=s,u=0;for(;u{let i=[];for await(let s of r(n,o))i.push(s);return i},t.paginate.each=r,t.stream=(n,o)=>t(n,{...o,isStream:!0});for(let n of Em)t[n]=(o,i)=>t(o,{...i,method:n}),t.stream[n]=(o,i)=>t(o,{...i,method:n,isStream:!0});return e.mutableDefaults||(Object.freeze(e.handlers),e.options.freeze()),Object.defineProperty(t,"defaults",{value:e,writable:!1,configurable:!1,enumerable:!0}),t},Tm=Bl,Om={options:new ht,handlers:[],mutableDefaults:!1},Rm=Tm(Om),De=Rm,Mn="https://www.googleapis.com",Pm=`${Mn}/oauth2/v4/token`,Ci={extId:"No extension ID provided, e.g. https://chrome.google.com/webstore/detail/EXT_ID",clientId:"No client ID provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",clientSecret:"No client secret provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",refreshToken:"No refresh token provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md"},xm=Object.keys(Ci),km=class{options={};constructor(e){for(let t of xm){if(!e[t])throw new Error(Ci[t]);this.options[t]=e[t]}}get uploadEndpoint(){return`${Mn}/upload/chromewebstore/v1.1/items/${this.options.extId}`}getPublishEndpoint(e){return`${Mn}/chromewebstore/v1.1/items/${this.options.extId}/publish?publishTarget=${e}`}getInfoEndpoint(e){return`${Mn}/chromewebstore/v1.1/items/${this.options.extId}?projection=${e}`}async submit({filePath:e="",target:t="default"}){let r=await this.getAccessToken(),{uploadState:n,itemError:o}=await this.upload({readStream:(0,Bf.createReadStream)(e)},r);if(n==="FAILURE"||n==="NOT_FOUND")throw new Error(o.map(({error_detail:i})=>i).join(` +`));return this.publish({target:t},r)}async upload({readStream:e=null},t=""){if(!e)throw new Error("Read stream missing");let r=t||await this.getAccessToken();return De.put(this.uploadEndpoint,{headers:this.getHeaders(r),body:e,throwHttpErrors:!1}).json()}async publish({target:e="default"},t=""){let r=t||await this.getAccessToken();return De.post(this.getPublishEndpoint(e),{headers:this.getHeaders(r)}).json()}async get({projection:e="DRAFT"},t=""){let r=t||await this.getAccessToken();return De.get(this.getInfoEndpoint(e),{headers:this.getHeaders(r)}).json()}async getAccessToken(){return(await De.post(Pm,{json:{client_id:this.options.clientId,refresh_token:this.options.refreshToken,grant_type:"refresh_token",client_secret:this.options.clientSecret}}).json()).access_token}getHeaders(e){return{Authorization:`Bearer ${e}`,"x-goog-api-version":"2"}}},Am=require("module"),qm=(0,Am.createRequire)("/"),Cm;try{Cm=qm("worker_threads").Worker}catch{}var je=Uint8Array,Dt=Uint16Array,Ul=Uint32Array,zl=new je([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dl=new je([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jm=new je([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hl=function(e,t){for(var r=new Dt(31),n=0;n<31;++n)r[n]=t+=1<>>1|(ae&21845)<<1,ct=(ct&52428)>>>2|(ct&13107)<<2,ct=(ct&61680)>>>4|(ct&3855)<<4,di[ae]=((ct&65280)>>>8|(ct&255)<<8)>>>1;var ct,ae,qr=function(e,t,r){for(var n=e.length,o=0,i=new Dt(t);o>>l]=u}else for(a=new Dt(n),o=0;o>>15-e[o]);return a},Dr=new je(288);for(ae=0;ae<144;++ae)Dr[ae]=8;var ae;for(ae=144;ae<256;++ae)Dr[ae]=9;var ae;for(ae=256;ae<280;++ae)Dr[ae]=7;var ae;for(ae=280;ae<288;++ae)Dr[ae]=8;var ae,Gl=new je(32);for(ae=0;ae<32;++ae)Gl[ae]=5;var ae,Mm=qr(Dr,9,1),Lm=qr(Gl,5,1),ei=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},Ge=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},ti=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},Nm=function(e){return(e+7)/8|0},ji=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e.BYTES_PER_ELEMENT==2?Dt:e.BYTES_PER_ELEMENT==4?Ul:je)(r-t);return n.set(e.subarray(t,r)),n},Bm=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Je=function(e,t,r){var n=new Error(t||Bm[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Je),!r)throw n;return n},Um=function(e,t,r){var n=e.length;if(!n||r&&r.f&&!r.l)return t||new je(0);var o=!t||r,i=!r||r.i;r||(r={}),t||(t=new je(n*3));var s=function($e){var qe=t.length;if($e>qe){var Xe=new je(Math.max(qe*2,$e));Xe.set(t),t=Xe}},a=r.f||0,l=r.p||0,u=r.b||0,d=r.l,h=r.d,c=r.m,p=r.n,m=n*8;do{if(!d){a=Ge(e,l,1);var O=Ge(e,l+1,3);if(l+=3,O)if(O==1)d=Mm,h=Lm,c=9,p=5;else if(O==2){var g=Ge(e,l,31)+257,M=Ge(e,l+10,15)+4,I=g+Ge(e,l+5,31)+1;l+=14;for(var S=new je(I),y=new je(19),_=0;_>>4;if(q<16)S[_++]=q;else{var N=0,J=0;for(q==16?(J=3+Ge(e,l,3),l+=2,N=S[_-1]):q==17?(J=3+Ge(e,l,7),l+=3):q==18&&(J=11+Ge(e,l,127),l+=7);J--;)S[_++]=N}}var j=S.subarray(0,g),w=S.subarray(g);c=ei(j),p=ei(w),d=qr(j,c,1),h=qr(w,p,1)}else Je(1);else{var q=Nm(l)+4,C=e[q-4]|e[q-3]<<8,U=q+C;if(U>n){i&&Je(0);break}o&&s(u+C),t.set(e.subarray(q,U),u),r.b=u+=C,r.p=l=U*8,r.f=a;continue}if(l>m){i&&Je(0);break}}o&&s(u+131072);for(var A=(1<>>4;if(l+=N&15,l>m){i&&Je(0);break}if(N||Je(2),te<256)t[u++]=te;else if(te==256){Z=l,d=null;break}else{var Y=te-254;if(te>264){var _=te-257,re=zl[_];Y=Ge(e,l,(1<>>4;be||Je(3),l+=be&15;var w=$m[Pe];if(Pe>3){var re=Dl[Pe];w+=ti(e,l)&(1<m){i&&Je(0);break}o&&s(u+131072);for(var Ie=u+Y;u>>0},ri=function(e,t){return Ke(e,t)+Ke(e,t+4)*4294967296};function Dm(e,t){return Um(e,t)}var fi=typeof TextDecoder<"u"&&new TextDecoder,Hm=0;try{fi.decode(zm,{stream:!0}),Hm=1}catch{}var Fm=function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return[t,ji(e,r-1)];o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function Jl(e,t){if(t){for(var r="",n=0;n65558)&&Je(13);var o=it(e,n+8);if(!o)return{};var i=Ke(e,n+16),s=i==4294967295||o==65535;if(s){var a=Ke(e,n-12);s=Ke(e,a)==101075792,s&&(o=Ke(e,a+32),i=Ke(e,a+48))}for(var l=t&&t.filter,u=0;u(0,Km.resolve)((0,Qm.cwd)(),e),Kl=e=>(0,Ii.existsSync)($i(e));function no({zip:e="",file:t="",versionFile:r="package.json"}){let n=e||t;if(Kl(r)&&n.includes("{version}")){let o=JSON.parse((0,Ii.readFileSync)(r).toString());return n.replace("{version}",o.version||"")}else return n}function oo(e){let t=(0,Ii.readFileSync)($i(e)),r=Jm(t),n=Jl(r["manifest.json"]);return JSON.parse(n)}function Mi({extId:e=null,market:t="",zip:r=""}){let{name:n,version:o}=oo(r),i=Al[t]||t;console.log(`Successfully updated "${e}" (${n}) to version ${o} on ${i}!`)}var En={};function Ql({message:e="Message",prefix:t="",market:r=""}){var n;En[r]=1+((n=En?.[r])!=null?n:0);let o=`${r}: Step ${En[r]}) ${e}`;return t!=="Error"&&(t=t||"Info",o=`${t} ${o}`),t==="Info"?o=o.trim():t==="Error"&&(o=o.trimStart()),o}var Yl={},io=e=>{Yl[e]=!0,process.env.VERBOSE="true"};function Li(e=""){return t=>Yl[e]&&console.log(Ql({market:e,message:t}))}var Ni=(e,t,r)=>{let n=new Error(Ql({market:t,message:`Item "${r}": ${e.message}`,prefix:"Error"}));return n.stack=e.stack,n};function ni(e,t){return`${e}: ${t}`}var so=({market:e="chrome",options:t={},errorMap:r={}})=>{if(Object.keys(r).some(o=>{if(!t[o])throw new Error(ni(e,r[o]))}),!t.zip&&!t.file)throw new Error(ni(e,"No extension bundle provided"));let n=t.zip||t.file;if(!Kl(n))throw new Error(ni(e,`Extension bundle file doesn't exist: ${$i(n)}`))},Ir="chrome",Ym=Li(Ir);function Xm(e){return Vt(this,null,function*(){var t=e,{extId:r,target:n="default",zip:o,dryRun:i}=t,s=Ri(t,["extId","target","zip","dryRun"]);let a=new km(Oi({extId:r},s));if(Ym(`Updating extension with ID ${r}`),i)return!0;try{return yield a.submit({filePath:o,target:n}),Mi({extId:r,market:Ir,zip:o}),!0}catch(l){let u=oo(o);throw Ni(l,Ir,`"${r}" (${u.name})`)}})}function Zm(e){return Vt(this,null,function*(){return e.zip=no(e),e.verbose&&io(Ir),so({market:Ir,options:e,errorMap:Ci}),Xm(e)})}var ey=require("fs"),Bi={productId:"Product ID is required. To get one, go to: https://partner.microsoft.com/en-us/dashboard/microsoftedge/{product-id}/package/dashboard",clientId:"Client ID is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",clientSecret:"Client Secret is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",accessTokenUrl:"Access token URL is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi"},ty=Object.keys(Bi),ry=e=>new Promise(t=>setTimeout(t,e)),Aa="https://api.addons.microsoftedge.microsoft.com",ny=class{options={};constructor(e){for(let t of ty){if(!e[t])throw new Error(Bi[t]);this.options[t]=e[t]}}get productEndpoint(){return`${Aa}/v1/products/${this.options.productId}`}get publishEndpoint(){return`${this.productEndpoint}/submissions`}get uploadEndpoint(){return`${this.publishEndpoint}/draft/package`}async submit({filePath:e="",notes:t=""}){let r=await this.getAccessToken(),n=await this.upload((0,ey.createReadStream)(e),r);return await this.waitForUpload(n,r),this.publish(t,r)}async publish(e="",t=null){let r={headers:{Authorization:`Bearer ${t||await this.getAccessToken()}`,"Content-Type":"application/x-www-form-urlencoded"}};e.length>0&&(r.body=`{ "notes"="${e}" }`);let n=await De.post(this.publishEndpoint,r);return this.handleTempStatus(n.statusCode,"Submit"),n.headers.location}async upload(e=null,t=null){let r=t||await this.getAccessToken(),n=await De.post(this.uploadEndpoint,{body:e,headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/zip"}});return this.handleTempStatus(n.statusCode,"Upload"),n.headers.location}async getPublishStatus(e,t=null){let r=t||await this.getAccessToken(),n=`${this.publishEndpoint}/operations/${e}`;return De.get(n,{headers:{Authorization:`Bearer ${r}`}}).json()}async waitForUpload(e,t=null,r=5,n=3e3){let o=t||await this.getAccessToken(),i=`${this.uploadEndpoint}/operations/${e}`,s,a,l=0;for(;a!=="Succeeded"&&l{if(e!==202)throw e>=500?new Error("Edge server error, please try again later"):new Error(`${t} failed, double check your api credentials`)};getAccessToken=async()=>(await De.post(`${this.options.accessTokenUrl}`,{body:`client_id=${this.options.clientId}&scope=${Aa}/.default&client_secret=${this.options.clientSecret}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).json()).access_token},$r="edge",oy=Li($r);function iy(e){return Vt(this,null,function*(){var t=e,{productId:r,notes:n,zip:o,dryRun:i}=t,s=Ri(t,["productId","notes","zip","dryRun"]);let a=oo(o),l=new ny(Oi({productId:r},s));if(oy(`Updating extension with Product ID ${r}`),i)return!0;try{return yield l.submit({filePath:o,notes:n}),Mi({extId:r,market:$r,zip:o}),!0}catch(u){throw Ni(u,$r,`"${r}" (${a.name})`)}})}function sy(e){return Vt(this,null,function*(){return e.zip=no(e),e.verbose&&io($r),so({market:$r,options:e,errorMap:Bi}),iy(e)})}var ve=e=>typeof e=="function",ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:e=>`Symbol(${e})`;function Xl(){}function Ee(e){return typeof e=="object"&&e!==null||typeof e=="function"}var Zl=Xl;function se(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}var Ui=Promise,ay=Promise.prototype.then,ly=Promise.resolve.bind(Ui),uy=Promise.reject.bind(Ui);function Re(e){return new Ui(e)}function le(e){return ly(e)}function X(e){return uy(e)}function dt(e,t,r){return ay.call(e,t,r)}function Se(e,t,r){dt(dt(e,t,r),void 0,Zl)}function qa(e,t){Se(e,t)}function Ca(e,t){Se(e,void 0,t)}function Qe(e,t,r){return dt(e,t,r)}function lr(e){dt(e,void 0,Zl)}var Ln=e=>{if(typeof queueMicrotask=="function")Ln=queueMicrotask;else{let t=le(void 0);Ln=r=>dt(t,r)}return Ln(e)};function ao(e,t,r){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Gt(e,t,r){try{return le(ao(e,t,r))}catch(n){return X(n)}}var He=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,r=t;t._elements.length===16383&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){let e=this._front,t=e,r=this._cursor,n=r+1,o=e._elements,i=o[r];return n===16384&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),o[r]=void 0,i}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&r._next===void 0||t===n.length&&(r=r._next,n=r._elements,t=0,n.length===0));)e(n[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}},eu=ne("[[AbortSteps]]"),tu=ne("[[ErrorSteps]]"),zi=ne("[[CancelSteps]]"),Di=ne("[[PullSteps]]"),Hi=ne("[[ReleaseSteps]]");function ru(e,t){e._ownerReadableStream=t,t._reader=e,t._state==="readable"?pi(e):t._state==="closed"?function(r){pi(r),su(r)}(e):iu(e,t._storedError)}function nu(e,t){return Lu(e._ownerReadableStream,t)}function ou(e){let t=e._ownerReadableStream;t._state==="readable"?Fi(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(r,n){iu(r,n)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._readableStreamController[Hi](),t._reader=void 0,e._ownerReadableStream=void 0}function ur(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function pi(e){e._closedPromise=Re((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r})}function iu(e,t){pi(e),Fi(e,t)}function Fi(e,t){e._closedPromise_reject!==void 0&&(lr(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function su(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var ja=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},cy=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function ft(e,t){if(e!==void 0&&typeof(r=e)!="object"&&typeof r!="function")throw new TypeError(`${t} is not an object.`);var r}function Ye(e,t){if(typeof e!="function")throw new TypeError(`${t} is not a function.`)}function au(e,t){if(!function(r){return typeof r=="object"&&r!==null||typeof r=="function"}(e))throw new TypeError(`${t} is not an object.`)}function pt(e,t,r){if(e===void 0)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function mi(e,t,r){if(e===void 0)throw new TypeError(`${t} is required in '${r}'.`)}function Wi(e){return Number(e)}function Ia(e){return e===0?0:e}function lu(e,t){let r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=Ia(n),!ja(n))throw new TypeError(`${t} is not a finite number`);if(n=function(o){return Ia(cy(o))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return ja(n)&&n!==0?n:0}function kr(e){if(!Ee(e)||typeof e.getReader!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function uu(e){if(!Ee(e)||typeof e.getWriter!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function cu(e,t){if(!Ft(e))throw new TypeError(`${t} is not a ReadableStream.`)}function hu(e,t){e._reader._readRequests.push(t)}function Vi(e,t,r){let n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function lo(e){return e._reader._readRequests.length}function du(e){let t=e._reader;return t!==void 0&&!!Ht(t)}var Mt=class{constructor(e){if(pt(e,1,"ReadableStreamDefaultReader"),cu(e,"First parameter"),hr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ru(this,e),this._readRequests=new He}get closed(){return Ht(this)?this._closedPromise:X(Tn("closed"))}cancel(e){return Ht(this)?this._ownerReadableStream===void 0?X(ur("cancel")):nu(this,e):X(Tn("cancel"))}read(){if(!Ht(this))return X(Tn("read"));if(this._ownerReadableStream===void 0)return X(ur("read from"));let e,t,r=Re((n,o)=>{e=n,t=o});return function(n,o){let i=n._ownerReadableStream;i._disturbed=!0,i._state==="closed"?o._closeSteps():i._state==="errored"?o._errorSteps(i._storedError):i._readableStreamController[Di](o)}(this,{_chunkSteps:n=>e({value:n,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:n=>t(n)}),r}releaseLock(){if(!Ht(this))throw Tn("releaseLock");this._ownerReadableStream!==void 0&&function(e){ou(e);let t=new TypeError("Reader was released");fu(e,t)}(this)}};function Ht(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof Mt}function fu(e,t){let r=e._readRequests;e._readRequests=new He,r.forEach(n=>{n._errorSteps(t)})}function Tn(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(Mt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),se(Mt.prototype.cancel,"cancel"),se(Mt.prototype.read,"read"),se(Mt.prototype.releaseLock,"releaseLock"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Mt.prototype,ne.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var pu=class{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Qe(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=()=>this._returnSteps(e);return this._ongoingPromise?Qe(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader;return e===void 0?X(ur("iterate")):dt(e.read(),t=>{var r;return this._ongoingPromise=void 0,t.done&&(this._isFinished=!0,(r=this._reader)===null||r===void 0||r.releaseLock(),this._reader=void 0),t},t=>{var r;throw this._ongoingPromise=void 0,this._isFinished=!0,(r=this._reader)===null||r===void 0||r.releaseLock(),this._reader=void 0,t})}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(t===void 0)return X(ur("finish iterating"));if(this._reader=void 0,!this._preventCancel){let r=t.cancel(e);return t.releaseLock(),Qe(r,()=>({value:e,done:!0}))}return t.releaseLock(),le({value:e,done:!0})}},mu={next(){return $a(this)?this._asyncIteratorImpl.next():X(Ma("next"))},return(e){return $a(this)?this._asyncIteratorImpl.return(e):X(Ma("return"))}};function $a(e){if(!Ee(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof pu}catch{return!1}}function Ma(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}typeof ne.asyncIterator=="symbol"&&Object.defineProperty(mu,ne.asyncIterator,{value(){return this},writable:!0,configurable:!0});var yu=Number.isNaN||function(e){return e!=e};function gu(e,t,r,n,o){new Uint8Array(e).set(new Uint8Array(r,n,o),t)}function La(e){let t=function(r,n,o){if(r.slice)return r.slice(n,o);let i=o-n,s=new ArrayBuffer(i);return gu(s,0,r,n,i),s}(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function yi(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function Gi(e,t,r){if(typeof(n=r)!="number"||yu(n)||n<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var n;e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Et(e){e._queue=new He,e._queueTotalSize=0}var ir=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!oi(this))throw ii("view");return this._view}respond(e){if(!oi(this))throw ii("respond");if(pt(e,1,"respond"),e=lu(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(t,r){let n=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(n.bytesFilled+r>n.byteLength)throw new RangeError("bytesWritten out of range")}n.buffer=n.buffer,Na(t,r)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!oi(this))throw ii("respondWithNewView");if(pt(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");e.buffer,function(t,r){let n=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(n.byteOffset+n.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(n.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(n.bytesFilled+r.byteLength>n.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let o=r.byteLength;n.buffer=r.buffer,Na(t,o)}(this._associatedReadableByteStreamController,e)}};Object.defineProperties(ir.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),se(ir.prototype.respond,"respond"),se(ir.prototype.respondWithNewView,"respondWithNewView"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(ir.prototype,ne.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Lt=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!nr(this))throw Or("byobRequest");return function(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(ir.prototype);(function(o,i,s){o._associatedReadableByteStreamController=i,o._view=s})(n,e,r),e._byobRequest=n}return e._byobRequest}(this)}get desiredSize(){if(!nr(this))throw Or("desiredSize");return Ou(this)}close(){if(!nr(this))throw Or("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if(e!=="readable")throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);(function(t){let r=t._controlledReadableByteStream;if(!(t._closeRequested||r._state!=="readable")){if(t._queueTotalSize>0)return void(t._closeRequested=!0);if(t._pendingPullIntos.length>0&&t._pendingPullIntos.peek().bytesFilled>0){let n=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(t,n),n}Wn(t),Lr(r)}})(this)}enqueue(e){if(!nr(this))throw Or("enqueue");if(pt(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);(function(r,n){let o=r._controlledReadableByteStream;if(r._closeRequested||o._state!=="readable")return;let i=n.buffer,s=n.byteOffset,a=n.byteLength,l=i;if(r._pendingPullIntos.length>0){let u=r._pendingPullIntos.peek();u.buffer,Ji(r),u.buffer=u.buffer,u.readerType==="none"&&wu(r,u)}du(o)?(function(u){let d=u._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(u._queueTotalSize===0)return;Ba(u,d._readRequests.shift())}}(r),lo(o)===0?Nn(r,l,s,a):(r._pendingPullIntos.length>0&&ar(r),Vi(o,new Uint8Array(l,s,a),!1))):Ki(o)?(Nn(r,l,s,a),bi(r)):Nn(r,l,s,a),Wt(r)})(this,e)}error(e){if(!nr(this))throw Or("error");cr(this,e)}[zi](e){bu(this),Et(this);let t=this._cancelAlgorithm(e);return Wn(this),t}[Di](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void Ba(this,e);let r=this._autoAllocateChunkSize;if(r!==void 0){let n;try{n=new ArrayBuffer(r)}catch(i){return void e._errorSteps(i)}let o={buffer:n,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}hu(t,e),Wt(this)}[Hi](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new He,this._pendingPullIntos.push(e)}}};function nr(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Lt}function oi(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof ir}function Wt(e){if(function(t){let r=t._controlledReadableByteStream;return r._state!=="readable"||t._closeRequested||!t._started?!1:!!(du(r)&&lo(r)>0||Ki(r)&&Ru(r)>0||Ou(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Se(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Wt(e)),null),t=>(cr(e,t),null))}}function bu(e){Ji(e),e._pendingPullIntos=new He}function gi(e,t){let r=!1;e._state==="closed"&&(r=!0);let n=vu(t);t.readerType==="default"?Vi(e,n,r):function(o,i,s){let a=o._reader._readIntoRequests.shift();s?a._closeSteps(i):a._chunkSteps(i)}(e,n,r)}function vu(e){let t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Nn(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function _u(e,t,r,n){let o;try{o=t.slice(r,r+n)}catch(i){throw cr(e,i),i}Nn(e,o,0,n)}function wu(e,t){t.bytesFilled>0&&_u(e,t.buffer,t.byteOffset,t.bytesFilled),ar(e)}function Su(e,t){let r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,o=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+o,s=i-i%r,a=o,l=!1;s>n&&(a=s-t.bytesFilled,l=!0);let u=e._queue;for(;a>0;){let d=u.peek(),h=Math.min(a,d.byteLength),c=t.byteOffset+t.bytesFilled;gu(t.buffer,c,d.buffer,d.byteOffset,h),d.byteLength===h?u.shift():(d.byteOffset+=h,d.byteLength-=h),e._queueTotalSize-=h,Eu(e,h,t),a-=h}return l}function Eu(e,t,r){r.bytesFilled+=t}function Tu(e){e._queueTotalSize===0&&e._closeRequested?(Wn(e),Lr(e._controlledReadableByteStream)):Wt(e)}function Ji(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function bi(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let t=e._pendingPullIntos.peek();Su(e,t)&&(ar(e),gi(e._controlledReadableByteStream,t))}}function Na(e,t){let r=e._pendingPullIntos.peek();Ji(e),e._controlledReadableByteStream._state==="closed"?function(n,o){o.readerType==="none"&&ar(n);let i=n._controlledReadableByteStream;if(Ki(i))for(;Ru(i)>0;)gi(i,ar(n))}(e,r):function(n,o,i){if(Eu(0,o,i),i.readerType==="none")return wu(n,i),void bi(n);if(i.bytesFilled0){let a=i.byteOffset+i.bytesFilled;_u(n,i.buffer,a-s,s)}i.bytesFilled-=s,gi(n._controlledReadableByteStream,i),bi(n)}(e,t,r),Wt(e)}function ar(e){return e._pendingPullIntos.shift()}function Wn(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function cr(e,t){let r=e._controlledReadableByteStream;r._state==="readable"&&(bu(e),Et(e),Wn(e),Nu(r,t))}function Ba(e,t){let r=e._queue.shift();e._queueTotalSize-=r.byteLength,Tu(e);let n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(n)}function Ou(e){let t=e._controlledReadableByteStream._state;return t==="errored"?null:t==="closed"?0:e._strategyHWM-e._queueTotalSize}function hy(e,t,r){let n=Object.create(Lt.prototype),o,i,s;o=t.start!==void 0?()=>t.start(n):()=>{},i=t.pull!==void 0?()=>t.pull(n):()=>le(void 0),s=t.cancel!==void 0?l=>t.cancel(l):()=>le(void 0);let a=t.autoAllocateChunkSize;if(a===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(l,u,d,h,c,p,m){u._controlledReadableByteStream=l,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,Et(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=p,u._pullAlgorithm=h,u._cancelAlgorithm=c,u._autoAllocateChunkSize=m,u._pendingPullIntos=new He,l._readableStreamController=u,Se(le(d()),()=>(u._started=!0,Wt(u),null),O=>(cr(u,O),null))})(e,n,o,i,s,r,a)}function ii(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Or(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Ua(e,t){e._reader._readIntoRequests.push(t)}function Ru(e){return e._reader._readIntoRequests.length}function Ki(e){let t=e._reader;return t!==void 0&&!!sr(t)}Object.defineProperties(Lt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),se(Lt.prototype.close,"close"),se(Lt.prototype.enqueue,"enqueue"),se(Lt.prototype.error,"error"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Lt.prototype,ne.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var Nt=class{constructor(e){if(pt(e,1,"ReadableStreamBYOBReader"),cu(e,"First parameter"),hr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!nr(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ru(this,e),this._readIntoRequests=new He}get closed(){return sr(this)?this._closedPromise:X(On("closed"))}cancel(e){return sr(this)?this._ownerReadableStream===void 0?X(ur("cancel")):nu(this,e):X(On("cancel"))}read(e){if(!sr(this))return X(On("read"));if(!ArrayBuffer.isView(e))return X(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return X(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return X(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,this._ownerReadableStream===void 0)return X(ur("read from"));let t,r,n=Re((o,i)=>{t=o,r=i});return function(o,i,s){let a=o._ownerReadableStream;a._disturbed=!0,a._state==="errored"?s._errorSteps(a._storedError):function(l,u,d){let h=l._controlledReadableByteStream,c=1;u.constructor!==DataView&&(c=u.constructor.BYTES_PER_ELEMENT);let p=u.constructor,m=u.buffer,O={buffer:m,bufferByteLength:m.byteLength,byteOffset:u.byteOffset,byteLength:u.byteLength,bytesFilled:0,elementSize:c,viewConstructor:p,readerType:"byob"};if(l._pendingPullIntos.length>0)return l._pendingPullIntos.push(O),void Ua(h,d);if(h._state!=="closed"){if(l._queueTotalSize>0){if(Su(l,O)){let g=vu(O);return Tu(l),void d._chunkSteps(g)}if(l._closeRequested){let g=new TypeError("Insufficient bytes to fill elements in the given buffer");return cr(l,g),void d._errorSteps(g)}}l._pendingPullIntos.push(O),Ua(h,d),Wt(l)}else{let g=new p(O.buffer,O.byteOffset,0);d._closeSteps(g)}}(a._readableStreamController,i,s)}(this,e,{_chunkSteps:o=>t({value:o,done:!1}),_closeSteps:o=>t({value:o,done:!0}),_errorSteps:o=>r(o)}),n}releaseLock(){if(!sr(this))throw On("releaseLock");this._ownerReadableStream!==void 0&&function(e){ou(e);let t=new TypeError("Reader was released");Pu(e,t)}(this)}};function sr(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Nt}function Pu(e,t){let r=e._readIntoRequests;e._readIntoRequests=new He,r.forEach(n=>{n._errorSteps(t)})}function On(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Mr(e,t){let{highWaterMark:r}=e;if(r===void 0)return t;if(yu(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Vn(e){let{size:t}=e;return t||(()=>1)}function Gn(e,t){ft(e,t);let r=e?.highWaterMark,n=e?.size;return{highWaterMark:r===void 0?void 0:Wi(r),size:n===void 0?void 0:dy(n,`${t} has member 'size' that`)}}function dy(e,t){return Ye(e,t),r=>Wi(e(r))}function fy(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function py(e,t,r){return Ye(e,r),()=>Gt(e,t,[])}function my(e,t,r){return Ye(e,r),n=>ao(e,t,[n])}function yy(e,t,r){return Ye(e,r),(n,o)=>Gt(e,t,[n,o])}Object.defineProperties(Nt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),se(Nt.prototype.cancel,"cancel"),se(Nt.prototype.read,"read"),se(Nt.prototype.releaseLock,"releaseLock"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Nt.prototype,ne.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var gy=typeof AbortController=="function",Bt=class{constructor(e={},t={}){e===void 0?e=null:au(e,"First parameter");let r=Gn(t,"Second parameter"),n=function(s,a){ft(s,a);let l=s?.abort,u=s?.close,d=s?.start,h=s?.type,c=s?.write;return{abort:l===void 0?void 0:fy(l,s,`${a} has member 'abort' that`),close:u===void 0?void 0:py(u,s,`${a} has member 'close' that`),start:d===void 0?void 0:my(d,s,`${a} has member 'start' that`),write:c===void 0?void 0:yy(c,s,`${a} has member 'write' that`),type:h}}(e,"First parameter");var o;if((o=this)._state="writable",o._storedError=void 0,o._writer=void 0,o._writableStreamController=void 0,o._writeRequests=new He,o._inFlightWriteRequest=void 0,o._closeRequest=void 0,o._inFlightCloseRequest=void 0,o._pendingAbortRequest=void 0,o._backpressure=!1,n.type!==void 0)throw new RangeError("Invalid type is specified");let i=Vn(r);(function(s,a,l,u){let d=Object.create(Jn.prototype),h,c,p,m;h=a.start!==void 0?()=>a.start(d):()=>{},c=a.write!==void 0?O=>a.write(O,d):()=>le(void 0),p=a.close!==void 0?()=>a.close():()=>le(void 0),m=a.abort!==void 0?O=>a.abort(O):()=>le(void 0),function(O,g,M,I,S,y,_,v){g._controlledWritableStream=O,O._writableStreamController=g,g._queue=void 0,g._queueTotalSize=void 0,Et(g),g._abortReason=void 0,g._abortController=function(){if(gy)return new AbortController}(),g._started=!1,g._strategySizeAlgorithm=v,g._strategyHWM=_,g._writeAlgorithm=I,g._closeAlgorithm=S,g._abortAlgorithm=y;let R=Zi(g);Xi(O,R);let $=M();Se(le($),()=>(g._started=!0,uo(g),null),x=>(g._started=!0,vi(O,x),null))}(s,d,h,c,p,m,l,u)})(this,n,Mr(r,1),i)}get locked(){if(!st(this))throw Pn("locked");return Bn(this)}abort(e){return st(this)?Bn(this)?X(new TypeError("Cannot abort a stream that already has a writer")):xu(this,e):X(Pn("abort"))}close(){return st(this)?Bn(this)?X(new TypeError("Cannot close a stream that already has a writer")):St(this)?X(new TypeError("Cannot close an already-closing stream")):ku(this):X(Pn("close"))}getWriter(){if(!st(this))throw Pn("getWriter");return new wt(this)}};function st(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Bt}function Bn(e){return e._writer!==void 0}function xu(e,t){var r;if(e._state==="closed"||e._state==="errored")return le(void 0);e._writableStreamController._abortReason=t,(r=e._writableStreamController._abortController)===null||r===void 0||r.abort(t);let n=e._state;if(n==="closed"||n==="errored")return le(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let o=!1;n==="erroring"&&(o=!0,t=void 0);let i=Re((s,a)=>{e._pendingAbortRequest={_promise:void 0,_resolve:s,_reject:a,_reason:t,_wasAlreadyErroring:o}});return e._pendingAbortRequest._promise=i,o||Qi(e,t),i}function ku(e){let t=e._state;if(t==="closed"||t==="errored")return X(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let r=Re((i,s)=>{let a={_resolve:i,_reject:s};e._closeRequest=a}),n=e._writer;var o;return n!==void 0&&e._backpressure&&t==="writable"&&ts(n),Gi(o=e._writableStreamController,qu,0),uo(o),r}function vi(e,t){e._state!=="writable"?Yi(e):Qi(e,t)}function Qi(e,t){let r=e._writableStreamController;e._state="erroring",e._storedError=t;let n=e._writer;n!==void 0&&Au(n,t),!function(o){return!(o._inFlightWriteRequest===void 0&&o._inFlightCloseRequest===void 0)}(e)&&r._started&&Yi(e)}function Yi(e){e._state="errored",e._writableStreamController[tu]();let t=e._storedError;if(e._writeRequests.forEach(n=>{n._reject(t)}),e._writeRequests=new He,e._pendingAbortRequest===void 0)return void Rn(e);let r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void Rn(e);Se(e._writableStreamController[eu](r._reason),()=>(r._resolve(),Rn(e),null),n=>(r._reject(n),Rn(e),null))}function St(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Rn(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;t!==void 0&&es(t,e._storedError)}function Xi(e,t){let r=e._writer;r!==void 0&&t!==e._backpressure&&(t?function(n){co(n)}(r):ts(r)),e._backpressure=t}Object.defineProperties(Bt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),se(Bt.prototype.abort,"abort"),se(Bt.prototype.close,"close"),se(Bt.prototype.getWriter,"getWriter"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Bt.prototype,ne.toStringTag,{value:"WritableStream",configurable:!0});var wt=class{constructor(e){if(pt(e,1,"WritableStreamDefaultWriter"),function(n,o){if(!st(n))throw new TypeError(`${o} is not a WritableStream.`)}(e,"First parameter"),Bn(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let t=e._state;if(t==="writable")!St(e)&&e._backpressure?co(this):Ha(this),Un(this);else if(t==="erroring")_i(this,e._storedError),Un(this);else if(t==="closed")Ha(this),Un(r=this),Iu(r);else{let n=e._storedError;_i(this,n),Da(this,n)}var r}get closed(){return xt(this)?this._closedPromise:X(kt("closed"))}get desiredSize(){if(!xt(this))throw kt("desiredSize");if(this._ownerWritableStream===void 0)throw Rr("desiredSize");return function(e){let t=e._ownerWritableStream,r=t._state;return r==="errored"||r==="erroring"?null:r==="closed"?0:Cu(t._writableStreamController)}(this)}get ready(){return xt(this)?this._readyPromise:X(kt("ready"))}abort(e){return xt(this)?this._ownerWritableStream===void 0?X(Rr("abort")):function(t,r){return xu(t._ownerWritableStream,r)}(this,e):X(kt("abort"))}close(){if(!xt(this))return X(kt("close"));let e=this._ownerWritableStream;return e===void 0?X(Rr("close")):St(e)?X(new TypeError("Cannot close an already-closing stream")):ku(this._ownerWritableStream)}releaseLock(){if(!xt(this))throw kt("releaseLock");this._ownerWritableStream!==void 0&&function(e){let t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Au(e,r),function(n,o){n._closedPromiseState==="pending"?es(n,o):function(i,s){Da(i,s)}(n,o)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}(this)}write(e){return xt(this)?this._ownerWritableStream===void 0?X(Rr("write to")):function(t,r){let n=t._ownerWritableStream,o=n._writableStreamController,i=function(l,u){try{return l._strategySizeAlgorithm(u)}catch(d){return za(l,d),1}}(o,r);if(n!==t._ownerWritableStream)return X(Rr("write to"));let s=n._state;if(s==="errored")return X(n._storedError);if(St(n)||s==="closed")return X(new TypeError("The stream is closing or closed and cannot be written to"));if(s==="erroring")return X(n._storedError);let a=function(l){return Re((u,d)=>{let h={_resolve:u,_reject:d};l._writeRequests.push(h)})}(n);return function(l,u,d){try{Gi(l,u,d)}catch(c){return void za(l,c)}let h=l._controlledWritableStream;!St(h)&&h._state==="writable"&&Xi(h,Zi(l)),uo(l)}(o,r,i),a}(this,e):X(kt("write"))}};function xt(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof wt}function Au(e,t){e._readyPromiseState==="pending"?$u(e,t):function(r,n){_i(r,n)}(e,t)}Object.defineProperties(wt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),se(wt.prototype.abort,"abort"),se(wt.prototype.close,"close"),se(wt.prototype.releaseLock,"releaseLock"),se(wt.prototype.write,"write"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(wt.prototype,ne.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var qu={},Jn=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!si(this))throw ai("abortReason");return this._abortReason}get signal(){if(!si(this))throw ai("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!si(this))throw ai("error");this._controlledWritableStream._state==="writable"&&ju(this,e)}[eu](e){let t=this._abortAlgorithm(e);return Kn(this),t}[tu](){Et(this)}};function si(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Jn}function Kn(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Cu(e){return e._strategyHWM-e._queueTotalSize}function uo(e){let t=e._controlledWritableStream;if(!e._started||t._inFlightWriteRequest!==void 0)return;if(t._state==="erroring")return void Yi(t);if(e._queue.length===0)return;let r=e._queue.peek().value;r===qu?function(n){let o=n._controlledWritableStream;(function(s){s._inFlightCloseRequest=s._closeRequest,s._closeRequest=void 0})(o),yi(n);let i=n._closeAlgorithm();Kn(n),Se(i,()=>(function(s){s._inFlightCloseRequest._resolve(void 0),s._inFlightCloseRequest=void 0,s._state==="erroring"&&(s._storedError=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._resolve(),s._pendingAbortRequest=void 0)),s._state="closed";let a=s._writer;a!==void 0&&Iu(a)}(o),null),s=>(function(a,l){a._inFlightCloseRequest._reject(l),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(l),a._pendingAbortRequest=void 0),vi(a,l)}(o,s),null))}(e):function(n,o){let i=n._controlledWritableStream;(function(s){s._inFlightWriteRequest=s._writeRequests.shift()})(i),Se(n._writeAlgorithm(o),()=>{(function(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0})(i);let s=i._state;if(yi(n),!St(i)&&s==="writable"){let a=Zi(n);Xi(i,a)}return uo(n),null},s=>(i._state==="writable"&&Kn(n),function(a,l){a._inFlightWriteRequest._reject(l),a._inFlightWriteRequest=void 0,vi(a,l)}(i,s),null))}(e,r)}function za(e,t){e._controlledWritableStream._state==="writable"&&ju(e,t)}function Zi(e){return Cu(e)<=0}function ju(e,t){let r=e._controlledWritableStream;Kn(e),Qi(r,t)}function Pn(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function ai(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function kt(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Rr(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Un(e){e._closedPromise=Re((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function Da(e,t){Un(e),es(e,t)}function es(e,t){e._closedPromise_reject!==void 0&&(lr(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Iu(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function co(e){e._readyPromise=Re((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function _i(e,t){co(e),$u(e,t)}function Ha(e){co(e),ts(e)}function $u(e,t){e._readyPromise_reject!==void 0&&(lr(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function ts(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Jn.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Jn.prototype,ne.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Fa=typeof DOMException<"u"?DOMException:void 0,by=function(e){if(typeof e!="function"&&typeof e!="object")return!1;try{return new e,!0}catch{return!1}}(Fa)?Fa:function(){let e=function(t,r){this.message=t||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Wa(e,t,r,n,o,i){let s=e.getReader(),a=t.getWriter();Ft(e)&&(e._disturbed=!0);let l,u,d,h=!1,c=!1,p="readable",m="writable",O=!1,g=!1,M=Re(S=>{d=S}),I=Promise.resolve(void 0);return Re((S,y)=>{let _;function v(){if(h)return;let j=Re((w,C)=>{(function U(A){A?w():dt(function(){return h?le(!0):dt(a.ready,()=>dt(s.read(),H=>!!H.done||(I=a.write(H.value),lr(I),!1)))}(),U,C)})(!1)});lr(j)}function R(){return p="closed",r?N():q(()=>(st(t)&&(O=St(t),m=t._state),O||m==="closed"?le(void 0):m==="erroring"||m==="errored"?X(u):(O=!0,a.close())),!1,void 0),null}function $(j){return h||(p="errored",l=j,n?N(!0,j):q(()=>a.abort(j),!0,j)),null}function x(j){return c||(m="errored",u=j,o?N(!0,j):q(()=>s.cancel(j),!0,j)),null}if(i!==void 0&&(_=()=>{let j=i.reason!==void 0?i.reason:new by("Aborted","AbortError"),w=[];n||w.push(()=>m==="writable"?a.abort(j):le(void 0)),o||w.push(()=>p==="readable"?s.cancel(j):le(void 0)),q(()=>Promise.all(w.map(C=>C())),!0,j)},i.aborted?_():i.addEventListener("abort",_)),Ft(e)&&(p=e._state,l=e._storedError),st(t)&&(m=t._state,u=t._storedError,O=St(t)),Ft(e)&&st(t)&&(g=!0,d()),p==="errored")$(l);else if(m==="erroring"||m==="errored")x(u);else if(p==="closed")R();else if(O||m==="closed"){let j=new TypeError("the destination writable stream closed before all data could be piped to it");o?N(!0,j):q(()=>s.cancel(j),!0,j)}function q(j,w,C){function U(){return m!=="writable"||O?A():qa(function(){let H;return le(function Z(){if(H!==I)return H=I,Qe(I,Z,Z)}())}(),A),null}function A(){return j?Se(j(),()=>J(w,C),H=>J(!0,H)):J(w,C),null}h||(h=!0,g?U():qa(M,U))}function N(j,w){q(void 0,j,w)}function J(j,w){return c=!0,a.releaseLock(),s.releaseLock(),i!==void 0&&i.removeEventListener("abort",_),j?y(w):S(void 0),null}h||(Se(s.closed,R,$),Se(a.closed,function(){return c||(m="closed"),null},x)),g?v():Ln(()=>{g=!0,d(),v()})})}function vy(e,t){return function(r){try{return r.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}(e)?function(r){let n,o,i,s,a,l=r.getReader(),u=!1,d=!1,h=!1,c=!1,p=!1,m=!1,O=Re(x=>{a=x});function g(x){Ca(x.closed,q=>(x!==l||(i.error(q),s.error(q),p&&m||a(void 0)),null))}function M(){u&&(l.releaseLock(),l=r.getReader(),g(l),u=!1),Se(l.read(),x=>{var q,N;if(h=!1,c=!1,x.done)return p||i.close(),m||s.close(),(q=i.byobRequest)===null||q===void 0||q.respond(0),(N=s.byobRequest)===null||N===void 0||N.respond(0),p&&m||a(void 0),null;let J=x.value,j=J,w=J;if(!p&&!m)try{w=La(J)}catch(C){return i.error(C),s.error(C),a(l.cancel(C)),null}return p||i.enqueue(j),m||s.enqueue(w),d=!1,h?S():c&&y(),null},()=>(d=!1,null))}function I(x,q){u||(l.releaseLock(),l=r.getReader({mode:"byob"}),g(l),u=!0);let N=q?s:i,J=q?i:s;Se(l.read(x),j=>{var w;h=!1,c=!1;let C=q?m:p,U=q?p:m;if(j.done){C||N.close(),U||J.close();let H=j.value;return H!==void 0&&(C||N.byobRequest.respondWithNewView(H),U||(w=J.byobRequest)===null||w===void 0||w.respond(0)),C&&U||a(void 0),null}let A=j.value;if(U)C||N.byobRequest.respondWithNewView(A);else{let H;try{H=La(A)}catch(Z){return N.error(Z),J.error(Z),a(l.cancel(Z)),null}C||N.byobRequest.respondWithNewView(A),J.enqueue(H)}return d=!1,h?S():c&&y(),null},()=>(d=!1,null))}function S(){if(d)return h=!0,le(void 0);d=!0;let x=i.byobRequest;return x===null?M():I(x.view,!1),le(void 0)}function y(){if(d)return c=!0,le(void 0);d=!0;let x=s.byobRequest;return x===null?M():I(x.view,!0),le(void 0)}function _(x){if(p=!0,n=x,m){let q=[n,o],N=l.cancel(q);a(N)}return O}function v(x){if(m=!0,o=x,p){let q=[n,o],N=l.cancel(q);a(N)}return O}let R=new we({type:"bytes",start(x){i=x},pull:S,cancel:_}),$=new we({type:"bytes",start(x){s=x},pull:y,cancel:v});return g(l),[R,$]}(e):function(r,n){let o=r.getReader(),i,s,a,l,u,d=!1,h=!1,c=!1,p=!1,m=Re(y=>{u=y});function O(){return d?(h=!0,le(void 0)):(d=!0,Se(o.read(),y=>{if(h=!1,y.done)return c||a.close(),p||l.close(),c&&p||u(void 0),null;let _=y.value,v=_,R=_;return c||a.enqueue(v),p||l.enqueue(R),d=!1,h&&O(),null},()=>(d=!1,null)),le(void 0))}function g(y){if(c=!0,i=y,p){let _=[i,s],v=o.cancel(_);u(v)}return m}function M(y){if(p=!0,s=y,c){let _=[i,s],v=o.cancel(_);u(v)}return m}let I=new we({start(y){a=y},pull:O,cancel:g}),S=new we({start(y){l=y},pull:O,cancel:M});return Ca(o.closed,y=>(a.error(y),l.error(y),c&&p||u(void 0),null)),[I,S]}(e)}var Ut=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!xn(this))throw kn("desiredSize");return Mu(this)}close(){if(!xn(this))throw kn("close");if(!Ar(this))throw new TypeError("The stream is not in a state that permits close");(function(e){if(!Ar(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(zn(e),Lr(t))})(this)}enqueue(e){if(!xn(this))throw kn("enqueue");if(!Ar(this))throw new TypeError("The stream is not in a state that permits enqueue");return function(t,r){if(!Ar(t))return;let n=t._controlledReadableStream;if(hr(n)&&lo(n)>0)Vi(n,r,!1);else{let o;try{o=t._strategySizeAlgorithm(r)}catch(i){throw jr(t,i),i}try{Gi(t,r,o)}catch(i){throw jr(t,i),i}}Cr(t)}(this,e)}error(e){if(!xn(this))throw kn("error");jr(this,e)}[zi](e){Et(this);let t=this._cancelAlgorithm(e);return zn(this),t}[Di](e){let t=this._controlledReadableStream;if(this._queue.length>0){let r=yi(this);this._closeRequested&&this._queue.length===0?(zn(this),Lr(t)):Cr(this),e._chunkSteps(r)}else hu(t,e),Cr(this)}[Hi](){}};function xn(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Ut}function Cr(e){if(function(t){let r=t._controlledReadableStream;return!Ar(t)||!t._started?!1:!!(hr(r)&&lo(r)>0||Mu(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Se(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Cr(e)),null),t=>(jr(e,t),null))}}function zn(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function jr(e,t){let r=e._controlledReadableStream;r._state==="readable"&&(Et(e),zn(e),Nu(r,t))}function Mu(e){let t=e._controlledReadableStream._state;return t==="errored"?null:t==="closed"?0:e._strategyHWM-e._queueTotalSize}function Ar(e){return!e._closeRequested&&e._controlledReadableStream._state==="readable"}function _y(e,t,r,n){let o=Object.create(Ut.prototype),i,s,a;i=t.start!==void 0?()=>t.start(o):()=>{},s=t.pull!==void 0?()=>t.pull(o):()=>le(void 0),a=t.cancel!==void 0?l=>t.cancel(l):()=>le(void 0),function(l,u,d,h,c,p,m){u._controlledReadableStream=l,u._queue=void 0,u._queueTotalSize=void 0,Et(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=m,u._strategyHWM=p,u._pullAlgorithm=h,u._cancelAlgorithm=c,l._readableStreamController=u,Se(le(d()),()=>(u._started=!0,Cr(u),null),O=>(jr(u,O),null))}(e,o,i,s,a,r,n)}function kn(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function wy(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function Sy(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function Ey(e,t,r){return Ye(e,r),n=>ao(e,t,[n])}function Ty(e,t){if((e=`${e}`)!="bytes")throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Oy(e,t){if((e=`${e}`)!="byob")throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Va(e,t){ft(e,t);let r=e?.preventAbort,n=e?.preventCancel,o=e?.preventClose,i=e?.signal;return i!==void 0&&function(s,a){if(!function(l){if(typeof l!="object"||l===null)return!1;try{return typeof l.aborted=="boolean"}catch{return!1}}(s))throw new TypeError(`${a} is not an AbortSignal.`)}(i,`${t} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(o),signal:i}}function Ry(e,t){ft(e,t);let r=e?.readable;mi(r,"readable","ReadableWritablePair"),function(o,i){if(!kr(o))throw new TypeError(`${i} is not a ReadableStream.`)}(r,`${t} has member 'readable' that`);let n=e?.writable;return mi(n,"writable","ReadableWritablePair"),function(o,i){if(!uu(o))throw new TypeError(`${i} is not a WritableStream.`)}(n,`${t} has member 'writable' that`),{readable:r,writable:n}}Object.defineProperties(Ut.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),se(Ut.prototype.close,"close"),se(Ut.prototype.enqueue,"enqueue"),se(Ut.prototype.error,"error"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Ut.prototype,ne.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var we=class{constructor(e={},t={}){e===void 0?e=null:au(e,"First parameter");let r=Gn(t,"Second parameter"),n=function(i,s){ft(i,s);let a=i,l=a?.autoAllocateChunkSize,u=a?.cancel,d=a?.pull,h=a?.start,c=a?.type;return{autoAllocateChunkSize:l===void 0?void 0:lu(l,`${s} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:wy(u,a,`${s} has member 'cancel' that`),pull:d===void 0?void 0:Sy(d,a,`${s} has member 'pull' that`),start:h===void 0?void 0:Ey(h,a,`${s} has member 'start' that`),type:c===void 0?void 0:Ty(c,`${s} has member 'type' that`)}}(e,"First parameter");var o;if((o=this)._state="readable",o._reader=void 0,o._storedError=void 0,o._disturbed=!1,n.type==="bytes"){if(r.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");hy(this,n,Mr(r,0))}else{let i=Vn(r);_y(this,n,Mr(r,1),i)}}get locked(){if(!Ft(this))throw At("locked");return hr(this)}cancel(e){return Ft(this)?hr(this)?X(new TypeError("Cannot cancel a stream that already has a reader")):Lu(this,e):X(At("cancel"))}getReader(e){if(!Ft(this))throw At("getReader");return function(t,r){ft(t,r);let n=t?.mode;return{mode:n===void 0?void 0:Oy(n,`${r} has member 'mode' that`)}}(e,"First parameter").mode===void 0?new Mt(this):function(t){return new Nt(t)}(this)}pipeThrough(e,t={}){if(!kr(this))throw At("pipeThrough");pt(e,1,"pipeThrough");let r=Ry(e,"First parameter"),n=Va(t,"Second parameter");if(this.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(r.writable.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return lr(Wa(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!kr(this))return X(At("pipeTo"));if(e===void 0)return X("Parameter 1 is required in 'pipeTo'.");if(!uu(e))return X(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Va(t,"Second parameter")}catch(n){return X(n)}return this.locked?X(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):e.locked?X(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Wa(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!kr(this))throw At("tee");if(this.locked)throw new TypeError("Cannot tee a stream that already has a reader");return vy(this)}values(e){if(!kr(this))throw At("values");return function(t,r){let n=t.getReader(),o=new pu(n,r),i=Object.create(mu);return i._asyncIteratorImpl=o,i}(this,function(t,r){ft(t,r);let n=t?.preventCancel;return{preventCancel:Boolean(n)}}(e,"First parameter").preventCancel)}};function Ft(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof we}function hr(e){return e._reader!==void 0}function Lu(e,t){if(e._disturbed=!0,e._state==="closed")return le(void 0);if(e._state==="errored")return X(e._storedError);Lr(e);let r=e._reader;if(r!==void 0&&sr(r)){let n=r._readIntoRequests;r._readIntoRequests=new He,n.forEach(o=>{o._closeSteps(void 0)})}return Qe(e._readableStreamController[zi](t),Xl)}function Lr(e){e._state="closed";let t=e._reader;if(t!==void 0&&(su(t),Ht(t))){let r=t._readRequests;t._readRequests=new He,r.forEach(n=>{n._closeSteps()})}}function Nu(e,t){e._state="errored",e._storedError=t;let r=e._reader;r!==void 0&&(Fi(r,t),Ht(r)?fu(r,t):Pu(r,t))}function At(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Bu(e,t){ft(e,t);let r=e?.highWaterMark;return mi(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Wi(r)}}Object.defineProperties(we.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),se(we.prototype.cancel,"cancel"),se(we.prototype.getReader,"getReader"),se(we.prototype.pipeThrough,"pipeThrough"),se(we.prototype.pipeTo,"pipeTo"),se(we.prototype.tee,"tee"),se(we.prototype.values,"values"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(we.prototype,ne.toStringTag,{value:"ReadableStream",configurable:!0}),typeof ne.asyncIterator=="symbol"&&Object.defineProperty(we.prototype,ne.asyncIterator,{value:we.prototype.values,writable:!0,configurable:!0});var Uu=e=>e.byteLength;se(Uu,"size");var wi=class{constructor(e){pt(e,1,"ByteLengthQueuingStrategy"),e=Bu(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ja(this))throw Ga("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ja(this))throw Ga("size");return Uu}};function Ga(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Ja(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof wi}Object.defineProperties(wi.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(wi.prototype,ne.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var zu=()=>1;se(zu,"size");var Si=class{constructor(e){pt(e,1,"CountQueuingStrategy"),e=Bu(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Qa(this))throw Ka("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Qa(this))throw Ka("size");return zu}};function Ka(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Qa(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Si}function Py(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function xy(e,t,r){return Ye(e,r),n=>ao(e,t,[n])}function ky(e,t,r){return Ye(e,r),(n,o)=>Gt(e,t,[n,o])}Object.defineProperties(Si.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Si.prototype,ne.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var Ei=class{constructor(e={},t={},r={}){e===void 0&&(e=null);let n=Gn(t,"Second parameter"),o=Gn(r,"Third parameter"),i=function(h,c){ft(h,c);let p=h?.flush,m=h?.readableType,O=h?.start,g=h?.transform,M=h?.writableType;return{flush:p===void 0?void 0:Py(p,h,`${c} has member 'flush' that`),readableType:m,start:O===void 0?void 0:xy(O,h,`${c} has member 'start' that`),transform:g===void 0?void 0:ky(g,h,`${c} has member 'transform' that`),writableType:M}}(e,"First parameter");if(i.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(i.writableType!==void 0)throw new RangeError("Invalid writableType specified");let s=Mr(o,0),a=Vn(o),l=Mr(n,1),u=Vn(n),d;(function(h,c,p,m,O,g){function M(){return c}function I(R){return function($,x){let q=$._transformStreamController;return $._backpressure?Qe($._backpressureChangePromise,()=>{if((st($._writable)?$._writable._state:$._writableState)==="erroring")throw st($._writable)?$._writable._storedError:$._writableStoredError;return Xa(q,x)}):Xa(q,x)}(h,R)}function S(R){return function($,x){return Qn($,x),le(void 0)}(h,R)}function y(){return function(R){let $=R._transformStreamController,x=$._flushAlgorithm();return Du($),Qe(x,()=>{if(R._readableState==="errored")throw R._readableStoredError;Xn(R)&&Fu(R)},q=>{throw Qn(R,q),R._readableStoredError})}(h)}function _(){return function(R){return Yn(R,!1),R._backpressureChangePromise}(h)}function v(R){return ho(h,R),le(void 0)}h._writableState="writable",h._writableStoredError=void 0,h._writableHasInFlightOperation=!1,h._writableStarted=!1,h._writable=function(R,$,x,q,N,J,j){return new Bt({start(w){R._writableController=w;try{let C=w.signal;C!==void 0&&C.addEventListener("abort",()=>{R._writableState==="writable"&&(R._writableState="erroring",C.reason&&(R._writableStoredError=C.reason))})}catch{}return Qe($(),()=>(R._writableStarted=!0,el(R),null),C=>{throw R._writableStarted=!0,li(R,C),C})},write:w=>(function(C){C._writableHasInFlightOperation=!0}(R),Qe(x(w),()=>(function(C){C._writableHasInFlightOperation=!1}(R),el(R),null),C=>{throw function(U,A){U._writableHasInFlightOperation=!1,li(U,A)}(R,C),C})),close:()=>(function(w){w._writableHasInFlightOperation=!0}(R),Qe(q(),()=>(function(w){w._writableHasInFlightOperation=!1,w._writableState==="erroring"&&(w._writableStoredError=void 0),w._writableState="closed"}(R),null),w=>{throw function(C,U){C._writableHasInFlightOperation=!1,C._writableState,li(C,U)}(R,w),w})),abort:w=>(R._writableState="errored",R._writableStoredError=w,N(w))},{highWaterMark:J,size:j})}(h,M,I,y,S,p,m),h._readableState="readable",h._readableStoredError=void 0,h._readableCloseRequested=!1,h._readablePulling=!1,h._readable=function(R,$,x,q,N,J){return new we({start:j=>(R._readableController=j,$().catch(w=>{Zn(R,w)})),pull:()=>(R._readablePulling=!0,x().catch(j=>{Zn(R,j)})),cancel:j=>(R._readableState="closed",q(j))},{highWaterMark:N,size:J})}(h,M,_,v,O,g),h._backpressure=void 0,h._backpressureChangePromise=void 0,h._backpressureChangePromise_resolve=void 0,Yn(h,!0),h._transformStreamController=void 0})(this,Re(h=>{d=h}),l,u,s,a),function(h,c){let p=Object.create(zt.prototype),m,O;m=c.transform!==void 0?g=>c.transform(g,p):g=>{try{return Hu(p,g),le(void 0)}catch(M){return X(M)}},O=c.flush!==void 0?()=>c.flush(p):()=>le(void 0),function(g,M,I,S){M._controlledTransformStream=g,g._transformStreamController=M,M._transformAlgorithm=I,M._flushAlgorithm=S}(h,p,m,O)}(this,i),i.start!==void 0?d(i.start(this._transformStreamController)):d(void 0)}get readable(){if(!Ya(this))throw Za("readable");return this._readable}get writable(){if(!Ya(this))throw Za("writable");return this._writable}};function Ya(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof Ei}function Qn(e,t){Zn(e,t),ho(e,t)}function ho(e,t){Du(e._transformStreamController),function(r,n){r._writableController.error(n),r._writableState==="writable"&&Vu(r,n)}(e,t),e._backpressure&&Yn(e,!1)}function Yn(e,t){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Re(r=>{e._backpressureChangePromise_resolve=r}),e._backpressure=t}Object.defineProperties(Ei.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Ei.prototype,ne.toStringTag,{value:"TransformStream",configurable:!0});var zt=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!An(this))throw qn("desiredSize");return Wu(this._controlledTransformStream)}enqueue(e){if(!An(this))throw qn("enqueue");Hu(this,e)}error(e){if(!An(this))throw qn("error");var t;t=e,Qn(this._controlledTransformStream,t)}terminate(){if(!An(this))throw qn("terminate");(function(e){let t=e._controlledTransformStream;Xn(t)&&Fu(t);let r=new TypeError("TransformStream terminated");ho(t,r)})(this)}};function An(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof zt}function Du(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Hu(e,t){let r=e._controlledTransformStream;if(!Xn(r))throw new TypeError("Readable side is not in a state that permits enqueue");try{(function(n,o){n._readablePulling=!1;try{n._readableController.enqueue(o)}catch(i){throw Zn(n,i),i}})(r,t)}catch(n){throw ho(r,n),r._readableStoredError}(function(n){return!function(o){return Xn(o)?!!(o._readablePulling||Wu(o)>0):!1}(n)})(r)!==r._backpressure&&Yn(r,!0)}function Xa(e,t){return Qe(e._transformAlgorithm(t),void 0,r=>{throw Qn(e._controlledTransformStream,r),r})}function qn(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Za(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}function Xn(e){return!e._readableCloseRequested&&e._readableState==="readable"}function Fu(e){e._readableState="closed",e._readableCloseRequested=!0,e._readableController.close()}function Zn(e,t){e._readableState==="readable"&&(e._readableState="errored",e._readableStoredError=t),e._readableController.error(t)}function Wu(e){return e._readableController.desiredSize}function li(e,t){e._writableState!=="writable"?rs(e):Vu(e,t)}function Vu(e,t){e._writableState="erroring",e._writableStoredError=t,!function(r){return r._writableHasInFlightOperation}(e)&&e._writableStarted&&rs(e)}function rs(e){e._writableState="errored"}function el(e){e._writableState==="erroring"&&rs(e)}Object.defineProperties(zt.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),se(zt.prototype.enqueue,"enqueue"),se(zt.prototype.error,"error"),se(zt.prototype.terminate,"terminate"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(zt.prototype,ne.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Gu=65536;async function*Ay(e){let t=e.byteOffset+e.byteLength,r=e.byteOffset;for(;r!==t;){let n=Math.min(t-r,Gu),o=e.buffer.slice(r,r+n);r+=o.byteLength,yield new Uint8Array(o)}}async function*qy(e){let t=0;for(;t!==e.size;){let r=await e.slice(t,Math.min(e.size,t+Gu)).arrayBuffer();t+=r.byteLength,yield new Uint8Array(r)}}async function*ui(e,t=!1){for(let r of e)ArrayBuffer.isView(r)?t?yield*Ay(r):yield r:ve(r.stream)?yield*r.stream():yield*qy(r)}function*Cy(e,t,r=0,n){n??(n=t);let o=r<0?Math.max(t+r,0):Math.min(r,t),i=n<0?Math.max(t+n,0):Math.min(n,t),s=Math.max(i-o,0),a=0;for(let l of e){if(a>=s)break;let u=ArrayBuffer.isView(l)?l.byteLength:l.size;if(o&&u<=o)o-=u,i-=u;else{let d;ArrayBuffer.isView(l)?(d=l.subarray(o,Math.min(u,i)),a+=d.byteLength):(d=l.slice(o,Math.min(u,i)),a+=d.size),i-=u,o=0,yield d}}}var _t=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},tl=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},qt,Cn,Pr,dr=class{constructor(e=[],t={}){if(qt.set(this,[]),Cn.set(this,""),Pr.set(this,0),t??(t={}),typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(!ve(e[Symbol.iterator]))throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof t!="object"&&!ve(t))throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");let r=new TextEncoder;for(let o of e){let i;ArrayBuffer.isView(o)?i=new Uint8Array(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)):o instanceof ArrayBuffer?i=new Uint8Array(o.slice(0)):o instanceof dr?i=o:i=r.encode(String(o)),tl(this,Pr,_t(this,Pr,"f")+(ArrayBuffer.isView(i)?i.byteLength:i.size),"f"),_t(this,qt,"f").push(i)}let n=t.type===void 0?"":String(t.type);tl(this,Cn,/^[\x20-\x7E]*$/.test(n)?n:"","f")}static[(qt=new WeakMap,Cn=new WeakMap,Pr=new WeakMap,Symbol.hasInstance)](e){return Boolean(e&&typeof e=="object"&&ve(e.constructor)&&(ve(e.stream)||ve(e.arrayBuffer))&&/^(Blob|File)$/.test(e[Symbol.toStringTag]))}get type(){return _t(this,Cn,"f")}get size(){return _t(this,Pr,"f")}slice(e,t,r){return new dr(Cy(_t(this,qt,"f"),this.size,e,t),{type:r})}async text(){let e=new TextDecoder,t="";for await(let r of ui(_t(this,qt,"f")))t+=e.decode(r,{stream:!0});return t+=e.decode(),t}async arrayBuffer(){let e=new Uint8Array(this.size),t=0;for await(let r of ui(_t(this,qt,"f")))e.set(r,t),t+=r.length;return e.buffer}stream(){let e=ui(_t(this,qt,"f"),!0);return new we({async pull(t){let{value:r,done:n}=await e.next();if(n)return queueMicrotask(()=>t.close());t.enqueue(r)},async cancel(){await e.return()}})}get[Symbol.toStringTag](){return"Blob"}};Object.defineProperties(dr.prototype,{type:{enumerable:!0},size:{enumerable:!0},slice:{enumerable:!0},stream:{enumerable:!0},text:{enumerable:!0},arrayBuffer:{enumerable:!0}});var jy=e=>e instanceof dr,rl=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},nl=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},jn,In,eo=class extends dr{constructor(e,t,r={}){if(super(e,r),jn.set(this,void 0),In.set(this,0),arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);rl(this,jn,String(t),"f");let n=r.lastModified===void 0?Date.now():Number(r.lastModified);Number.isNaN(n)||rl(this,In,n,"f")}static[(jn=new WeakMap,In=new WeakMap,Symbol.hasInstance)](e){return e instanceof dr&&e[Symbol.toStringTag]==="File"&&typeof e.name=="string"}get name(){return nl(this,jn,"f")}get webkitRelativePath(){return""}get lastModified(){return nl(this,In,"f")}get[Symbol.toStringTag](){return"File"}},Iy=e=>e instanceof eo,nt=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},$n,ot,ci,$y=class{constructor(){$n.add(this),ot.set(this,new Map)}static[(ot=new WeakMap,$n=new WeakSet,Symbol.hasInstance)](e){if(!e)return!1;let t=e;return Boolean(ve(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&ve(t.append)&&ve(t.set)&&ve(t.get)&&ve(t.getAll)&&ve(t.has)&&ve(t.delete)&&ve(t.entries)&&ve(t.values)&&ve(t.keys)&&ve(t[Symbol.iterator])&&ve(t.forEach))}append(e,t,r){nt(this,$n,"m",ci).call(this,{name:e,fileName:r,append:!0,rawValue:t,argsLength:arguments.length})}set(e,t,r){nt(this,$n,"m",ci).call(this,{name:e,fileName:r,append:!1,rawValue:t,argsLength:arguments.length})}get(e){let t=nt(this,ot,"f").get(String(e));return t?t[0]:null}getAll(e){let t=nt(this,ot,"f").get(String(e));return t?t.slice():[]}has(e){return nt(this,ot,"f").has(String(e))}delete(e){nt(this,ot,"f").delete(String(e))}*keys(){for(let e of nt(this,ot,"f").keys())yield e}*entries(){for(let e of this.keys()){let t=this.getAll(e);for(let r of t)yield[e,r]}}*values(){for(let[,e]of this)yield e}[(ci=function({name:e,rawValue:t,append:r,fileName:n,argsLength:o}){let i=r?"append":"set";if(o<2)throw new TypeError(`Failed to execute '${i}' on 'FormData': 2 arguments required, but only ${o} present.`);e=String(e);let s;if(Iy(t))s=n===void 0?t:new eo([t],n,{type:t.type,lastModified:t.lastModified});else if(jy(t))s=new eo([t],n===void 0?"blob":n,{type:t.type});else{if(n)throw new TypeError(`Failed to execute '${i}' on 'FormData': parameter 2 is not of type 'Blob'.`);s=String(t)}let a=nt(this,ot,"f").get(e);if(!a)return void nt(this,ot,"f").set(e,[s]);if(!r)return void nt(this,ot,"f").set(e,[s]);a.push(s)},Symbol.iterator)](){return this.entries()}forEach(e,t){for(let[r,n]of this)e.call(t,n,r,this)}get[Symbol.toStringTag](){return"FormData"}},My=require("node:fs"),Ju=require("node:fs/promises"),Ly=require("node:path"),Ny=me(_f(),1),By=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function Uy(e){if(By(e)!=="object")return!1;let t=Object.getPrototypeOf(e);return t==null?!0:(t.constructor&&t.constructor.toString())===Object.toString()}var zy=Uy,ol=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},Ct=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},jt,rr,Dy="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",Ku=class{constructor(e){jt.set(this,void 0),rr.set(this,void 0),ol(this,jt,e.path,"f"),ol(this,rr,e.start||0,"f"),this.name=(0,Ly.basename)(Ct(this,jt,"f")),this.size=e.size,this.lastModified=e.lastModified}slice(e,t){return new Ku({path:Ct(this,jt,"f"),lastModified:this.lastModified,start:Ct(this,rr,"f")+e,size:t-e})}async*stream(){let{mtimeMs:e}=await(0,Ju.stat)(Ct(this,jt,"f"));if(e>this.lastModified)throw new Ny.default(Dy,"NotReadableError");this.size&&(yield*(0,My.createReadStream)(Ct(this,jt,"f"),{start:Ct(this,rr,"f"),end:Ct(this,rr,"f")+this.size-1}))}get[(jt=new WeakMap,rr=new WeakMap,Symbol.toStringTag)](){return"File"}};function Hy(e,{mtimeMs:t,size:r},n,o={}){let i;zy(n)?[o,i]=[n,void 0]:i=n;let s=new Ku({path:e,size:r,lastModified:t});return i||(i=s.name),new eo([s],i,{...o,lastModified:s.lastModified})}async function Fy(e,t,r){let n=await(0,Ju.stat)(e);return Hy(e,n,t,r)}var Wy=me(Lf(),1),ns={apiKey:"API Key is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key",apiSecret:"API Secret is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key"},Vy=Object.keys(ns),il="https://addons.mozilla.org/api",Gy=class{options={};get productEndpoint(){return`${il}/v5/addons/${encodeURIComponent(this.options.extId)}`}constructor(e){for(let t of Vy){if(!e[t])throw new Error(ns[t]);this.options[t]=e[t]}typeof e.extId=="string"&&e.extId.length>0&&!e.extId.includes("@")&&(e.extId.startsWith("{")||(e.extId="{"+e.extId),e.extId.endsWith("}")||(e.extId+="}")),this.options.extId=e.extId}submit=async({filePath:e,version:t="1.0.0"})=>{let r=`${this.productEndpoint}/versions/${encodeURIComponent(t)}/`,n=new $y;n.append("upload",await Fy(e));let o=await this.getAccessToken(),i=await De.put(r,{throwHttpErrors:!1,body:n,headers:{Authorization:`JWT ${o}`}});if(i.statusCode>=400)throw i.statusCode===401?new Error("Invalid access token"):i.statusCode===403?new Error("You do not own this add-on"):i.statusCode===409?new Error(`Version ${t} already exists`):(console.log(i.body),new Error(JSON.parse(i.body).error||"Unknown error"));return JSON.parse(i.body)};getUploadStatus=async({version:e="1.0.0"})=>{let t=await this.getAccessToken(),r=`${this.productEndpoint}/versions/${encodeURIComponent(e)}/`;return De.get(r,{headers:{Authorization:`JWT ${t}`}}).json()};getProfile=async()=>{let e=await this.getAccessToken(),t=`${il}/v5/accounts/profile`;return De.get(t,{headers:{Authorization:`JWT ${e}`}}).json()};getAccessToken=async()=>{let e=Math.floor(Date.now()/1e3),t={iss:this.options.apiKey,jti:Math.random().toString(),iat:e,exp:e+60*5};return Wy.default.sign(t,this.options.apiSecret,{algorithm:"HS256"})}},Nr="firefox",Jy=Li(Nr);function Ky(e){return Vt(this,null,function*(){var t=e,{extId:r,zip:n,dryRun:o}=t,i=Ri(t,["extId","zip","dryRun"]),s,a,l,u;let d=oo(n),h=((a=(s=d.browser_specific_settings)==null?void 0:s.gecko)==null?void 0:a.id)||((u=(l=d.applications)==null?void 0:l.gecko)==null?void 0:u.id)||r,c=new Gy(Oi({extId:h},i));if(Jy(`Updating extension with ID ${h}`),o)return!0;try{return yield c.submit({filePath:n,version:d.version}),Mi({extId:h,market:Nr,zip:n}),!0}catch(p){throw Ni(p,Nr,`"${h}" (${d.name})`)}})}function Qy(e){return Vt(this,null,function*(){return e.zip=no(e),e.verbose&&io(Nr),so({market:Nr,options:e,errorMap:ns}),Ky(e)})}var Yy={packageId:"No package ID is provided, e.g. https://addons.opera.com/developer/package/PACKAGE_ID",sessionid:`No "sessionid" is provided. If you have a hard time obtaining it, run: web-ext-deploy --get-cookies=opera`,csrftoken:`No "csrftoken" is provided. If you have a hard time obtaining it, run: -web-ext-deploy --get-cookies=opera`},id="opera";function Gw(e){return pn(this,null,function*(){throw e.zip=Oa(e),e.changelog&&(e.changelog=e.changelog.replace(/\/\/n/g,` -`)),e.verbose&&La(id),Ua({market:id,options:e,errorMap:Ww}),new Error("Opera submission is not supported at this time, due to lack of automation API - their CSRF token and cookies expires in 24 hours. It will be faster to just drag/drop the zip on their dev portal.")})}});var xt=Qc(mu()),ur=Qc(By());var ja=e=>`${e.padEnd(9)} |`,dc=e=>!!e.zip||!!e.file;function Qw(){return Xc(this,null,function*(){try{(0,xt.info)("\u{1F7E3} Plasmo Browser Platform Publish v3");let e=JSON.parse((0,xt.getInput)("keys",{required:!0})),n=(0,xt.getInput)("file")||(0,xt.getInput)("zip")||(0,xt.getInput)("artifact"),r=(0,xt.getInput)("version-file"),t=(0,xt.getInput)("notes"),i=!!(0,xt.getInput)("verbose");i&&(console.log=xt.info);let o=Object.keys(e).filter(a=>ur.supportedBrowserSet.has(a));if(o.length===0)throw new Error("No supported browser found");if(!(!!n||o.some(a=>dc(e[a]))))throw new Error("No artifact found for deployment");if(o.forEach(a=>{dc(e[a])||(n?e[a].zip=n:(0,xt.warning)(`${ja("\u{1F7E1} SKIP")} No artifact available to submit for ${a}`)),e[a].versionFile||(e[a].versionFile=r),t&&(e[a].notes=t),e[a].verbose=i}),process.env.NODE_ENV==="test"){(0,xt.debug)(JSON.stringify({artifact:n,versionFile:r,verbose:i})),(0,xt.debug)(o.join(","));return}let u=o.map(a=>{if(!dc(e[a]))return!1;switch((0,xt.info)(`${ja("\u{1F7E1} QUEUE")} Prepare for ${a} submission`),a){case ur.BrowserName.Chrome:return(0,ur.submitChrome)(e[a]);case ur.BrowserName.Firefox:return(0,ur.submitFirefox)(e[a]);case ur.BrowserName.Edge:return(0,ur.submitEdge)(e[a]);case ur.BrowserName.Itero:return(0,ur.submitItero)(e[a])}});(yield Promise.allSettled(u)).forEach((a,y)=>{a.status==="rejected"?(0,xt.setFailed)(`${ja("\u{1F534} ERROR")} ${a.reason}`):a.value&&(0,xt.info)(`${ja("\u{1F7E2} DONE")} ${o[y]} submission successful`)})}catch(e){e instanceof Error&&(0,xt.setFailed)(`${ja("\u{1F534} ERROR")} ${e.message}`)}})}Qw(); +web-ext-deploy --get-cookies=opera`},sl="opera";function Xy(e){return Vt(this,null,function*(){throw e.zip=no(e),e.changelog&&(e.changelog=e.changelog.replace(/\/\/n/g,` +`)),e.verbose&&io(sl),so({market:sl,options:e,errorMap:Yy}),new Error("Opera submission is not supported at this time, due to lack of automation API - their CSRF token and cookies expires in 24 hours. It will be faster to just drag/drop the zip on their dev portal.")})}});var pe=ls($o()),Fe=ls(Yu());var Hr=e=>`${e.padEnd(9)} |`,os=e=>!!e.zip||!!e.file;function Zy(){return us(this,null,function*(){try{(0,pe.info)("\u{1F7E3} Plasmo Browser Platform Publish v3");let e=JSON.parse((0,pe.getInput)("keys",{required:!0})),t=(0,pe.getInput)("file")||(0,pe.getInput)("zip")||(0,pe.getInput)("artifact"),r=(0,pe.getInput)("version-file"),n=(0,pe.getInput)("notes"),o=!!(0,pe.getInput)("verbose");o&&(console.log=pe.info);let i=Object.keys(e).filter(u=>Fe.supportedBrowserSet.has(u));if(i.length===0)throw new Error("No supported browser found");if(!(!!t||i.some(u=>os(e[u]))))throw new Error("No artifact found for deployment");if(i.forEach(u=>{os(e[u])||(t?e[u].zip=t:(0,pe.warning)(`${Hr("\u{1F7E1} SKIP")} No artifact available to submit for ${u}`)),e[u].versionFile||(e[u].versionFile=r),n&&(e[u].notes=n),e[u].verbose=o}),process.env.NODE_ENV==="test"){(0,pe.debug)(JSON.stringify({artifact:t,versionFile:r,verbose:o})),(0,pe.debug)(i.join(","));return}let a=i.map(u=>{if(!os(e[u]))return!1;switch((0,pe.info)(`${Hr("\u{1F7E1} QUEUE")} Prepare for ${u} submission`),u){case Fe.BrowserName.Chrome:return(0,Fe.submitChrome)(e[u]);case Fe.BrowserName.Firefox:return(0,Fe.submitFirefox)(e[u]);case Fe.BrowserName.Edge:return(0,Fe.submitEdge)(e[u])}});(yield Promise.allSettled(a)).forEach((u,d)=>{u.status==="rejected"?(0,pe.setFailed)(`${Hr("\u{1F534} ERROR")} ${u.reason}`):u.value&&(0,pe.info)(`${Hr("\u{1F7E2} DONE")} ${i[d]} submission successful`)})}catch(e){e instanceof Error&&(0,pe.setFailed)(`${Hr("\u{1F534} ERROR")} ${e.message}`)}})}Zy(); /*! Based on fetch-blob. MIT License. Jimmy Wärting & David Frank */ -/*! fetch-blob. MIT License. Jimmy Wärting */ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ /*! node-domexception. MIT License. Jimmy Wärting */ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /** diff --git a/keys.schema.json b/keys.schema.json index a818abc..dec408e 100644 --- a/keys.schema.json +++ b/keys.schema.json @@ -25,12 +25,6 @@ { "$ref": "#/definitions/Common" }, { "$ref": "#/definitions/Edge" } ] - }, - "itero": { - "allOf": [ - { "$ref": "#/definitions/Common" }, - { "$ref": "#/definitions/Itero" } - ] } } }, @@ -56,22 +50,6 @@ } } }, - "Itero": { - "description": "Generated the submit token from the Itero Dashboard: https://itero.plasmo.com/", - "type": "object", - "properties": { - "privateKey": { - "type": "string" - }, - "token": { - "type": "string" - }, - "userId": { - "type": "string" - } - }, - "required": ["privateKey", "token", "userId"] - }, "Chrome": { "description": "For refreshToken and clientId, follow: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md", "type": "object",