diff --git a/index.js b/index.js index e5c25e1..eaa1113 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,16 @@ -"use strict";var PC=Object.create;var Ml=Object.defineProperty;var BC=Object.getOwnPropertyDescriptor;var LC=Object.getOwnPropertyNames;var NC=Object.getPrototypeOf,xC=Object.prototype.hasOwnProperty;var rn=(e,n)=>()=>(e&&(n=e(e=0)),n);var Pn=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),UC=(e,n)=>{for(var t in n)Ml(e,t,{get:n[t],enumerable:!0})},Uy=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of LC(n))!xC.call(e,i)&&i!==t&&Ml(e,i,{get:()=>n[i],enumerable:!(r=BC(n,i))||r.enumerable});return e};var uu=(e,n,t)=>(t=e!=null?PC(NC(e)):{},Uy(n||!e||!e.__esModule?Ml(t,"default",{value:e,enumerable:!0}):t,e)),DC=e=>Uy(Ml({},"__esModule",{value:!0}),e);var Dy=(e,n,t)=>new Promise((r,i)=>{var s=c=>{try{h(t.next(c))}catch(a){i(a)}},u=c=>{try{h(t.throw(c))}catch(a){i(a)}},h=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,u);h((t=t.apply(e,n)).next())});var Vl=Pn(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.toCommandProperties=os.toCommandValue=void 0;function jC(e){return e==null?"":typeof e=="string"||e instanceof String?e:JSON.stringify(e)}os.toCommandValue=jC;function qC(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}os.toCommandProperties=qC});var Vy=Pn($n=>{"use strict";var MC=$n&&$n.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),VC=$n&&$n.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),FC=$n&&$n.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&MC(n,e,t);return VC(n,e),n};Object.defineProperty($n,"__esModule",{value:!0});$n.issue=$n.issueCommand=void 0;var $C=FC(require("os")),qy=Vl();function My(e,n,t){let r=new Pf(e,n,t);process.stdout.write(r.toString()+$C.EOL)}$n.issueCommand=My;function zC(e,n=""){My(e,{},n)}$n.issue=zC;var jy="::",Pf=class{constructor(n,t,r){n||(n="missing.command"),this.command=n,this.properties=t,this.message=r}toString(){let n=jy+this.command;if(this.properties&&Object.keys(this.properties).length>0){n+=" ";let t=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let i=this.properties[r];i&&(t?t=!1:n+=",",n+=`${r}=${KC(i)}`)}}return n+=`${jy}${HC(this.message)}`,n}};function HC(e){return qy.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function KC(e){return qy.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});function lu(){return Fl>$l.length-16&&(Fy.default.randomFillSync($l),Fl=0),$l.slice(Fl,Fl+=16)}var Fy,$l,Fl,Bf=rn(()=>{Fy=uu(require("crypto")),$l=new Uint8Array(256),Fl=$l.length});var $y,zy=rn(()=>{$y=/^(?:[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});function WC(e){return typeof e=="string"&&$y.test(e)}var Bo,cu=rn(()=>{zy();Bo=WC});function GC(e,n=0){let t=(Ur[e[n+0]]+Ur[e[n+1]]+Ur[e[n+2]]+Ur[e[n+3]]+"-"+Ur[e[n+4]]+Ur[e[n+5]]+"-"+Ur[e[n+6]]+Ur[e[n+7]]+"-"+Ur[e[n+8]]+Ur[e[n+9]]+"-"+Ur[e[n+10]]+Ur[e[n+11]]+Ur[e[n+12]]+Ur[e[n+13]]+Ur[e[n+14]]+Ur[e[n+15]]).toLowerCase();if(!Bo(t))throw TypeError("Stringified UUID is invalid");return t}var Ur,Lo,hu=rn(()=>{cu();Ur=[];for(let e=0;e<256;++e)Ur.push((e+256).toString(16).substr(1));Lo=GC});function QC(e,n,t){let r=n&&t||0,i=n||new Array(16);e=e||{};let s=e.node||Hy,u=e.clockseq!==void 0?e.clockseq:Lf;if(s==null||u==null){let g=e.random||(e.rng||lu)();s==null&&(s=Hy=[g[0]|1,g[1],g[2],g[3],g[4],g[5]]),u==null&&(u=Lf=(g[6]<<8|g[7])&16383)}let h=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:xf+1,a=h-Nf+(c-xf)/1e4;if(a<0&&e.clockseq===void 0&&(u=u+1&16383),(a<0||h>Nf)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Nf=h,xf=c,Lf=u,h+=122192928e5;let d=((h&268435455)*1e4+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;let f=h/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=f&255,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=u>>>8|128,i[r++]=u&255;for(let g=0;g<6;++g)i[r+g]=s[g];return n||Lo(i)}var Hy,Lf,Nf,xf,Ky,Wy=rn(()=>{Bf();hu();Nf=0,xf=0;Ky=QC});function YC(e){if(!Bo(e))throw TypeError("Invalid UUID");let n,t=new Uint8Array(16);return t[0]=(n=parseInt(e.slice(0,8),16))>>>24,t[1]=n>>>16&255,t[2]=n>>>8&255,t[3]=n&255,t[4]=(n=parseInt(e.slice(9,13),16))>>>8,t[5]=n&255,t[6]=(n=parseInt(e.slice(14,18),16))>>>8,t[7]=n&255,t[8]=(n=parseInt(e.slice(19,23),16))>>>8,t[9]=n&255,t[10]=(n=parseInt(e.slice(24,36),16))/1099511627776&255,t[11]=n/4294967296&255,t[12]=n>>>24&255,t[13]=n>>>16&255,t[14]=n>>>8&255,t[15]=n&255,t}var zl,Uf=rn(()=>{cu();zl=YC});function XC(e){e=unescape(encodeURIComponent(e));let n=[];for(let t=0;t{hu();Uf();JC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ZC="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function eT(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Gy.default.createHash("md5").update(e).digest()}var Gy,Qy,Yy=rn(()=>{Gy=uu(require("crypto"));Qy=eT});var tT,Xy,Jy=rn(()=>{Df();Yy();tT=Hl("v3",48,Qy),Xy=tT});function rT(e,n,t){e=e||{};let r=e.random||(e.rng||lu)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,n){t=t||0;for(let i=0;i<16;++i)n[t+i]=r[i];return n}return Lo(r)}var Zy,eg=rn(()=>{Bf();hu();Zy=rT});function nT(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),tg.default.createHash("sha1").update(e).digest()}var tg,rg,ng=rn(()=>{tg=uu(require("crypto"));rg=nT});var iT,ig,og=rn(()=>{Df();ng();iT=Hl("v5",80,rg),ig=iT});var ag,sg=rn(()=>{ag="00000000-0000-0000-0000-000000000000"});function oT(e){if(!Bo(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var ug,lg=rn(()=>{cu();ug=oT});var cg={};UC(cg,{NIL:()=>ag,parse:()=>zl,stringify:()=>Lo,v1:()=>Ky,v3:()=>Xy,v4:()=>Zy,v5:()=>ig,validate:()=>Bo,version:()=>ug});var hg=rn(()=>{Wy();Jy();eg();og();sg();lg();cu();hu();Uf()});var yg=Pn(zn=>{"use strict";var aT=zn&&zn.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),sT=zn&&zn.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),dg=zn&&zn.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&aT(n,e,t);return sT(n,e),n};Object.defineProperty(zn,"__esModule",{value:!0});zn.prepareKeyValueMessage=zn.issueFileCommand=void 0;var fg=dg(require("fs")),jf=dg(require("os")),uT=(hg(),DC(cg)),pg=Vl();function lT(e,n){let t=process.env[`GITHUB_${e}`];if(!t)throw new Error(`Unable to find environment variable for file command ${e}`);if(!fg.existsSync(t))throw new Error(`Missing file at path: ${t}`);fg.appendFileSync(t,`${pg.toCommandValue(n)}${jf.EOL}`,{encoding:"utf8"})}zn.issueFileCommand=lT;function cT(e,n){let t=`ghadelimiter_${uT.v4()}`,r=pg.toCommandValue(n);if(e.includes(t))throw new Error(`Unexpected input: name should not contain the delimiter "${t}"`);if(r.includes(t))throw new Error(`Unexpected input: value should not contain the delimiter "${t}"`);return`${e}<<${t}${jf.EOL}${r}${jf.EOL}${t}`}zn.prepareKeyValueMessage=cT});var mg=Pn(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.checkBypass=as.getProxyUrl=void 0;function hT(e){let n=e.protocol==="https:";if(gg(e))return;let t=(()=>n?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(t)return new URL(t)}as.getProxyUrl=hT;function gg(e){if(!e.hostname)return!1;let n=e.hostname;if(fT(n))return!0;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 i=[e.hostname.toUpperCase()];typeof r=="number"&&i.push(`${i[0]}:${r}`);for(let s of t.split(",").map(u=>u.trim().toUpperCase()).filter(u=>u))if(s==="*"||i.some(u=>u===s||u.endsWith(`.${s}`)||s.startsWith(".")&&u.endsWith(`${s}`)))return!0;return!1}as.checkBypass=gg;function fT(e){let n=e.toLowerCase();return n==="localhost"||n.startsWith("127.")||n.startsWith("[::1]")||n.startsWith("[0:0:0:0:0:0:0:1]")}});var wg=Pn(ss=>{"use strict";var dk=require("net"),dT=require("tls"),qf=require("http"),vg=require("https"),pT=require("events"),pk=require("assert"),yT=require("util");ss.httpOverHttp=gT;ss.httpsOverHttp=mT;ss.httpOverHttps=vT;ss.httpsOverHttps=bT;function gT(e){var n=new eo(e);return n.request=qf.request,n}function mT(e){var n=new eo(e);return n.request=qf.request,n.createSocket=bg,n.defaultPort=443,n}function vT(e){var n=new eo(e);return n.request=vg.request,n}function bT(e){var n=new eo(e);return n.request=vg.request,n.createSocket=bg,n.defaultPort=443,n}function eo(e){var n=this;n.options=e||{},n.proxyOptions=n.options.proxy||{},n.maxSockets=n.options.maxSockets||qf.Agent.defaultMaxSockets,n.requests=[],n.sockets=[],n.on("free",function(r,i,s,u){for(var h=_g(i,s,u),c=0,a=n.requests.length;c=this.maxSockets){s.requests.push(u);return}s.createSocket(u,function(h){h.on("free",c),h.on("close",a),h.on("agentRemove",a),n.onSocket(h);function c(){s.emit("free",h,u)}function a(d){s.removeSocket(h),h.removeListener("free",c),h.removeListener("close",a),h.removeListener("agentRemove",a)}})};eo.prototype.createSocket=function(n,t){var r=this,i={};r.sockets.push(i);var s=Mf({},r.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1,headers:{host:n.host+":"+n.port}});n.localAddress&&(s.localAddress=n.localAddress),s.proxyAuth&&(s.headers=s.headers||{},s.headers["Proxy-Authorization"]="Basic "+new Buffer(s.proxyAuth).toString("base64")),No("making CONNECT request");var u=r.request(s);u.useChunkedEncodingByDefault=!1,u.once("response",h),u.once("upgrade",c),u.once("connect",a),u.once("error",d),u.end();function h(f){f.upgrade=!0}function c(f,g,I){process.nextTick(function(){a(f,g,I)})}function a(f,g,I){if(u.removeAllListeners(),g.removeAllListeners(),f.statusCode!==200){No("tunneling socket could not be established, statusCode=%d",f.statusCode),g.destroy();var C=new Error("tunneling socket could not be established, statusCode="+f.statusCode);C.code="ECONNRESET",n.request.emit("error",C),r.removeSocket(i);return}if(I.length>0){No("got illegal response body from proxy"),g.destroy();var C=new Error("got illegal response body from proxy");C.code="ECONNRESET",n.request.emit("error",C),r.removeSocket(i);return}return No("tunneling connection has established"),r.sockets[r.sockets.indexOf(i)]=g,t(g)}function d(f){u.removeAllListeners(),No(`tunneling socket could not be established, cause=%s -`,f.message,f.stack);var g=new Error("tunneling socket could not be established, cause="+f.message);g.code="ECONNRESET",n.request.emit("error",g),r.removeSocket(i)}};eo.prototype.removeSocket=function(n){var t=this.sockets.indexOf(n);if(t!==-1){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createSocket(r,function(i){r.request.onSocket(i)})}};function bg(e,n){var t=this;eo.prototype.createSocket.call(t,e,function(r){var i=e.request.getHeader("host"),s=Mf({},t.options,{socket:r,servername:i?i.replace(/:.*$/,""):e.host}),u=dT.connect(0,s);t.sockets[t.sockets.indexOf(r)]=u,n(u)})}function _g(e,n,t){return typeof e=="string"?{host:e,port:n,localAddress:t}:e}function Mf(e){for(var n=1,t=arguments.length;n{Eg.exports=wg()});var Tg=Pn(Nt=>{"use strict";var _T=Nt&&Nt.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),wT=Nt&&Nt.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Yl=Nt&&Nt.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&_T(n,e,t);return wT(n,e),n},wr=Nt&&Nt.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.HttpClient=Nt.isHttps=Nt.HttpClientResponse=Nt.HttpClientError=Nt.getProxyUrl=Nt.MediaTypes=Nt.Headers=Nt.HttpCodes=void 0;var Kl=Yl(require("http")),Vf=Yl(require("https")),Cg=Yl(mg()),Wl=Yl(Sg()),Zn;(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"})(Zn=Nt.HttpCodes||(Nt.HttpCodes={}));var nn;(function(e){e.Accept="accept",e.ContentType="content-type"})(nn=Nt.Headers||(Nt.Headers={}));var xo;(function(e){e.ApplicationJson="application/json"})(xo=Nt.MediaTypes||(Nt.MediaTypes={}));function ET(e){let n=Cg.getProxyUrl(new URL(e));return n?n.href:""}Nt.getProxyUrl=ET;var ST=[Zn.MovedPermanently,Zn.ResourceMoved,Zn.SeeOther,Zn.TemporaryRedirect,Zn.PermanentRedirect],CT=[Zn.BadGateway,Zn.ServiceUnavailable,Zn.GatewayTimeout],TT=["OPTIONS","GET","DELETE","HEAD"],RT=10,IT=5,us=class extends Error{constructor(n,t){super(n),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,us.prototype)}};Nt.HttpClientError=us;var Ql=class{constructor(n){this.message=n}readBody(){return wr(this,void 0,void 0,function*(){return new Promise(n=>wr(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",r=>{t=Buffer.concat([t,r])}),this.message.on("end",()=>{n(t.toString())})}))})}};Nt.HttpClientResponse=Ql;function AT(e){return new URL(e).protocol==="https:"}Nt.isHttps=AT;var Ff=class{constructor(n,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=n,this.handlers=t||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(n,t){return wr(this,void 0,void 0,function*(){return this.request("OPTIONS",n,null,t||{})})}get(n,t){return wr(this,void 0,void 0,function*(){return this.request("GET",n,null,t||{})})}del(n,t){return wr(this,void 0,void 0,function*(){return this.request("DELETE",n,null,t||{})})}post(n,t,r){return wr(this,void 0,void 0,function*(){return this.request("POST",n,t,r||{})})}patch(n,t,r){return wr(this,void 0,void 0,function*(){return this.request("PATCH",n,t,r||{})})}put(n,t,r){return wr(this,void 0,void 0,function*(){return this.request("PUT",n,t,r||{})})}head(n,t){return wr(this,void 0,void 0,function*(){return this.request("HEAD",n,null,t||{})})}sendStream(n,t,r,i){return wr(this,void 0,void 0,function*(){return this.request(n,t,r,i)})}getJson(n,t={}){return wr(this,void 0,void 0,function*(){t[nn.Accept]=this._getExistingOrDefaultHeader(t,nn.Accept,xo.ApplicationJson);let r=yield this.get(n,t);return this._processResponse(r,this.requestOptions)})}postJson(n,t,r={}){return wr(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[nn.Accept]=this._getExistingOrDefaultHeader(r,nn.Accept,xo.ApplicationJson),r[nn.ContentType]=this._getExistingOrDefaultHeader(r,nn.ContentType,xo.ApplicationJson);let s=yield this.post(n,i,r);return this._processResponse(s,this.requestOptions)})}putJson(n,t,r={}){return wr(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[nn.Accept]=this._getExistingOrDefaultHeader(r,nn.Accept,xo.ApplicationJson),r[nn.ContentType]=this._getExistingOrDefaultHeader(r,nn.ContentType,xo.ApplicationJson);let s=yield this.put(n,i,r);return this._processResponse(s,this.requestOptions)})}patchJson(n,t,r={}){return wr(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[nn.Accept]=this._getExistingOrDefaultHeader(r,nn.Accept,xo.ApplicationJson),r[nn.ContentType]=this._getExistingOrDefaultHeader(r,nn.ContentType,xo.ApplicationJson);let s=yield this.patch(n,i,r);return this._processResponse(s,this.requestOptions)})}request(n,t,r,i){return wr(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let s=new URL(t),u=this._prepareRequest(n,s,i),h=this._allowRetries&&TT.includes(n)?this._maxRetries+1:1,c=0,a;do{if(a=yield this.requestRaw(u,r),a&&a.message&&a.message.statusCode===Zn.Unauthorized){let f;for(let g of this.handlers)if(g.canHandleAuthentication(a)){f=g;break}return f?f.handleAuthentication(this,u,r):a}let d=this._maxRedirects;for(;a.message.statusCode&&ST.includes(a.message.statusCode)&&this._allowRedirects&&d>0;){let f=a.message.headers.location;if(!f)break;let g=new URL(f);if(s.protocol==="https:"&&s.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!==s.hostname)for(let I in i)I.toLowerCase()==="authorization"&&delete i[I];u=this._prepareRequest(n,g,i),a=yield this.requestRaw(u,r),d--}if(!a.message.statusCode||!CT.includes(a.message.statusCode))return a;c+=1,c{function s(u,h){u?i(u):h?r(h):i(new Error("Unknown error"))}this.requestRawWithCallback(n,t,s)})})}requestRawWithCallback(n,t,r){typeof t=="string"&&(n.options.headers||(n.options.headers={}),n.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let i=!1;function s(c,a){i||(i=!0,r(c,a))}let u=n.httpModule.request(n.options,c=>{let a=new Ql(c);s(void 0,a)}),h;u.on("socket",c=>{h=c}),u.setTimeout(this._socketTimeout||3*6e4,()=>{h&&h.end(),s(new Error(`Request timeout: ${n.options.path}`))}),u.on("error",function(c){s(c)}),t&&typeof t=="string"&&u.write(t,"utf8"),t&&typeof t!="string"?(t.on("close",function(){u.end()}),t.pipe(u)):u.end()}getAgent(n){let t=new URL(n);return this._getAgent(t)}_prepareRequest(n,t,r){let i={};i.parsedUrl=t;let s=i.parsedUrl.protocol==="https:";i.httpModule=s?Vf:Kl;let u=s?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):u,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=n,i.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let h of this.handlers)h.prepareRequest(i.options);return i}_mergeHeaders(n){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Gl(this.requestOptions.headers),Gl(n||{})):Gl(n||{})}_getExistingOrDefaultHeader(n,t,r){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Gl(this.requestOptions.headers)[t]),n[t]||i||r}_getAgent(n){let t,r=Cg.getProxyUrl(n),i=r&&r.hostname;if(this._keepAlive&&i&&(t=this._proxyAgent),this._keepAlive&&!i&&(t=this._agent),t)return t;let s=n.protocol==="https:",u=100;if(this.requestOptions&&(u=this.requestOptions.maxSockets||Kl.globalAgent.maxSockets),r&&r.hostname){let h={maxSockets:u,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},c,a=r.protocol==="https:";s?c=a?Wl.httpsOverHttps:Wl.httpsOverHttp:c=a?Wl.httpOverHttps:Wl.httpOverHttp,t=c(h),this._proxyAgent=t}if(this._keepAlive&&!t){let h={keepAlive:this._keepAlive,maxSockets:u};t=s?new Vf.Agent(h):new Kl.Agent(h),this._agent=t}return t||(t=s?Vf.globalAgent:Kl.globalAgent),s&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_performExponentialBackoff(n){return wr(this,void 0,void 0,function*(){n=Math.min(RT,n);let t=IT*Math.pow(2,n);return new Promise(r=>setTimeout(()=>r(),t))})}_processResponse(n,t){return wr(this,void 0,void 0,function*(){return new Promise((r,i)=>wr(this,void 0,void 0,function*(){let s=n.message.statusCode||0,u={statusCode:s,result:null,headers:{}};s===Zn.NotFound&&r(u);function h(d,f){if(typeof f=="string"){let g=new Date(f);if(!isNaN(g.valueOf()))return g}return f}let c,a;try{a=yield n.readBody(),a&&a.length>0&&(t&&t.deserializeDates?c=JSON.parse(a,h):c=JSON.parse(a),u.result=c),u.headers=n.message.headers}catch{}if(s>299){let d;c&&c.message?d=c.message:a&&a.length>0?d=a:d=`Failed request: (${s})`;let f=new us(d,s);f.result=u.result,i(f)}else r(u)}))})}};Nt.HttpClient=Ff;var Gl=e=>Object.keys(e).reduce((n,t)=>(n[t.toLowerCase()]=e[t],n),{})});var Rg=Pn(wi=>{"use strict";var Kf=wi&&wi.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(wi,"__esModule",{value:!0});wi.PersonalAccessTokenCredentialHandler=wi.BearerCredentialHandler=wi.BasicCredentialHandler=void 0;var $f=class{constructor(n,t){this.username=n,this.password=t}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 Kf(this,void 0,void 0,function*(){throw new Error("not implemented")})}};wi.BasicCredentialHandler=$f;var zf=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 Kf(this,void 0,void 0,function*(){throw new Error("not implemented")})}};wi.BearerCredentialHandler=zf;var Hf=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 Kf(this,void 0,void 0,function*(){throw new Error("not implemented")})}};wi.PersonalAccessTokenCredentialHandler=Hf});var kg=Pn(ls=>{"use strict";var Ig=ls&&ls.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(ls,"__esModule",{value:!0});ls.OidcClient=void 0;var kT=Tg(),OT=Rg(),Ag=Wf(),Uo=class{static createHttpClient(n=!0,t=10){let r={allowRetries:n,maxRetries:t};return new kT.HttpClient("actions/oidc-client",[new OT.BearerCredentialHandler(Uo.getRequestToken())],r)}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 t;return Ig(this,void 0,void 0,function*(){let s=(t=(yield Uo.createHttpClient().getJson(n).catch(u=>{throw new Error(`Failed to get ID Token. +"use strict";var SC=Object.create;var jl=Object.defineProperty;var CC=Object.getOwnPropertyDescriptor;var TC=Object.getOwnPropertyNames;var RC=Object.getPrototypeOf,IC=Object.prototype.hasOwnProperty;var rn=(e,n)=>()=>(e&&(n=e(e=0)),n);var Pn=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),AC=(e,n)=>{for(var t in n)jl(e,t,{get:n[t],enumerable:!0})},Py=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of TC(n))!IC.call(e,i)&&i!==t&&jl(e,i,{get:()=>n[i],enumerable:!(r=CC(n,i))||r.enumerable});return e};var su=(e,n,t)=>(t=e!=null?SC(RC(e)):{},Py(n||!e||!e.__esModule?jl(t,"default",{value:e,enumerable:!0}):t,e)),kC=e=>Py(jl({},"__esModule",{value:!0}),e);var ql=Pn(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.toCommandProperties=is.toCommandValue=void 0;function OC(e){return e==null?"":typeof e=="string"||e instanceof String?e:JSON.stringify(e)}is.toCommandValue=OC;function PC(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}is.toCommandProperties=PC});var xy=Pn($n=>{"use strict";var BC=$n&&$n.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),LC=$n&&$n.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),NC=$n&&$n.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&BC(n,e,t);return LC(n,e),n};Object.defineProperty($n,"__esModule",{value:!0});$n.issue=$n.issueCommand=void 0;var xC=NC(require("os")),Ly=ql();function Ny(e,n,t){let r=new Rf(e,n,t);process.stdout.write(r.toString()+xC.EOL)}$n.issueCommand=Ny;function UC(e,n=""){Ny(e,{},n)}$n.issue=UC;var By="::",Rf=class{constructor(n,t,r){n||(n="missing.command"),this.command=n,this.properties=t,this.message=r}toString(){let n=By+this.command;if(this.properties&&Object.keys(this.properties).length>0){n+=" ";let t=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let i=this.properties[r];i&&(t?t=!1:n+=",",n+=`${r}=${jC(i)}`)}}return n+=`${By}${DC(this.message)}`,n}};function DC(e){return Ly.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function jC(e){return Ly.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});function uu(){return Ml>Vl.length-16&&(Uy.default.randomFillSync(Vl),Ml=0),Vl.slice(Ml,Ml+=16)}var Uy,Vl,Ml,If=rn(()=>{Uy=su(require("crypto")),Vl=new Uint8Array(256),Ml=Vl.length});var Dy,jy=rn(()=>{Dy=/^(?:[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});function qC(e){return typeof e=="string"&&Dy.test(e)}var Po,lu=rn(()=>{jy();Po=qC});function MC(e,n=0){let t=(Ur[e[n+0]]+Ur[e[n+1]]+Ur[e[n+2]]+Ur[e[n+3]]+"-"+Ur[e[n+4]]+Ur[e[n+5]]+"-"+Ur[e[n+6]]+Ur[e[n+7]]+"-"+Ur[e[n+8]]+Ur[e[n+9]]+"-"+Ur[e[n+10]]+Ur[e[n+11]]+Ur[e[n+12]]+Ur[e[n+13]]+Ur[e[n+14]]+Ur[e[n+15]]).toLowerCase();if(!Po(t))throw TypeError("Stringified UUID is invalid");return t}var Ur,Bo,cu=rn(()=>{lu();Ur=[];for(let e=0;e<256;++e)Ur.push((e+256).toString(16).substr(1));Bo=MC});function VC(e,n,t){let r=n&&t||0,i=n||new Array(16);e=e||{};let s=e.node||qy,u=e.clockseq!==void 0?e.clockseq:Af;if(s==null||u==null){let g=e.random||(e.rng||uu)();s==null&&(s=qy=[g[0]|1,g[1],g[2],g[3],g[4],g[5]]),u==null&&(u=Af=(g[6]<<8|g[7])&16383)}let h=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:Of+1,a=h-kf+(c-Of)/1e4;if(a<0&&e.clockseq===void 0&&(u=u+1&16383),(a<0||h>kf)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");kf=h,Of=c,Af=u,h+=122192928e5;let d=((h&268435455)*1e4+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;let f=h/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=f&255,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=u>>>8|128,i[r++]=u&255;for(let g=0;g<6;++g)i[r+g]=s[g];return n||Bo(i)}var qy,Af,kf,Of,My,Vy=rn(()=>{If();cu();kf=0,Of=0;My=VC});function FC(e){if(!Po(e))throw TypeError("Invalid UUID");let n,t=new Uint8Array(16);return t[0]=(n=parseInt(e.slice(0,8),16))>>>24,t[1]=n>>>16&255,t[2]=n>>>8&255,t[3]=n&255,t[4]=(n=parseInt(e.slice(9,13),16))>>>8,t[5]=n&255,t[6]=(n=parseInt(e.slice(14,18),16))>>>8,t[7]=n&255,t[8]=(n=parseInt(e.slice(19,23),16))>>>8,t[9]=n&255,t[10]=(n=parseInt(e.slice(24,36),16))/1099511627776&255,t[11]=n/4294967296&255,t[12]=n>>>24&255,t[13]=n>>>16&255,t[14]=n>>>8&255,t[15]=n&255,t}var Fl,Pf=rn(()=>{lu();Fl=FC});function $C(e){e=unescape(encodeURIComponent(e));let n=[];for(let t=0;t{cu();Pf();zC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",HC="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function KC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Fy.default.createHash("md5").update(e).digest()}var Fy,$y,zy=rn(()=>{Fy=su(require("crypto"));$y=KC});var WC,Hy,Ky=rn(()=>{Bf();zy();WC=$l("v3",48,$y),Hy=WC});function GC(e,n,t){e=e||{};let r=e.random||(e.rng||uu)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,n){t=t||0;for(let i=0;i<16;++i)n[t+i]=r[i];return n}return Bo(r)}var Wy,Gy=rn(()=>{If();cu();Wy=GC});function QC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Qy.default.createHash("sha1").update(e).digest()}var Qy,Yy,Xy=rn(()=>{Qy=su(require("crypto"));Yy=QC});var YC,Jy,Zy=rn(()=>{Bf();Xy();YC=$l("v5",80,Yy),Jy=YC});var eg,tg=rn(()=>{eg="00000000-0000-0000-0000-000000000000"});function XC(e){if(!Po(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var rg,ng=rn(()=>{lu();rg=XC});var ig={};AC(ig,{NIL:()=>eg,parse:()=>Fl,stringify:()=>Bo,v1:()=>My,v3:()=>Hy,v4:()=>Wy,v5:()=>Jy,validate:()=>Po,version:()=>rg});var og=rn(()=>{Vy();Ky();Gy();Zy();tg();ng();lu();cu();Pf()});var lg=Pn(zn=>{"use strict";var JC=zn&&zn.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),ZC=zn&&zn.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),sg=zn&&zn.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&JC(n,e,t);return ZC(n,e),n};Object.defineProperty(zn,"__esModule",{value:!0});zn.prepareKeyValueMessage=zn.issueFileCommand=void 0;var ag=sg(require("fs")),Lf=sg(require("os")),eT=(og(),kC(ig)),ug=ql();function tT(e,n){let t=process.env[`GITHUB_${e}`];if(!t)throw new Error(`Unable to find environment variable for file command ${e}`);if(!ag.existsSync(t))throw new Error(`Missing file at path: ${t}`);ag.appendFileSync(t,`${ug.toCommandValue(n)}${Lf.EOL}`,{encoding:"utf8"})}zn.issueFileCommand=tT;function rT(e,n){let t=`ghadelimiter_${eT.v4()}`,r=ug.toCommandValue(n);if(e.includes(t))throw new Error(`Unexpected input: name should not contain the delimiter "${t}"`);if(r.includes(t))throw new Error(`Unexpected input: value should not contain the delimiter "${t}"`);return`${e}<<${t}${Lf.EOL}${r}${Lf.EOL}${t}`}zn.prepareKeyValueMessage=rT});var hg=Pn(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.checkBypass=os.getProxyUrl=void 0;function nT(e){let n=e.protocol==="https:";if(cg(e))return;let t=(()=>n?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(t)return new URL(t)}os.getProxyUrl=nT;function cg(e){if(!e.hostname)return!1;let n=e.hostname;if(iT(n))return!0;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 i=[e.hostname.toUpperCase()];typeof r=="number"&&i.push(`${i[0]}:${r}`);for(let s of t.split(",").map(u=>u.trim().toUpperCase()).filter(u=>u))if(s==="*"||i.some(u=>u===s||u.endsWith(`.${s}`)||s.startsWith(".")&&u.endsWith(`${s}`)))return!0;return!1}os.checkBypass=cg;function iT(e){let n=e.toLowerCase();return n==="localhost"||n.startsWith("127.")||n.startsWith("[::1]")||n.startsWith("[0:0:0:0:0:0:0:1]")}});var yg=Pn(as=>{"use strict";var ak=require("net"),oT=require("tls"),Nf=require("http"),fg=require("https"),aT=require("events"),sk=require("assert"),sT=require("util");as.httpOverHttp=uT;as.httpsOverHttp=lT;as.httpOverHttps=cT;as.httpsOverHttps=hT;function uT(e){var n=new eo(e);return n.request=Nf.request,n}function lT(e){var n=new eo(e);return n.request=Nf.request,n.createSocket=dg,n.defaultPort=443,n}function cT(e){var n=new eo(e);return n.request=fg.request,n}function hT(e){var n=new eo(e);return n.request=fg.request,n.createSocket=dg,n.defaultPort=443,n}function eo(e){var n=this;n.options=e||{},n.proxyOptions=n.options.proxy||{},n.maxSockets=n.options.maxSockets||Nf.Agent.defaultMaxSockets,n.requests=[],n.sockets=[],n.on("free",function(r,i,s,u){for(var h=pg(i,s,u),c=0,a=n.requests.length;c=this.maxSockets){s.requests.push(u);return}s.createSocket(u,function(h){h.on("free",c),h.on("close",a),h.on("agentRemove",a),n.onSocket(h);function c(){s.emit("free",h,u)}function a(d){s.removeSocket(h),h.removeListener("free",c),h.removeListener("close",a),h.removeListener("agentRemove",a)}})};eo.prototype.createSocket=function(n,t){var r=this,i={};r.sockets.push(i);var s=xf({},r.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1,headers:{host:n.host+":"+n.port}});n.localAddress&&(s.localAddress=n.localAddress),s.proxyAuth&&(s.headers=s.headers||{},s.headers["Proxy-Authorization"]="Basic "+new Buffer(s.proxyAuth).toString("base64")),Lo("making CONNECT request");var u=r.request(s);u.useChunkedEncodingByDefault=!1,u.once("response",h),u.once("upgrade",c),u.once("connect",a),u.once("error",d),u.end();function h(f){f.upgrade=!0}function c(f,g,I){process.nextTick(function(){a(f,g,I)})}function a(f,g,I){if(u.removeAllListeners(),g.removeAllListeners(),f.statusCode!==200){Lo("tunneling socket could not be established, statusCode=%d",f.statusCode),g.destroy();var C=new Error("tunneling socket could not be established, statusCode="+f.statusCode);C.code="ECONNRESET",n.request.emit("error",C),r.removeSocket(i);return}if(I.length>0){Lo("got illegal response body from proxy"),g.destroy();var C=new Error("got illegal response body from proxy");C.code="ECONNRESET",n.request.emit("error",C),r.removeSocket(i);return}return Lo("tunneling connection has established"),r.sockets[r.sockets.indexOf(i)]=g,t(g)}function d(f){u.removeAllListeners(),Lo(`tunneling socket could not be established, cause=%s +`,f.message,f.stack);var g=new Error("tunneling socket could not be established, cause="+f.message);g.code="ECONNRESET",n.request.emit("error",g),r.removeSocket(i)}};eo.prototype.removeSocket=function(n){var t=this.sockets.indexOf(n);if(t!==-1){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createSocket(r,function(i){r.request.onSocket(i)})}};function dg(e,n){var t=this;eo.prototype.createSocket.call(t,e,function(r){var i=e.request.getHeader("host"),s=xf({},t.options,{socket:r,servername:i?i.replace(/:.*$/,""):e.host}),u=oT.connect(0,s);t.sockets[t.sockets.indexOf(r)]=u,n(u)})}function pg(e,n,t){return typeof e=="string"?{host:e,port:n,localAddress:t}:e}function xf(e){for(var n=1,t=arguments.length;n{gg.exports=yg()});var bg=Pn(Nt=>{"use strict";var fT=Nt&&Nt.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),dT=Nt&&Nt.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Gl=Nt&&Nt.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&fT(n,e,t);return dT(n,e),n},wr=Nt&&Nt.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.HttpClient=Nt.isHttps=Nt.HttpClientResponse=Nt.HttpClientError=Nt.getProxyUrl=Nt.MediaTypes=Nt.Headers=Nt.HttpCodes=void 0;var zl=Gl(require("http")),Uf=Gl(require("https")),vg=Gl(hg()),Hl=Gl(mg()),Zn;(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"})(Zn=Nt.HttpCodes||(Nt.HttpCodes={}));var nn;(function(e){e.Accept="accept",e.ContentType="content-type"})(nn=Nt.Headers||(Nt.Headers={}));var No;(function(e){e.ApplicationJson="application/json"})(No=Nt.MediaTypes||(Nt.MediaTypes={}));function pT(e){let n=vg.getProxyUrl(new URL(e));return n?n.href:""}Nt.getProxyUrl=pT;var yT=[Zn.MovedPermanently,Zn.ResourceMoved,Zn.SeeOther,Zn.TemporaryRedirect,Zn.PermanentRedirect],gT=[Zn.BadGateway,Zn.ServiceUnavailable,Zn.GatewayTimeout],mT=["OPTIONS","GET","DELETE","HEAD"],vT=10,bT=5,ss=class extends Error{constructor(n,t){super(n),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,ss.prototype)}};Nt.HttpClientError=ss;var Wl=class{constructor(n){this.message=n}readBody(){return wr(this,void 0,void 0,function*(){return new Promise(n=>wr(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",r=>{t=Buffer.concat([t,r])}),this.message.on("end",()=>{n(t.toString())})}))})}};Nt.HttpClientResponse=Wl;function _T(e){return new URL(e).protocol==="https:"}Nt.isHttps=_T;var Df=class{constructor(n,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=n,this.handlers=t||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(n,t){return wr(this,void 0,void 0,function*(){return this.request("OPTIONS",n,null,t||{})})}get(n,t){return wr(this,void 0,void 0,function*(){return this.request("GET",n,null,t||{})})}del(n,t){return wr(this,void 0,void 0,function*(){return this.request("DELETE",n,null,t||{})})}post(n,t,r){return wr(this,void 0,void 0,function*(){return this.request("POST",n,t,r||{})})}patch(n,t,r){return wr(this,void 0,void 0,function*(){return this.request("PATCH",n,t,r||{})})}put(n,t,r){return wr(this,void 0,void 0,function*(){return this.request("PUT",n,t,r||{})})}head(n,t){return wr(this,void 0,void 0,function*(){return this.request("HEAD",n,null,t||{})})}sendStream(n,t,r,i){return wr(this,void 0,void 0,function*(){return this.request(n,t,r,i)})}getJson(n,t={}){return wr(this,void 0,void 0,function*(){t[nn.Accept]=this._getExistingOrDefaultHeader(t,nn.Accept,No.ApplicationJson);let r=yield this.get(n,t);return this._processResponse(r,this.requestOptions)})}postJson(n,t,r={}){return wr(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[nn.Accept]=this._getExistingOrDefaultHeader(r,nn.Accept,No.ApplicationJson),r[nn.ContentType]=this._getExistingOrDefaultHeader(r,nn.ContentType,No.ApplicationJson);let s=yield this.post(n,i,r);return this._processResponse(s,this.requestOptions)})}putJson(n,t,r={}){return wr(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[nn.Accept]=this._getExistingOrDefaultHeader(r,nn.Accept,No.ApplicationJson),r[nn.ContentType]=this._getExistingOrDefaultHeader(r,nn.ContentType,No.ApplicationJson);let s=yield this.put(n,i,r);return this._processResponse(s,this.requestOptions)})}patchJson(n,t,r={}){return wr(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[nn.Accept]=this._getExistingOrDefaultHeader(r,nn.Accept,No.ApplicationJson),r[nn.ContentType]=this._getExistingOrDefaultHeader(r,nn.ContentType,No.ApplicationJson);let s=yield this.patch(n,i,r);return this._processResponse(s,this.requestOptions)})}request(n,t,r,i){return wr(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let s=new URL(t),u=this._prepareRequest(n,s,i),h=this._allowRetries&&mT.includes(n)?this._maxRetries+1:1,c=0,a;do{if(a=yield this.requestRaw(u,r),a&&a.message&&a.message.statusCode===Zn.Unauthorized){let f;for(let g of this.handlers)if(g.canHandleAuthentication(a)){f=g;break}return f?f.handleAuthentication(this,u,r):a}let d=this._maxRedirects;for(;a.message.statusCode&&yT.includes(a.message.statusCode)&&this._allowRedirects&&d>0;){let f=a.message.headers.location;if(!f)break;let g=new URL(f);if(s.protocol==="https:"&&s.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!==s.hostname)for(let I in i)I.toLowerCase()==="authorization"&&delete i[I];u=this._prepareRequest(n,g,i),a=yield this.requestRaw(u,r),d--}if(!a.message.statusCode||!gT.includes(a.message.statusCode))return a;c+=1,c{function s(u,h){u?i(u):h?r(h):i(new Error("Unknown error"))}this.requestRawWithCallback(n,t,s)})})}requestRawWithCallback(n,t,r){typeof t=="string"&&(n.options.headers||(n.options.headers={}),n.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let i=!1;function s(c,a){i||(i=!0,r(c,a))}let u=n.httpModule.request(n.options,c=>{let a=new Wl(c);s(void 0,a)}),h;u.on("socket",c=>{h=c}),u.setTimeout(this._socketTimeout||3*6e4,()=>{h&&h.end(),s(new Error(`Request timeout: ${n.options.path}`))}),u.on("error",function(c){s(c)}),t&&typeof t=="string"&&u.write(t,"utf8"),t&&typeof t!="string"?(t.on("close",function(){u.end()}),t.pipe(u)):u.end()}getAgent(n){let t=new URL(n);return this._getAgent(t)}_prepareRequest(n,t,r){let i={};i.parsedUrl=t;let s=i.parsedUrl.protocol==="https:";i.httpModule=s?Uf:zl;let u=s?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):u,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=n,i.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let h of this.handlers)h.prepareRequest(i.options);return i}_mergeHeaders(n){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Kl(this.requestOptions.headers),Kl(n||{})):Kl(n||{})}_getExistingOrDefaultHeader(n,t,r){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Kl(this.requestOptions.headers)[t]),n[t]||i||r}_getAgent(n){let t,r=vg.getProxyUrl(n),i=r&&r.hostname;if(this._keepAlive&&i&&(t=this._proxyAgent),this._keepAlive&&!i&&(t=this._agent),t)return t;let s=n.protocol==="https:",u=100;if(this.requestOptions&&(u=this.requestOptions.maxSockets||zl.globalAgent.maxSockets),r&&r.hostname){let h={maxSockets:u,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},c,a=r.protocol==="https:";s?c=a?Hl.httpsOverHttps:Hl.httpsOverHttp:c=a?Hl.httpOverHttps:Hl.httpOverHttp,t=c(h),this._proxyAgent=t}if(this._keepAlive&&!t){let h={keepAlive:this._keepAlive,maxSockets:u};t=s?new Uf.Agent(h):new zl.Agent(h),this._agent=t}return t||(t=s?Uf.globalAgent:zl.globalAgent),s&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_performExponentialBackoff(n){return wr(this,void 0,void 0,function*(){n=Math.min(vT,n);let t=bT*Math.pow(2,n);return new Promise(r=>setTimeout(()=>r(),t))})}_processResponse(n,t){return wr(this,void 0,void 0,function*(){return new Promise((r,i)=>wr(this,void 0,void 0,function*(){let s=n.message.statusCode||0,u={statusCode:s,result:null,headers:{}};s===Zn.NotFound&&r(u);function h(d,f){if(typeof f=="string"){let g=new Date(f);if(!isNaN(g.valueOf()))return g}return f}let c,a;try{a=yield n.readBody(),a&&a.length>0&&(t&&t.deserializeDates?c=JSON.parse(a,h):c=JSON.parse(a),u.result=c),u.headers=n.message.headers}catch{}if(s>299){let d;c&&c.message?d=c.message:a&&a.length>0?d=a:d=`Failed request: (${s})`;let f=new ss(d,s);f.result=u.result,i(f)}else r(u)}))})}};Nt.HttpClient=Df;var Kl=e=>Object.keys(e).reduce((n,t)=>(n[t.toLowerCase()]=e[t],n),{})});var _g=Pn(wi=>{"use strict";var Vf=wi&&wi.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(wi,"__esModule",{value:!0});wi.PersonalAccessTokenCredentialHandler=wi.BearerCredentialHandler=wi.BasicCredentialHandler=void 0;var jf=class{constructor(n,t){this.username=n,this.password=t}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 Vf(this,void 0,void 0,function*(){throw new Error("not implemented")})}};wi.BasicCredentialHandler=jf;var qf=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 Vf(this,void 0,void 0,function*(){throw new Error("not implemented")})}};wi.BearerCredentialHandler=qf;var Mf=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 Vf(this,void 0,void 0,function*(){throw new Error("not implemented")})}};wi.PersonalAccessTokenCredentialHandler=Mf});var Sg=Pn(us=>{"use strict";var wg=us&&us.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(us,"__esModule",{value:!0});us.OidcClient=void 0;var wT=bg(),ET=_g(),Eg=Ff(),xo=class{static createHttpClient(n=!0,t=10){let r={allowRetries:n,maxRetries:t};return new wT.HttpClient("actions/oidc-client",[new ET.BearerCredentialHandler(xo.getRequestToken())],r)}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 t;return wg(this,void 0,void 0,function*(){let s=(t=(yield xo.createHttpClient().getJson(n).catch(u=>{throw new Error(`Failed to get ID Token. Error Code : ${u.statusCode} - Error Message: ${u.result.message}`)})).result)===null||t===void 0?void 0:t.value;if(!s)throw new Error("Response json body do not have ID Token field");return s})}static getIDToken(n){return Ig(this,void 0,void 0,function*(){try{let t=Uo.getIDTokenUrl();if(n){let i=encodeURIComponent(n);t=`${t}&audience=${i}`}Ag.debug(`ID token url is ${t}`);let r=yield Uo.getCall(t);return Ag.setSecret(r),r}catch(t){throw new Error(`Error message: ${t.message}`)}})}};ls.OidcClient=Uo});var Xf=Pn(yn=>{"use strict";var Gf=yn&&yn.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(yn,"__esModule",{value:!0});yn.summary=yn.markdownSummary=yn.SUMMARY_DOCS_URL=yn.SUMMARY_ENV_VAR=void 0;var PT=require("os"),Qf=require("fs"),{access:BT,appendFile:LT,writeFile:NT}=Qf.promises;yn.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";yn.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var Yf=class{constructor(){this._buffer=""}filePath(){return Gf(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let n=process.env[yn.SUMMARY_ENV_VAR];if(!n)throw new Error(`Unable to find environment variable for $${yn.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield BT(n,Qf.constants.R_OK|Qf.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,t,r={}){let i=Object.entries(r).map(([s,u])=>` ${s}="${u}"`).join("");return t?`<${n}${i}>${t}`:`<${n}${i}>`}write(n){return Gf(this,void 0,void 0,function*(){let t=!!n?.overwrite,r=yield this.filePath();return yield(t?NT:LT)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Gf(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,t=!1){return this._buffer+=n,t?this.addEOL():this}addEOL(){return this.addRaw(PT.EOL)}addCodeBlock(n,t){let r=Object.assign({},t&&{lang:t}),i=this.wrap("pre",this.wrap("code",n),r);return this.addRaw(i).addEOL()}addList(n,t=!1){let r=t?"ol":"ul",i=n.map(u=>this.wrap("li",u)).join(""),s=this.wrap(r,i);return this.addRaw(s).addEOL()}addTable(n){let t=n.map(i=>{let s=i.map(u=>{if(typeof u=="string")return this.wrap("td",u);let{header:h,data:c,colspan:a,rowspan:d}=u,f=h?"th":"td",g=Object.assign(Object.assign({},a&&{colspan:a}),d&&{rowspan:d});return this.wrap(f,c,g)}).join("");return this.wrap("tr",s)}).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(n,t){let r=this.wrap("details",this.wrap("summary",n)+t);return this.addRaw(r).addEOL()}addImage(n,t,r){let{width:i,height:s}=r||{},u=Object.assign(Object.assign({},i&&{width:i}),s&&{height:s}),h=this.wrap("img",null,Object.assign({src:n,alt:t},u));return this.addRaw(h).addEOL()}addHeading(n,t){let r=`h${t}`,i=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",s=this.wrap(i,n);return this.addRaw(s).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,t){let r=Object.assign({},t&&{cite:t}),i=this.wrap("blockquote",n,r);return this.addRaw(i).addEOL()}addLink(n,t){let r=this.wrap("a",n,{href:t});return this.addRaw(r).addEOL()}},Og=new Yf;yn.markdownSummary=Og;yn.summary=Og});var Pg=Pn(gn=>{"use strict";var xT=gn&&gn.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),UT=gn&&gn.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),DT=gn&&gn.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&xT(n,e,t);return UT(n,e),n};Object.defineProperty(gn,"__esModule",{value:!0});gn.toPlatformPath=gn.toWin32Path=gn.toPosixPath=void 0;var jT=DT(require("path"));function qT(e){return e.replace(/[\\]/g,"/")}gn.toPosixPath=qT;function MT(e){return e.replace(/[/]/g,"\\")}gn.toWin32Path=MT;function VT(e){return e.replace(/[/\\]/g,jT.sep)}gn.toPlatformPath=VT});var Wf=Pn(Fe=>{"use strict";var FT=Fe&&Fe.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),$T=Fe&&Fe.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Bg=Fe&&Fe.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&FT(n,e,t);return $T(n,e),n},Lg=Fe&&Fe.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getIDToken=Fe.getState=Fe.saveState=Fe.group=Fe.endGroup=Fe.startGroup=Fe.info=Fe.notice=Fe.warning=Fe.error=Fe.debug=Fe.isDebug=Fe.setFailed=Fe.setCommandEcho=Fe.setOutput=Fe.getBooleanInput=Fe.getMultilineInput=Fe.getInput=Fe.addPath=Fe.setSecret=Fe.exportVariable=Fe.ExitCode=void 0;var Hn=Vy(),fa=yg(),cs=Vl(),Ng=Bg(require("os")),zT=Bg(require("path")),HT=kg(),xg;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(xg=Fe.ExitCode||(Fe.ExitCode={}));function KT(e,n){let t=cs.toCommandValue(n);if(process.env[e]=t,process.env.GITHUB_ENV||"")return fa.issueFileCommand("ENV",fa.prepareKeyValueMessage(e,n));Hn.issueCommand("set-env",{name:e},t)}Fe.exportVariable=KT;function WT(e){Hn.issueCommand("add-mask",{},e)}Fe.setSecret=WT;function GT(e){process.env.GITHUB_PATH||""?fa.issueFileCommand("PATH",e):Hn.issueCommand("add-path",{},e),process.env.PATH=`${e}${zT.delimiter}${process.env.PATH}`}Fe.addPath=GT;function Jf(e,n){let t=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(n&&n.required&&!t)throw new Error(`Input required and not supplied: ${e}`);return n&&n.trimWhitespace===!1?t:t.trim()}Fe.getInput=Jf;function QT(e,n){let t=Jf(e,n).split(` -`).filter(r=>r!=="");return n&&n.trimWhitespace===!1?t:t.map(r=>r.trim())}Fe.getMultilineInput=QT;function YT(e,n){let t=["true","True","TRUE"],r=["false","False","FALSE"],i=Jf(e,n);if(t.includes(i))return!0;if(r.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\``)}Fe.getBooleanInput=YT;function XT(e,n){if(process.env.GITHUB_OUTPUT||"")return fa.issueFileCommand("OUTPUT",fa.prepareKeyValueMessage(e,n));process.stdout.write(Ng.EOL),Hn.issueCommand("set-output",{name:e},cs.toCommandValue(n))}Fe.setOutput=XT;function JT(e){Hn.issue("echo",e?"on":"off")}Fe.setCommandEcho=JT;function ZT(e){process.exitCode=xg.Failure,Ug(e)}Fe.setFailed=ZT;function e3(){return process.env.RUNNER_DEBUG==="1"}Fe.isDebug=e3;function t3(e){Hn.issueCommand("debug",{},e)}Fe.debug=t3;function Ug(e,n={}){Hn.issueCommand("error",cs.toCommandProperties(n),e instanceof Error?e.toString():e)}Fe.error=Ug;function r3(e,n={}){Hn.issueCommand("warning",cs.toCommandProperties(n),e instanceof Error?e.toString():e)}Fe.warning=r3;function n3(e,n={}){Hn.issueCommand("notice",cs.toCommandProperties(n),e instanceof Error?e.toString():e)}Fe.notice=n3;function i3(e){process.stdout.write(e+Ng.EOL)}Fe.info=i3;function Dg(e){Hn.issue("group",e)}Fe.startGroup=Dg;function jg(){Hn.issue("endgroup")}Fe.endGroup=jg;function o3(e,n){return Lg(this,void 0,void 0,function*(){Dg(e);let t;try{t=yield n()}finally{jg()}return t})}Fe.group=o3;function a3(e,n){if(process.env.GITHUB_STATE||"")return fa.issueFileCommand("STATE",fa.prepareKeyValueMessage(e,n));Hn.issueCommand("save-state",{name:e},cs.toCommandValue(n))}Fe.saveState=a3;function s3(e){return process.env[`STATE_${e}`]||""}Fe.getState=s3;function u3(e){return Lg(this,void 0,void 0,function*(){return yield HT.OidcClient.getIDToken(e)})}Fe.getIDToken=u3;var l3=Xf();Object.defineProperty(Fe,"summary",{enumerable:!0,get:function(){return l3.summary}});var c3=Xf();Object.defineProperty(Fe,"markdownSummary",{enumerable:!0,get:function(){return c3.markdownSummary}});var Zf=Pg();Object.defineProperty(Fe,"toPosixPath",{enumerable:!0,get:function(){return Zf.toPosixPath}});Object.defineProperty(Fe,"toWin32Path",{enumerable:!0,get:function(){return Zf.toWin32Path}});Object.defineProperty(Fe,"toPlatformPath",{enumerable:!0,get:function(){return Zf.toPlatformPath}})});var Vb=Pn((qk,Mb)=>{var h3=Object.create,ju=Object.defineProperty,f3=Object.getOwnPropertyDescriptor,d3=Object.getOwnPropertyNames,Ac=Object.getOwnPropertySymbols,p3=Object.getPrototypeOf,lp=Object.prototype.hasOwnProperty,iv=Object.prototype.propertyIsEnumerable,qg=(e,n,t)=>n in e?ju(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,zc=(e,n)=>{for(var t in n||={})lp.call(n,t)&&qg(e,t,n[t]);if(Ac)for(var t of Ac(n))iv.call(n,t)&&qg(e,t,n[t]);return e},Hc=(e,n)=>{var t={};for(var r in e)lp.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Ac)for(var r of Ac(e))n.indexOf(r)<0&&iv.call(e,r)&&(t[r]=e[r]);return t},Ae=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),y3=(e,n)=>{for(var t in n)ju(e,t,{get:n[t],enumerable:!0})},ov=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of d3(n))!lp.call(e,i)&&i!==t&&ju(e,i,{get:()=>n[i],enumerable:!(r=f3(n,i))||r.enumerable});return e},xt=(e,n,t)=>(t=e!=null?h3(p3(e)):{},ov(n||!e||!e.__esModule?ju(t,"default",{value:e,enumerable:!0}):t,e)),g3=e=>ov(ju({},"__esModule",{value:!0}),e),ho=(e,n,t)=>new Promise((r,i)=>{var s=c=>{try{h(t.next(c))}catch(a){i(a)}},u=c=>{try{h(t.throw(c))}catch(a){i(a)}},h=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,u);h((t=t.apply(e,n)).next())}),m3=Ae((e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(i){return i.encrypted}var r=(i,s)=>{let u;typeof s=="function"?u={connect:s}:u=s;let h=typeof u.connect=="function",c=typeof u.secureConnect=="function",a=typeof u.close=="function",d=()=>{h&&u.connect(),t(i)&&c&&(i.authorized?u.secureConnect():i.authorizationError||i.once("secureConnect",u.secureConnect)),a&&i.once("close",u.close)};i.writable&&!i.connecting?d():i.connecting?i.once("connect",d):i.destroyed&&a&&u.close(i._hadError)};e.default=r,n.exports=r,n.exports.default=r}),v3=Ae((e,n)=>{"use strict";var{PassThrough:t}=require("stream");n.exports=r=>{r={...r};let{array:i}=r,{encoding:s}=r,u=s==="buffer",h=!1;i?h=!(s||u):s=s||"utf8",u&&(s=null);let c=new t({objectMode:h});s&&c.setEncoding(s);let a=0,d=[];return c.on("data",f=>{d.push(f),h?a=d.length:a+=f.length}),c.getBufferedValue=()=>i?d:u?Buffer.concat(d,a):d.join(""),c.getBufferedLength=()=>a,c}}),cp=Ae((e,n)=>{"use strict";var{constants:t}=require("buffer"),r=require("stream"),{promisify:i}=require("util"),s=v3(),u=i(r.pipeline),h=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function c(a,d){if(!a)throw new Error("Expected a stream");d={maxBuffer:1/0,...d};let{maxBuffer:f}=d,g=s(d);return await new Promise((I,C)=>{let v=T=>{T&&g.getBufferedLength()<=t.MAX_LENGTH&&(T.bufferedData=g.getBufferedValue()),C(T)};(async()=>{try{await u(a,g),I()}catch(T){v(T)}})(),g.on("data",()=>{g.getBufferedLength()>f&&v(new h)})}),g.getBufferedValue()}n.exports=c,n.exports.buffer=(a,d)=>c(a,{...d,encoding:"buffer"}),n.exports.array=(a,d)=>c(a,{...d,array:!0}),n.exports.MaxBufferError=h}),b3=Ae((e,n)=>{"use strict";var t=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),r=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),s={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},u={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function h(f){let g=parseInt(f,10);return isFinite(g)?g:0}function c(f){return f?i.has(f.status):!0}function a(f){let g={};if(!f)return g;let I=f.trim().split(/,/);for(let C of I){let[v,T]=C.split(/=/,2);g[v.trim()]=T===void 0?!0:T.trim().replace(/^"|"$/g,"")}return g}function d(f){let g=[];for(let I in f){let C=f[I];g.push(C===!0?I:I+"="+C)}if(g.length)return g.join(", ")}n.exports=class{constructor(f,g,{shared:I,cacheHeuristic:C,immutableMinTimeToLive:v,ignoreCargoCult:T,_fromObject:O}={}){if(O){this._fromObject(O);return}if(!g||!g.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(f),this._responseTime=this.now(),this._isShared=I!==!1,this._cacheHeuristic=C!==void 0?C:.1,this._immutableMinTtl=v!==void 0?v: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 f?f.method:"GET",this._url=f.url,this._host=f.headers.host,this._noAuthorization=!f.headers.authorization,this._reqHeaders=g.headers.vary?f.headers:null,this._reqcc=a(f.headers["cache-control"]),T&&"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),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())&&r.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||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(f){if(!f||!f.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(f){this._assertRequestHasHeaders(f);let g=a(f.headers["cache-control"]);return g["no-cache"]||/no-cache/.test(f.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(f,!1)}_requestMatches(f,g){return(!this._url||this._url===f.url)&&this._host===f.headers.host&&(!f.method||this._method===f.method||g&&f.method==="HEAD")&&this._varyMatches(f)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(f){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(f.headers[I]!==this._reqHeaders[I])return!1;return!0}_copyWithoutHopByHopHeaders(f){let g={};for(let I in f)s[I]||(g[I]=f[I]);if(f.connection){let I=f.connection.trim().split(/\s*,\s*/);for(let C of I)delete g[C]}if(g.warning){let I=g.warning.split(/,/).filter(C=>!/^\s*1[0-9][0-9]/.test(C));I.length?g.warning=I.join(",").trim():delete g.warning}return g}responseHeaders(){let f=this._copyWithoutHopByHopHeaders(this._resHeaders),g=this.age();return g>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(f.warning=(f.warning?`${f.warning}, `:"")+'113 - "rfc7234 5.5.4"'),f.age=`${Math.round(g)}`,f.date=new Date(this.now()).toUTCString(),f}date(){let f=Date.parse(this._resHeaders.date);return isFinite(f)?f:this._responseTime}age(){let f=this._ageValue(),g=(this.now()-this._responseTime)/1e3;return f+g}_ageValue(){return h(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 h(this._rescc["s-maxage"])}if(this._rescc["max-age"])return h(this._rescc["max-age"]);let f=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(f,(g-I)/1e3*this._cacheHeuristic)}return f}timeToLive(){let f=this.maxAge()-this.age(),g=f+h(this._rescc["stale-if-error"]),I=f+h(this._rescc["stale-while-revalidate"]);return Math.max(0,f,g,I)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+h(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+h(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(f){return new this(void 0,void 0,{_fromObject:f})}_fromObject(f){if(this._responseTime)throw Error("Reinitialized");if(!f||f.v!==1)throw Error("Invalid serialization");this._responseTime=f.t,this._isShared=f.sh,this._cacheHeuristic=f.ch,this._immutableMinTtl=f.imm!==void 0?f.imm:24*3600*1e3,this._status=f.st,this._resHeaders=f.resh,this._rescc=f.rescc,this._method=f.m,this._url=f.u,this._host=f.h,this._noAuthorization=f.a,this._reqHeaders=f.reqh,this._reqcc=f.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(f){this._assertRequestHasHeaders(f);let g=this._copyWithoutHopByHopHeaders(f.headers);if(delete g["if-range"],!this._requestMatches(f,!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(C=>!/^\s*W\//.test(C));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(f,g){if(this._assertRequestHasHeaders(f),this._useStaleIfError()&&c(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(f,g),modified:g.status!=304,matches:!1};let C={};for(let T in this._resHeaders)C[T]=T in g.headers&&!u[T]?g.headers[T]:this._resHeaders[T];let v=Object.assign({},g,{status:this._status,method:this._method,headers:C});return{policy:new this.constructor(f,v,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),_3=Ae(e=>{e.stringify=function n(t){if(typeof t>"u")return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON&&(t=t.toJSON()),t&&typeof t=="object"){var r="",i=Array.isArray(t);r=i?"[":"{";var s=!0;for(var u in t){var h=typeof t[u]=="function"||!i&&typeof t[u]>"u";Object.hasOwnProperty.call(t,u)&&!h&&(s||(r+=","),s=!1,i?t[u]==null?r+="null":r+=n(t[u]):t[u]!==void 0&&(r+=n(u)+":"+n(t[u])))}return r+=i?"]":"}",r}else return typeof t=="string"?JSON.stringify(/^:/.test(t)?":"+t:t):typeof t>"u"?"null":JSON.stringify(t)},e.parse=function(n){return JSON.parse(n,function(t,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}}),w3=Ae((e,n)=>{"use strict";var t=require("events"),r=_3(),i=h=>{let c={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(h.adapter||h.uri){let a=h.adapter||/^[^:+]*/.exec(h.uri)[0];return new(require(c[a]))(h)}return new Map},s=["sqlite","postgres","mysql","mongo","redis","tiered"],u=class extends t{constructor(h,{emitErrors:c=!0,...a}={}){if(super(),this.opts={namespace:"keyv",serialize:r.stringify,deserialize:r.parse,...typeof h=="string"?{uri:h}:h,...a},!this.opts.store){let f={...this.opts};this.opts.store=i(f)}if(this.opts.compression){let f=this.opts.compression;this.opts.serialize=f.serialize.bind(f),this.opts.deserialize=f.deserialize.bind(f)}typeof this.opts.store.on=="function"&&c&&this.opts.store.on("error",f=>this.emit("error",f)),this.opts.store.namespace=this.opts.namespace;let d=f=>async function*(){for await(let[g,I]of typeof f=="function"?f(this.opts.store.namespace):f){let C=this.opts.deserialize(I);if(!(this.opts.store.namespace&&!g.includes(this.opts.store.namespace))){if(typeof C.expires=="number"&&Date.now()>C.expires){this.delete(g);continue}yield[this._getKeyUnprefix(g),C.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 s.includes(this.opts.store.opts.dialect)||s.findIndex(h=>this.opts.store.opts.url.includes(h))>=0}_getKeyPrefix(h){return`${this.opts.namespace}:${h}`}_getKeyPrefixArray(h){return h.map(c=>`${this.opts.namespace}:${c}`)}_getKeyUnprefix(h){return h.split(":").splice(1).join(":")}get(h,c){let{store:a}=this.opts,d=Array.isArray(h),f=d?this._getKeyPrefixArray(h):this._getKeyPrefix(h);if(d&&a.getMany===void 0){let g=[];for(let I of f)g.push(Promise.resolve().then(()=>a.get(I)).then(C=>typeof C=="string"?this.opts.deserialize(C):this.opts.compression?this.opts.deserialize(C):C).then(C=>{if(C!=null)return typeof C.expires=="number"&&Date.now()>C.expires?this.delete(I).then(()=>{}):c&&c.raw?C:C.value}));return Promise.allSettled(g).then(I=>{let C=[];for(let v of I)C.push(v.value);return C})}return Promise.resolve().then(()=>d?a.getMany(f):a.get(f)).then(g=>typeof g=="string"?this.opts.deserialize(g):this.opts.compression?this.opts.deserialize(g):g).then(g=>{if(g!=null){if(d){let I=[];for(let C of g){if(typeof C=="string"&&(C=this.opts.deserialize(C)),C==null){I.push(void 0);continue}typeof C.expires=="number"&&Date.now()>C.expires?(this.delete(h).then(()=>{}),I.push(void 0)):I.push(c&&c.raw?C:C.value)}return I}return typeof g.expires=="number"&&Date.now()>g.expires?this.delete(h).then(()=>{}):c&&c.raw?g:g.value}})}set(h,c,a){let d=this._getKeyPrefix(h);typeof a>"u"&&(a=this.opts.ttl),a===0&&(a=void 0);let{store:f}=this.opts;return Promise.resolve().then(()=>{let g=typeof a=="number"?Date.now()+a:null;return typeof c=="symbol"&&this.emit("error","symbol cannot be serialized"),c={value:c,expires:g},this.opts.serialize(c)}).then(g=>f.set(d,g,a)).then(()=>!0)}delete(h){let{store:c}=this.opts;if(Array.isArray(h)){let d=this._getKeyPrefixArray(h);if(c.deleteMany===void 0){let f=[];for(let g of d)f.push(c.delete(g));return Promise.allSettled(f).then(g=>g.every(I=>I.value===!0))}return Promise.resolve().then(()=>c.deleteMany(d))}let a=this._getKeyPrefix(h);return Promise.resolve().then(()=>c.delete(a))}clear(){let{store:h}=this.opts;return Promise.resolve().then(()=>h.clear())}has(h){let c=this._getKeyPrefix(h),{store:a}=this.opts;return Promise.resolve().then(async()=>typeof a.has=="function"?a.has(c):await a.get(c)!==void 0)}disconnect(){let{store:h}=this.opts;if(typeof h.disconnect=="function")return h.disconnect()}};n.exports=u}),E3=Ae((e,n)=>{"use strict";var t=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];n.exports=(r,i)=>{if(i._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let s=new Set(Object.keys(r).concat(t)),u={};for(let h of s)h in i||(u[h]={get(){let c=r[h];return typeof c=="function"?c.bind(r):c},set(c){r[h]=c},enumerable:!0,configurable:!1});return Object.defineProperties(i,u),r.once("aborted",()=>{i.destroy(),i.emit("aborted")}),r.once("close",()=>{r.complete&&i.readable?i.once("end",()=>{i.emit("close")}):i.emit("close")}),i}}),av=Ae((e,n)=>{"use strict";var{Transform:t,PassThrough:r}=require("stream"),i=require("zlib"),s=E3();n.exports=u=>{let h=(u.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(h))return u;let c=h==="br";if(c&&typeof i.createBrotliDecompress!="function")return u.destroy(new Error("Brotli is not supported on Node.js < 12")),u;let a=!0,d=new t({transform(I,C,v){a=!1,v(null,I)},flush(I){I()}}),f=new r({autoDestroy:!1,destroy(I,C){u.destroy(),C(I)}}),g=c?i.createBrotliDecompress():i.createUnzip();return g.once("error",I=>{if(a&&!u.readable){f.end();return}f.destroy(I)}),s(u,f),u.pipe(d).pipe(g).pipe(f),f}}),sv=Ae((e,n)=>{"use strict";var t=class{constructor(r={}){if(!(r.maxSize&&r.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=r.maxSize,this.onEviction=r.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(r,i){if(this.cache.set(r,i),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[s,u]of this.oldCache.entries())this.onEviction(s,u);this.oldCache=this.cache,this.cache=new Map}}get(r){if(this.cache.has(r))return this.cache.get(r);if(this.oldCache.has(r)){let i=this.oldCache.get(r);return this.oldCache.delete(r),this._set(r,i),i}}set(r,i){return this.cache.has(r)?this.cache.set(r,i):this._set(r,i),this}has(r){return this.cache.has(r)||this.oldCache.has(r)}peek(r){if(this.cache.has(r))return this.cache.get(r);if(this.oldCache.has(r))return this.oldCache.get(r)}delete(r){let i=this.cache.delete(r);return i&&this._size--,this.oldCache.delete(r)||i}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[r]of this)yield r}*values(){for(let[,r]of this)yield r}*[Symbol.iterator](){for(let r of this.cache)yield r;for(let r of this.oldCache){let[i]=r;this.cache.has(i)||(yield r)}}get size(){let r=0;for(let i of this.oldCache.keys())this.cache.has(i)||r++;return Math.min(this._size+r,this.maxSize)}};n.exports=t}),uv=Ae((e,n)=>{"use strict";n.exports=t=>{if(t.listenerCount("error")!==0)return t;t.__destroy=t._destroy,t._destroy=(...i)=>{let s=i.pop();t.__destroy(...i,async u=>{await Promise.resolve(),s(u)})};let r=i=>{Promise.resolve().then(()=>{t.emit("error",i)})};return t.once("error",r),Promise.resolve().then(()=>{t.off("error",r)}),t}}),Rs=Ae((e,n)=>{"use strict";var{URL:t}=require("url"),r=require("events"),i=require("tls"),s=require("http2"),u=sv(),h=uv(),c=Symbol("currentStreamCount"),a=Symbol("request"),d=Symbol("cachedOriginSet"),f=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"],C=(R,w,L)=>{let D=0,S=R.length;for(;D>>1;L(R[m],w)?D=m+1:S=m}return D},v=(R,w)=>R.remoteSettings.maxConcurrentStreams>w.remoteSettings.maxConcurrentStreams,T=(R,w)=>{for(let L=0;L0&&D[d].lengthw[d].includes(S))&&D[c]+w[c]<=w.remoteSettings.maxConcurrentStreams&&k(D)}},O=(R,w)=>{for(let L=0;L0&&w[d].lengthD[d].includes(S))&&w[c]+D[c]<=D.remoteSettings.maxConcurrentStreams)return k(w),!0}return!1},k=R=>{R[f]=!0,R[c]===0&&R.close()},y=class extends r{constructor({timeout:R=0,maxSessions:w=Number.POSITIVE_INFINITY,maxEmptySessions:L=10,maxCachedTlsSessions:D=100}={}){super(),this.sessions={},this.queue={},this.timeout=R,this.maxSessions=w,this.maxEmptySessions=L,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new u({maxSize:D})}get protocol(){return"https:"}normalizeOptions(R){let w="";for(let L=0;L=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let R in this.queue)for(let w in this.queue[R]){let L=this.queue[R][w];L.completed||(L.completed=!0,L())}}_isBetterSession(R,w){return R>w}_accept(R,w,L,D){let S=0;for(;S0&&(this.getSession(L,D,w),w.length=0)}getSession(R,w,L){return new Promise((D,S)=>{Array.isArray(L)&&L.length>0?(L=[...L],D()):L=[{resolve:D,reject:S}];try{if(typeof R=="string")R=new t(R);else if(!(R instanceof t))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(w){let{servername:$}=w,{hostname:E}=R;if($&&E!==$)throw new Error(`Origin ${E} differs from servername ${$}`)}}catch($){for(let E=0;E=ee||M[f]||M.destroyed||(j||(E=ee),this._isBetterSession(oe,B)&&(j=M,B=oe))}if(j){this._accept(j,L,p,w);return}}if(m in this.queue){if(p in this.queue[m]){this.queue[m][p].listeners.push(...L);return}}else this.queue[m]={[g]:0};let q=()=>{m in this.queue&&this.queue[m][p]===V&&(delete this.queue[m][p],--this.queue[m][g]===0&&delete this.queue[m])},V=async()=>{this._sessionCount++;let $=`${p}:${m}`,E=!1,B;try{let j={...w};j.settings===void 0&&(j.settings=this.settings),j.session===void 0&&(j.session=this.tlsSessionCache.get($)),B=await(j.createConnection||this.createConnection).call(this,R,j),j.createConnection=()=>B;let N=s.connect(R,j);N[c]=0,N[f]=!1;let M=()=>{let{socket:ae}=N,pe;return ae.servername===!1?(ae.servername=ae.remoteAddress,pe=N.originSet,ae.servername=!1):pe=N.originSet,pe},ee=()=>N[c]{this.tlsSessionCache.set($,ae)}),N.once("error",ae=>{for(let pe=0;pe{N.destroy()}),N.once("close",()=>{if(this._sessionCount--,E){this._emptySessionCount--;let ae=this.sessions[m];ae.length===1?delete this.sessions[m]:ae.splice(ae.indexOf(N),1)}else{q();let ae=new Error("Session closed without receiving a SETTINGS frame");ae.code="HTTP2WRAPPER_NOSETTINGS";for(let pe=0;pe{let ae=this.queue[m];if(!ae)return;let pe=N[d];for(let _e=0;_e{N[d]=M()||[],N[f]=!1,O(this.sessions[m],N),!(N[f]||!ee())&&(oe(),ee()&&T(this.sessions[m],N))}),N.once("remoteSettings",()=>{if(V.destroyed){let ae=new Error("Agent has been destroyed");for(let pe=0;pethis.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),N.on("remoteSettings",()=>{ee()&&(oe(),ee()&&T(this.sessions[m],N))})}),N[a]=N.request,N.request=(ae,pe)=>{if(N[f])throw new Error("The session is gracefully closing. No new streams are allowed.");let _e=N[a](ae,pe);return N.ref(),N[c]++===0&&this._emptySessionCount--,_e.once("close",()=>{if(--N[c]===0&&(this._emptySessionCount++,N.unref(),this._emptySessionCount>this.maxEmptySessions||N[f])){N.close();return}N.destroyed||N.closed||ee()&&!O(this.sessions[m],N)&&(T(this.sessions[m],N),oe(),N[c]===0&&this._processQueue())}),_e}}catch(j){q(),this._sessionCount--;for(let N=0;N{this.getSession(R,w,[{reject:m,resolve:p=>{try{let q=p.request(L,D);h(q),S(q)}catch(q){m(q)}}}])})}async createConnection(R,w){return y.connect(R,w)}static connect(R,w){w.ALPNProtocols=["h2"];let L=R.port||443,D=R.hostname;typeof w.servername>"u"&&(w.servername=D);let S=i.connect(L,D,w);return w.socket&&(S._peername={family:void 0,address:void 0,port:L}),S}closeEmptySessions(R=Number.POSITIVE_INFINITY){let w=0,{sessions:L}=this;for(let D in L){let S=L[D];for(let m=0;m=R))return w}}return w}destroy(R){let{sessions:w,queue:L}=this;for(let D in w){let S=w[D];for(let m=0;m{"use strict";var{Readable:t}=require("stream"),r=class extends t{constructor(i,s){super({emitClose:!1,autoDestroy:!0,highWaterMark:s}),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,s){this.readableEnded||(this.aborted=!0),s(),this.req._request.destroy(i)}setTimeout(i,s){return this.req.setTimeout(i,s),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};n.exports=r}),S3=Ae((e,n)=>{"use strict";n.exports=(t,r,i)=>{for(let s of i)t.on(s,(...u)=>r.emit(s,...u))}}),Kc=Ae((e,n)=>{"use strict";var t=(r,i,s)=>{n.exports[i]=class extends r{constructor(...u){super(typeof s=="string"?s:s(u)),this.name=`${super.name} [${i}]`,this.code=i}}};t(TypeError,"ERR_INVALID_ARG_TYPE",r=>{let i=r[0].includes(".")?"property":"argument",s=r[1],u=Array.isArray(s);return u&&(s=`${s.slice(0,-1).join(", ")} or ${s.slice(-1)}`),`The "${r[0]}" ${i} must be ${u?"one of":"of"} type ${s}. Received ${typeof r[2]}`}),t(TypeError,"ERR_INVALID_PROTOCOL",r=>`Protocol "${r[0]}" not supported. Expected "${r[1]}"`),t(Error,"ERR_HTTP_HEADERS_SENT",r=>`Cannot ${r[0]} headers after they are sent to the client`),t(TypeError,"ERR_INVALID_HTTP_TOKEN",r=>`${r[0]} must be a valid HTTP token [${r[1]}]`),t(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",r=>`Invalid value "${r[0]} for header "${r[1]}"`),t(TypeError,"ERR_INVALID_CHAR",r=>`Invalid character in ${r[0]} [${r[1]}]`),t(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}),C3=Ae((e,n)=>{"use strict";n.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),cv=Ae((e,n)=>{"use strict";var{ERR_INVALID_HTTP_TOKEN:t}=Kc(),r=C3(),i=/^[\^`\-\w!#$%&*+.|~]+$/;n.exports=s=>{if(typeof s!="string"||!i.test(s)&&!r(s))throw new t("Header name",s)}}),hv=Ae((e,n)=>{"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE:t,ERR_INVALID_CHAR:r}=Kc(),i=/[^\t\u0020-\u007E\u0080-\u00FF]/;n.exports=(s,u)=>{if(typeof u>"u")throw new t(u,s);if(i.test(u))throw new r("header content",s)}}),T3=Ae((e,n)=>{"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION:t}=Kc(),r={has(i,s){let u=i.session===void 0?i:i.session.socket;return s in i||s in u},get(i,s){switch(s){case"on":case"once":case"end":case"emit":case"destroy":return i[s].bind(i);case"writable":case"destroyed":return i[s];case"readable":return i.destroyed?!1:i.readable;case"setTimeout":{let{session:u}=i;return u!==void 0?u.setTimeout.bind(u):i.setTimeout.bind(i)}case"write":case"read":case"pause":case"resume":throw new t;default:{let u=i.session===void 0?i:i.session.socket,h=u[s];return typeof h=="function"?h.bind(u):h}}},getPrototypeOf(i){return i.session!==void 0?Reflect.getPrototypeOf(i.session.socket):Reflect.getPrototypeOf(i)},set(i,s,u){switch(s){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return i[s]=u,!0;case"setTimeout":{let{session:h}=i;return h===void 0?i.setTimeout=u:h.setTimeout=u,!0}case"write":case"read":case"pause":case"resume":throw new t;default:{let h=i.session===void 0?i:i.session.socket;return h[s]=u,!0}}}};n.exports=r}),fv=Ae((e,n)=>{"use strict";var{URL:t,urlToHttpOptions:r}=require("url"),i=require("http2"),{Writable:s}=require("stream"),{Agent:u,globalAgent:h}=Rs(),c=lv(),a=S3(),{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_PROTOCOL:f,ERR_HTTP_HEADERS_SENT:g}=Kc(),I=cv(),C=hv(),v=T3(),{HTTP2_HEADER_STATUS:T,HTTP2_HEADER_METHOD:O,HTTP2_HEADER_PATH:k,HTTP2_HEADER_AUTHORITY:y,HTTP2_METHOD_CONNECT:R}=i.constants,w=Symbol("headers"),L=Symbol("origin"),D=Symbol("session"),S=Symbol("options"),m=Symbol("flushedHeaders"),p=Symbol("jobs"),q=Symbol("pendingAgentPromise"),V=class extends s{constructor($,E,B){if(super({autoDestroy:!1,emitClose:!1}),typeof $=="string"?$=r(new t($)):$ instanceof t?$=r($):$={...$},typeof E=="function"||E===void 0?(B=E,E=$):E=Object.assign($,E),E.h2session){if(this[D]=E.h2session,this[D].destroyed)throw new Error("The session has been closed already");this.protocol=this[D].socket.encrypted?"https:":"http:"}else if(E.agent===!1)this.agent=new u({maxEmptySessions:0});else if(typeof E.agent>"u"||E.agent===null)this.agent=h;else if(typeof E.agent.request=="function")this.agent=E.agent;else throw new d("options.agent",["http2wrapper.Agent-like Object","undefined","false"],E.agent);if(this.agent&&(this.protocol=this.agent.protocol),E.protocol&&E.protocol!==this.protocol)throw new f(E.protocol,this.protocol);E.port||(E.port=E.defaultPort||this.agent&&this.agent.defaultPort||443),E.host=E.hostname||E.host||"localhost",delete E.hostname;let{timeout:j}=E;E.timeout=void 0,this[w]=Object.create(null),this[p]=[],this[q]=void 0,this.socket=null,this.connection=null,this.method=E.method||"GET",this.method==="CONNECT"&&(E.path==="/"||E.path===void 0)||(this.path=E.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:N}=E;if(N)for(let ee in N)this.setHeader(ee,N[ee]);E.auth&&!("authorization"in this[w])&&(this[w].authorization="Basic "+Buffer.from(E.auth).toString("base64")),E.session=E.tlsSession,E.path=E.socketPath,this[S]=E,this[L]=new t(`${this.protocol}//${E.servername||E.host}:${E.port}`);let M=E._reuseSocket;M&&(E.createConnection=(...ee)=>M.destroyed?this.agent.createConnection(...ee):M,this.agent.getSession(this[L],this[S]).catch(()=>{})),j&&this.setTimeout(j),B&&this.once("response",B),this[m]=!1}get method(){return this[w][O]}set method($){$&&(this[w][O]=$.toUpperCase())}get path(){let $=this.method==="CONNECT"?y:k;return this[w][$]}set path($){if($){let E=this.method==="CONNECT"?y:k;this[w][E]=$}}get host(){return this[L].hostname}set host($){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write($,E,B){if(this._mustNotHaveABody){B(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let j=()=>this._request.write($,E,B);this._request?j():this[p].push(j)}_final($){this.flushHeaders();let E=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){$();return}this._request.end($)};this._request?E():this[p].push(E)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy($,E){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[q]}catch(B){this.aborted&&($=B)}E($)}async flushHeaders(){if(this[m]||this.destroyed)return;this[m]=!0;let $=this.method===R,E=B=>{if(this._request=B,this.destroyed){B.destroy();return}$||a(B,this,["timeout","continue"]),B.once("error",N=>{this.destroy(N)}),B.once("aborted",()=>{let{res:N}=this;N?(N.aborted=!0,N.emit("aborted"),N.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let j=(N,M,ee)=>{let oe=new c(this.socket,B.readableHighWaterMark);this.res=oe,oe.url=`${this[L].origin}${this.path}`,oe.req=this,oe.statusCode=N[T],oe.headers=N,oe.rawHeaders=ee,oe.once("end",()=>{oe.complete=!0,oe.socket=null,oe.connection=null}),$?(oe.upgrade=!0,this.emit("connect",oe,B,Buffer.alloc(0))?this.emit("close"):B.destroy()):(B.on("data",ae=>{!oe._dumped&&!oe.push(ae)&&B.pause()}),B.once("end",()=>{this.aborted||oe.push(null)}),this.emit("response",oe)||oe._dump())};B.once("response",j),B.once("headers",N=>this.emit("information",{statusCode:N[T]})),B.once("trailers",(N,M,ee)=>{let{res:oe}=this;if(oe===null){j(N,M,ee);return}oe.trailers=N,oe.rawTrailers=ee}),B.once("close",()=>{let{aborted:N,res:M}=this;if(M){N&&(M.aborted=!0,M.emit("aborted"),M.destroy());let ee=()=>{M.emit("close"),this.destroy(),this.emit("close")};M.readable?M.once("end",ee):ee();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(B,v);for(let N of this[p])N();this[p].length=0,this.emit("socket",this.socket)};if(!(y in this[w])&&!$&&(this[w][y]=this[L].host),this[D])try{E(this[D].request(this[w]))}catch(B){this.destroy(B)}else{this.reusedSocket=!0;try{let B=this.agent.request(this[L],this[S],this[w]);this[q]=B,E(await B),this[q]=!1}catch(B){this[q]=!1,this.destroy(B)}}}get connection(){return this.socket}set connection($){this.socket=$}getHeaderNames(){return Object.keys(this[w])}hasHeader($){if(typeof $!="string")throw new d("name","string",$);return!!this[w][$.toLowerCase()]}getHeader($){if(typeof $!="string")throw new d("name","string",$);return this[w][$.toLowerCase()]}get headersSent(){return this[m]}removeHeader($){if(typeof $!="string")throw new d("name","string",$);if(this.headersSent)throw new g("remove");delete this[w][$.toLowerCase()]}setHeader($,E){if(this.headersSent)throw new g("set");I($),C($,E);let B=$.toLowerCase();if(B==="connection"){if(E.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${E}`)}B==="host"&&this.method==="CONNECT"?this[w][y]=E:this[w][B]=E}setNoDelay(){}setSocketKeepAlive(){}setTimeout($,E){let B=()=>this._request.setTimeout($,E);return this._request?B():this[p].push(B),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount($){}};n.exports=V}),R3=Ae((e,n)=>{"use strict";var t=require("tls");n.exports=(r={},i=t.connect)=>new Promise((s,u)=>{let h=!1,c,a=async()=>{await f,c.off("timeout",d),c.off("error",u),r.resolveSocket?(s({alpnProtocol:c.alpnProtocol,socket:c,timeout:h}),h&&(await Promise.resolve(),c.emit("timeout"))):(c.destroy(),s({alpnProtocol:c.alpnProtocol,timeout:h}))},d=async()=>{h=!0,a()},f=(async()=>{try{c=await i(r,a),c.on("error",u),c.once("timeout",d)}catch(g){u(g)}})()})}),I3=Ae((e,n)=>{"use strict";var{isIP:t}=require("net"),r=require("assert"),i=s=>{if(s[0]==="["){let h=s.indexOf("]");return r(h!==-1),s.slice(1,h)}let u=s.indexOf(":");return u===-1?s:s.slice(0,u)};n.exports=s=>{let u=i(s);return t(u)?"":u}}),A3=Ae((e,n)=>{"use strict";var{URL:t,urlToHttpOptions:r}=require("url"),i=require("http"),s=require("https"),u=R3(),h=sv(),{Agent:c,globalAgent:a}=Rs(),d=fv(),f=I3(),g=uv(),I=new h({maxSize:100}),C=new Map,v=(k,y,R)=>{y._httpMessage={shouldKeepAlive:!0};let w=()=>{k.emit("free",y,R)};y.on("free",w);let L=()=>{k.removeSocket(y,R)};y.on("close",L);let D=()=>{let{freeSockets:m}=k;for(let p of Object.values(m))if(p.includes(y)){y.destroy();return}};y.on("timeout",D);let S=()=>{k.removeSocket(y,R),y.off("close",L),y.off("free",w),y.off("timeout",D),y.off("agentRemove",S)};y.on("agentRemove",S),k.emit("free",y,R)},T=(k,y=new Map,R=void 0)=>async w=>{let L=`${w.host}:${w.port}:${w.ALPNProtocols.sort()}`;if(!k.has(L)){if(y.has(L))return{alpnProtocol:(await y.get(L)).alpnProtocol};let{path:D}=w;w.path=w.socketPath;let S=u(w,R);y.set(L,S);try{let m=await S;return k.set(L,m.alpnProtocol),y.delete(L),w.path=D,m}catch(m){throw y.delete(L),w.path=D,m}}return{alpnProtocol:k.get(L)}},O=T(I,C);n.exports=async(k,y,R)=>{if(typeof k=="string"?k=r(new t(k)):k instanceof t?k=r(k):k={...k},typeof y=="function"||y===void 0?(R=y,y=k):y=Object.assign(k,y),y.ALPNProtocols=y.ALPNProtocols||["h2","http/1.1"],!Array.isArray(y.ALPNProtocols)||y.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");y.protocol=y.protocol||"https:";let w=y.protocol==="https:";y.host=y.hostname||y.host||"localhost",y.session=y.tlsSession,y.servername=y.servername||f(y.headers&&y.headers.host||y.host),y.port=y.port||(w?443:80),y._defaultAgent=w?s.globalAgent:i.globalAgent;let L=y.resolveProtocol||O,{agent:D}=y;if(D!==void 0&&D!==!1&&D.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(w){y.resolveSocket=!0;let{socket:S,alpnProtocol:m,timeout:p}=await L(y);if(p){S&&S.destroy();let V=new Error(`Timed out resolving ALPN: ${y.timeout} ms`);throw V.code="ETIMEDOUT",V.ms=y.timeout,V}S&&y.createConnection&&(S.destroy(),S=void 0),delete y.resolveSocket;let q=m==="h2";if(D&&(D=q?D.http2:D.https,y.agent=D),D===void 0&&(D=q?a:s.globalAgent),S)if(D===!1)S.destroy();else{let V=(q?c:s.Agent).prototype.createConnection;D.createConnection===V?q?y._reuseSocket=S:v(D,S,y):S.destroy()}if(q)return g(new d(y,R))}else D&&(y.agent=D.http);return g(i.request(y,R))},n.exports.protocolCache=I,n.exports.resolveProtocol=O,n.exports.createResolveProtocol=T}),dv=Ae((e,n)=>{"use strict";var t=require("stream"),r=require("tls"),i=new r.TLSSocket(new t.PassThrough)._handle._parentWrap.constructor;n.exports=i}),pv=Ae((e,n)=>{"use strict";var t=class extends Error{constructor(r,i=""){super(`The proxy server rejected the request with status code ${r} (${i||"empty status message"})`),this.statusCode=r,this.statusMessage=i}};n.exports=t}),k3=Ae((e,n)=>{"use strict";var t=(r,i,s)=>{if(!s.some(u=>typeof u=="string"?typeof i===u:i instanceof u)){let u=s.map(h=>typeof h=="string"?h:h.name);throw new TypeError(`Expected '${r}' to be a type of ${u.join(" or ")}, got ${typeof i}`)}};n.exports=t}),yv=Ae((e,n)=>{"use strict";var{URL:t}=require("url"),r=k3();n.exports=(i,s)=>{r("proxyOptions",s,["object"]),r("proxyOptions.headers",s.headers,["object","undefined"]),r("proxyOptions.raw",s.raw,["boolean","undefined"]),r("proxyOptions.url",s.url,[t,"string"]);let u=new t(s.url);i.proxyOptions={raw:!0,...s,headers:{...s.headers},url:u}}}),hp=Ae((e,n)=>{"use strict";n.exports=t=>{let{username:r,password:i}=t.proxyOptions.url;if(r||i){let s=`${r}:${i}`,u=`Basic ${Buffer.from(s).toString("base64")}`;return{"proxy-authorization":u,authorization:u}}return{}}}),O3=Ae((e,n)=>{"use strict";var t=require("tls"),r=require("http"),i=require("https"),s=dv(),{globalAgent:u}=Rs(),h=pv(),c=yv(),a=hp(),d=(I,C,v)=>{(async()=>{try{let{proxyOptions:T}=I,{url:O,headers:k,raw:y}=T,R=await u.request(O,T,{...a(I),...k,":method":"CONNECT",":authority":`${C.host}:${C.port}`});R.once("error",v),R.once("response",w=>{let L=w[":status"];if(L!==200){v(new h(L,""));return}let D=I instanceof i.Agent;if(y&&D){C.socket=R;let m=t.connect(C);m.once("close",()=>{R.destroy()}),v(null,m);return}let S=new s(R);S.encrypted=!1,S._handle.getpeername=m=>{m.family=void 0,m.address=void 0,m.port=void 0},v(null,S)})}catch(T){v(T)}})()},f=class extends r.Agent{constructor(I){super(I),c(this,I.proxyOptions)}createConnection(I,C){d(this,I,C)}},g=class extends i.Agent{constructor(I){super(I),c(this,I.proxyOptions)}createConnection(I,C){d(this,I,C)}};n.exports={HttpOverHttp2:f,HttpsOverHttp2:g}}),gv=Ae((e,n)=>{"use strict";var{Agent:t}=Rs(),r=dv(),i=pv(),s=yv(),u=class extends t{constructor(h){super(h),s(this,h.proxyOptions)}async createConnection(h,c){let a=`${h.hostname}:${h.port||443}`,[d,f,g]=await this._getProxyStream(a);if(f!==200)throw new i(f,g);if(this.proxyOptions.raw)c.socket=d;else{let I=new r(d);return I.encrypted=!1,I._handle.getpeername=C=>{C.family=void 0,C.address=void 0,C.port=void 0},I}return super.createConnection(h,c)}};n.exports=u}),P3=Ae((e,n)=>{"use strict";var{globalAgent:t}=Rs(),r=gv(),i=hp(),s=h=>new Promise((c,a)=>{h.once("error",a),h.once("response",d=>{h.off("error",a),c(d[":status"])})}),u=class extends r{async _getProxyStream(h){let{proxyOptions:c}=this,a={...i(this),...c.headers,":method":"CONNECT",":authority":h},d=await t.request(c.url,c,a),f=await s(d);return[d,f,""]}};n.exports=u}),B3=Ae((e,n)=>{"use strict";var t=require("http"),r=require("https"),i=gv(),s=hp(),u=c=>new Promise((a,d)=>{let f=(g,I,C)=>{I.unshift(C),c.off("error",d),a([I,g.statusCode,g.statusMessage])};c.once("error",d),c.once("connect",f)}),h=class extends i{async _getProxyStream(c){let{proxyOptions:a}=this,{url:d,headers:f}=this.proxyOptions,g=(d.protocol==="https:"?r:t).request({...a,hostname:d.hostname,port:d.port,path:c,headers:{...s(this),...f,host:c},method:"CONNECT"}).end();return u(g)}};n.exports={Http2OverHttp:h,Http2OverHttps:h}}),mv=Ae((e,n)=>{"use strict";var t=require("http2"),{Agent:r,globalAgent:i}=Rs(),s=fv(),u=lv(),h=A3(),{HttpOverHttp2:c,HttpsOverHttp2:a}=O3(),d=P3(),{Http2OverHttp:f,Http2OverHttps:g}=B3(),I=cv(),C=hv(),v=(O,k,y)=>new s(O,k,y),T=(O,k,y)=>{let R=new s(O,k,y);return R.end(),R};n.exports={...t,ClientRequest:s,IncomingMessage:u,Agent:r,globalAgent:i,request:v,get:T,auto:h,proxies:{HttpOverHttp2:c,HttpsOverHttp2:a,Http2OverHttp2:d,Http2OverHttp:f,Http2OverHttps:g},validateHeaderName:I,validateHeaderValue:C}}),L3=Ae((e,n)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),r=new t().port1,i=new ArrayBuffer;r.postMessage(i,[i,i])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}n.exports=globalThis.DOMException}),Wc=Ae((e,n)=>{var t=function(r,i){Error.call(this,r),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=r,i&&(this.inner=i)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,n.exports=t}),vv=Ae((e,n)=>{var t=Wc(),r=function(i,s){t.call(this,i),this.name="NotBeforeError",this.date=s};r.prototype=Object.create(t.prototype),r.prototype.constructor=r,n.exports=r}),bv=Ae((e,n)=>{var t=Wc(),r=function(i,s){t.call(this,i),this.name="TokenExpiredError",this.expiredAt=s};r.prototype=Object.create(t.prototype),r.prototype.constructor=r,n.exports=r}),qu=Ae((e,n)=>{var t=require("buffer"),r=t.Buffer;function i(u,h){for(var c in u)h[c]=u[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(i(t,e),e.Buffer=s);function s(u,h,c){return r(u,h,c)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(u,h,c){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,h,c)},s.alloc=function(u,h,c){if(typeof u!="number")throw new TypeError("Argument must be a number");var a=r(u);return h!==void 0?typeof c=="string"?a.fill(h,c):a.fill(h):a.fill(0),a},s.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},s.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}}),_v=Ae((e,n)=>{var t=qu().Buffer,r=require("stream"),i=require("util");function s(u){if(this.buffer=null,this.writable=!0,this.readable=!0,!u)return this.buffer=t.alloc(0),this;if(typeof u.pipe=="function")return this.buffer=t.alloc(0),u.pipe(this),this;if(u.length||typeof u=="object")return this.buffer=u,this.writable=!1,process.nextTick(function(){this.emit("end",u),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof u+")")}i.inherits(s,r),s.prototype.write=function(u){this.buffer=t.concat([this.buffer,t.from(u)]),this.emit("data",u)},s.prototype.end=function(u){u&&this.write(u),this.emit("end",u),this.emit("close"),this.writable=!1,this.readable=!1},n.exports=s}),N3=Ae((e,n)=>{"use strict";var t=require("buffer").Buffer,r=require("buffer").SlowBuffer;n.exports=i;function i(h,c){if(!t.isBuffer(h)||!t.isBuffer(c)||h.length!==c.length)return!1;for(var a=0,d=0;d{"use strict";function t(s){var u=(s/8|0)+(s%8===0?0:1);return u}var r={ES256:t(256),ES384:t(384),ES512:t(521)};function i(s){var u=r[s];if(u)return u;throw new Error('Unknown algorithm "'+s+'"')}n.exports=i}),U3=Ae((e,n)=>{"use strict";var t=qu().Buffer,r=x3(),i=128,s=0,u=32,h=16,c=2,a=h|u|s<<6,d=c|s<<6;function f(T){return T.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function g(T){if(t.isBuffer(T))return T;if(typeof T=="string")return t.from(T,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function I(T,O){T=g(T);var k=r(O),y=k+1,R=T.length,w=0;if(T[w++]!==a)throw new Error('Could not find expected "seq"');var L=T[w++];if(L===(i|1)&&(L=T[w++]),R-w=i;return R&&--y,y}function v(T,O){T=g(T);var k=r(O),y=T.length;if(y!==k*2)throw new TypeError('"'+O+'" signatures must be "'+k*2+'" bytes, saw "'+y+'"');var R=C(T,0,k),w=C(T,k,T.length),L=k-R,D=k-w,S=1+1+L+1+1+D,m=S{var t=N3(),r=qu().Buffer,i=require("crypto"),s=U3(),u=require("util"),h=`"%s" is not a valid algorithm. + Error Message: ${u.result.message}`)})).result)===null||t===void 0?void 0:t.value;if(!s)throw new Error("Response json body do not have ID Token field");return s})}static getIDToken(n){return wg(this,void 0,void 0,function*(){try{let t=xo.getIDTokenUrl();if(n){let i=encodeURIComponent(n);t=`${t}&audience=${i}`}Eg.debug(`ID token url is ${t}`);let r=yield xo.getCall(t);return Eg.setSecret(r),r}catch(t){throw new Error(`Error message: ${t.message}`)}})}};us.OidcClient=xo});var Kf=Pn(yn=>{"use strict";var $f=yn&&yn.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(yn,"__esModule",{value:!0});yn.summary=yn.markdownSummary=yn.SUMMARY_DOCS_URL=yn.SUMMARY_ENV_VAR=void 0;var ST=require("os"),zf=require("fs"),{access:CT,appendFile:TT,writeFile:RT}=zf.promises;yn.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";yn.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var Hf=class{constructor(){this._buffer=""}filePath(){return $f(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let n=process.env[yn.SUMMARY_ENV_VAR];if(!n)throw new Error(`Unable to find environment variable for $${yn.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield CT(n,zf.constants.R_OK|zf.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,t,r={}){let i=Object.entries(r).map(([s,u])=>` ${s}="${u}"`).join("");return t?`<${n}${i}>${t}`:`<${n}${i}>`}write(n){return $f(this,void 0,void 0,function*(){let t=!!n?.overwrite,r=yield this.filePath();return yield(t?RT:TT)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return $f(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,t=!1){return this._buffer+=n,t?this.addEOL():this}addEOL(){return this.addRaw(ST.EOL)}addCodeBlock(n,t){let r=Object.assign({},t&&{lang:t}),i=this.wrap("pre",this.wrap("code",n),r);return this.addRaw(i).addEOL()}addList(n,t=!1){let r=t?"ol":"ul",i=n.map(u=>this.wrap("li",u)).join(""),s=this.wrap(r,i);return this.addRaw(s).addEOL()}addTable(n){let t=n.map(i=>{let s=i.map(u=>{if(typeof u=="string")return this.wrap("td",u);let{header:h,data:c,colspan:a,rowspan:d}=u,f=h?"th":"td",g=Object.assign(Object.assign({},a&&{colspan:a}),d&&{rowspan:d});return this.wrap(f,c,g)}).join("");return this.wrap("tr",s)}).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(n,t){let r=this.wrap("details",this.wrap("summary",n)+t);return this.addRaw(r).addEOL()}addImage(n,t,r){let{width:i,height:s}=r||{},u=Object.assign(Object.assign({},i&&{width:i}),s&&{height:s}),h=this.wrap("img",null,Object.assign({src:n,alt:t},u));return this.addRaw(h).addEOL()}addHeading(n,t){let r=`h${t}`,i=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",s=this.wrap(i,n);return this.addRaw(s).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,t){let r=Object.assign({},t&&{cite:t}),i=this.wrap("blockquote",n,r);return this.addRaw(i).addEOL()}addLink(n,t){let r=this.wrap("a",n,{href:t});return this.addRaw(r).addEOL()}},Cg=new Hf;yn.markdownSummary=Cg;yn.summary=Cg});var Tg=Pn(gn=>{"use strict";var IT=gn&&gn.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),AT=gn&&gn.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),kT=gn&&gn.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&IT(n,e,t);return AT(n,e),n};Object.defineProperty(gn,"__esModule",{value:!0});gn.toPlatformPath=gn.toWin32Path=gn.toPosixPath=void 0;var OT=kT(require("path"));function PT(e){return e.replace(/[\\]/g,"/")}gn.toPosixPath=PT;function BT(e){return e.replace(/[/]/g,"\\")}gn.toWin32Path=BT;function LT(e){return e.replace(/[/\\]/g,OT.sep)}gn.toPlatformPath=LT});var Ff=Pn(Fe=>{"use strict";var NT=Fe&&Fe.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),xT=Fe&&Fe.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Rg=Fe&&Fe.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.hasOwnProperty.call(e,t)&&NT(n,e,t);return xT(n,e),n},Ig=Fe&&Fe.__awaiter||function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(u){u(s)})}return new(t||(t=Promise))(function(s,u){function h(d){try{a(r.next(d))}catch(f){u(f)}}function c(d){try{a(r.throw(d))}catch(f){u(f)}}function a(d){d.done?s(d.value):i(d.value).then(h,c)}a((r=r.apply(e,n||[])).next())})};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getIDToken=Fe.getState=Fe.saveState=Fe.group=Fe.endGroup=Fe.startGroup=Fe.info=Fe.notice=Fe.warning=Fe.error=Fe.debug=Fe.isDebug=Fe.setFailed=Fe.setCommandEcho=Fe.setOutput=Fe.getBooleanInput=Fe.getMultilineInput=Fe.getInput=Fe.addPath=Fe.setSecret=Fe.exportVariable=Fe.ExitCode=void 0;var Hn=xy(),ha=lg(),ls=ql(),Ag=Rg(require("os")),UT=Rg(require("path")),DT=Sg(),kg;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(kg=Fe.ExitCode||(Fe.ExitCode={}));function jT(e,n){let t=ls.toCommandValue(n);if(process.env[e]=t,process.env.GITHUB_ENV||"")return ha.issueFileCommand("ENV",ha.prepareKeyValueMessage(e,n));Hn.issueCommand("set-env",{name:e},t)}Fe.exportVariable=jT;function qT(e){Hn.issueCommand("add-mask",{},e)}Fe.setSecret=qT;function MT(e){process.env.GITHUB_PATH||""?ha.issueFileCommand("PATH",e):Hn.issueCommand("add-path",{},e),process.env.PATH=`${e}${UT.delimiter}${process.env.PATH}`}Fe.addPath=MT;function Wf(e,n){let t=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(n&&n.required&&!t)throw new Error(`Input required and not supplied: ${e}`);return n&&n.trimWhitespace===!1?t:t.trim()}Fe.getInput=Wf;function VT(e,n){let t=Wf(e,n).split(` +`).filter(r=>r!=="");return n&&n.trimWhitespace===!1?t:t.map(r=>r.trim())}Fe.getMultilineInput=VT;function FT(e,n){let t=["true","True","TRUE"],r=["false","False","FALSE"],i=Wf(e,n);if(t.includes(i))return!0;if(r.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\``)}Fe.getBooleanInput=FT;function $T(e,n){if(process.env.GITHUB_OUTPUT||"")return ha.issueFileCommand("OUTPUT",ha.prepareKeyValueMessage(e,n));process.stdout.write(Ag.EOL),Hn.issueCommand("set-output",{name:e},ls.toCommandValue(n))}Fe.setOutput=$T;function zT(e){Hn.issue("echo",e?"on":"off")}Fe.setCommandEcho=zT;function HT(e){process.exitCode=kg.Failure,Og(e)}Fe.setFailed=HT;function KT(){return process.env.RUNNER_DEBUG==="1"}Fe.isDebug=KT;function WT(e){Hn.issueCommand("debug",{},e)}Fe.debug=WT;function Og(e,n={}){Hn.issueCommand("error",ls.toCommandProperties(n),e instanceof Error?e.toString():e)}Fe.error=Og;function GT(e,n={}){Hn.issueCommand("warning",ls.toCommandProperties(n),e instanceof Error?e.toString():e)}Fe.warning=GT;function QT(e,n={}){Hn.issueCommand("notice",ls.toCommandProperties(n),e instanceof Error?e.toString():e)}Fe.notice=QT;function YT(e){process.stdout.write(e+Ag.EOL)}Fe.info=YT;function Pg(e){Hn.issue("group",e)}Fe.startGroup=Pg;function Bg(){Hn.issue("endgroup")}Fe.endGroup=Bg;function XT(e,n){return Ig(this,void 0,void 0,function*(){Pg(e);let t;try{t=yield n()}finally{Bg()}return t})}Fe.group=XT;function JT(e,n){if(process.env.GITHUB_STATE||"")return ha.issueFileCommand("STATE",ha.prepareKeyValueMessage(e,n));Hn.issueCommand("save-state",{name:e},ls.toCommandValue(n))}Fe.saveState=JT;function ZT(e){return process.env[`STATE_${e}`]||""}Fe.getState=ZT;function e3(e){return Ig(this,void 0,void 0,function*(){return yield DT.OidcClient.getIDToken(e)})}Fe.getIDToken=e3;var t3=Kf();Object.defineProperty(Fe,"summary",{enumerable:!0,get:function(){return t3.summary}});var r3=Kf();Object.defineProperty(Fe,"markdownSummary",{enumerable:!0,get:function(){return r3.markdownSummary}});var Gf=Tg();Object.defineProperty(Fe,"toPosixPath",{enumerable:!0,get:function(){return Gf.toPosixPath}});Object.defineProperty(Fe,"toWin32Path",{enumerable:!0,get:function(){return Gf.toWin32Path}});Object.defineProperty(Fe,"toPlatformPath",{enumerable:!0,get:function(){return Gf.toPlatformPath}})});var Lb=Pn((Bk,Bb)=>{var n3=Object.create,Mc=Object.defineProperty,i3=Object.getOwnPropertyDescriptor,o3=Object.getOwnPropertyNames,a3=Object.getPrototypeOf,s3=Object.prototype.hasOwnProperty,Ae=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),u3=(e,n)=>{for(var t in n)Mc(e,t,{get:n[t],enumerable:!0})},Xm=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of o3(n))!s3.call(e,i)&&i!==t&&Mc(e,i,{get:()=>n[i],enumerable:!(r=i3(n,i))||r.enumerable});return e},xt=(e,n,t)=>(t=e!=null?n3(a3(e)):{},Xm(n||!e||!e.__esModule?Mc(t,"default",{value:e,enumerable:!0}):t,e)),l3=e=>Xm(Mc({},"__esModule",{value:!0}),e),c3=Ae((e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(i){return i.encrypted}var r=(i,s)=>{let u;typeof s=="function"?u={connect:s}:u=s;let h=typeof u.connect=="function",c=typeof u.secureConnect=="function",a=typeof u.close=="function",d=()=>{h&&u.connect(),t(i)&&c&&(i.authorized?u.secureConnect():i.authorizationError||i.once("secureConnect",u.secureConnect)),a&&i.once("close",u.close)};i.writable&&!i.connecting?d():i.connecting?i.once("connect",d):i.destroyed&&a&&u.close(i._hadError)};e.default=r,n.exports=r,n.exports.default=r}),h3=Ae((e,n)=>{"use strict";var{PassThrough:t}=require("stream");n.exports=r=>{r={...r};let{array:i}=r,{encoding:s}=r,u=s==="buffer",h=!1;i?h=!(s||u):s=s||"utf8",u&&(s=null);let c=new t({objectMode:h});s&&c.setEncoding(s);let a=0,d=[];return c.on("data",f=>{d.push(f),h?a=d.length:a+=f.length}),c.getBufferedValue=()=>i?d:u?Buffer.concat(d,a):d.join(""),c.getBufferedLength=()=>a,c}}),op=Ae((e,n)=>{"use strict";var{constants:t}=require("buffer"),r=require("stream"),{promisify:i}=require("util"),s=h3(),u=i(r.pipeline),h=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function c(a,d){if(!a)throw new Error("Expected a stream");d={maxBuffer:1/0,...d};let{maxBuffer:f}=d,g=s(d);return await new Promise((I,C)=>{let v=T=>{T&&g.getBufferedLength()<=t.MAX_LENGTH&&(T.bufferedData=g.getBufferedValue()),C(T)};(async()=>{try{await u(a,g),I()}catch(T){v(T)}})(),g.on("data",()=>{g.getBufferedLength()>f&&v(new h)})}),g.getBufferedValue()}n.exports=c,n.exports.buffer=(a,d)=>c(a,{...d,encoding:"buffer"}),n.exports.array=(a,d)=>c(a,{...d,array:!0}),n.exports.MaxBufferError=h}),f3=Ae((e,n)=>{"use strict";var t=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),r=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),s={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},u={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function h(f){let g=parseInt(f,10);return isFinite(g)?g:0}function c(f){return f?i.has(f.status):!0}function a(f){let g={};if(!f)return g;let I=f.trim().split(/,/);for(let C of I){let[v,T]=C.split(/=/,2);g[v.trim()]=T===void 0?!0:T.trim().replace(/^"|"$/g,"")}return g}function d(f){let g=[];for(let I in f){let C=f[I];g.push(C===!0?I:I+"="+C)}if(g.length)return g.join(", ")}n.exports=class{constructor(f,g,{shared:I,cacheHeuristic:C,immutableMinTimeToLive:v,ignoreCargoCult:T,_fromObject:O}={}){if(O){this._fromObject(O);return}if(!g||!g.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(f),this._responseTime=this.now(),this._isShared=I!==!1,this._cacheHeuristic=C!==void 0?C:.1,this._immutableMinTtl=v!==void 0?v: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 f?f.method:"GET",this._url=f.url,this._host=f.headers.host,this._noAuthorization=!f.headers.authorization,this._reqHeaders=g.headers.vary?f.headers:null,this._reqcc=a(f.headers["cache-control"]),T&&"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),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())&&r.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||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(f){if(!f||!f.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(f){this._assertRequestHasHeaders(f);let g=a(f.headers["cache-control"]);return g["no-cache"]||/no-cache/.test(f.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(f,!1)}_requestMatches(f,g){return(!this._url||this._url===f.url)&&this._host===f.headers.host&&(!f.method||this._method===f.method||g&&f.method==="HEAD")&&this._varyMatches(f)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(f){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(f.headers[I]!==this._reqHeaders[I])return!1;return!0}_copyWithoutHopByHopHeaders(f){let g={};for(let I in f)s[I]||(g[I]=f[I]);if(f.connection){let I=f.connection.trim().split(/\s*,\s*/);for(let C of I)delete g[C]}if(g.warning){let I=g.warning.split(/,/).filter(C=>!/^\s*1[0-9][0-9]/.test(C));I.length?g.warning=I.join(",").trim():delete g.warning}return g}responseHeaders(){let f=this._copyWithoutHopByHopHeaders(this._resHeaders),g=this.age();return g>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(f.warning=(f.warning?`${f.warning}, `:"")+'113 - "rfc7234 5.5.4"'),f.age=`${Math.round(g)}`,f.date=new Date(this.now()).toUTCString(),f}date(){let f=Date.parse(this._resHeaders.date);return isFinite(f)?f:this._responseTime}age(){let f=this._ageValue(),g=(this.now()-this._responseTime)/1e3;return f+g}_ageValue(){return h(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 h(this._rescc["s-maxage"])}if(this._rescc["max-age"])return h(this._rescc["max-age"]);let f=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(f,(g-I)/1e3*this._cacheHeuristic)}return f}timeToLive(){let f=this.maxAge()-this.age(),g=f+h(this._rescc["stale-if-error"]),I=f+h(this._rescc["stale-while-revalidate"]);return Math.max(0,f,g,I)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+h(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+h(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(f){return new this(void 0,void 0,{_fromObject:f})}_fromObject(f){if(this._responseTime)throw Error("Reinitialized");if(!f||f.v!==1)throw Error("Invalid serialization");this._responseTime=f.t,this._isShared=f.sh,this._cacheHeuristic=f.ch,this._immutableMinTtl=f.imm!==void 0?f.imm:24*3600*1e3,this._status=f.st,this._resHeaders=f.resh,this._rescc=f.rescc,this._method=f.m,this._url=f.u,this._host=f.h,this._noAuthorization=f.a,this._reqHeaders=f.reqh,this._reqcc=f.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(f){this._assertRequestHasHeaders(f);let g=this._copyWithoutHopByHopHeaders(f.headers);if(delete g["if-range"],!this._requestMatches(f,!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(C=>!/^\s*W\//.test(C));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(f,g){if(this._assertRequestHasHeaders(f),this._useStaleIfError()&&c(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(f,g),modified:g.status!=304,matches:!1};let C={};for(let T in this._resHeaders)C[T]=T in g.headers&&!u[T]?g.headers[T]:this._resHeaders[T];let v=Object.assign({},g,{status:this._status,method:this._method,headers:C});return{policy:new this.constructor(f,v,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),d3=Ae(e=>{e.stringify=function n(t){if(typeof t>"u")return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON&&(t=t.toJSON()),t&&typeof t=="object"){var r="",i=Array.isArray(t);r=i?"[":"{";var s=!0;for(var u in t){var h=typeof t[u]=="function"||!i&&typeof t[u]>"u";Object.hasOwnProperty.call(t,u)&&!h&&(s||(r+=","),s=!1,i?t[u]==null?r+="null":r+=n(t[u]):t[u]!==void 0&&(r+=n(u)+":"+n(t[u])))}return r+=i?"]":"}",r}else return typeof t=="string"?JSON.stringify(/^:/.test(t)?":"+t:t):typeof t>"u"?"null":JSON.stringify(t)},e.parse=function(n){return JSON.parse(n,function(t,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}}),p3=Ae((e,n)=>{"use strict";var t=require("events"),r=d3(),i=h=>{let c={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(h.adapter||h.uri){let a=h.adapter||/^[^:+]*/.exec(h.uri)[0];return new(require(c[a]))(h)}return new Map},s=["sqlite","postgres","mysql","mongo","redis","tiered"],u=class extends t{constructor(h,{emitErrors:c=!0,...a}={}){if(super(),this.opts={namespace:"keyv",serialize:r.stringify,deserialize:r.parse,...typeof h=="string"?{uri:h}:h,...a},!this.opts.store){let f={...this.opts};this.opts.store=i(f)}if(this.opts.compression){let f=this.opts.compression;this.opts.serialize=f.serialize.bind(f),this.opts.deserialize=f.deserialize.bind(f)}typeof this.opts.store.on=="function"&&c&&this.opts.store.on("error",f=>this.emit("error",f)),this.opts.store.namespace=this.opts.namespace;let d=f=>async function*(){for await(let[g,I]of typeof f=="function"?f(this.opts.store.namespace):f){let C=this.opts.deserialize(I);if(!(this.opts.store.namespace&&!g.includes(this.opts.store.namespace))){if(typeof C.expires=="number"&&Date.now()>C.expires){this.delete(g);continue}yield[this._getKeyUnprefix(g),C.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 s.includes(this.opts.store.opts.dialect)||s.findIndex(h=>this.opts.store.opts.url.includes(h))>=0}_getKeyPrefix(h){return`${this.opts.namespace}:${h}`}_getKeyPrefixArray(h){return h.map(c=>`${this.opts.namespace}:${c}`)}_getKeyUnprefix(h){return h.split(":").splice(1).join(":")}get(h,c){let{store:a}=this.opts,d=Array.isArray(h),f=d?this._getKeyPrefixArray(h):this._getKeyPrefix(h);if(d&&a.getMany===void 0){let g=[];for(let I of f)g.push(Promise.resolve().then(()=>a.get(I)).then(C=>typeof C=="string"?this.opts.deserialize(C):this.opts.compression?this.opts.deserialize(C):C).then(C=>{if(C!=null)return typeof C.expires=="number"&&Date.now()>C.expires?this.delete(I).then(()=>{}):c&&c.raw?C:C.value}));return Promise.allSettled(g).then(I=>{let C=[];for(let v of I)C.push(v.value);return C})}return Promise.resolve().then(()=>d?a.getMany(f):a.get(f)).then(g=>typeof g=="string"?this.opts.deserialize(g):this.opts.compression?this.opts.deserialize(g):g).then(g=>{if(g!=null){if(d){let I=[];for(let C of g){if(typeof C=="string"&&(C=this.opts.deserialize(C)),C==null){I.push(void 0);continue}typeof C.expires=="number"&&Date.now()>C.expires?(this.delete(h).then(()=>{}),I.push(void 0)):I.push(c&&c.raw?C:C.value)}return I}return typeof g.expires=="number"&&Date.now()>g.expires?this.delete(h).then(()=>{}):c&&c.raw?g:g.value}})}set(h,c,a){let d=this._getKeyPrefix(h);typeof a>"u"&&(a=this.opts.ttl),a===0&&(a=void 0);let{store:f}=this.opts;return Promise.resolve().then(()=>{let g=typeof a=="number"?Date.now()+a:null;return typeof c=="symbol"&&this.emit("error","symbol cannot be serialized"),c={value:c,expires:g},this.opts.serialize(c)}).then(g=>f.set(d,g,a)).then(()=>!0)}delete(h){let{store:c}=this.opts;if(Array.isArray(h)){let d=this._getKeyPrefixArray(h);if(c.deleteMany===void 0){let f=[];for(let g of d)f.push(c.delete(g));return Promise.allSettled(f).then(g=>g.every(I=>I.value===!0))}return Promise.resolve().then(()=>c.deleteMany(d))}let a=this._getKeyPrefix(h);return Promise.resolve().then(()=>c.delete(a))}clear(){let{store:h}=this.opts;return Promise.resolve().then(()=>h.clear())}has(h){let c=this._getKeyPrefix(h),{store:a}=this.opts;return Promise.resolve().then(async()=>typeof a.has=="function"?a.has(c):await a.get(c)!==void 0)}disconnect(){let{store:h}=this.opts;if(typeof h.disconnect=="function")return h.disconnect()}};n.exports=u}),y3=Ae((e,n)=>{"use strict";var t=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];n.exports=(r,i)=>{if(i._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let s=new Set(Object.keys(r).concat(t)),u={};for(let h of s)h in i||(u[h]={get(){let c=r[h];return typeof c=="function"?c.bind(r):c},set(c){r[h]=c},enumerable:!0,configurable:!1});return Object.defineProperties(i,u),r.once("aborted",()=>{i.destroy(),i.emit("aborted")}),r.once("close",()=>{r.complete&&i.readable?i.once("end",()=>{i.emit("close")}):i.emit("close")}),i}}),Jm=Ae((e,n)=>{"use strict";var{Transform:t,PassThrough:r}=require("stream"),i=require("zlib"),s=y3();n.exports=u=>{let h=(u.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(h))return u;let c=h==="br";if(c&&typeof i.createBrotliDecompress!="function")return u.destroy(new Error("Brotli is not supported on Node.js < 12")),u;let a=!0,d=new t({transform(I,C,v){a=!1,v(null,I)},flush(I){I()}}),f=new r({autoDestroy:!1,destroy(I,C){u.destroy(),C(I)}}),g=c?i.createBrotliDecompress():i.createUnzip();return g.once("error",I=>{if(a&&!u.readable){f.end();return}f.destroy(I)}),s(u,f),u.pipe(d).pipe(g).pipe(f),f}}),Zm=Ae((e,n)=>{"use strict";var t=class{constructor(r={}){if(!(r.maxSize&&r.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=r.maxSize,this.onEviction=r.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(r,i){if(this.cache.set(r,i),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[s,u]of this.oldCache.entries())this.onEviction(s,u);this.oldCache=this.cache,this.cache=new Map}}get(r){if(this.cache.has(r))return this.cache.get(r);if(this.oldCache.has(r)){let i=this.oldCache.get(r);return this.oldCache.delete(r),this._set(r,i),i}}set(r,i){return this.cache.has(r)?this.cache.set(r,i):this._set(r,i),this}has(r){return this.cache.has(r)||this.oldCache.has(r)}peek(r){if(this.cache.has(r))return this.cache.get(r);if(this.oldCache.has(r))return this.oldCache.get(r)}delete(r){let i=this.cache.delete(r);return i&&this._size--,this.oldCache.delete(r)||i}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[r]of this)yield r}*values(){for(let[,r]of this)yield r}*[Symbol.iterator](){for(let r of this.cache)yield r;for(let r of this.oldCache){let[i]=r;this.cache.has(i)||(yield r)}}get size(){let r=0;for(let i of this.oldCache.keys())this.cache.has(i)||r++;return Math.min(this._size+r,this.maxSize)}};n.exports=t}),ev=Ae((e,n)=>{"use strict";n.exports=t=>{if(t.listenerCount("error")!==0)return t;t.__destroy=t._destroy,t._destroy=(...i)=>{let s=i.pop();t.__destroy(...i,async u=>{await Promise.resolve(),s(u)})};let r=i=>{Promise.resolve().then(()=>{t.emit("error",i)})};return t.once("error",r),Promise.resolve().then(()=>{t.off("error",r)}),t}}),Ts=Ae((e,n)=>{"use strict";var{URL:t}=require("url"),r=require("events"),i=require("tls"),s=require("http2"),u=Zm(),h=ev(),c=Symbol("currentStreamCount"),a=Symbol("request"),d=Symbol("cachedOriginSet"),f=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"],C=(R,w,L)=>{let D=0,S=R.length;for(;D>>1;L(R[m],w)?D=m+1:S=m}return D},v=(R,w)=>R.remoteSettings.maxConcurrentStreams>w.remoteSettings.maxConcurrentStreams,T=(R,w)=>{for(let L=0;L0&&D[d].lengthw[d].includes(S))&&D[c]+w[c]<=w.remoteSettings.maxConcurrentStreams&&k(D)}},O=(R,w)=>{for(let L=0;L0&&w[d].lengthD[d].includes(S))&&w[c]+D[c]<=D.remoteSettings.maxConcurrentStreams)return k(w),!0}return!1},k=R=>{R[f]=!0,R[c]===0&&R.close()},y=class extends r{constructor({timeout:R=0,maxSessions:w=Number.POSITIVE_INFINITY,maxEmptySessions:L=10,maxCachedTlsSessions:D=100}={}){super(),this.sessions={},this.queue={},this.timeout=R,this.maxSessions=w,this.maxEmptySessions=L,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new u({maxSize:D})}get protocol(){return"https:"}normalizeOptions(R){let w="";for(let L=0;L=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let R in this.queue)for(let w in this.queue[R]){let L=this.queue[R][w];L.completed||(L.completed=!0,L())}}_isBetterSession(R,w){return R>w}_accept(R,w,L,D){let S=0;for(;S0&&(this.getSession(L,D,w),w.length=0)}getSession(R,w,L){return new Promise((D,S)=>{Array.isArray(L)&&L.length>0?(L=[...L],D()):L=[{resolve:D,reject:S}];try{if(typeof R=="string")R=new t(R);else if(!(R instanceof t))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(w){let{servername:$}=w,{hostname:E}=R;if($&&E!==$)throw new Error(`Origin ${E} differs from servername ${$}`)}}catch($){for(let E=0;E=ee||M[f]||M.destroyed||(j||(E=ee),this._isBetterSession(oe,B)&&(j=M,B=oe))}if(j){this._accept(j,L,p,w);return}}if(m in this.queue){if(p in this.queue[m]){this.queue[m][p].listeners.push(...L);return}}else this.queue[m]={[g]:0};let q=()=>{m in this.queue&&this.queue[m][p]===V&&(delete this.queue[m][p],--this.queue[m][g]===0&&delete this.queue[m])},V=async()=>{this._sessionCount++;let $=`${p}:${m}`,E=!1,B;try{let j={...w};j.settings===void 0&&(j.settings=this.settings),j.session===void 0&&(j.session=this.tlsSessionCache.get($)),B=await(j.createConnection||this.createConnection).call(this,R,j),j.createConnection=()=>B;let N=s.connect(R,j);N[c]=0,N[f]=!1;let M=()=>{let{socket:ae}=N,pe;return ae.servername===!1?(ae.servername=ae.remoteAddress,pe=N.originSet,ae.servername=!1):pe=N.originSet,pe},ee=()=>N[c]{this.tlsSessionCache.set($,ae)}),N.once("error",ae=>{for(let pe=0;pe{N.destroy()}),N.once("close",()=>{if(this._sessionCount--,E){this._emptySessionCount--;let ae=this.sessions[m];ae.length===1?delete this.sessions[m]:ae.splice(ae.indexOf(N),1)}else{q();let ae=new Error("Session closed without receiving a SETTINGS frame");ae.code="HTTP2WRAPPER_NOSETTINGS";for(let pe=0;pe{let ae=this.queue[m];if(!ae)return;let pe=N[d];for(let _e=0;_e{N[d]=M()||[],N[f]=!1,O(this.sessions[m],N),!(N[f]||!ee())&&(oe(),ee()&&T(this.sessions[m],N))}),N.once("remoteSettings",()=>{if(V.destroyed){let ae=new Error("Agent has been destroyed");for(let pe=0;pethis.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),N.on("remoteSettings",()=>{ee()&&(oe(),ee()&&T(this.sessions[m],N))})}),N[a]=N.request,N.request=(ae,pe)=>{if(N[f])throw new Error("The session is gracefully closing. No new streams are allowed.");let _e=N[a](ae,pe);return N.ref(),N[c]++===0&&this._emptySessionCount--,_e.once("close",()=>{if(--N[c]===0&&(this._emptySessionCount++,N.unref(),this._emptySessionCount>this.maxEmptySessions||N[f])){N.close();return}N.destroyed||N.closed||ee()&&!O(this.sessions[m],N)&&(T(this.sessions[m],N),oe(),N[c]===0&&this._processQueue())}),_e}}catch(j){q(),this._sessionCount--;for(let N=0;N{this.getSession(R,w,[{reject:m,resolve:p=>{try{let q=p.request(L,D);h(q),S(q)}catch(q){m(q)}}}])})}async createConnection(R,w){return y.connect(R,w)}static connect(R,w){w.ALPNProtocols=["h2"];let L=R.port||443,D=R.hostname;typeof w.servername>"u"&&(w.servername=D);let S=i.connect(L,D,w);return w.socket&&(S._peername={family:void 0,address:void 0,port:L}),S}closeEmptySessions(R=Number.POSITIVE_INFINITY){let w=0,{sessions:L}=this;for(let D in L){let S=L[D];for(let m=0;m=R))return w}}return w}destroy(R){let{sessions:w,queue:L}=this;for(let D in w){let S=w[D];for(let m=0;m{"use strict";var{Readable:t}=require("stream"),r=class extends t{constructor(i,s){super({emitClose:!1,autoDestroy:!0,highWaterMark:s}),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,s){this.readableEnded||(this.aborted=!0),s(),this.req._request.destroy(i)}setTimeout(i,s){return this.req.setTimeout(i,s),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};n.exports=r}),g3=Ae((e,n)=>{"use strict";n.exports=(t,r,i)=>{for(let s of i)t.on(s,(...u)=>r.emit(s,...u))}}),Vc=Ae((e,n)=>{"use strict";var t=(r,i,s)=>{n.exports[i]=class extends r{constructor(...u){super(typeof s=="string"?s:s(u)),this.name=`${super.name} [${i}]`,this.code=i}}};t(TypeError,"ERR_INVALID_ARG_TYPE",r=>{let i=r[0].includes(".")?"property":"argument",s=r[1],u=Array.isArray(s);return u&&(s=`${s.slice(0,-1).join(", ")} or ${s.slice(-1)}`),`The "${r[0]}" ${i} must be ${u?"one of":"of"} type ${s}. Received ${typeof r[2]}`}),t(TypeError,"ERR_INVALID_PROTOCOL",r=>`Protocol "${r[0]}" not supported. Expected "${r[1]}"`),t(Error,"ERR_HTTP_HEADERS_SENT",r=>`Cannot ${r[0]} headers after they are sent to the client`),t(TypeError,"ERR_INVALID_HTTP_TOKEN",r=>`${r[0]} must be a valid HTTP token [${r[1]}]`),t(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",r=>`Invalid value "${r[0]} for header "${r[1]}"`),t(TypeError,"ERR_INVALID_CHAR",r=>`Invalid character in ${r[0]} [${r[1]}]`),t(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}),m3=Ae((e,n)=>{"use strict";n.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),rv=Ae((e,n)=>{"use strict";var{ERR_INVALID_HTTP_TOKEN:t}=Vc(),r=m3(),i=/^[\^`\-\w!#$%&*+.|~]+$/;n.exports=s=>{if(typeof s!="string"||!i.test(s)&&!r(s))throw new t("Header name",s)}}),nv=Ae((e,n)=>{"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE:t,ERR_INVALID_CHAR:r}=Vc(),i=/[^\t\u0020-\u007E\u0080-\u00FF]/;n.exports=(s,u)=>{if(typeof u>"u")throw new t(u,s);if(i.test(u))throw new r("header content",s)}}),v3=Ae((e,n)=>{"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION:t}=Vc(),r={has(i,s){let u=i.session===void 0?i:i.session.socket;return s in i||s in u},get(i,s){switch(s){case"on":case"once":case"end":case"emit":case"destroy":return i[s].bind(i);case"writable":case"destroyed":return i[s];case"readable":return i.destroyed?!1:i.readable;case"setTimeout":{let{session:u}=i;return u!==void 0?u.setTimeout.bind(u):i.setTimeout.bind(i)}case"write":case"read":case"pause":case"resume":throw new t;default:{let u=i.session===void 0?i:i.session.socket,h=u[s];return typeof h=="function"?h.bind(u):h}}},getPrototypeOf(i){return i.session!==void 0?Reflect.getPrototypeOf(i.session.socket):Reflect.getPrototypeOf(i)},set(i,s,u){switch(s){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return i[s]=u,!0;case"setTimeout":{let{session:h}=i;return h===void 0?i.setTimeout=u:h.setTimeout=u,!0}case"write":case"read":case"pause":case"resume":throw new t;default:{let h=i.session===void 0?i:i.session.socket;return h[s]=u,!0}}}};n.exports=r}),iv=Ae((e,n)=>{"use strict";var{URL:t,urlToHttpOptions:r}=require("url"),i=require("http2"),{Writable:s}=require("stream"),{Agent:u,globalAgent:h}=Ts(),c=tv(),a=g3(),{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_PROTOCOL:f,ERR_HTTP_HEADERS_SENT:g}=Vc(),I=rv(),C=nv(),v=v3(),{HTTP2_HEADER_STATUS:T,HTTP2_HEADER_METHOD:O,HTTP2_HEADER_PATH:k,HTTP2_HEADER_AUTHORITY:y,HTTP2_METHOD_CONNECT:R}=i.constants,w=Symbol("headers"),L=Symbol("origin"),D=Symbol("session"),S=Symbol("options"),m=Symbol("flushedHeaders"),p=Symbol("jobs"),q=Symbol("pendingAgentPromise"),V=class extends s{constructor($,E,B){if(super({autoDestroy:!1,emitClose:!1}),typeof $=="string"?$=r(new t($)):$ instanceof t?$=r($):$={...$},typeof E=="function"||E===void 0?(B=E,E=$):E=Object.assign($,E),E.h2session){if(this[D]=E.h2session,this[D].destroyed)throw new Error("The session has been closed already");this.protocol=this[D].socket.encrypted?"https:":"http:"}else if(E.agent===!1)this.agent=new u({maxEmptySessions:0});else if(typeof E.agent>"u"||E.agent===null)this.agent=h;else if(typeof E.agent.request=="function")this.agent=E.agent;else throw new d("options.agent",["http2wrapper.Agent-like Object","undefined","false"],E.agent);if(this.agent&&(this.protocol=this.agent.protocol),E.protocol&&E.protocol!==this.protocol)throw new f(E.protocol,this.protocol);E.port||(E.port=E.defaultPort||this.agent&&this.agent.defaultPort||443),E.host=E.hostname||E.host||"localhost",delete E.hostname;let{timeout:j}=E;E.timeout=void 0,this[w]=Object.create(null),this[p]=[],this[q]=void 0,this.socket=null,this.connection=null,this.method=E.method||"GET",this.method==="CONNECT"&&(E.path==="/"||E.path===void 0)||(this.path=E.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:N}=E;if(N)for(let ee in N)this.setHeader(ee,N[ee]);E.auth&&!("authorization"in this[w])&&(this[w].authorization="Basic "+Buffer.from(E.auth).toString("base64")),E.session=E.tlsSession,E.path=E.socketPath,this[S]=E,this[L]=new t(`${this.protocol}//${E.servername||E.host}:${E.port}`);let M=E._reuseSocket;M&&(E.createConnection=(...ee)=>M.destroyed?this.agent.createConnection(...ee):M,this.agent.getSession(this[L],this[S]).catch(()=>{})),j&&this.setTimeout(j),B&&this.once("response",B),this[m]=!1}get method(){return this[w][O]}set method($){$&&(this[w][O]=$.toUpperCase())}get path(){let $=this.method==="CONNECT"?y:k;return this[w][$]}set path($){if($){let E=this.method==="CONNECT"?y:k;this[w][E]=$}}get host(){return this[L].hostname}set host($){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write($,E,B){if(this._mustNotHaveABody){B(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let j=()=>this._request.write($,E,B);this._request?j():this[p].push(j)}_final($){this.flushHeaders();let E=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){$();return}this._request.end($)};this._request?E():this[p].push(E)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy($,E){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[q]}catch(B){this.aborted&&($=B)}E($)}async flushHeaders(){if(this[m]||this.destroyed)return;this[m]=!0;let $=this.method===R,E=B=>{if(this._request=B,this.destroyed){B.destroy();return}$||a(B,this,["timeout","continue"]),B.once("error",N=>{this.destroy(N)}),B.once("aborted",()=>{let{res:N}=this;N?(N.aborted=!0,N.emit("aborted"),N.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let j=(N,M,ee)=>{let oe=new c(this.socket,B.readableHighWaterMark);this.res=oe,oe.url=`${this[L].origin}${this.path}`,oe.req=this,oe.statusCode=N[T],oe.headers=N,oe.rawHeaders=ee,oe.once("end",()=>{oe.complete=!0,oe.socket=null,oe.connection=null}),$?(oe.upgrade=!0,this.emit("connect",oe,B,Buffer.alloc(0))?this.emit("close"):B.destroy()):(B.on("data",ae=>{!oe._dumped&&!oe.push(ae)&&B.pause()}),B.once("end",()=>{this.aborted||oe.push(null)}),this.emit("response",oe)||oe._dump())};B.once("response",j),B.once("headers",N=>this.emit("information",{statusCode:N[T]})),B.once("trailers",(N,M,ee)=>{let{res:oe}=this;if(oe===null){j(N,M,ee);return}oe.trailers=N,oe.rawTrailers=ee}),B.once("close",()=>{let{aborted:N,res:M}=this;if(M){N&&(M.aborted=!0,M.emit("aborted"),M.destroy());let ee=()=>{M.emit("close"),this.destroy(),this.emit("close")};M.readable?M.once("end",ee):ee();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(B,v);for(let N of this[p])N();this[p].length=0,this.emit("socket",this.socket)};if(!(y in this[w])&&!$&&(this[w][y]=this[L].host),this[D])try{E(this[D].request(this[w]))}catch(B){this.destroy(B)}else{this.reusedSocket=!0;try{let B=this.agent.request(this[L],this[S],this[w]);this[q]=B,E(await B),this[q]=!1}catch(B){this[q]=!1,this.destroy(B)}}}get connection(){return this.socket}set connection($){this.socket=$}getHeaderNames(){return Object.keys(this[w])}hasHeader($){if(typeof $!="string")throw new d("name","string",$);return!!this[w][$.toLowerCase()]}getHeader($){if(typeof $!="string")throw new d("name","string",$);return this[w][$.toLowerCase()]}get headersSent(){return this[m]}removeHeader($){if(typeof $!="string")throw new d("name","string",$);if(this.headersSent)throw new g("remove");delete this[w][$.toLowerCase()]}setHeader($,E){if(this.headersSent)throw new g("set");I($),C($,E);let B=$.toLowerCase();if(B==="connection"){if(E.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${E}`)}B==="host"&&this.method==="CONNECT"?this[w][y]=E:this[w][B]=E}setNoDelay(){}setSocketKeepAlive(){}setTimeout($,E){let B=()=>this._request.setTimeout($,E);return this._request?B():this[p].push(B),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount($){}};n.exports=V}),b3=Ae((e,n)=>{"use strict";var t=require("tls");n.exports=(r={},i=t.connect)=>new Promise((s,u)=>{let h=!1,c,a=async()=>{await f,c.off("timeout",d),c.off("error",u),r.resolveSocket?(s({alpnProtocol:c.alpnProtocol,socket:c,timeout:h}),h&&(await Promise.resolve(),c.emit("timeout"))):(c.destroy(),s({alpnProtocol:c.alpnProtocol,timeout:h}))},d=async()=>{h=!0,a()},f=(async()=>{try{c=await i(r,a),c.on("error",u),c.once("timeout",d)}catch(g){u(g)}})()})}),_3=Ae((e,n)=>{"use strict";var{isIP:t}=require("net"),r=require("assert"),i=s=>{if(s[0]==="["){let h=s.indexOf("]");return r(h!==-1),s.slice(1,h)}let u=s.indexOf(":");return u===-1?s:s.slice(0,u)};n.exports=s=>{let u=i(s);return t(u)?"":u}}),w3=Ae((e,n)=>{"use strict";var{URL:t,urlToHttpOptions:r}=require("url"),i=require("http"),s=require("https"),u=b3(),h=Zm(),{Agent:c,globalAgent:a}=Ts(),d=iv(),f=_3(),g=ev(),I=new h({maxSize:100}),C=new Map,v=(k,y,R)=>{y._httpMessage={shouldKeepAlive:!0};let w=()=>{k.emit("free",y,R)};y.on("free",w);let L=()=>{k.removeSocket(y,R)};y.on("close",L);let D=()=>{let{freeSockets:m}=k;for(let p of Object.values(m))if(p.includes(y)){y.destroy();return}};y.on("timeout",D);let S=()=>{k.removeSocket(y,R),y.off("close",L),y.off("free",w),y.off("timeout",D),y.off("agentRemove",S)};y.on("agentRemove",S),k.emit("free",y,R)},T=(k,y=new Map,R=void 0)=>async w=>{let L=`${w.host}:${w.port}:${w.ALPNProtocols.sort()}`;if(!k.has(L)){if(y.has(L))return{alpnProtocol:(await y.get(L)).alpnProtocol};let{path:D}=w;w.path=w.socketPath;let S=u(w,R);y.set(L,S);try{let m=await S;return k.set(L,m.alpnProtocol),y.delete(L),w.path=D,m}catch(m){throw y.delete(L),w.path=D,m}}return{alpnProtocol:k.get(L)}},O=T(I,C);n.exports=async(k,y,R)=>{if(typeof k=="string"?k=r(new t(k)):k instanceof t?k=r(k):k={...k},typeof y=="function"||y===void 0?(R=y,y=k):y=Object.assign(k,y),y.ALPNProtocols=y.ALPNProtocols||["h2","http/1.1"],!Array.isArray(y.ALPNProtocols)||y.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");y.protocol=y.protocol||"https:";let w=y.protocol==="https:";y.host=y.hostname||y.host||"localhost",y.session=y.tlsSession,y.servername=y.servername||f(y.headers&&y.headers.host||y.host),y.port=y.port||(w?443:80),y._defaultAgent=w?s.globalAgent:i.globalAgent;let L=y.resolveProtocol||O,{agent:D}=y;if(D!==void 0&&D!==!1&&D.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(w){y.resolveSocket=!0;let{socket:S,alpnProtocol:m,timeout:p}=await L(y);if(p){S&&S.destroy();let V=new Error(`Timed out resolving ALPN: ${y.timeout} ms`);throw V.code="ETIMEDOUT",V.ms=y.timeout,V}S&&y.createConnection&&(S.destroy(),S=void 0),delete y.resolveSocket;let q=m==="h2";if(D&&(D=q?D.http2:D.https,y.agent=D),D===void 0&&(D=q?a:s.globalAgent),S)if(D===!1)S.destroy();else{let V=(q?c:s.Agent).prototype.createConnection;D.createConnection===V?q?y._reuseSocket=S:v(D,S,y):S.destroy()}if(q)return g(new d(y,R))}else D&&(y.agent=D.http);return g(i.request(y,R))},n.exports.protocolCache=I,n.exports.resolveProtocol=O,n.exports.createResolveProtocol=T}),ov=Ae((e,n)=>{"use strict";var t=require("stream"),r=require("tls"),i=new r.TLSSocket(new t.PassThrough)._handle._parentWrap.constructor;n.exports=i}),av=Ae((e,n)=>{"use strict";var t=class extends Error{constructor(r,i=""){super(`The proxy server rejected the request with status code ${r} (${i||"empty status message"})`),this.statusCode=r,this.statusMessage=i}};n.exports=t}),E3=Ae((e,n)=>{"use strict";var t=(r,i,s)=>{if(!s.some(u=>typeof u=="string"?typeof i===u:i instanceof u)){let u=s.map(h=>typeof h=="string"?h:h.name);throw new TypeError(`Expected '${r}' to be a type of ${u.join(" or ")}, got ${typeof i}`)}};n.exports=t}),sv=Ae((e,n)=>{"use strict";var{URL:t}=require("url"),r=E3();n.exports=(i,s)=>{r("proxyOptions",s,["object"]),r("proxyOptions.headers",s.headers,["object","undefined"]),r("proxyOptions.raw",s.raw,["boolean","undefined"]),r("proxyOptions.url",s.url,[t,"string"]);let u=new t(s.url);i.proxyOptions={raw:!0,...s,headers:{...s.headers},url:u}}}),ap=Ae((e,n)=>{"use strict";n.exports=t=>{let{username:r,password:i}=t.proxyOptions.url;if(r||i){let s=`${r}:${i}`,u=`Basic ${Buffer.from(s).toString("base64")}`;return{"proxy-authorization":u,authorization:u}}return{}}}),S3=Ae((e,n)=>{"use strict";var t=require("tls"),r=require("http"),i=require("https"),s=ov(),{globalAgent:u}=Ts(),h=av(),c=sv(),a=ap(),d=(I,C,v)=>{(async()=>{try{let{proxyOptions:T}=I,{url:O,headers:k,raw:y}=T,R=await u.request(O,T,{...a(I),...k,":method":"CONNECT",":authority":`${C.host}:${C.port}`});R.once("error",v),R.once("response",w=>{let L=w[":status"];if(L!==200){v(new h(L,""));return}let D=I instanceof i.Agent;if(y&&D){C.socket=R;let m=t.connect(C);m.once("close",()=>{R.destroy()}),v(null,m);return}let S=new s(R);S.encrypted=!1,S._handle.getpeername=m=>{m.family=void 0,m.address=void 0,m.port=void 0},v(null,S)})}catch(T){v(T)}})()},f=class extends r.Agent{constructor(I){super(I),c(this,I.proxyOptions)}createConnection(I,C){d(this,I,C)}},g=class extends i.Agent{constructor(I){super(I),c(this,I.proxyOptions)}createConnection(I,C){d(this,I,C)}};n.exports={HttpOverHttp2:f,HttpsOverHttp2:g}}),uv=Ae((e,n)=>{"use strict";var{Agent:t}=Ts(),r=ov(),i=av(),s=sv(),u=class extends t{constructor(h){super(h),s(this,h.proxyOptions)}async createConnection(h,c){let a=`${h.hostname}:${h.port||443}`,[d,f,g]=await this._getProxyStream(a);if(f!==200)throw new i(f,g);if(this.proxyOptions.raw)c.socket=d;else{let I=new r(d);return I.encrypted=!1,I._handle.getpeername=C=>{C.family=void 0,C.address=void 0,C.port=void 0},I}return super.createConnection(h,c)}};n.exports=u}),C3=Ae((e,n)=>{"use strict";var{globalAgent:t}=Ts(),r=uv(),i=ap(),s=h=>new Promise((c,a)=>{h.once("error",a),h.once("response",d=>{h.off("error",a),c(d[":status"])})}),u=class extends r{async _getProxyStream(h){let{proxyOptions:c}=this,a={...i(this),...c.headers,":method":"CONNECT",":authority":h},d=await t.request(c.url,c,a),f=await s(d);return[d,f,""]}};n.exports=u}),T3=Ae((e,n)=>{"use strict";var t=require("http"),r=require("https"),i=uv(),s=ap(),u=c=>new Promise((a,d)=>{let f=(g,I,C)=>{I.unshift(C),c.off("error",d),a([I,g.statusCode,g.statusMessage])};c.once("error",d),c.once("connect",f)}),h=class extends i{async _getProxyStream(c){let{proxyOptions:a}=this,{url:d,headers:f}=this.proxyOptions,g=(d.protocol==="https:"?r:t).request({...a,hostname:d.hostname,port:d.port,path:c,headers:{...s(this),...f,host:c},method:"CONNECT"}).end();return u(g)}};n.exports={Http2OverHttp:h,Http2OverHttps:h}}),lv=Ae((e,n)=>{"use strict";var t=require("http2"),{Agent:r,globalAgent:i}=Ts(),s=iv(),u=tv(),h=w3(),{HttpOverHttp2:c,HttpsOverHttp2:a}=S3(),d=C3(),{Http2OverHttp:f,Http2OverHttps:g}=T3(),I=rv(),C=nv(),v=(O,k,y)=>new s(O,k,y),T=(O,k,y)=>{let R=new s(O,k,y);return R.end(),R};n.exports={...t,ClientRequest:s,IncomingMessage:u,Agent:r,globalAgent:i,request:v,get:T,auto:h,proxies:{HttpOverHttp2:c,HttpsOverHttp2:a,Http2OverHttp2:d,Http2OverHttp:f,Http2OverHttps:g},validateHeaderName:I,validateHeaderValue:C}}),R3=Ae((e,n)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),r=new t().port1,i=new ArrayBuffer;r.postMessage(i,[i,i])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}n.exports=globalThis.DOMException}),Fc=Ae((e,n)=>{var t=function(r,i){Error.call(this,r),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=r,i&&(this.inner=i)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,n.exports=t}),cv=Ae((e,n)=>{var t=Fc(),r=function(i,s){t.call(this,i),this.name="NotBeforeError",this.date=s};r.prototype=Object.create(t.prototype),r.prototype.constructor=r,n.exports=r}),hv=Ae((e,n)=>{var t=Fc(),r=function(i,s){t.call(this,i),this.name="TokenExpiredError",this.expiredAt=s};r.prototype=Object.create(t.prototype),r.prototype.constructor=r,n.exports=r}),Du=Ae((e,n)=>{var t=require("buffer"),r=t.Buffer;function i(u,h){for(var c in u)h[c]=u[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(i(t,e),e.Buffer=s);function s(u,h,c){return r(u,h,c)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(u,h,c){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,h,c)},s.alloc=function(u,h,c){if(typeof u!="number")throw new TypeError("Argument must be a number");var a=r(u);return h!==void 0?typeof c=="string"?a.fill(h,c):a.fill(h):a.fill(0),a},s.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},s.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}}),fv=Ae((e,n)=>{var t=Du().Buffer,r=require("stream"),i=require("util");function s(u){if(this.buffer=null,this.writable=!0,this.readable=!0,!u)return this.buffer=t.alloc(0),this;if(typeof u.pipe=="function")return this.buffer=t.alloc(0),u.pipe(this),this;if(u.length||typeof u=="object")return this.buffer=u,this.writable=!1,process.nextTick(function(){this.emit("end",u),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof u+")")}i.inherits(s,r),s.prototype.write=function(u){this.buffer=t.concat([this.buffer,t.from(u)]),this.emit("data",u)},s.prototype.end=function(u){u&&this.write(u),this.emit("end",u),this.emit("close"),this.writable=!1,this.readable=!1},n.exports=s}),I3=Ae((e,n)=>{"use strict";var t=require("buffer").Buffer,r=require("buffer").SlowBuffer;n.exports=i;function i(h,c){if(!t.isBuffer(h)||!t.isBuffer(c)||h.length!==c.length)return!1;for(var a=0,d=0;d{"use strict";function t(s){var u=(s/8|0)+(s%8===0?0:1);return u}var r={ES256:t(256),ES384:t(384),ES512:t(521)};function i(s){var u=r[s];if(u)return u;throw new Error('Unknown algorithm "'+s+'"')}n.exports=i}),k3=Ae((e,n)=>{"use strict";var t=Du().Buffer,r=A3(),i=128,s=0,u=32,h=16,c=2,a=h|u|s<<6,d=c|s<<6;function f(T){return T.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function g(T){if(t.isBuffer(T))return T;if(typeof T=="string")return t.from(T,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function I(T,O){T=g(T);var k=r(O),y=k+1,R=T.length,w=0;if(T[w++]!==a)throw new Error('Could not find expected "seq"');var L=T[w++];if(L===(i|1)&&(L=T[w++]),R-w=i;return R&&--y,y}function v(T,O){T=g(T);var k=r(O),y=T.length;if(y!==k*2)throw new TypeError('"'+O+'" signatures must be "'+k*2+'" bytes, saw "'+y+'"');var R=C(T,0,k),w=C(T,k,T.length),L=k-R,D=k-w,S=1+1+L+1+1+D,m=S{var t=I3(),r=Du().Buffer,i=require("crypto"),s=k3(),u=require("util"),h=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,c="secret must be a string or buffer",a="key must be a string or a buffer",d="key must be a string, a buffer or an object",f=typeof i.createPublicKey=="function";f&&(a+=" or a KeyObject",c+="or a KeyObject");function g(E){if(!r.isBuffer(E)&&typeof E!="string"&&(!f||typeof E!="object"||typeof E.type!="string"||typeof E.asymmetricKeyType!="string"||typeof E.export!="function"))throw O(a)}function I(E){if(!r.isBuffer(E)&&typeof E!="string"&&typeof E!="object")throw O(d)}function C(E){if(!r.isBuffer(E)){if(typeof E=="string")return E;if(!f||typeof E!="object"||E.type!=="secret"||typeof E.export!="function")throw O(c)}}function v(E){return E.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function T(E){E=E.toString();var B=4-E.length%4;if(B!==4)for(var j=0;j{var t=require("buffer").Buffer;n.exports=function(r){return typeof r=="string"?r:typeof r=="number"||t.isBuffer(r)?r.toString():JSON.stringify(r)}}),D3=Ae((e,n)=>{var t=qu().Buffer,r=_v(),i=wv(),s=require("stream"),u=Ev(),h=require("util");function c(g,I){return t.from(g,I).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function a(g,I,C){C=C||"utf8";var v=c(u(g),"binary"),T=c(u(I),C);return h.format("%s.%s",v,T)}function d(g){var I=g.header,C=g.payload,v=g.secret||g.privateKey,T=g.encoding,O=i(I.alg),k=a(I,C,T),y=O.sign(k,v);return h.format("%s.%s",k,y)}function f(g){var I=g.secret||g.privateKey||g.key,C=new r(I);this.readable=!0,this.header=g.header,this.encoding=g.encoding,this.secret=this.privateKey=this.key=C,this.payload=new r(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))}h.inherits(f,s),f.prototype.sign=function(){try{var g=d({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")}},f.sign=d,n.exports=f}),j3=Ae((e,n)=>{var t=qu().Buffer,r=_v(),i=wv(),s=require("stream"),u=Ev(),h=require("util"),c=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function a(y){return Object.prototype.toString.call(y)==="[object Object]"}function d(y){if(a(y))return y;try{return JSON.parse(y)}catch{return}}function f(y){var R=y.split(".",1)[0];return d(t.from(R,"base64").toString("binary"))}function g(y){return y.split(".",2).join(".")}function I(y){return y.split(".")[2]}function C(y,R){R=R||"utf8";var w=y.split(".")[1];return t.from(w,"base64").toString(R)}function v(y){return c.test(y)&&!!f(y)}function T(y,R,w){if(!R){var L=new Error("Missing algorithm parameter for jws.verify");throw L.code="MISSING_ALGORITHM",L}y=u(y);var D=I(y),S=g(y),m=i(R);return m.verify(S,D,w)}function O(y,R){if(R=R||{},y=u(y),!v(y))return null;var w=f(y);if(!w)return null;var L=C(y);return(w.typ==="JWT"||R.json)&&(L=JSON.parse(L,R.encoding)),{header:w,payload:L,signature:I(y)}}function k(y){y=y||{};var R=y.secret||y.publicKey||y.key,w=new r(R);this.readable=!0,this.algorithm=y.algorithm,this.encoding=y.encoding,this.secret=this.publicKey=this.key=w,this.signature=new r(y.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))}h.inherits(k,s),k.prototype.verify=function(){try{var y=T(this.signature.buffer,this.algorithm,this.key.buffer),R=O(this.signature.buffer,this.encoding);return this.emit("done",y,R),this.emit("data",y),this.emit("end"),this.readable=!1,y}catch(w){this.readable=!1,this.emit("error",w),this.emit("close")}},k.decode=O,k.isValid=v,k.verify=T,n.exports=k}),fp=Ae(e=>{var n=D3(),t=j3(),r=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.ALGORITHMS=r,e.sign=n.sign,e.verify=t.verify,e.decode=t.decode,e.isValid=t.isValid,e.createSign=function(i){return new n(i)},e.createVerify=function(i){return new t(i)}}),Sv=Ae((e,n)=>{var t=fp();n.exports=function(r,i){i=i||{};var s=t.decode(r,i);if(!s)return null;var u=s.payload;if(typeof u=="string")try{var h=JSON.parse(u);h!==null&&typeof h=="object"&&(u=h)}catch{}return i.complete===!0?{header:s.header,payload:u,signature:s.signature}:u}}),q3=Ae((e,n)=>{var t=1e3,r=t*60,i=r*60,s=i*24,u=s*7,h=s*365.25;n.exports=function(g,I){I=I||{};var C=typeof g;if(C==="string"&&g.length>0)return c(g);if(C==="number"&&isFinite(g))return I.long?d(g):a(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function c(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 C=parseFloat(I[1]),v=(I[2]||"ms").toLowerCase();switch(v){case"years":case"year":case"yrs":case"yr":case"y":return C*h;case"weeks":case"week":case"w":return C*u;case"days":case"day":case"d":return C*s;case"hours":case"hour":case"hrs":case"hr":case"h":return C*i;case"minutes":case"minute":case"mins":case"min":case"m":return C*r;case"seconds":case"second":case"secs":case"sec":case"s":return C*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return C;default:return}}}}function a(g){var I=Math.abs(g);return I>=s?Math.round(g/s)+"d":I>=i?Math.round(g/i)+"h":I>=r?Math.round(g/r)+"m":I>=t?Math.round(g/t)+"s":g+"ms"}function d(g){var I=Math.abs(g);return I>=s?f(g,I,s,"day"):I>=i?f(g,I,i,"hour"):I>=r?f(g,I,r,"minute"):I>=t?f(g,I,t,"second"):g+" ms"}function f(g,I,C,v){var T=I>=C*1.5;return Math.round(g/C)+" "+v+(T?"s":"")}}),Cv=Ae((e,n)=>{var t=q3();n.exports=function(r,i){var s=i||Math.floor(Date.now()/1e3);if(typeof r=="string"){var u=t(r);return typeof u>"u"?void 0:Math.floor(s+u/1e3)}else return typeof r=="number"?s+r:void 0}}),Gc=Ae((e,n)=>{var t="2.0.0",r=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=["major","premajor","minor","preminor","patch","prepatch","prerelease"];n.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),Qc=Ae((e,n)=>{var t=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};n.exports=t}),Mu=Ae((e,n)=>{var{MAX_SAFE_COMPONENT_LENGTH:t}=Gc(),r=Qc();e=n.exports={};var i=e.re=[],s=e.src=[],u=e.t={},h=0,c=(a,d,f)=>{let g=h++;r(a,g,d),u[a]=g,s[g]=d,i[g]=new RegExp(d,f?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${s[u.NUMERICIDENTIFIER]})\\.(${s[u.NUMERICIDENTIFIER]})\\.(${s[u.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${s[u.NUMERICIDENTIFIERLOOSE]})\\.(${s[u.NUMERICIDENTIFIERLOOSE]})\\.(${s[u.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${s[u.NUMERICIDENTIFIER]}|${s[u.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${s[u.NUMERICIDENTIFIERLOOSE]}|${s[u.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${s[u.PRERELEASEIDENTIFIER]}(?:\\.${s[u.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${s[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[u.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${s[u.BUILDIDENTIFIER]}(?:\\.${s[u.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${s[u.MAINVERSION]}${s[u.PRERELEASE]}?${s[u.BUILD]}?`),c("FULL",`^${s[u.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${s[u.MAINVERSIONLOOSE]}${s[u.PRERELEASELOOSE]}?${s[u.BUILD]}?`),c("LOOSE",`^${s[u.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${s[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${s[u.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${s[u.XRANGEIDENTIFIER]})(?:\\.(${s[u.XRANGEIDENTIFIER]})(?:\\.(${s[u.XRANGEIDENTIFIER]})(?:${s[u.PRERELEASE]})?${s[u.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${s[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[u.XRANGEIDENTIFIERLOOSE]})(?:${s[u.PRERELEASELOOSE]})?${s[u.BUILD]}?)?)?`),c("XRANGE",`^${s[u.GTLT]}\\s*${s[u.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${s[u.GTLT]}\\s*${s[u.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`),c("COERCERTL",s[u.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${s[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",c("TILDE",`^${s[u.LONETILDE]}${s[u.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${s[u.LONETILDE]}${s[u.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${s[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",c("CARET",`^${s[u.LONECARET]}${s[u.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${s[u.LONECARET]}${s[u.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${s[u.GTLT]}\\s*(${s[u.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${s[u.GTLT]}\\s*(${s[u.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${s[u.GTLT]}\\s*(${s[u.LOOSEPLAIN]}|${s[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${s[u.XRANGEPLAIN]})\\s+-\\s+(${s[u.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${s[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[u.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}),dp=Ae((e,n)=>{var t=Object.freeze({loose:!0}),r=Object.freeze({}),i=s=>s?typeof s!="object"?t:s:r;n.exports=i}),Tv=Ae((e,n)=>{var t=/^[0-9]+$/,r=(s,u)=>{let h=t.test(s),c=t.test(u);return h&&c&&(s=+s,u=+u),s===u?0:h&&!c?-1:c&&!h?1:sr(u,s);n.exports={compareIdentifiers:r,rcompareIdentifiers:i}}),an=Ae((e,n)=>{var t=Qc(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Gc(),{re:s,t:u}=Mu(),h=dp(),{compareIdentifiers:c}=Tv(),a=class{constructor(d,f){if(f=h(f),d instanceof a){if(d.loose===!!f.loose&&d.includePrerelease===!!f.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>r)throw new TypeError(`version is longer than ${r} characters`);t("SemVer",d,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;let g=d.trim().match(f.loose?s[u.LOOSE]:s[u.FULL]);if(!g)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+g[1],this.minor=+g[2],this.patch=+g[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");g[4]?this.prerelease=g[4].split(".").map(I=>{if(/^[0-9]+$/.test(I)){let C=+I;if(C>=0&&C=0;)typeof this.prerelease[C]=="number"&&(this.prerelease[C]++,C=-2);if(C===-1){if(f===this.prerelease.join(".")&&g===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(I)}}if(f){let C=[f,I];g===!1&&(C=[f]),c(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=C):this.prerelease=C}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.format(),this.raw=this.version,this}};n.exports=a}),Is=Ae((e,n)=>{var t=an(),r=(i,s,u=!1)=>{if(i instanceof t)return i;try{return new t(i,s)}catch(h){if(!u)return null;throw h}};n.exports=r}),M3=Ae((e,n)=>{var t=Is(),r=(i,s)=>{let u=t(i,s);return u?u.version:null};n.exports=r}),V3=Ae((e,n)=>{var t=Is(),r=(i,s)=>{let u=t(i.trim().replace(/^[=v]+/,""),s);return u?u.version:null};n.exports=r}),F3=Ae((e,n)=>{var t=an(),r=(i,s,u,h,c)=>{typeof u=="string"&&(c=h,h=u,u=void 0);try{return new t(i instanceof t?i.version:i,u).inc(s,h,c).version}catch{return null}};n.exports=r}),$3=Ae((e,n)=>{var t=Is(),r=(i,s)=>{let u=t(i,null,!0),h=t(s,null,!0),c=u.compare(h);if(c===0)return null;let a=c>0,d=a?u:h,f=a?h:u,g=!!d.prerelease.length,I=g?"pre":"";return u.major!==h.major?I+"major":u.minor!==h.minor?I+"minor":u.patch!==h.patch?I+"patch":g?"prerelease":f.patch?"patch":f.minor?"minor":"major"};n.exports=r}),z3=Ae((e,n)=>{var t=an(),r=(i,s)=>new t(i,s).major;n.exports=r}),H3=Ae((e,n)=>{var t=an(),r=(i,s)=>new t(i,s).minor;n.exports=r}),K3=Ae((e,n)=>{var t=an(),r=(i,s)=>new t(i,s).patch;n.exports=r}),W3=Ae((e,n)=>{var t=Is(),r=(i,s)=>{let u=t(i,s);return u&&u.prerelease.length?u.prerelease:null};n.exports=r}),oi=Ae((e,n)=>{var t=an(),r=(i,s,u)=>new t(i,u).compare(new t(s,u));n.exports=r}),G3=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(s,i,u);n.exports=r}),Q3=Ae((e,n)=>{var t=oi(),r=(i,s)=>t(i,s,!0);n.exports=r}),pp=Ae((e,n)=>{var t=an(),r=(i,s,u)=>{let h=new t(i,u),c=new t(s,u);return h.compare(c)||h.compareBuild(c)};n.exports=r}),Y3=Ae((e,n)=>{var t=pp(),r=(i,s)=>i.sort((u,h)=>t(u,h,s));n.exports=r}),X3=Ae((e,n)=>{var t=pp(),r=(i,s)=>i.sort((u,h)=>t(h,u,s));n.exports=r}),Yc=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)>0;n.exports=r}),yp=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)<0;n.exports=r}),Rv=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)===0;n.exports=r}),Iv=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)!==0;n.exports=r}),gp=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)>=0;n.exports=r}),mp=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)<=0;n.exports=r}),Av=Ae((e,n)=>{var t=Rv(),r=Iv(),i=Yc(),s=gp(),u=yp(),h=mp(),c=(a,d,f,g)=>{switch(d){case"===":return typeof a=="object"&&(a=a.version),typeof f=="object"&&(f=f.version),a===f;case"!==":return typeof a=="object"&&(a=a.version),typeof f=="object"&&(f=f.version),a!==f;case"":case"=":case"==":return t(a,f,g);case"!=":return r(a,f,g);case">":return i(a,f,g);case">=":return s(a,f,g);case"<":return u(a,f,g);case"<=":return h(a,f,g);default:throw new TypeError(`Invalid operator: ${d}`)}};n.exports=c}),J3=Ae((e,n)=>{var t=an(),r=Is(),{re:i,t:s}=Mu(),u=(h,c)=>{if(h instanceof t)return h;if(typeof h=="number"&&(h=String(h)),typeof h!="string")return null;c=c||{};let a=null;if(!c.rtl)a=h.match(i[s.COERCE]);else{let d;for(;(d=i[s.COERCERTL].exec(h))&&(!a||a.index+a[0].length!==h.length);)(!a||d.index+d[0].length!==a.index+a[0].length)&&(a=d),i[s.COERCERTL].lastIndex=d.index+d[1].length+d[2].length;i[s.COERCERTL].lastIndex=-1}return a===null?null:r(`${a[2]}.${a[3]||"0"}.${a[4]||"0"}`,c)};n.exports=u}),Z3=Ae((e,n)=>{"use strict";n.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let r=this.head;r;r=r.next)yield r.value}}}),e6=Ae((e,n)=>{"use strict";n.exports=t,t.Node=u,t.create=t;function t(h){var c=this;if(c instanceof t||(c=new t),c.tail=null,c.head=null,c.length=0,h&&typeof h.forEach=="function")h.forEach(function(f){c.push(f)});else if(arguments.length>0)for(var a=0,d=arguments.length;a1)a=c;else if(this.head)d=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=0;d!==null;f++)a=h(a,d.value,f),d=d.next;return a},t.prototype.reduceReverse=function(h,c){var a,d=this.tail;if(arguments.length>1)a=c;else if(this.tail)d=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=this.length-1;d!==null;f--)a=h(a,d.value,f),d=d.prev;return a},t.prototype.toArray=function(){for(var h=new Array(this.length),c=0,a=this.head;a!==null;c++)h[c]=a.value,a=a.next;return h},t.prototype.toArrayReverse=function(){for(var h=new Array(this.length),c=0,a=this.tail;a!==null;c++)h[c]=a.value,a=a.prev;return h},t.prototype.slice=function(h,c){c=c||this.length,c<0&&(c+=this.length),h=h||0,h<0&&(h+=this.length);var a=new t;if(cthis.length&&(c=this.length);for(var d=0,f=this.head;f!==null&&dthis.length&&(c=this.length);for(var d=this.length,f=this.tail;f!==null&&d>c;d--)f=f.prev;for(;f!==null&&d>h;d--,f=f.prev)a.push(f.value);return a},t.prototype.splice=function(h,c,...a){h>this.length&&(h=this.length-1),h<0&&(h=this.length+h);for(var d=0,f=this.head;f!==null&&d{"use strict";var t=e6(),r=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),u=Symbol("allowStale"),h=Symbol("maxAge"),c=Symbol("dispose"),a=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),g=Symbol("updateAgeOnGet"),I=()=>1,C=class{constructor(w){if(typeof w=="number"&&(w={max:w}),w||(w={}),w.max&&(typeof w.max!="number"||w.max<0))throw new TypeError("max must be a non-negative number");let L=this[r]=w.max||1/0,D=w.length||I;if(this[s]=typeof D!="function"?I:D,this[u]=w.stale||!1,w.maxAge&&typeof w.maxAge!="number")throw new TypeError("maxAge must be a number");this[h]=w.maxAge||0,this[c]=w.dispose,this[a]=w.noDisposeOnSet||!1,this[g]=w.updateAgeOnGet||!1,this.reset()}set max(w){if(typeof w!="number"||w<0)throw new TypeError("max must be a non-negative number");this[r]=w||1/0,O(this)}get max(){return this[r]}set allowStale(w){this[u]=!!w}get allowStale(){return this[u]}set maxAge(w){if(typeof w!="number")throw new TypeError("maxAge must be a non-negative number");this[h]=w,O(this)}get maxAge(){return this[h]}set lengthCalculator(w){typeof w!="function"&&(w=I),w!==this[s]&&(this[s]=w,this[i]=0,this[d].forEach(L=>{L.length=this[s](L.value,L.key),this[i]+=L.length})),O(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(w,L){L=L||this;for(let D=this[d].tail;D!==null;){let S=D.prev;R(this,w,D,L),D=S}}forEach(w,L){L=L||this;for(let D=this[d].head;D!==null;){let S=D.next;R(this,w,D,L),D=S}}keys(){return this[d].toArray().map(w=>w.key)}values(){return this[d].toArray().map(w=>w.value)}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach(w=>this[c](w.key,w.value)),this[f]=new Map,this[d]=new t,this[i]=0}dump(){return this[d].map(w=>T(this,w)?!1:{k:w.key,v:w.value,e:w.now+(w.maxAge||0)}).toArray().filter(w=>w)}dumpLru(){return this[d]}set(w,L,D){if(D=D||this[h],D&&typeof D!="number")throw new TypeError("maxAge must be a number");let S=D?Date.now():0,m=this[s](L,w);if(this[f].has(w)){if(m>this[r])return k(this,this[f].get(w)),!1;let q=this[f].get(w).value;return this[c]&&(this[a]||this[c](w,q.value)),q.now=S,q.maxAge=D,q.value=L,this[i]+=m-q.length,q.length=m,this.get(w),O(this),!0}let p=new y(w,L,m,S,D);return p.length>this[r]?(this[c]&&this[c](w,L),!1):(this[i]+=p.length,this[d].unshift(p),this[f].set(w,this[d].head),O(this),!0)}has(w){if(!this[f].has(w))return!1;let L=this[f].get(w).value;return!T(this,L)}get(w){return v(this,w,!0)}peek(w){return v(this,w,!1)}pop(){let w=this[d].tail;return w?(k(this,w),w.value):null}del(w){k(this,this[f].get(w))}load(w){this.reset();let L=Date.now();for(let D=w.length-1;D>=0;D--){let S=w[D],m=S.e||0;if(m===0)this.set(S.k,S.v);else{let p=m-L;p>0&&this.set(S.k,S.v,p)}}}prune(){this[f].forEach((w,L)=>v(this,L,!1))}},v=(w,L,D)=>{let S=w[f].get(L);if(S){let m=S.value;if(T(w,m)){if(k(w,S),!w[u])return}else D&&(w[g]&&(S.value.now=Date.now()),w[d].unshiftNode(S));return m.value}},T=(w,L)=>{if(!L||!L.maxAge&&!w[h])return!1;let D=Date.now()-L.now;return L.maxAge?D>L.maxAge:w[h]&&D>w[h]},O=w=>{if(w[i]>w[r])for(let L=w[d].tail;w[i]>w[r]&&L!==null;){let D=L.prev;k(w,L),L=D}},k=(w,L)=>{if(L){let D=L.value;w[c]&&w[c](D.key,D.value),w[i]-=D.length,w[f].delete(D.key),w[d].removeNode(L)}},y=class{constructor(w,L,D,S,m){this.key=w,this.value=L,this.length=D,this.now=S,this.maxAge=m||0}},R=(w,L,D,S)=>{let m=D.value;T(w,m)&&(k(w,D),w[u]||(m=void 0)),m&&L.call(S,m.value,m.key,w)};n.exports=C}),ai=Ae((e,n)=>{var t=class{constructor(B,j){if(j=s(j),B instanceof t)return B.loose===!!j.loose&&B.includePrerelease===!!j.includePrerelease?B:new t(B.raw,j);if(B instanceof u)return this.raw=B.value,this.set=[[B]],this.format(),this;if(this.options=j,this.loose=!!j.loose,this.includePrerelease=!!j.includePrerelease,this.raw=B,this.set=B.split("||").map(N=>this.parseRange(N.trim())).filter(N=>N.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${B}`);if(this.set.length>1){let N=this.set[0];if(this.set=this.set.filter(M=>!T(M[0])),this.set.length===0)this.set=[N];else if(this.set.length>1){for(let M of this.set)if(M.length===1&&O(M[0])){this.set=[M];break}}}this.format()}format(){return this.range=this.set.map(B=>B.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(B){B=B.trim();let j=((this.options.includePrerelease&&C)|(this.options.loose&&v))+":"+B,N=i.get(j);if(N)return N;let M=this.options.loose,ee=M?a[d.HYPHENRANGELOOSE]:a[d.HYPHENRANGE];B=B.replace(ee,$(this.options.includePrerelease)),h("hyphen replace",B),B=B.replace(a[d.COMPARATORTRIM],f),h("comparator trim",B),B=B.replace(a[d.TILDETRIM],g),B=B.replace(a[d.CARETTRIM],I),B=B.split(/\s+/).join(" ");let oe=B.split(" ").map(Re=>y(Re,this.options)).join(" ").split(/\s+/).map(Re=>V(Re,this.options));M&&(oe=oe.filter(Re=>(h("loose invalid filter",Re,this.options),!!Re.match(a[d.COMPARATORLOOSE])))),h("range list",oe);let ae=new Map,pe=oe.map(Re=>new u(Re,this.options));for(let Re of pe){if(T(Re))return[Re];ae.set(Re.value,Re)}ae.size>1&&ae.has("")&&ae.delete("");let _e=[...ae.values()];return i.set(j,_e),_e}intersects(B,j){if(!(B instanceof t))throw new TypeError("a Range is required");return this.set.some(N=>k(N,j)&&B.set.some(M=>k(M,j)&&N.every(ee=>M.every(oe=>ee.intersects(oe,j)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new c(B,this.options)}catch{return!1}for(let j=0;jB.value==="<0.0.0-0",O=B=>B.value==="",k=(B,j)=>{let N=!0,M=B.slice(),ee=M.pop();for(;N&&M.length;)N=M.every(oe=>ee.intersects(oe,j)),ee=M.pop();return N},y=(B,j)=>(h("comp",B,j),B=D(B,j),h("caret",B),B=w(B,j),h("tildes",B),B=m(B,j),h("xrange",B),B=q(B,j),h("stars",B),B),R=B=>!B||B.toLowerCase()==="x"||B==="*",w=(B,j)=>B.trim().split(/\s+/).map(N=>L(N,j)).join(" "),L=(B,j)=>{let N=j.loose?a[d.TILDELOOSE]:a[d.TILDE];return B.replace(N,(M,ee,oe,ae,pe)=>{h("tilde",B,M,ee,oe,ae,pe);let _e;return R(ee)?_e="":R(oe)?_e=`>=${ee}.0.0 <${+ee+1}.0.0-0`:R(ae)?_e=`>=${ee}.${oe}.0 <${ee}.${+oe+1}.0-0`:pe?(h("replaceTilde pr",pe),_e=`>=${ee}.${oe}.${ae}-${pe} <${ee}.${+oe+1}.0-0`):_e=`>=${ee}.${oe}.${ae} <${ee}.${+oe+1}.0-0`,h("tilde return",_e),_e})},D=(B,j)=>B.trim().split(/\s+/).map(N=>S(N,j)).join(" "),S=(B,j)=>{h("caret",B,j);let N=j.loose?a[d.CARETLOOSE]:a[d.CARET],M=j.includePrerelease?"-0":"";return B.replace(N,(ee,oe,ae,pe,_e)=>{h("caret",B,ee,oe,ae,pe,_e);let Re;return R(oe)?Re="":R(ae)?Re=`>=${oe}.0.0${M} <${+oe+1}.0.0-0`:R(pe)?oe==="0"?Re=`>=${oe}.${ae}.0${M} <${oe}.${+ae+1}.0-0`:Re=`>=${oe}.${ae}.0${M} <${+oe+1}.0.0-0`:_e?(h("replaceCaret pr",_e),oe==="0"?ae==="0"?Re=`>=${oe}.${ae}.${pe}-${_e} <${oe}.${ae}.${+pe+1}-0`:Re=`>=${oe}.${ae}.${pe}-${_e} <${oe}.${+ae+1}.0-0`:Re=`>=${oe}.${ae}.${pe}-${_e} <${+oe+1}.0.0-0`):(h("no pr"),oe==="0"?ae==="0"?Re=`>=${oe}.${ae}.${pe}${M} <${oe}.${ae}.${+pe+1}-0`:Re=`>=${oe}.${ae}.${pe}${M} <${oe}.${+ae+1}.0-0`:Re=`>=${oe}.${ae}.${pe} <${+oe+1}.0.0-0`),h("caret return",Re),Re})},m=(B,j)=>(h("replaceXRanges",B,j),B.split(/\s+/).map(N=>p(N,j)).join(" ")),p=(B,j)=>{B=B.trim();let N=j.loose?a[d.XRANGELOOSE]:a[d.XRANGE];return B.replace(N,(M,ee,oe,ae,pe,_e)=>{h("xRange",B,M,ee,oe,ae,pe,_e);let Re=R(oe),qe=Re||R(ae),Ce=qe||R(pe),$e=Ce;return ee==="="&&$e&&(ee=""),_e=j.includePrerelease?"-0":"",Re?ee===">"||ee==="<"?M="<0.0.0-0":M="*":ee&&$e?(qe&&(ae=0),pe=0,ee===">"?(ee=">=",qe?(oe=+oe+1,ae=0,pe=0):(ae=+ae+1,pe=0)):ee==="<="&&(ee="<",qe?oe=+oe+1:ae=+ae+1),ee==="<"&&(_e="-0"),M=`${ee+oe}.${ae}.${pe}${_e}`):qe?M=`>=${oe}.0.0${_e} <${+oe+1}.0.0-0`:Ce&&(M=`>=${oe}.${ae}.0${_e} <${oe}.${+ae+1}.0-0`),h("xRange return",M),M})},q=(B,j)=>(h("replaceStars",B,j),B.trim().replace(a[d.STAR],"")),V=(B,j)=>(h("replaceGTE0",B,j),B.trim().replace(a[j.includePrerelease?d.GTE0PRE:d.GTE0],"")),$=B=>(j,N,M,ee,oe,ae,pe,_e,Re,qe,Ce,$e,Ie)=>(R(M)?N="":R(ee)?N=`>=${M}.0.0${B?"-0":""}`:R(oe)?N=`>=${M}.${ee}.0${B?"-0":""}`:ae?N=`>=${N}`:N=`>=${N}${B?"-0":""}`,R(Re)?_e="":R(qe)?_e=`<${+Re+1}.0.0-0`:R(Ce)?_e=`<${Re}.${+qe+1}.0-0`:$e?_e=`<=${Re}.${qe}.${Ce}-${$e}`:B?_e=`<${Re}.${qe}.${+Ce+1}-0`:_e=`<=${_e}`,`${N} ${_e}`.trim()),E=(B,j,N)=>{for(let M=0;M0){let ee=B[M].semver;if(ee.major===j.major&&ee.minor===j.minor&&ee.patch===j.patch)return!0}return!1}return!0}}),Xc=Ae((e,n)=>{var t=Symbol("SemVer ANY"),r=class{static get ANY(){return t}constructor(f,g){if(g=i(g),f instanceof r){if(f.loose===!!g.loose)return f;f=f.value}c("comparator",f,g),this.options=g,this.loose=!!g.loose,this.parse(f),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(f){let g=this.options.loose?s[u.COMPARATORLOOSE]:s[u.COMPARATOR],I=f.match(g);if(!I)throw new TypeError(`Invalid comparator: ${f}`);this.operator=I[1]!==void 0?I[1]:"",this.operator==="="&&(this.operator=""),I[2]?this.semver=new a(I[2],this.options.loose):this.semver=t}toString(){return this.value}test(f){if(c("Comparator.test",f,this.options.loose),this.semver===t||f===t)return!0;if(typeof f=="string")try{f=new a(f,this.options)}catch{return!1}return h(f,this.operator,this.semver,this.options)}intersects(f,g){if(!(f instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(f.value,g).test(this.value):f.operator===""?f.value===""?!0:new d(this.value,g).test(f.semver):(g=i(g),g.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||h(this.semver,"<",f.semver,g)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||h(this.semver,">",f.semver,g)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}};n.exports=r;var i=dp(),{re:s,t:u}=Mu(),h=Av(),c=Qc(),a=an(),d=ai()}),Jc=Ae((e,n)=>{var t=ai(),r=(i,s,u)=>{try{s=new t(s,u)}catch{return!1}return s.test(i)};n.exports=r}),r6=Ae((e,n)=>{var t=ai(),r=(i,s)=>new t(i,s).set.map(u=>u.map(h=>h.value).join(" ").trim().split(" "));n.exports=r}),n6=Ae((e,n)=>{var t=an(),r=ai(),i=(s,u,h)=>{let c=null,a=null,d=null;try{d=new r(u,h)}catch{return null}return s.forEach(f=>{d.test(f)&&(!c||a.compare(f)===-1)&&(c=f,a=new t(c,h))}),c};n.exports=i}),i6=Ae((e,n)=>{var t=an(),r=ai(),i=(s,u,h)=>{let c=null,a=null,d=null;try{d=new r(u,h)}catch{return null}return s.forEach(f=>{d.test(f)&&(!c||a.compare(f)===1)&&(c=f,a=new t(c,h))}),c};n.exports=i}),o6=Ae((e,n)=>{var t=an(),r=ai(),i=Yc(),s=(u,h)=>{u=new r(u,h);let c=new t("0.0.0");if(u.test(c)||(c=new t("0.0.0-0"),u.test(c)))return c;c=null;for(let a=0;a{let I=new t(g.semver.version);switch(g.operator){case">":I.prerelease.length===0?I.patch++:I.prerelease.push(0),I.raw=I.format();case"":case">=":(!f||i(I,f))&&(f=I);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${g.operator}`)}}),f&&(!c||i(c,f))&&(c=f)}return c&&u.test(c)?c:null};n.exports=s}),a6=Ae((e,n)=>{var t=ai(),r=(i,s)=>{try{return new t(i,s).range||"*"}catch{return null}};n.exports=r}),vp=Ae((e,n)=>{var t=an(),r=Xc(),{ANY:i}=r,s=ai(),u=Jc(),h=Yc(),c=yp(),a=mp(),d=gp(),f=(g,I,C,v)=>{g=new t(g,v),I=new s(I,v);let T,O,k,y,R;switch(C){case">":T=h,O=a,k=c,y=">",R=">=";break;case"<":T=c,O=d,k=h,y="<",R="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(g,I,v))return!1;for(let w=0;w{m.semver===i&&(m=new r(">=0.0.0")),D=D||m,S=S||m,T(m.semver,D.semver,v)?D=m:k(m.semver,S.semver,v)&&(S=m)}),D.operator===y||D.operator===R||(!S.operator||S.operator===y)&&O(g,S.semver)||S.operator===R&&k(g,S.semver))return!1}return!0};n.exports=f}),s6=Ae((e,n)=>{var t=vp(),r=(i,s,u)=>t(i,s,">",u);n.exports=r}),u6=Ae((e,n)=>{var t=vp(),r=(i,s,u)=>t(i,s,"<",u);n.exports=r}),l6=Ae((e,n)=>{var t=ai(),r=(i,s,u)=>(i=new t(i,u),s=new t(s,u),i.intersects(s,u));n.exports=r}),c6=Ae((e,n)=>{var t=Jc(),r=oi();n.exports=(i,s,u)=>{let h=[],c=null,a=null,d=i.sort((C,v)=>r(C,v,u));for(let C of d)t(C,s,u)?(a=C,c||(c=C)):(a&&h.push([c,a]),a=null,c=null);c&&h.push([c,null]);let f=[];for(let[C,v]of h)C===v?f.push(C):!v&&C===d[0]?f.push("*"):v?C===d[0]?f.push(`<=${v}`):f.push(`${C} - ${v}`):f.push(`>=${C}`);let g=f.join(" || "),I=typeof s.raw=="string"?s.raw:String(s);return g.length{var t=ai(),r=Xc(),{ANY:i}=r,s=Jc(),u=oi(),h=(I,C,v={})=>{if(I===C)return!0;I=new t(I,v),C=new t(C,v);let T=!1;e:for(let O of I.set){for(let k of C.set){let y=d(O,k,v);if(T=T||y!==null,y)continue e}if(T)return!1}return!0},c=[new r(">=0.0.0-0")],a=[new r(">=0.0.0")],d=(I,C,v)=>{if(I===C)return!0;if(I.length===1&&I[0].semver===i){if(C.length===1&&C[0].semver===i)return!0;v.includePrerelease?I=c:I=a}if(C.length===1&&C[0].semver===i){if(v.includePrerelease)return!0;C=a}let T=new Set,O,k;for(let p of I)p.operator===">"||p.operator===">="?O=f(O,p,v):p.operator==="<"||p.operator==="<="?k=g(k,p,v):T.add(p.semver);if(T.size>1)return null;let y;if(O&&k&&(y=u(O.semver,k.semver,v),y>0||y===0&&(O.operator!==">="||k.operator!=="<=")))return null;for(let p of T){if(O&&!s(p,String(O),v)||k&&!s(p,String(k),v))return null;for(let q of C)if(!s(p,String(q),v))return!1;return!0}let R,w,L,D,S=k&&!v.includePrerelease&&k.semver.prerelease.length?k.semver:!1,m=O&&!v.includePrerelease&&O.semver.prerelease.length?O.semver:!1;S&&S.prerelease.length===1&&k.operator==="<"&&S.prerelease[0]===0&&(S=!1);for(let p of C){if(D=D||p.operator===">"||p.operator===">=",L=L||p.operator==="<"||p.operator==="<=",O){if(m&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===m.major&&p.semver.minor===m.minor&&p.semver.patch===m.patch&&(m=!1),p.operator===">"||p.operator===">="){if(R=f(O,p,v),R===p&&R!==O)return!1}else if(O.operator===">="&&!s(O.semver,String(p),v))return!1}if(k){if(S&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===S.major&&p.semver.minor===S.minor&&p.semver.patch===S.patch&&(S=!1),p.operator==="<"||p.operator==="<="){if(w=g(k,p,v),w===p&&w!==k)return!1}else if(k.operator==="<="&&!s(k.semver,String(p),v))return!1}if(!p.operator&&(k||O)&&y!==0)return!1}return!(O&&L&&!k&&y!==0||k&&D&&!O&&y!==0||m||S)},f=(I,C,v)=>{if(!I)return C;let T=u(I.semver,C.semver,v);return T>0?I:T<0||C.operator===">"&&I.operator===">="?C:I},g=(I,C,v)=>{if(!I)return C;let T=u(I.semver,C.semver,v);return T<0?I:T>0||C.operator==="<"&&I.operator==="<="?C:I};n.exports=h}),bp=Ae((e,n)=>{var t=Mu(),r=Gc(),i=an(),s=Tv(),u=Is(),h=M3(),c=V3(),a=F3(),d=$3(),f=z3(),g=H3(),I=K3(),C=W3(),v=oi(),T=G3(),O=Q3(),k=pp(),y=Y3(),R=X3(),w=Yc(),L=yp(),D=Rv(),S=Iv(),m=gp(),p=mp(),q=Av(),V=J3(),$=Xc(),E=ai(),B=Jc(),j=r6(),N=n6(),M=i6(),ee=o6(),oe=a6(),ae=vp(),pe=s6(),_e=u6(),Re=l6(),qe=c6(),Ce=h6();n.exports={parse:u,valid:h,clean:c,inc:a,diff:d,major:f,minor:g,patch:I,prerelease:C,compare:v,rcompare:T,compareLoose:O,compareBuild:k,sort:y,rsort:R,gt:w,lt:L,eq:D,neq:S,gte:m,lte:p,cmp:q,coerce:V,Comparator:$,Range:E,satisfies:B,toComparators:j,maxSatisfying:N,minSatisfying:M,minVersion:ee,validRange:oe,outside:ae,gtr:pe,ltr:_e,intersects:Re,simplifyRange:qe,subset:Ce,SemVer:i,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}}),f6=Ae((e,n)=>{var t=bp();n.exports=t.satisfies(process.version,">=15.7.0")}),d6=Ae((e,n)=>{var t=bp();n.exports=t.satisfies(process.version,">=16.9.0")}),kv=Ae((e,n)=>{var t=f6(),r=d6(),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};n.exports=function(u,h){if(!u||!h)return;let c=h.asymmetricKeyType;if(!c)return;let a=i[c];if(!a)throw new Error(`Unknown key type "${c}".`);if(!a.includes(u))throw new Error(`"alg" parameter for "${c}" key type must be one of: ${a.join(", ")}.`);if(t)switch(c){case"ec":let d=h.asymmetricKeyDetails.namedCurve,f=s[u];if(d!==f)throw new Error(`"alg" parameter "${u}" requires curve "${f}".`);break;case"rsa-pss":if(r){let g=parseInt(u.slice(-3),10),{hashAlgorithm:I,mgf1HashAlgorithm:C,saltLength:v}=h.asymmetricKeyDetails;if(I!==`sha${g}`||C!==I)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${u}.`);if(v!==void 0&&v>g>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${u}.`)}break}}}),Ov=Ae((e,n)=>{var t=bp();n.exports=t.satisfies(process.version,"^6.12.0 || >=8.0.0")}),p6=Ae((e,n)=>{var t=Wc(),r=vv(),i=bv(),s=Sv(),u=Cv(),h=kv(),c=Ov(),a=fp(),{KeyObject:d,createSecretKey:f,createPublicKey:g}=require("crypto"),I=["RS256","RS384","RS512"],C=["ES256","ES384","ES512"],v=["RS256","RS384","RS512"],T=["HS256","HS384","HS512"];c&&(I.splice(I.length,0,"PS256","PS384","PS512"),v.splice(v.length,0,"PS256","PS384","PS512")),n.exports=function(O,k,y,R){typeof y=="function"&&!R&&(R=y,y={}),y||(y={}),y=Object.assign({},y);let w;if(R?w=R:w=function(q,V){if(q)throw q;return V},y.clockTimestamp&&typeof y.clockTimestamp!="number")return w(new t("clockTimestamp must be a number"));if(y.nonce!==void 0&&(typeof y.nonce!="string"||y.nonce.trim()===""))return w(new t("nonce must be a non-empty string"));if(y.allowInvalidAsymmetricKeyTypes!==void 0&&typeof y.allowInvalidAsymmetricKeyTypes!="boolean")return w(new t("allowInvalidAsymmetricKeyTypes must be a boolean"));let L=y.clockTimestamp||Math.floor(Date.now()/1e3);if(!O)return w(new t("jwt must be provided"));if(typeof O!="string")return w(new t("jwt must be a string"));let D=O.split(".");if(D.length!==3)return w(new t("jwt malformed"));let S;try{S=s(O,{complete:!0})}catch(q){return w(q)}if(!S)return w(new t("invalid token"));let m=S.header,p;if(typeof k=="function"){if(!R)return w(new t("verify must be called asynchronous if secret or public key is provided as a callback"));p=k}else p=function(q,V){return V(null,k)};return p(m,function(q,V){if(q)return w(new t("error in secret or public key callback: "+q.message));let $=D[2].trim()!=="";if(!$&&V)return w(new t("jwt signature is required"));if($&&!V)return w(new t("secret or public key must be provided"));if(!$&&!y.algorithms)return w(new t('please specify "none" in "algorithms" to verify unsigned tokens'));if(V!=null&&!(V instanceof d))try{V=g(V)}catch{try{V=f(typeof V=="string"?Buffer.from(V):V)}catch{return w(new t("secretOrPublicKey is not valid key material"))}}if(y.algorithms||(V.type==="secret"?y.algorithms=T:["rsa","rsa-pss"].includes(V.asymmetricKeyType)?y.algorithms=v:V.asymmetricKeyType==="ec"?y.algorithms=C:y.algorithms=I),y.algorithms.indexOf(S.header.alg)===-1)return w(new t("invalid algorithm"));if(m.alg.startsWith("HS")&&V.type!=="secret")return w(new t(`secretOrPublicKey must be a symmetric key when using ${m.alg}`));if(/^(?:RS|PS|ES)/.test(m.alg)&&V.type!=="public")return w(new t(`secretOrPublicKey must be an asymmetric key when using ${m.alg}`));if(!y.allowInvalidAsymmetricKeyTypes)try{h(m.alg,V)}catch(j){return w(j)}let E;try{E=a.verify(O,S.header.alg,V)}catch(j){return w(j)}if(!E)return w(new t("invalid signature"));let B=S.payload;if(typeof B.nbf<"u"&&!y.ignoreNotBefore){if(typeof B.nbf!="number")return w(new t("invalid nbf value"));if(B.nbf>L+(y.clockTolerance||0))return w(new r("jwt not active",new Date(B.nbf*1e3)))}if(typeof B.exp<"u"&&!y.ignoreExpiration){if(typeof B.exp!="number")return w(new t("invalid exp value"));if(L>=B.exp+(y.clockTolerance||0))return w(new i("jwt expired",new Date(B.exp*1e3)))}if(y.audience){let j=Array.isArray(y.audience)?y.audience:[y.audience];if(!(Array.isArray(B.aud)?B.aud:[B.aud]).some(function(N){return j.some(function(M){return M instanceof RegExp?M.test(N):M===N})}))return w(new t("jwt audience invalid. expected: "+j.join(" or ")))}if(y.issuer&&(typeof y.issuer=="string"&&B.iss!==y.issuer||Array.isArray(y.issuer)&&y.issuer.indexOf(B.iss)===-1))return w(new t("jwt issuer invalid. expected: "+y.issuer));if(y.subject&&B.sub!==y.subject)return w(new t("jwt subject invalid. expected: "+y.subject));if(y.jwtid&&B.jti!==y.jwtid)return w(new t("jwt jwtid invalid. expected: "+y.jwtid));if(y.nonce&&B.nonce!==y.nonce)return w(new t("jwt nonce invalid. expected: "+y.nonce));if(y.maxAge){if(typeof B.iat!="number")return w(new t("iat required when maxAge is specified"));let j=u(y.maxAge,B.iat);if(typeof j>"u")return w(new t('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(L>=j+(y.clockTolerance||0))return w(new i("maxAge exceeded",new Date(j*1e3)))}if(y.complete===!0){let j=S.signature;return w(null,{header:m,payload:B,signature:j})}return w(null,B)})}}),y6=Ae((e,n)=>{(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",h="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",a=500,d="__lodash_placeholder__",f=1,g=2,I=4,C=1,v=2,T=1,O=2,k=4,y=8,R=16,w=32,L=64,D=128,S=256,m=512,p=30,q="...",V=800,$=16,E=1,B=2,j=3,N=1/0,M=9007199254740991,ee=17976931348623157e292,oe=0/0,ae=4294967295,pe=ae-1,_e=ae>>>1,Re=[["ary",D],["bind",T],["bindKey",O],["curry",y],["curryRight",R],["flip",m],["partial",w],["partialRight",L],["rearg",S]],qe="[object Arguments]",Ce="[object Array]",$e="[object AsyncFunction]",Ie="[object Boolean]",et="[object Date]",Je="[object DOMException]",x="[object Error]",X="[object Function]",Q="[object GeneratorFunction]",A="[object Map]",K="[object Number]",se="[object Null]",te="[object Object]",Ee="[object Promise]",xe="[object Proxy]",je="[object RegExp]",ge="[object Set]",Le="[object String]",We="[object Symbol]",rt="[object Undefined]",He="[object WeakMap]",kt="[object WeakSet]",St="[object ArrayBuffer]",Ct="[object DataView]",Bt="[object Float32Array]",Ot="[object Float64Array]",Lt="[object Int8Array]",zt="[object Int16Array]",Xt="[object Int32Array]",Ht="[object Uint8Array]",Kt="[object Uint8ClampedArray]",lr="[object Uint16Array]",Cr="[object Uint32Array]",gr=/\b__p \+= '';/g,qr=/\b(__p \+=) '' \+/g,un=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qr=/&(?:amp|lt|gt|quot|#39);/g,Yr=/[&<>"']/g,_n=RegExp(Qr.source),li=RegExp(Yr.source),Mr=/<%-([\s\S]+?)%>/g,Nn=/<%([\s\S]+?)%>/g,Ut=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jt=/^\w*$/,jt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wt=/[\\^$.*+?()[\]{}|]/g,Zt=RegExp(Wt.source),Gt=/^\s+/,Qt=/\s/,rr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nr=/\{\n\/\* \[wrapped with (.+)\] \*/,ir=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,or=/[()=,{}\[\]\/\s]/,cr=/\\(\\)?/g,$t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tr=/\w*$/,Na=/^[-+]0x[0-9a-f]+$/i,po=/^0b[01]+$/i,Ps=/^\[object .+?Constructor\]$/,yo=/^0o[0-7]+$/i,Oi=/^(?:0|[1-9]\d*)$/,wn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tr=/($^)/,Ko=/['\n\r\u2028\u2029\\]/g,Pi="\\ud800-\\udfff",go="\\u0300-\\u036f",mo="\\ufe20-\\ufe2f",xa="\\u20d0-\\u20ff",Ua=go+mo+xa,Da="\\u2700-\\u27bf",vo="a-z\\xdf-\\xf6\\xf8-\\xff",br="\\xac\\xb1\\xd7\\xf7",ja="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",qa="\\u2000-\\u206f",Bs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wo="A-Z\\xc0-\\xd6\\xd8-\\xde",z="\\ufe0e\\ufe0f",G=br+ja+qa+Bs,Z="['\u2019]",ce="["+Pi+"]",be="["+G+"]",Te="["+Ua+"]",Ne="\\d+",Be="["+Da+"]",bt="["+vo+"]",ar="[^"+Pi+G+Ne+Da+vo+Wo+"]",Rr="\\ud83c[\\udffb-\\udfff]",Pr="(?:"+Te+"|"+Rr+")",ln="[^"+Pi+"]",ci="(?:\\ud83c[\\udde6-\\uddff]){2}",Ir="[\\ud800-\\udbff][\\udc00-\\udfff]",mr="["+Wo+"]",Bi="\\u200d",En="(?:"+bt+"|"+ar+")",Gn="(?:"+mr+"|"+ar+")",Ls="(?:"+Z+"(?:d|ll|m|re|s|t|ve))?",Xu="(?:"+Z+"(?:D|LL|M|RE|S|T|VE))?",Ns=Pr+"?",Li="["+z+"]?",bo="(?:"+Bi+"(?:"+[ln,ci,Ir].join("|")+")"+Li+Ns+")*",Ma="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ju="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zu=Li+Ns+bo,xs="(?:"+[Be,ci,Ir].join("|")+")"+Zu,Us="(?:"+[ln+Te+"?",Te,ci,Ir,ce].join("|")+")",Ds=RegExp(Z,"g"),yh=RegExp(Te,"g"),js=RegExp(Rr+"(?="+Rr+")|"+Us+Zu,"g"),gh=RegExp([mr+"?"+bt+"+"+Ls+"(?="+[be,mr,"$"].join("|")+")",Gn+"+"+Xu+"(?="+[be,mr+En,"$"].join("|")+")",mr+"?"+En+"+"+Ls,mr+"+"+Xu,Ju,Ma,Ne,xs].join("|"),"g"),mh=RegExp("["+Bi+Pi+Ua+z+"]"),xn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bh=-1,Vt={};Vt[Bt]=Vt[Ot]=Vt[Lt]=Vt[zt]=Vt[Xt]=Vt[Ht]=Vt[Kt]=Vt[lr]=Vt[Cr]=!0,Vt[qe]=Vt[Ce]=Vt[St]=Vt[Ie]=Vt[Ct]=Vt[et]=Vt[x]=Vt[X]=Vt[A]=Vt[K]=Vt[te]=Vt[je]=Vt[ge]=Vt[Le]=Vt[He]=!1;var Tt={};Tt[qe]=Tt[Ce]=Tt[St]=Tt[Ct]=Tt[Ie]=Tt[et]=Tt[Bt]=Tt[Ot]=Tt[Lt]=Tt[zt]=Tt[Xt]=Tt[A]=Tt[K]=Tt[te]=Tt[je]=Tt[ge]=Tt[Le]=Tt[We]=Tt[Ht]=Tt[Kt]=Tt[lr]=Tt[Cr]=!0,Tt[x]=Tt[X]=Tt[He]=!1;var qs={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Go={"&":"&","<":"<",">":">",'"':""","'":"'"},Ni={"&":"&","<":"<",">":">",""":'"',"'":"'"},_h={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},el=parseFloat,wh=parseInt,tl=typeof global=="object"&&global&&global.Object===Object&&global,rl=typeof self=="object"&&self&&self.Object===Object&&self,vr=tl||rl||Function("return this")(),Va=typeof e=="object"&&e&&!e.nodeType&&e,hi=Va&&typeof n=="object"&&n&&!n.nodeType&&n,Ms=hi&&hi.exports===Va,fi=Ms&&tl.process,Vr=function(){try{var he=hi&&hi.require&&hi.require("util").types;return he||fi&&fi.binding&&fi.binding("util")}catch{}}(),Vs=Vr&&Vr.isArrayBuffer,nl=Vr&&Vr.isDate,Qo=Vr&&Vr.isMap,il=Vr&&Vr.isRegExp,ol=Vr&&Vr.isSet,Fs=Vr&&Vr.isTypedArray;function Xr(he,me,ye){switch(ye.length){case 0:return he.call(me);case 1:return he.call(me,ye[0]);case 2:return he.call(me,ye[0],ye[1]);case 3:return he.call(me,ye[0],ye[1],ye[2])}return he.apply(me,ye)}function Fa(he,me,ye,Ue){for(var Ke=-1,ht=he==null?0:he.length;++Ke-1}function _o(he,me,ye){for(var Ue=-1,Ke=he==null?0:he.length;++Ue-1;);return ye}function Eo(he,me){for(var ye=he.length;ye--&&di(me,he[ye],0)>-1;);return ye}function Ha(he,me){for(var ye=he.length,Ue=0;ye--;)he[ye]===me&&++Ue;return Ue}var pi=Xo(qs),Ys=Xo(Go);function Rh(he){return"\\"+_h[he]}function So(he,me){return he==null?t:he[me]}function qi(he){return mh.test(he)}function Ih(he){return xn.test(he)}function Ka(he){for(var me,ye=[];!(me=he.next()).done;)ye.push(me.value);return ye}function Xs(he){var me=-1,ye=Array(he.size);return he.forEach(function(Ue,Ke){ye[++me]=[Ke,Ue]}),ye}function cl(he,me){return function(ye){return he(me(ye))}}function yi(he,me){for(var ye=-1,Ue=he.length,Ke=0,ht=[];++ye-1}function r_(o,l){var b=this.__data__,U=vl(b,o);return U<0?(++this.size,b.push([o,l])):b[U][1]=l,this}Hi.prototype.clear=Jb,Hi.prototype.delete=Zb,Hi.prototype.get=e_,Hi.prototype.has=t_,Hi.prototype.set=r_;function Ki(o){var l=-1,b=o==null?0:o.length;for(this.clear();++l=l?o:l)),o}function qn(o,l,b,U,F,J){var ne,ue=l&f,fe=l&g,we=l&I;if(b&&(ne=F?b(o,U,F,J):b(o)),ne!==t)return ne;if(!sr(o))return o;var Se=tt(o);if(Se){if(ne=aw(o),!ue)return hn(o,ne)}else{var ke=Kr(o),De=ke==X||ke==Q;if(Po(o))return I0(o,ue);if(ke==te||ke==qe||De&&!F){if(ne=fe||De?{}:K0(o),!ue)return fe?Q_(o,v_(ne,o)):G_(o,n0(ne,o))}else{if(!Tt[ke])return F?o:{};ne=sw(o,ke,ue)}}J||(J=new Yn);var Ve=J.get(o);if(Ve)return Ve;J.set(o,ne),wy(o)?o.forEach(function(Xe){ne.add(qn(Xe,l,b,Xe,o,J))}):by(o)&&o.forEach(function(Xe,ft){ne.set(ft,qn(Xe,l,b,ft,o,J))});var Ye=we?fe?uf:sf:fe?dn:kr,ot=Se?t:Ye(o);return Fr(ot||o,function(Xe,ft){ot&&(ft=Xe,Xe=o[ft]),Zs(ne,ft,qn(Xe,l,b,ft,o,J))}),ne}function b_(o){var l=kr(o);return function(b){return i0(b,o,l)}}function i0(o,l,b){var U=b.length;if(o==null)return!U;for(o=yt(o);U--;){var F=b[U],J=l[F],ne=o[F];if(ne===t&&!(F in o)||!J(ne))return!1}return!0}function o0(o,l,b){if(typeof o!="function")throw new Br(u);return au(function(){o.apply(t,b)},l)}function eu(o,l,b,U){var F=-1,J=Yo,ne=!0,ue=o.length,fe=[],we=l.length;if(!ue)return fe;b&&(l=qt(l,Ar(b))),U?(J=_o,ne=!1):l.length>=i&&(J=wo,ne=!1,l=new aa(l));e:for(;++FF?0:F+b),U=U===t||U>F?F:it(U),U<0&&(U+=F),U=b>U?0:Sy(U);b0&&b(ue)?l>1?xr(ue,l-1,b,U,F):$r(F,ue):U||(F[F.length]=ue)}return F}var Fh=L0(),u0=L0(!0);function vi(o,l){return o&&Fh(o,l,kr)}function $h(o,l){return o&&u0(o,l,kr)}function _l(o,l){return Un(l,function(b){return Xi(o[b])})}function ua(o,l){l=ko(l,o);for(var b=0,U=l.length;o!=null&&bl}function E_(o,l){return o!=null&&_t.call(o,l)}function S_(o,l){return o!=null&&l in yt(o)}function C_(o,l,b){return o>=de(l,b)&&o=120&&Se.length>=120)?new aa(ne&&Se):t}Se=o[0];var ke=-1,De=ue[0];e:for(;++ke-1;)ue!==o&&Xa.call(ue,fe,1),Xa.call(o,fe,1);return o}function b0(o,l){for(var b=o?l.length:0,U=b-1;b--;){var F=l[b];if(b==U||F!==J){var J=F;Yi(F)?Xa.call(o,F,1):Zh(o,F)}}return o}function Yh(o,l){return o+Za(Me()*(l-o+1))}function D_(o,l,b,U){for(var F=-1,J=re(Ja((l-o)/(b||1)),0),ne=ye(J);J--;)ne[U?J:++F]=o,o+=b;return ne}function Xh(o,l){var b="";if(!o||l<1||l>M)return b;do l%2&&(b+=o),l=Za(l/2),l&&(o+=o);while(l);return b}function ut(o,l){return yf(Q0(o,l,pn),o+"")}function j_(o){return r0(is(o))}function q_(o,l){var b=is(o);return Pl(b,sa(l,0,b.length))}function nu(o,l,b,U){if(!sr(o))return o;l=ko(l,o);for(var F=-1,J=l.length,ne=J-1,ue=o;ue!=null&&++FF?0:F+l),b=b>F?F:b,b<0&&(b+=F),F=l>b?0:b-l>>>0,l>>>=0;for(var J=ye(F);++U>>1,ne=o[J];ne!==null&&!An(ne)&&(b?ne<=l:ne=i){var we=l?null:Z_(o);if(we)return Wa(we);ne=!1,F=wo,fe=new aa}else fe=l?[]:ue;e:for(;++U=U?o:Mn(o,l,b)}var R0=Dh||function(o){return vr.clearTimeout(o)};function I0(o,l){if(l)return o.slice();var b=o.length,U=ra?ra(b):new o.constructor(b);return o.copy(U),U}function nf(o){var l=new o.constructor(o.byteLength);return new Fi(l).set(new Fi(o)),l}function z_(o,l){var b=l?nf(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.byteLength)}function H_(o){var l=new o.constructor(o.source,tr.exec(o));return l.lastIndex=o.lastIndex,l}function K_(o){return vt?yt(vt.call(o)):{}}function A0(o,l){var b=l?nf(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.length)}function k0(o,l){if(o!==l){var b=o!==t,U=o===null,F=o===o,J=An(o),ne=l!==t,ue=l===null,fe=l===l,we=An(l);if(!ue&&!we&&!J&&o>l||J&&ne&&fe&&!ue&&!we||U&&ne&&fe||!b&&fe||!F)return 1;if(!U&&!J&&!we&&o=ue)return fe;var we=b[U];return fe*(we=="desc"?-1:1)}}return o.index-l.index}function O0(o,l,b,U){for(var F=-1,J=o.length,ne=b.length,ue=-1,fe=l.length,we=re(J-ne,0),Se=ye(fe+we),ke=!U;++ue1?b[F-1]:t,ne=F>2?b[2]:t;for(J=o.length>3&&typeof J=="function"?(F--,J):t,ne&&en(b[0],b[1],ne)&&(J=F<3?t:J,F=1),l=yt(l);++U-1?F[J?l[ne]:ne]:t}}function U0(o){return Qi(function(l){var b=l.length,U=b,F=Hr.prototype.thru;for(o&&l.reverse();U--;){var J=l[U];if(typeof J!="function")throw new Br(u);if(F&&!ne&&kl(J)=="wrapper")var ne=new Hr([],!0)}for(U=ne?U:b;++U1&>.reverse(),Se&&feue))return!1;var we=J.get(o),Se=J.get(l);if(we&&Se)return we==l&&Se==o;var ke=-1,De=!0,Ve=b&v?new aa:t;for(J.set(o,l),J.set(l,o);++ke1?"& ":"")+l[U],l=l.join(b>2?", ":" "),o.replace(rr,`{ + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,c="secret must be a string or buffer",a="key must be a string or a buffer",d="key must be a string, a buffer or an object",f=typeof i.createPublicKey=="function";f&&(a+=" or a KeyObject",c+="or a KeyObject");function g(E){if(!r.isBuffer(E)&&typeof E!="string"&&(!f||typeof E!="object"||typeof E.type!="string"||typeof E.asymmetricKeyType!="string"||typeof E.export!="function"))throw O(a)}function I(E){if(!r.isBuffer(E)&&typeof E!="string"&&typeof E!="object")throw O(d)}function C(E){if(!r.isBuffer(E)){if(typeof E=="string")return E;if(!f||typeof E!="object"||E.type!=="secret"||typeof E.export!="function")throw O(c)}}function v(E){return E.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function T(E){E=E.toString();var B=4-E.length%4;if(B!==4)for(var j=0;j{var t=require("buffer").Buffer;n.exports=function(r){return typeof r=="string"?r:typeof r=="number"||t.isBuffer(r)?r.toString():JSON.stringify(r)}}),O3=Ae((e,n)=>{var t=Du().Buffer,r=fv(),i=dv(),s=require("stream"),u=pv(),h=require("util");function c(g,I){return t.from(g,I).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function a(g,I,C){C=C||"utf8";var v=c(u(g),"binary"),T=c(u(I),C);return h.format("%s.%s",v,T)}function d(g){var I=g.header,C=g.payload,v=g.secret||g.privateKey,T=g.encoding,O=i(I.alg),k=a(I,C,T),y=O.sign(k,v);return h.format("%s.%s",k,y)}function f(g){var I=g.secret||g.privateKey||g.key,C=new r(I);this.readable=!0,this.header=g.header,this.encoding=g.encoding,this.secret=this.privateKey=this.key=C,this.payload=new r(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))}h.inherits(f,s),f.prototype.sign=function(){try{var g=d({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")}},f.sign=d,n.exports=f}),P3=Ae((e,n)=>{var t=Du().Buffer,r=fv(),i=dv(),s=require("stream"),u=pv(),h=require("util"),c=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function a(y){return Object.prototype.toString.call(y)==="[object Object]"}function d(y){if(a(y))return y;try{return JSON.parse(y)}catch{return}}function f(y){var R=y.split(".",1)[0];return d(t.from(R,"base64").toString("binary"))}function g(y){return y.split(".",2).join(".")}function I(y){return y.split(".")[2]}function C(y,R){R=R||"utf8";var w=y.split(".")[1];return t.from(w,"base64").toString(R)}function v(y){return c.test(y)&&!!f(y)}function T(y,R,w){if(!R){var L=new Error("Missing algorithm parameter for jws.verify");throw L.code="MISSING_ALGORITHM",L}y=u(y);var D=I(y),S=g(y),m=i(R);return m.verify(S,D,w)}function O(y,R){if(R=R||{},y=u(y),!v(y))return null;var w=f(y);if(!w)return null;var L=C(y);return(w.typ==="JWT"||R.json)&&(L=JSON.parse(L,R.encoding)),{header:w,payload:L,signature:I(y)}}function k(y){y=y||{};var R=y.secret||y.publicKey||y.key,w=new r(R);this.readable=!0,this.algorithm=y.algorithm,this.encoding=y.encoding,this.secret=this.publicKey=this.key=w,this.signature=new r(y.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))}h.inherits(k,s),k.prototype.verify=function(){try{var y=T(this.signature.buffer,this.algorithm,this.key.buffer),R=O(this.signature.buffer,this.encoding);return this.emit("done",y,R),this.emit("data",y),this.emit("end"),this.readable=!1,y}catch(w){this.readable=!1,this.emit("error",w),this.emit("close")}},k.decode=O,k.isValid=v,k.verify=T,n.exports=k}),sp=Ae(e=>{var n=O3(),t=P3(),r=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.ALGORITHMS=r,e.sign=n.sign,e.verify=t.verify,e.decode=t.decode,e.isValid=t.isValid,e.createSign=function(i){return new n(i)},e.createVerify=function(i){return new t(i)}}),yv=Ae((e,n)=>{var t=sp();n.exports=function(r,i){i=i||{};var s=t.decode(r,i);if(!s)return null;var u=s.payload;if(typeof u=="string")try{var h=JSON.parse(u);h!==null&&typeof h=="object"&&(u=h)}catch{}return i.complete===!0?{header:s.header,payload:u,signature:s.signature}:u}}),B3=Ae((e,n)=>{var t=1e3,r=t*60,i=r*60,s=i*24,u=s*7,h=s*365.25;n.exports=function(g,I){I=I||{};var C=typeof g;if(C==="string"&&g.length>0)return c(g);if(C==="number"&&isFinite(g))return I.long?d(g):a(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function c(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 C=parseFloat(I[1]),v=(I[2]||"ms").toLowerCase();switch(v){case"years":case"year":case"yrs":case"yr":case"y":return C*h;case"weeks":case"week":case"w":return C*u;case"days":case"day":case"d":return C*s;case"hours":case"hour":case"hrs":case"hr":case"h":return C*i;case"minutes":case"minute":case"mins":case"min":case"m":return C*r;case"seconds":case"second":case"secs":case"sec":case"s":return C*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return C;default:return}}}}function a(g){var I=Math.abs(g);return I>=s?Math.round(g/s)+"d":I>=i?Math.round(g/i)+"h":I>=r?Math.round(g/r)+"m":I>=t?Math.round(g/t)+"s":g+"ms"}function d(g){var I=Math.abs(g);return I>=s?f(g,I,s,"day"):I>=i?f(g,I,i,"hour"):I>=r?f(g,I,r,"minute"):I>=t?f(g,I,t,"second"):g+" ms"}function f(g,I,C,v){var T=I>=C*1.5;return Math.round(g/C)+" "+v+(T?"s":"")}}),gv=Ae((e,n)=>{var t=B3();n.exports=function(r,i){var s=i||Math.floor(Date.now()/1e3);if(typeof r=="string"){var u=t(r);return typeof u>"u"?void 0:Math.floor(s+u/1e3)}else return typeof r=="number"?s+r:void 0}}),$c=Ae((e,n)=>{var t="2.0.0",r=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=["major","premajor","minor","preminor","patch","prepatch","prerelease"];n.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),zc=Ae((e,n)=>{var t=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};n.exports=t}),ju=Ae((e,n)=>{var{MAX_SAFE_COMPONENT_LENGTH:t}=$c(),r=zc();e=n.exports={};var i=e.re=[],s=e.src=[],u=e.t={},h=0,c=(a,d,f)=>{let g=h++;r(a,g,d),u[a]=g,s[g]=d,i[g]=new RegExp(d,f?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${s[u.NUMERICIDENTIFIER]})\\.(${s[u.NUMERICIDENTIFIER]})\\.(${s[u.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${s[u.NUMERICIDENTIFIERLOOSE]})\\.(${s[u.NUMERICIDENTIFIERLOOSE]})\\.(${s[u.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${s[u.NUMERICIDENTIFIER]}|${s[u.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${s[u.NUMERICIDENTIFIERLOOSE]}|${s[u.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${s[u.PRERELEASEIDENTIFIER]}(?:\\.${s[u.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${s[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[u.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${s[u.BUILDIDENTIFIER]}(?:\\.${s[u.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${s[u.MAINVERSION]}${s[u.PRERELEASE]}?${s[u.BUILD]}?`),c("FULL",`^${s[u.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${s[u.MAINVERSIONLOOSE]}${s[u.PRERELEASELOOSE]}?${s[u.BUILD]}?`),c("LOOSE",`^${s[u.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${s[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${s[u.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${s[u.XRANGEIDENTIFIER]})(?:\\.(${s[u.XRANGEIDENTIFIER]})(?:\\.(${s[u.XRANGEIDENTIFIER]})(?:${s[u.PRERELEASE]})?${s[u.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${s[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[u.XRANGEIDENTIFIERLOOSE]})(?:${s[u.PRERELEASELOOSE]})?${s[u.BUILD]}?)?)?`),c("XRANGE",`^${s[u.GTLT]}\\s*${s[u.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${s[u.GTLT]}\\s*${s[u.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`),c("COERCERTL",s[u.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${s[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",c("TILDE",`^${s[u.LONETILDE]}${s[u.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${s[u.LONETILDE]}${s[u.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${s[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",c("CARET",`^${s[u.LONECARET]}${s[u.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${s[u.LONECARET]}${s[u.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${s[u.GTLT]}\\s*(${s[u.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${s[u.GTLT]}\\s*(${s[u.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${s[u.GTLT]}\\s*(${s[u.LOOSEPLAIN]}|${s[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${s[u.XRANGEPLAIN]})\\s+-\\s+(${s[u.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${s[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[u.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}),up=Ae((e,n)=>{var t=Object.freeze({loose:!0}),r=Object.freeze({}),i=s=>s?typeof s!="object"?t:s:r;n.exports=i}),mv=Ae((e,n)=>{var t=/^[0-9]+$/,r=(s,u)=>{let h=t.test(s),c=t.test(u);return h&&c&&(s=+s,u=+u),s===u?0:h&&!c?-1:c&&!h?1:sr(u,s);n.exports={compareIdentifiers:r,rcompareIdentifiers:i}}),an=Ae((e,n)=>{var t=zc(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=$c(),{re:s,t:u}=ju(),h=up(),{compareIdentifiers:c}=mv(),a=class{constructor(d,f){if(f=h(f),d instanceof a){if(d.loose===!!f.loose&&d.includePrerelease===!!f.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>r)throw new TypeError(`version is longer than ${r} characters`);t("SemVer",d,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;let g=d.trim().match(f.loose?s[u.LOOSE]:s[u.FULL]);if(!g)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+g[1],this.minor=+g[2],this.patch=+g[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");g[4]?this.prerelease=g[4].split(".").map(I=>{if(/^[0-9]+$/.test(I)){let C=+I;if(C>=0&&C=0;)typeof this.prerelease[C]=="number"&&(this.prerelease[C]++,C=-2);if(C===-1){if(f===this.prerelease.join(".")&&g===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(I)}}if(f){let C=[f,I];g===!1&&(C=[f]),c(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=C):this.prerelease=C}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.format(),this.raw=this.version,this}};n.exports=a}),Rs=Ae((e,n)=>{var t=an(),r=(i,s,u=!1)=>{if(i instanceof t)return i;try{return new t(i,s)}catch(h){if(!u)return null;throw h}};n.exports=r}),L3=Ae((e,n)=>{var t=Rs(),r=(i,s)=>{let u=t(i,s);return u?u.version:null};n.exports=r}),N3=Ae((e,n)=>{var t=Rs(),r=(i,s)=>{let u=t(i.trim().replace(/^[=v]+/,""),s);return u?u.version:null};n.exports=r}),x3=Ae((e,n)=>{var t=an(),r=(i,s,u,h,c)=>{typeof u=="string"&&(c=h,h=u,u=void 0);try{return new t(i instanceof t?i.version:i,u).inc(s,h,c).version}catch{return null}};n.exports=r}),U3=Ae((e,n)=>{var t=Rs(),r=(i,s)=>{let u=t(i,null,!0),h=t(s,null,!0),c=u.compare(h);if(c===0)return null;let a=c>0,d=a?u:h,f=a?h:u,g=!!d.prerelease.length,I=g?"pre":"";return u.major!==h.major?I+"major":u.minor!==h.minor?I+"minor":u.patch!==h.patch?I+"patch":g?"prerelease":f.patch?"patch":f.minor?"minor":"major"};n.exports=r}),D3=Ae((e,n)=>{var t=an(),r=(i,s)=>new t(i,s).major;n.exports=r}),j3=Ae((e,n)=>{var t=an(),r=(i,s)=>new t(i,s).minor;n.exports=r}),q3=Ae((e,n)=>{var t=an(),r=(i,s)=>new t(i,s).patch;n.exports=r}),M3=Ae((e,n)=>{var t=Rs(),r=(i,s)=>{let u=t(i,s);return u&&u.prerelease.length?u.prerelease:null};n.exports=r}),oi=Ae((e,n)=>{var t=an(),r=(i,s,u)=>new t(i,u).compare(new t(s,u));n.exports=r}),V3=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(s,i,u);n.exports=r}),F3=Ae((e,n)=>{var t=oi(),r=(i,s)=>t(i,s,!0);n.exports=r}),lp=Ae((e,n)=>{var t=an(),r=(i,s,u)=>{let h=new t(i,u),c=new t(s,u);return h.compare(c)||h.compareBuild(c)};n.exports=r}),$3=Ae((e,n)=>{var t=lp(),r=(i,s)=>i.sort((u,h)=>t(u,h,s));n.exports=r}),z3=Ae((e,n)=>{var t=lp(),r=(i,s)=>i.sort((u,h)=>t(h,u,s));n.exports=r}),Hc=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)>0;n.exports=r}),cp=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)<0;n.exports=r}),vv=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)===0;n.exports=r}),bv=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)!==0;n.exports=r}),hp=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)>=0;n.exports=r}),fp=Ae((e,n)=>{var t=oi(),r=(i,s,u)=>t(i,s,u)<=0;n.exports=r}),_v=Ae((e,n)=>{var t=vv(),r=bv(),i=Hc(),s=hp(),u=cp(),h=fp(),c=(a,d,f,g)=>{switch(d){case"===":return typeof a=="object"&&(a=a.version),typeof f=="object"&&(f=f.version),a===f;case"!==":return typeof a=="object"&&(a=a.version),typeof f=="object"&&(f=f.version),a!==f;case"":case"=":case"==":return t(a,f,g);case"!=":return r(a,f,g);case">":return i(a,f,g);case">=":return s(a,f,g);case"<":return u(a,f,g);case"<=":return h(a,f,g);default:throw new TypeError(`Invalid operator: ${d}`)}};n.exports=c}),H3=Ae((e,n)=>{var t=an(),r=Rs(),{re:i,t:s}=ju(),u=(h,c)=>{if(h instanceof t)return h;if(typeof h=="number"&&(h=String(h)),typeof h!="string")return null;c=c||{};let a=null;if(!c.rtl)a=h.match(i[s.COERCE]);else{let d;for(;(d=i[s.COERCERTL].exec(h))&&(!a||a.index+a[0].length!==h.length);)(!a||d.index+d[0].length!==a.index+a[0].length)&&(a=d),i[s.COERCERTL].lastIndex=d.index+d[1].length+d[2].length;i[s.COERCERTL].lastIndex=-1}return a===null?null:r(`${a[2]}.${a[3]||"0"}.${a[4]||"0"}`,c)};n.exports=u}),K3=Ae((e,n)=>{"use strict";n.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let r=this.head;r;r=r.next)yield r.value}}}),W3=Ae((e,n)=>{"use strict";n.exports=t,t.Node=u,t.create=t;function t(h){var c=this;if(c instanceof t||(c=new t),c.tail=null,c.head=null,c.length=0,h&&typeof h.forEach=="function")h.forEach(function(f){c.push(f)});else if(arguments.length>0)for(var a=0,d=arguments.length;a1)a=c;else if(this.head)d=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=0;d!==null;f++)a=h(a,d.value,f),d=d.next;return a},t.prototype.reduceReverse=function(h,c){var a,d=this.tail;if(arguments.length>1)a=c;else if(this.tail)d=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=this.length-1;d!==null;f--)a=h(a,d.value,f),d=d.prev;return a},t.prototype.toArray=function(){for(var h=new Array(this.length),c=0,a=this.head;a!==null;c++)h[c]=a.value,a=a.next;return h},t.prototype.toArrayReverse=function(){for(var h=new Array(this.length),c=0,a=this.tail;a!==null;c++)h[c]=a.value,a=a.prev;return h},t.prototype.slice=function(h,c){c=c||this.length,c<0&&(c+=this.length),h=h||0,h<0&&(h+=this.length);var a=new t;if(cthis.length&&(c=this.length);for(var d=0,f=this.head;f!==null&&dthis.length&&(c=this.length);for(var d=this.length,f=this.tail;f!==null&&d>c;d--)f=f.prev;for(;f!==null&&d>h;d--,f=f.prev)a.push(f.value);return a},t.prototype.splice=function(h,c,...a){h>this.length&&(h=this.length-1),h<0&&(h=this.length+h);for(var d=0,f=this.head;f!==null&&d{"use strict";var t=W3(),r=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),u=Symbol("allowStale"),h=Symbol("maxAge"),c=Symbol("dispose"),a=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),g=Symbol("updateAgeOnGet"),I=()=>1,C=class{constructor(w){if(typeof w=="number"&&(w={max:w}),w||(w={}),w.max&&(typeof w.max!="number"||w.max<0))throw new TypeError("max must be a non-negative number");let L=this[r]=w.max||1/0,D=w.length||I;if(this[s]=typeof D!="function"?I:D,this[u]=w.stale||!1,w.maxAge&&typeof w.maxAge!="number")throw new TypeError("maxAge must be a number");this[h]=w.maxAge||0,this[c]=w.dispose,this[a]=w.noDisposeOnSet||!1,this[g]=w.updateAgeOnGet||!1,this.reset()}set max(w){if(typeof w!="number"||w<0)throw new TypeError("max must be a non-negative number");this[r]=w||1/0,O(this)}get max(){return this[r]}set allowStale(w){this[u]=!!w}get allowStale(){return this[u]}set maxAge(w){if(typeof w!="number")throw new TypeError("maxAge must be a non-negative number");this[h]=w,O(this)}get maxAge(){return this[h]}set lengthCalculator(w){typeof w!="function"&&(w=I),w!==this[s]&&(this[s]=w,this[i]=0,this[d].forEach(L=>{L.length=this[s](L.value,L.key),this[i]+=L.length})),O(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(w,L){L=L||this;for(let D=this[d].tail;D!==null;){let S=D.prev;R(this,w,D,L),D=S}}forEach(w,L){L=L||this;for(let D=this[d].head;D!==null;){let S=D.next;R(this,w,D,L),D=S}}keys(){return this[d].toArray().map(w=>w.key)}values(){return this[d].toArray().map(w=>w.value)}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach(w=>this[c](w.key,w.value)),this[f]=new Map,this[d]=new t,this[i]=0}dump(){return this[d].map(w=>T(this,w)?!1:{k:w.key,v:w.value,e:w.now+(w.maxAge||0)}).toArray().filter(w=>w)}dumpLru(){return this[d]}set(w,L,D){if(D=D||this[h],D&&typeof D!="number")throw new TypeError("maxAge must be a number");let S=D?Date.now():0,m=this[s](L,w);if(this[f].has(w)){if(m>this[r])return k(this,this[f].get(w)),!1;let q=this[f].get(w).value;return this[c]&&(this[a]||this[c](w,q.value)),q.now=S,q.maxAge=D,q.value=L,this[i]+=m-q.length,q.length=m,this.get(w),O(this),!0}let p=new y(w,L,m,S,D);return p.length>this[r]?(this[c]&&this[c](w,L),!1):(this[i]+=p.length,this[d].unshift(p),this[f].set(w,this[d].head),O(this),!0)}has(w){if(!this[f].has(w))return!1;let L=this[f].get(w).value;return!T(this,L)}get(w){return v(this,w,!0)}peek(w){return v(this,w,!1)}pop(){let w=this[d].tail;return w?(k(this,w),w.value):null}del(w){k(this,this[f].get(w))}load(w){this.reset();let L=Date.now();for(let D=w.length-1;D>=0;D--){let S=w[D],m=S.e||0;if(m===0)this.set(S.k,S.v);else{let p=m-L;p>0&&this.set(S.k,S.v,p)}}}prune(){this[f].forEach((w,L)=>v(this,L,!1))}},v=(w,L,D)=>{let S=w[f].get(L);if(S){let m=S.value;if(T(w,m)){if(k(w,S),!w[u])return}else D&&(w[g]&&(S.value.now=Date.now()),w[d].unshiftNode(S));return m.value}},T=(w,L)=>{if(!L||!L.maxAge&&!w[h])return!1;let D=Date.now()-L.now;return L.maxAge?D>L.maxAge:w[h]&&D>w[h]},O=w=>{if(w[i]>w[r])for(let L=w[d].tail;w[i]>w[r]&&L!==null;){let D=L.prev;k(w,L),L=D}},k=(w,L)=>{if(L){let D=L.value;w[c]&&w[c](D.key,D.value),w[i]-=D.length,w[f].delete(D.key),w[d].removeNode(L)}},y=class{constructor(w,L,D,S,m){this.key=w,this.value=L,this.length=D,this.now=S,this.maxAge=m||0}},R=(w,L,D,S)=>{let m=D.value;T(w,m)&&(k(w,D),w[u]||(m=void 0)),m&&L.call(S,m.value,m.key,w)};n.exports=C}),ai=Ae((e,n)=>{var t=class{constructor(B,j){if(j=s(j),B instanceof t)return B.loose===!!j.loose&&B.includePrerelease===!!j.includePrerelease?B:new t(B.raw,j);if(B instanceof u)return this.raw=B.value,this.set=[[B]],this.format(),this;if(this.options=j,this.loose=!!j.loose,this.includePrerelease=!!j.includePrerelease,this.raw=B,this.set=B.split("||").map(N=>this.parseRange(N.trim())).filter(N=>N.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${B}`);if(this.set.length>1){let N=this.set[0];if(this.set=this.set.filter(M=>!T(M[0])),this.set.length===0)this.set=[N];else if(this.set.length>1){for(let M of this.set)if(M.length===1&&O(M[0])){this.set=[M];break}}}this.format()}format(){return this.range=this.set.map(B=>B.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(B){B=B.trim();let j=((this.options.includePrerelease&&C)|(this.options.loose&&v))+":"+B,N=i.get(j);if(N)return N;let M=this.options.loose,ee=M?a[d.HYPHENRANGELOOSE]:a[d.HYPHENRANGE];B=B.replace(ee,$(this.options.includePrerelease)),h("hyphen replace",B),B=B.replace(a[d.COMPARATORTRIM],f),h("comparator trim",B),B=B.replace(a[d.TILDETRIM],g),B=B.replace(a[d.CARETTRIM],I),B=B.split(/\s+/).join(" ");let oe=B.split(" ").map(Re=>y(Re,this.options)).join(" ").split(/\s+/).map(Re=>V(Re,this.options));M&&(oe=oe.filter(Re=>(h("loose invalid filter",Re,this.options),!!Re.match(a[d.COMPARATORLOOSE])))),h("range list",oe);let ae=new Map,pe=oe.map(Re=>new u(Re,this.options));for(let Re of pe){if(T(Re))return[Re];ae.set(Re.value,Re)}ae.size>1&&ae.has("")&&ae.delete("");let _e=[...ae.values()];return i.set(j,_e),_e}intersects(B,j){if(!(B instanceof t))throw new TypeError("a Range is required");return this.set.some(N=>k(N,j)&&B.set.some(M=>k(M,j)&&N.every(ee=>M.every(oe=>ee.intersects(oe,j)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new c(B,this.options)}catch{return!1}for(let j=0;jB.value==="<0.0.0-0",O=B=>B.value==="",k=(B,j)=>{let N=!0,M=B.slice(),ee=M.pop();for(;N&&M.length;)N=M.every(oe=>ee.intersects(oe,j)),ee=M.pop();return N},y=(B,j)=>(h("comp",B,j),B=D(B,j),h("caret",B),B=w(B,j),h("tildes",B),B=m(B,j),h("xrange",B),B=q(B,j),h("stars",B),B),R=B=>!B||B.toLowerCase()==="x"||B==="*",w=(B,j)=>B.trim().split(/\s+/).map(N=>L(N,j)).join(" "),L=(B,j)=>{let N=j.loose?a[d.TILDELOOSE]:a[d.TILDE];return B.replace(N,(M,ee,oe,ae,pe)=>{h("tilde",B,M,ee,oe,ae,pe);let _e;return R(ee)?_e="":R(oe)?_e=`>=${ee}.0.0 <${+ee+1}.0.0-0`:R(ae)?_e=`>=${ee}.${oe}.0 <${ee}.${+oe+1}.0-0`:pe?(h("replaceTilde pr",pe),_e=`>=${ee}.${oe}.${ae}-${pe} <${ee}.${+oe+1}.0-0`):_e=`>=${ee}.${oe}.${ae} <${ee}.${+oe+1}.0-0`,h("tilde return",_e),_e})},D=(B,j)=>B.trim().split(/\s+/).map(N=>S(N,j)).join(" "),S=(B,j)=>{h("caret",B,j);let N=j.loose?a[d.CARETLOOSE]:a[d.CARET],M=j.includePrerelease?"-0":"";return B.replace(N,(ee,oe,ae,pe,_e)=>{h("caret",B,ee,oe,ae,pe,_e);let Re;return R(oe)?Re="":R(ae)?Re=`>=${oe}.0.0${M} <${+oe+1}.0.0-0`:R(pe)?oe==="0"?Re=`>=${oe}.${ae}.0${M} <${oe}.${+ae+1}.0-0`:Re=`>=${oe}.${ae}.0${M} <${+oe+1}.0.0-0`:_e?(h("replaceCaret pr",_e),oe==="0"?ae==="0"?Re=`>=${oe}.${ae}.${pe}-${_e} <${oe}.${ae}.${+pe+1}-0`:Re=`>=${oe}.${ae}.${pe}-${_e} <${oe}.${+ae+1}.0-0`:Re=`>=${oe}.${ae}.${pe}-${_e} <${+oe+1}.0.0-0`):(h("no pr"),oe==="0"?ae==="0"?Re=`>=${oe}.${ae}.${pe}${M} <${oe}.${ae}.${+pe+1}-0`:Re=`>=${oe}.${ae}.${pe}${M} <${oe}.${+ae+1}.0-0`:Re=`>=${oe}.${ae}.${pe} <${+oe+1}.0.0-0`),h("caret return",Re),Re})},m=(B,j)=>(h("replaceXRanges",B,j),B.split(/\s+/).map(N=>p(N,j)).join(" ")),p=(B,j)=>{B=B.trim();let N=j.loose?a[d.XRANGELOOSE]:a[d.XRANGE];return B.replace(N,(M,ee,oe,ae,pe,_e)=>{h("xRange",B,M,ee,oe,ae,pe,_e);let Re=R(oe),qe=Re||R(ae),Ce=qe||R(pe),$e=Ce;return ee==="="&&$e&&(ee=""),_e=j.includePrerelease?"-0":"",Re?ee===">"||ee==="<"?M="<0.0.0-0":M="*":ee&&$e?(qe&&(ae=0),pe=0,ee===">"?(ee=">=",qe?(oe=+oe+1,ae=0,pe=0):(ae=+ae+1,pe=0)):ee==="<="&&(ee="<",qe?oe=+oe+1:ae=+ae+1),ee==="<"&&(_e="-0"),M=`${ee+oe}.${ae}.${pe}${_e}`):qe?M=`>=${oe}.0.0${_e} <${+oe+1}.0.0-0`:Ce&&(M=`>=${oe}.${ae}.0${_e} <${oe}.${+ae+1}.0-0`),h("xRange return",M),M})},q=(B,j)=>(h("replaceStars",B,j),B.trim().replace(a[d.STAR],"")),V=(B,j)=>(h("replaceGTE0",B,j),B.trim().replace(a[j.includePrerelease?d.GTE0PRE:d.GTE0],"")),$=B=>(j,N,M,ee,oe,ae,pe,_e,Re,qe,Ce,$e,Ie)=>(R(M)?N="":R(ee)?N=`>=${M}.0.0${B?"-0":""}`:R(oe)?N=`>=${M}.${ee}.0${B?"-0":""}`:ae?N=`>=${N}`:N=`>=${N}${B?"-0":""}`,R(Re)?_e="":R(qe)?_e=`<${+Re+1}.0.0-0`:R(Ce)?_e=`<${Re}.${+qe+1}.0-0`:$e?_e=`<=${Re}.${qe}.${Ce}-${$e}`:B?_e=`<${Re}.${qe}.${+Ce+1}-0`:_e=`<=${_e}`,`${N} ${_e}`.trim()),E=(B,j,N)=>{for(let M=0;M0){let ee=B[M].semver;if(ee.major===j.major&&ee.minor===j.minor&&ee.patch===j.patch)return!0}return!1}return!0}}),Kc=Ae((e,n)=>{var t=Symbol("SemVer ANY"),r=class{static get ANY(){return t}constructor(f,g){if(g=i(g),f instanceof r){if(f.loose===!!g.loose)return f;f=f.value}c("comparator",f,g),this.options=g,this.loose=!!g.loose,this.parse(f),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(f){let g=this.options.loose?s[u.COMPARATORLOOSE]:s[u.COMPARATOR],I=f.match(g);if(!I)throw new TypeError(`Invalid comparator: ${f}`);this.operator=I[1]!==void 0?I[1]:"",this.operator==="="&&(this.operator=""),I[2]?this.semver=new a(I[2],this.options.loose):this.semver=t}toString(){return this.value}test(f){if(c("Comparator.test",f,this.options.loose),this.semver===t||f===t)return!0;if(typeof f=="string")try{f=new a(f,this.options)}catch{return!1}return h(f,this.operator,this.semver,this.options)}intersects(f,g){if(!(f instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(f.value,g).test(this.value):f.operator===""?f.value===""?!0:new d(this.value,g).test(f.semver):(g=i(g),g.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||h(this.semver,"<",f.semver,g)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||h(this.semver,">",f.semver,g)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}};n.exports=r;var i=up(),{re:s,t:u}=ju(),h=_v(),c=zc(),a=an(),d=ai()}),Wc=Ae((e,n)=>{var t=ai(),r=(i,s,u)=>{try{s=new t(s,u)}catch{return!1}return s.test(i)};n.exports=r}),Q3=Ae((e,n)=>{var t=ai(),r=(i,s)=>new t(i,s).set.map(u=>u.map(h=>h.value).join(" ").trim().split(" "));n.exports=r}),Y3=Ae((e,n)=>{var t=an(),r=ai(),i=(s,u,h)=>{let c=null,a=null,d=null;try{d=new r(u,h)}catch{return null}return s.forEach(f=>{d.test(f)&&(!c||a.compare(f)===-1)&&(c=f,a=new t(c,h))}),c};n.exports=i}),X3=Ae((e,n)=>{var t=an(),r=ai(),i=(s,u,h)=>{let c=null,a=null,d=null;try{d=new r(u,h)}catch{return null}return s.forEach(f=>{d.test(f)&&(!c||a.compare(f)===1)&&(c=f,a=new t(c,h))}),c};n.exports=i}),J3=Ae((e,n)=>{var t=an(),r=ai(),i=Hc(),s=(u,h)=>{u=new r(u,h);let c=new t("0.0.0");if(u.test(c)||(c=new t("0.0.0-0"),u.test(c)))return c;c=null;for(let a=0;a{let I=new t(g.semver.version);switch(g.operator){case">":I.prerelease.length===0?I.patch++:I.prerelease.push(0),I.raw=I.format();case"":case">=":(!f||i(I,f))&&(f=I);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${g.operator}`)}}),f&&(!c||i(c,f))&&(c=f)}return c&&u.test(c)?c:null};n.exports=s}),Z3=Ae((e,n)=>{var t=ai(),r=(i,s)=>{try{return new t(i,s).range||"*"}catch{return null}};n.exports=r}),dp=Ae((e,n)=>{var t=an(),r=Kc(),{ANY:i}=r,s=ai(),u=Wc(),h=Hc(),c=cp(),a=fp(),d=hp(),f=(g,I,C,v)=>{g=new t(g,v),I=new s(I,v);let T,O,k,y,R;switch(C){case">":T=h,O=a,k=c,y=">",R=">=";break;case"<":T=c,O=d,k=h,y="<",R="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(g,I,v))return!1;for(let w=0;w{m.semver===i&&(m=new r(">=0.0.0")),D=D||m,S=S||m,T(m.semver,D.semver,v)?D=m:k(m.semver,S.semver,v)&&(S=m)}),D.operator===y||D.operator===R||(!S.operator||S.operator===y)&&O(g,S.semver)||S.operator===R&&k(g,S.semver))return!1}return!0};n.exports=f}),e6=Ae((e,n)=>{var t=dp(),r=(i,s,u)=>t(i,s,">",u);n.exports=r}),t6=Ae((e,n)=>{var t=dp(),r=(i,s,u)=>t(i,s,"<",u);n.exports=r}),r6=Ae((e,n)=>{var t=ai(),r=(i,s,u)=>(i=new t(i,u),s=new t(s,u),i.intersects(s,u));n.exports=r}),n6=Ae((e,n)=>{var t=Wc(),r=oi();n.exports=(i,s,u)=>{let h=[],c=null,a=null,d=i.sort((C,v)=>r(C,v,u));for(let C of d)t(C,s,u)?(a=C,c||(c=C)):(a&&h.push([c,a]),a=null,c=null);c&&h.push([c,null]);let f=[];for(let[C,v]of h)C===v?f.push(C):!v&&C===d[0]?f.push("*"):v?C===d[0]?f.push(`<=${v}`):f.push(`${C} - ${v}`):f.push(`>=${C}`);let g=f.join(" || "),I=typeof s.raw=="string"?s.raw:String(s);return g.length{var t=ai(),r=Kc(),{ANY:i}=r,s=Wc(),u=oi(),h=(I,C,v={})=>{if(I===C)return!0;I=new t(I,v),C=new t(C,v);let T=!1;e:for(let O of I.set){for(let k of C.set){let y=d(O,k,v);if(T=T||y!==null,y)continue e}if(T)return!1}return!0},c=[new r(">=0.0.0-0")],a=[new r(">=0.0.0")],d=(I,C,v)=>{if(I===C)return!0;if(I.length===1&&I[0].semver===i){if(C.length===1&&C[0].semver===i)return!0;v.includePrerelease?I=c:I=a}if(C.length===1&&C[0].semver===i){if(v.includePrerelease)return!0;C=a}let T=new Set,O,k;for(let p of I)p.operator===">"||p.operator===">="?O=f(O,p,v):p.operator==="<"||p.operator==="<="?k=g(k,p,v):T.add(p.semver);if(T.size>1)return null;let y;if(O&&k&&(y=u(O.semver,k.semver,v),y>0||y===0&&(O.operator!==">="||k.operator!=="<=")))return null;for(let p of T){if(O&&!s(p,String(O),v)||k&&!s(p,String(k),v))return null;for(let q of C)if(!s(p,String(q),v))return!1;return!0}let R,w,L,D,S=k&&!v.includePrerelease&&k.semver.prerelease.length?k.semver:!1,m=O&&!v.includePrerelease&&O.semver.prerelease.length?O.semver:!1;S&&S.prerelease.length===1&&k.operator==="<"&&S.prerelease[0]===0&&(S=!1);for(let p of C){if(D=D||p.operator===">"||p.operator===">=",L=L||p.operator==="<"||p.operator==="<=",O){if(m&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===m.major&&p.semver.minor===m.minor&&p.semver.patch===m.patch&&(m=!1),p.operator===">"||p.operator===">="){if(R=f(O,p,v),R===p&&R!==O)return!1}else if(O.operator===">="&&!s(O.semver,String(p),v))return!1}if(k){if(S&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===S.major&&p.semver.minor===S.minor&&p.semver.patch===S.patch&&(S=!1),p.operator==="<"||p.operator==="<="){if(w=g(k,p,v),w===p&&w!==k)return!1}else if(k.operator==="<="&&!s(k.semver,String(p),v))return!1}if(!p.operator&&(k||O)&&y!==0)return!1}return!(O&&L&&!k&&y!==0||k&&D&&!O&&y!==0||m||S)},f=(I,C,v)=>{if(!I)return C;let T=u(I.semver,C.semver,v);return T>0?I:T<0||C.operator===">"&&I.operator===">="?C:I},g=(I,C,v)=>{if(!I)return C;let T=u(I.semver,C.semver,v);return T<0?I:T>0||C.operator==="<"&&I.operator==="<="?C:I};n.exports=h}),pp=Ae((e,n)=>{var t=ju(),r=$c(),i=an(),s=mv(),u=Rs(),h=L3(),c=N3(),a=x3(),d=U3(),f=D3(),g=j3(),I=q3(),C=M3(),v=oi(),T=V3(),O=F3(),k=lp(),y=$3(),R=z3(),w=Hc(),L=cp(),D=vv(),S=bv(),m=hp(),p=fp(),q=_v(),V=H3(),$=Kc(),E=ai(),B=Wc(),j=Q3(),N=Y3(),M=X3(),ee=J3(),oe=Z3(),ae=dp(),pe=e6(),_e=t6(),Re=r6(),qe=n6(),Ce=i6();n.exports={parse:u,valid:h,clean:c,inc:a,diff:d,major:f,minor:g,patch:I,prerelease:C,compare:v,rcompare:T,compareLoose:O,compareBuild:k,sort:y,rsort:R,gt:w,lt:L,eq:D,neq:S,gte:m,lte:p,cmp:q,coerce:V,Comparator:$,Range:E,satisfies:B,toComparators:j,maxSatisfying:N,minSatisfying:M,minVersion:ee,validRange:oe,outside:ae,gtr:pe,ltr:_e,intersects:Re,simplifyRange:qe,subset:Ce,SemVer:i,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}}),o6=Ae((e,n)=>{var t=pp();n.exports=t.satisfies(process.version,">=15.7.0")}),a6=Ae((e,n)=>{var t=pp();n.exports=t.satisfies(process.version,">=16.9.0")}),wv=Ae((e,n)=>{var t=o6(),r=a6(),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};n.exports=function(u,h){if(!u||!h)return;let c=h.asymmetricKeyType;if(!c)return;let a=i[c];if(!a)throw new Error(`Unknown key type "${c}".`);if(!a.includes(u))throw new Error(`"alg" parameter for "${c}" key type must be one of: ${a.join(", ")}.`);if(t)switch(c){case"ec":let d=h.asymmetricKeyDetails.namedCurve,f=s[u];if(d!==f)throw new Error(`"alg" parameter "${u}" requires curve "${f}".`);break;case"rsa-pss":if(r){let g=parseInt(u.slice(-3),10),{hashAlgorithm:I,mgf1HashAlgorithm:C,saltLength:v}=h.asymmetricKeyDetails;if(I!==`sha${g}`||C!==I)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${u}.`);if(v!==void 0&&v>g>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${u}.`)}break}}}),Ev=Ae((e,n)=>{var t=pp();n.exports=t.satisfies(process.version,"^6.12.0 || >=8.0.0")}),s6=Ae((e,n)=>{var t=Fc(),r=cv(),i=hv(),s=yv(),u=gv(),h=wv(),c=Ev(),a=sp(),{KeyObject:d,createSecretKey:f,createPublicKey:g}=require("crypto"),I=["RS256","RS384","RS512"],C=["ES256","ES384","ES512"],v=["RS256","RS384","RS512"],T=["HS256","HS384","HS512"];c&&(I.splice(I.length,0,"PS256","PS384","PS512"),v.splice(v.length,0,"PS256","PS384","PS512")),n.exports=function(O,k,y,R){typeof y=="function"&&!R&&(R=y,y={}),y||(y={}),y=Object.assign({},y);let w;if(R?w=R:w=function(q,V){if(q)throw q;return V},y.clockTimestamp&&typeof y.clockTimestamp!="number")return w(new t("clockTimestamp must be a number"));if(y.nonce!==void 0&&(typeof y.nonce!="string"||y.nonce.trim()===""))return w(new t("nonce must be a non-empty string"));if(y.allowInvalidAsymmetricKeyTypes!==void 0&&typeof y.allowInvalidAsymmetricKeyTypes!="boolean")return w(new t("allowInvalidAsymmetricKeyTypes must be a boolean"));let L=y.clockTimestamp||Math.floor(Date.now()/1e3);if(!O)return w(new t("jwt must be provided"));if(typeof O!="string")return w(new t("jwt must be a string"));let D=O.split(".");if(D.length!==3)return w(new t("jwt malformed"));let S;try{S=s(O,{complete:!0})}catch(q){return w(q)}if(!S)return w(new t("invalid token"));let m=S.header,p;if(typeof k=="function"){if(!R)return w(new t("verify must be called asynchronous if secret or public key is provided as a callback"));p=k}else p=function(q,V){return V(null,k)};return p(m,function(q,V){if(q)return w(new t("error in secret or public key callback: "+q.message));let $=D[2].trim()!=="";if(!$&&V)return w(new t("jwt signature is required"));if($&&!V)return w(new t("secret or public key must be provided"));if(!$&&!y.algorithms)return w(new t('please specify "none" in "algorithms" to verify unsigned tokens'));if(V!=null&&!(V instanceof d))try{V=g(V)}catch{try{V=f(typeof V=="string"?Buffer.from(V):V)}catch{return w(new t("secretOrPublicKey is not valid key material"))}}if(y.algorithms||(V.type==="secret"?y.algorithms=T:["rsa","rsa-pss"].includes(V.asymmetricKeyType)?y.algorithms=v:V.asymmetricKeyType==="ec"?y.algorithms=C:y.algorithms=I),y.algorithms.indexOf(S.header.alg)===-1)return w(new t("invalid algorithm"));if(m.alg.startsWith("HS")&&V.type!=="secret")return w(new t(`secretOrPublicKey must be a symmetric key when using ${m.alg}`));if(/^(?:RS|PS|ES)/.test(m.alg)&&V.type!=="public")return w(new t(`secretOrPublicKey must be an asymmetric key when using ${m.alg}`));if(!y.allowInvalidAsymmetricKeyTypes)try{h(m.alg,V)}catch(j){return w(j)}let E;try{E=a.verify(O,S.header.alg,V)}catch(j){return w(j)}if(!E)return w(new t("invalid signature"));let B=S.payload;if(typeof B.nbf<"u"&&!y.ignoreNotBefore){if(typeof B.nbf!="number")return w(new t("invalid nbf value"));if(B.nbf>L+(y.clockTolerance||0))return w(new r("jwt not active",new Date(B.nbf*1e3)))}if(typeof B.exp<"u"&&!y.ignoreExpiration){if(typeof B.exp!="number")return w(new t("invalid exp value"));if(L>=B.exp+(y.clockTolerance||0))return w(new i("jwt expired",new Date(B.exp*1e3)))}if(y.audience){let j=Array.isArray(y.audience)?y.audience:[y.audience];if(!(Array.isArray(B.aud)?B.aud:[B.aud]).some(function(N){return j.some(function(M){return M instanceof RegExp?M.test(N):M===N})}))return w(new t("jwt audience invalid. expected: "+j.join(" or ")))}if(y.issuer&&(typeof y.issuer=="string"&&B.iss!==y.issuer||Array.isArray(y.issuer)&&y.issuer.indexOf(B.iss)===-1))return w(new t("jwt issuer invalid. expected: "+y.issuer));if(y.subject&&B.sub!==y.subject)return w(new t("jwt subject invalid. expected: "+y.subject));if(y.jwtid&&B.jti!==y.jwtid)return w(new t("jwt jwtid invalid. expected: "+y.jwtid));if(y.nonce&&B.nonce!==y.nonce)return w(new t("jwt nonce invalid. expected: "+y.nonce));if(y.maxAge){if(typeof B.iat!="number")return w(new t("iat required when maxAge is specified"));let j=u(y.maxAge,B.iat);if(typeof j>"u")return w(new t('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(L>=j+(y.clockTolerance||0))return w(new i("maxAge exceeded",new Date(j*1e3)))}if(y.complete===!0){let j=S.signature;return w(null,{header:m,payload:B,signature:j})}return w(null,B)})}}),u6=Ae((e,n)=>{(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",h="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",a=500,d="__lodash_placeholder__",f=1,g=2,I=4,C=1,v=2,T=1,O=2,k=4,y=8,R=16,w=32,L=64,D=128,S=256,m=512,p=30,q="...",V=800,$=16,E=1,B=2,j=3,N=1/0,M=9007199254740991,ee=17976931348623157e292,oe=0/0,ae=4294967295,pe=ae-1,_e=ae>>>1,Re=[["ary",D],["bind",T],["bindKey",O],["curry",y],["curryRight",R],["flip",m],["partial",w],["partialRight",L],["rearg",S]],qe="[object Arguments]",Ce="[object Array]",$e="[object AsyncFunction]",Ie="[object Boolean]",et="[object Date]",Je="[object DOMException]",x="[object Error]",X="[object Function]",Q="[object GeneratorFunction]",A="[object Map]",K="[object Number]",se="[object Null]",te="[object Object]",Ee="[object Promise]",xe="[object Proxy]",je="[object RegExp]",ge="[object Set]",Le="[object String]",We="[object Symbol]",rt="[object Undefined]",He="[object WeakMap]",kt="[object WeakSet]",St="[object ArrayBuffer]",Ct="[object DataView]",Bt="[object Float32Array]",Ot="[object Float64Array]",Lt="[object Int8Array]",zt="[object Int16Array]",Xt="[object Int32Array]",Ht="[object Uint8Array]",Kt="[object Uint8ClampedArray]",lr="[object Uint16Array]",Cr="[object Uint32Array]",gr=/\b__p \+= '';/g,qr=/\b(__p \+=) '' \+/g,un=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qr=/&(?:amp|lt|gt|quot|#39);/g,Yr=/[&<>"']/g,_n=RegExp(Qr.source),li=RegExp(Yr.source),Mr=/<%-([\s\S]+?)%>/g,Nn=/<%([\s\S]+?)%>/g,Ut=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jt=/^\w*$/,jt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wt=/[\\^$.*+?()[\]{}|]/g,Zt=RegExp(Wt.source),Gt=/^\s+/,Qt=/\s/,rr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nr=/\{\n\/\* \[wrapped with (.+)\] \*/,ir=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,or=/[()=,{}\[\]\/\s]/,cr=/\\(\\)?/g,$t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tr=/\w*$/,La=/^[-+]0x[0-9a-f]+$/i,fo=/^0b[01]+$/i,Os=/^\[object .+?Constructor\]$/,po=/^0o[0-7]+$/i,Oi=/^(?:0|[1-9]\d*)$/,wn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tr=/($^)/,Ho=/['\n\r\u2028\u2029\\]/g,Pi="\\ud800-\\udfff",yo="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",Na="\\u20d0-\\u20ff",xa=yo+go+Na,Ua="\\u2700-\\u27bf",mo="a-z\\xdf-\\xf6\\xf8-\\xff",br="\\xac\\xb1\\xd7\\xf7",Da="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ja="\\u2000-\\u206f",Ps=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ko="A-Z\\xc0-\\xd6\\xd8-\\xde",z="\\ufe0e\\ufe0f",G=br+Da+ja+Ps,Z="['\u2019]",ce="["+Pi+"]",be="["+G+"]",Te="["+xa+"]",Ne="\\d+",Be="["+Ua+"]",bt="["+mo+"]",ar="[^"+Pi+G+Ne+Ua+mo+Ko+"]",Rr="\\ud83c[\\udffb-\\udfff]",Pr="(?:"+Te+"|"+Rr+")",ln="[^"+Pi+"]",ci="(?:\\ud83c[\\udde6-\\uddff]){2}",Ir="[\\ud800-\\udbff][\\udc00-\\udfff]",mr="["+Ko+"]",Bi="\\u200d",En="(?:"+bt+"|"+ar+")",Gn="(?:"+mr+"|"+ar+")",Bs="(?:"+Z+"(?:d|ll|m|re|s|t|ve))?",Qu="(?:"+Z+"(?:D|LL|M|RE|S|T|VE))?",Ls=Pr+"?",Li="["+z+"]?",vo="(?:"+Bi+"(?:"+[ln,ci,Ir].join("|")+")"+Li+Ls+")*",qa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xu=Li+Ls+vo,Ns="(?:"+[Be,ci,Ir].join("|")+")"+Xu,xs="(?:"+[ln+Te+"?",Te,ci,Ir,ce].join("|")+")",Us=RegExp(Z,"g"),ch=RegExp(Te,"g"),Ds=RegExp(Rr+"(?="+Rr+")|"+xs+Xu,"g"),hh=RegExp([mr+"?"+bt+"+"+Bs+"(?="+[be,mr,"$"].join("|")+")",Gn+"+"+Qu+"(?="+[be,mr+En,"$"].join("|")+")",mr+"?"+En+"+"+Bs,mr+"+"+Qu,Yu,qa,Ne,Ns].join("|"),"g"),fh=RegExp("["+Bi+Pi+xa+z+"]"),xn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ph=-1,Vt={};Vt[Bt]=Vt[Ot]=Vt[Lt]=Vt[zt]=Vt[Xt]=Vt[Ht]=Vt[Kt]=Vt[lr]=Vt[Cr]=!0,Vt[qe]=Vt[Ce]=Vt[St]=Vt[Ie]=Vt[Ct]=Vt[et]=Vt[x]=Vt[X]=Vt[A]=Vt[K]=Vt[te]=Vt[je]=Vt[ge]=Vt[Le]=Vt[He]=!1;var Tt={};Tt[qe]=Tt[Ce]=Tt[St]=Tt[Ct]=Tt[Ie]=Tt[et]=Tt[Bt]=Tt[Ot]=Tt[Lt]=Tt[zt]=Tt[Xt]=Tt[A]=Tt[K]=Tt[te]=Tt[je]=Tt[ge]=Tt[Le]=Tt[We]=Tt[Ht]=Tt[Kt]=Tt[lr]=Tt[Cr]=!0,Tt[x]=Tt[X]=Tt[He]=!1;var js={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Wo={"&":"&","<":"<",">":">",'"':""","'":"'"},Ni={"&":"&","<":"<",">":">",""":'"',"'":"'"},yh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ju=parseFloat,gh=parseInt,Zu=typeof global=="object"&&global&&global.Object===Object&&global,el=typeof self=="object"&&self&&self.Object===Object&&self,vr=Zu||el||Function("return this")(),Ma=typeof e=="object"&&e&&!e.nodeType&&e,hi=Ma&&typeof n=="object"&&n&&!n.nodeType&&n,qs=hi&&hi.exports===Ma,fi=qs&&Zu.process,Vr=function(){try{var he=hi&&hi.require&&hi.require("util").types;return he||fi&&fi.binding&&fi.binding("util")}catch{}}(),Ms=Vr&&Vr.isArrayBuffer,tl=Vr&&Vr.isDate,Go=Vr&&Vr.isMap,rl=Vr&&Vr.isRegExp,nl=Vr&&Vr.isSet,Vs=Vr&&Vr.isTypedArray;function Xr(he,me,ye){switch(ye.length){case 0:return he.call(me);case 1:return he.call(me,ye[0]);case 2:return he.call(me,ye[0],ye[1]);case 3:return he.call(me,ye[0],ye[1],ye[2])}return he.apply(me,ye)}function Va(he,me,ye,Ue){for(var Ke=-1,ht=he==null?0:he.length;++Ke-1}function bo(he,me,ye){for(var Ue=-1,Ke=he==null?0:he.length;++Ue-1;);return ye}function wo(he,me){for(var ye=he.length;ye--&&di(me,he[ye],0)>-1;);return ye}function za(he,me){for(var ye=he.length,Ue=0;ye--;)he[ye]===me&&++Ue;return Ue}var pi=Yo(js),Qs=Yo(Wo);function wh(he){return"\\"+yh[he]}function Eo(he,me){return he==null?t:he[me]}function qi(he){return fh.test(he)}function Eh(he){return xn.test(he)}function Ha(he){for(var me,ye=[];!(me=he.next()).done;)ye.push(me.value);return ye}function Ys(he){var me=-1,ye=Array(he.size);return he.forEach(function(Ue,Ke){ye[++me]=[Ke,Ue]}),ye}function ul(he,me){return function(ye){return he(me(ye))}}function yi(he,me){for(var ye=-1,Ue=he.length,Ke=0,ht=[];++ye-1}function Gb(o,l){var b=this.__data__,U=gl(b,o);return U<0?(++this.size,b.push([o,l])):b[U][1]=l,this}Hi.prototype.clear=zb,Hi.prototype.delete=Hb,Hi.prototype.get=Kb,Hi.prototype.has=Wb,Hi.prototype.set=Gb;function Ki(o){var l=-1,b=o==null?0:o.length;for(this.clear();++l=l?o:l)),o}function qn(o,l,b,U,F,J){var ne,ue=l&f,fe=l&g,we=l&I;if(b&&(ne=F?b(o,U,F,J):b(o)),ne!==t)return ne;if(!sr(o))return o;var Se=tt(o);if(Se){if(ne=J_(o),!ue)return hn(o,ne)}else{var ke=Kr(o),De=ke==X||ke==Q;if(Oo(o))return E0(o,ue);if(ke==te||ke==qe||De&&!F){if(ne=fe||De?{}:V0(o),!ue)return fe?V_(o,c_(ne,o)):M_(o,Jp(ne,o))}else{if(!Tt[ke])return F?o:{};ne=Z_(o,ke,ue)}}J||(J=new Yn);var Ve=J.get(o);if(Ve)return Ve;J.set(o,ne),gy(o)?o.forEach(function(Xe){ne.add(qn(Xe,l,b,Xe,o,J))}):py(o)&&o.forEach(function(Xe,ft){ne.set(ft,qn(Xe,l,b,ft,o,J))});var Ye=we?fe?rf:tf:fe?dn:kr,ot=Se?t:Ye(o);return Fr(ot||o,function(Xe,ft){ot&&(ft=Xe,Xe=o[ft]),Js(ne,ft,qn(Xe,l,b,ft,o,J))}),ne}function h_(o){var l=kr(o);return function(b){return Zp(b,o,l)}}function Zp(o,l,b){var U=b.length;if(o==null)return!U;for(o=yt(o);U--;){var F=b[U],J=l[F],ne=o[F];if(ne===t&&!(F in o)||!J(ne))return!1}return!0}function e0(o,l,b){if(typeof o!="function")throw new Br(u);return ou(function(){o.apply(t,b)},l)}function Zs(o,l,b,U){var F=-1,J=Qo,ne=!0,ue=o.length,fe=[],we=l.length;if(!ue)return fe;b&&(l=qt(l,Ar(b))),U?(J=bo,ne=!1):l.length>=i&&(J=_o,ne=!1,l=new oa(l));e:for(;++FF?0:F+b),U=U===t||U>F?F:it(U),U<0&&(U+=F),U=b>U?0:vy(U);b0&&b(ue)?l>1?xr(ue,l-1,b,U,F):$r(F,ue):U||(F[F.length]=ue)}return F}var Dh=A0(),n0=A0(!0);function vi(o,l){return o&&Dh(o,l,kr)}function jh(o,l){return o&&n0(o,l,kr)}function vl(o,l){return Un(l,function(b){return Xi(o[b])})}function sa(o,l){l=Ao(l,o);for(var b=0,U=l.length;o!=null&&bl}function p_(o,l){return o!=null&&_t.call(o,l)}function y_(o,l){return o!=null&&l in yt(o)}function g_(o,l,b){return o>=de(l,b)&&o=120&&Se.length>=120)?new oa(ne&&Se):t}Se=o[0];var ke=-1,De=ue[0];e:for(;++ke-1;)ue!==o&&Ya.call(ue,fe,1),Ya.call(o,fe,1);return o}function p0(o,l){for(var b=o?l.length:0,U=b-1;b--;){var F=l[b];if(b==U||F!==J){var J=F;Yi(F)?Ya.call(o,F,1):Gh(o,F)}}return o}function Hh(o,l){return o+Ja(Me()*(l-o+1))}function k_(o,l,b,U){for(var F=-1,J=re(Xa((l-o)/(b||1)),0),ne=ye(J);J--;)ne[U?J:++F]=o,o+=b;return ne}function Kh(o,l){var b="";if(!o||l<1||l>M)return b;do l%2&&(b+=o),l=Ja(l/2),l&&(o+=o);while(l);return b}function ut(o,l){return cf(z0(o,l,pn),o+"")}function O_(o){return Xp(ns(o))}function P_(o,l){var b=ns(o);return kl(b,aa(l,0,b.length))}function ru(o,l,b,U){if(!sr(o))return o;l=Ao(l,o);for(var F=-1,J=l.length,ne=J-1,ue=o;ue!=null&&++FF?0:F+l),b=b>F?F:b,b<0&&(b+=F),F=l>b?0:b-l>>>0,l>>>=0;for(var J=ye(F);++U>>1,ne=o[J];ne!==null&&!An(ne)&&(b?ne<=l:ne=i){var we=l?null:H_(o);if(we)return Ka(we);ne=!1,F=_o,fe=new oa}else fe=l?[]:ue;e:for(;++U=U?o:Mn(o,l,b)}var w0=Bh||function(o){return vr.clearTimeout(o)};function E0(o,l){if(l)return o.slice();var b=o.length,U=ta?ta(b):new o.constructor(b);return o.copy(U),U}function Jh(o){var l=new o.constructor(o.byteLength);return new Fi(l).set(new Fi(o)),l}function U_(o,l){var b=l?Jh(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.byteLength)}function D_(o){var l=new o.constructor(o.source,tr.exec(o));return l.lastIndex=o.lastIndex,l}function j_(o){return vt?yt(vt.call(o)):{}}function S0(o,l){var b=l?Jh(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.length)}function C0(o,l){if(o!==l){var b=o!==t,U=o===null,F=o===o,J=An(o),ne=l!==t,ue=l===null,fe=l===l,we=An(l);if(!ue&&!we&&!J&&o>l||J&&ne&&fe&&!ue&&!we||U&&ne&&fe||!b&&fe||!F)return 1;if(!U&&!J&&!we&&o=ue)return fe;var we=b[U];return fe*(we=="desc"?-1:1)}}return o.index-l.index}function T0(o,l,b,U){for(var F=-1,J=o.length,ne=b.length,ue=-1,fe=l.length,we=re(J-ne,0),Se=ye(fe+we),ke=!U;++ue1?b[F-1]:t,ne=F>2?b[2]:t;for(J=o.length>3&&typeof J=="function"?(F--,J):t,ne&&en(b[0],b[1],ne)&&(J=F<3?t:J,F=1),l=yt(l);++U-1?F[J?l[ne]:ne]:t}}function P0(o){return Qi(function(l){var b=l.length,U=b,F=Hr.prototype.thru;for(o&&l.reverse();U--;){var J=l[U];if(typeof J!="function")throw new Br(u);if(F&&!ne&&Il(J)=="wrapper")var ne=new Hr([],!0)}for(U=ne?U:b;++U1&>.reverse(),Se&&feue))return!1;var we=J.get(o),Se=J.get(l);if(we&&Se)return we==l&&Se==o;var ke=-1,De=!0,Ve=b&v?new oa:t;for(J.set(o,l),J.set(l,o);++ke1?"& ":"")+l[U],l=l.join(b>2?", ":" "),o.replace(rr,`{ /* [wrapped with `+l+`] */ -`)}function lw(o){return tt(o)||ha(o)||!!(Js&&o&&o[Js])}function Yi(o,l){var b=typeof o;return l=l??M,!!l&&(b=="number"||b!="symbol"&&Oi.test(o))&&o>-1&&o%1==0&&o0){if(++l>=V)return arguments[0]}else l=0;return o.apply(t,arguments)}}function Pl(o,l){var b=-1,U=o.length,F=U-1;for(l=l===t?U:l;++b1?o[l-1]:t;return b=typeof b=="function"?(o.pop(),b):t,sy(o,b)});function uy(o){var l=Y(o);return l.__chain__=!0,l}function _2(o,l){return l(o),o}function Bl(o,l){return l(o)}var w2=Qi(function(o){var l=o.length,b=l?o[0]:0,U=this.__wrapped__,F=function(J){return Vh(J,o)};return l>1||this.__actions__.length||!(U instanceof pt)||!Yi(b)?this.thru(F):(U=U.slice(b,+b+(l?1:0)),U.__actions__.push({func:Bl,args:[F],thisArg:t}),new Hr(U,this.__chain__).thru(function(J){return l&&!J.length&&J.push(t),J}))});function E2(){return uy(this)}function S2(){return new Hr(this.value(),this.__chain__)}function C2(){this.__values__===t&&(this.__values__=Ey(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function T2(){return this}function R2(o){for(var l,b=this;b instanceof Qn;){var U=ty(b);U.__index__=0,U.__values__=t,l?F.__wrapped__=U:l=U;var F=U;b=b.__wrapped__}return F.__wrapped__=o,l}function I2(){var o=this.__wrapped__;if(o instanceof pt){var l=o;return this.__actions__.length&&(l=new pt(this)),l=l.reverse(),l.__actions__.push({func:Bl,args:[gf],thisArg:t}),new Hr(l,this.__chain__)}return this.thru(gf)}function A2(){return C0(this.__wrapped__,this.__actions__)}var k2=Cl(function(o,l,b){_t.call(o,b)?++o[b]:Wi(o,b,1)});function O2(o,l,b){var U=tt(o)?al:__;return b&&en(o,l,b)&&(l=t),U(o,Ge(l,3))}function P2(o,l){var b=tt(o)?Un:s0;return b(o,Ge(l,3))}var B2=x0(ry),L2=x0(ny);function N2(o,l){return xr(Ll(o,l),1)}function x2(o,l){return xr(Ll(o,l),N)}function U2(o,l,b){return b=b===t?1:it(b),xr(Ll(o,l),b)}function ly(o,l){var b=tt(o)?Fr:Io;return b(o,Ge(l,3))}function cy(o,l){var b=tt(o)?Eh:a0;return b(o,Ge(l,3))}var D2=Cl(function(o,l,b){_t.call(o,b)?o[b].push(l):Wi(o,b,[l])});function j2(o,l,b,U){o=fn(o)?o:is(o),b=b&&!U?it(b):0;var F=o.length;return b<0&&(b=re(F+b,0)),jl(o)?b<=F&&o.indexOf(l,b)>-1:!!F&&di(o,l,b)>-1}var q2=ut(function(o,l,b){var U=-1,F=typeof l=="function",J=fn(o)?ye(o.length):[];return Io(o,function(ne){J[++U]=F?Xr(l,ne,b):tu(ne,l,b)}),J}),M2=Cl(function(o,l,b){Wi(o,b,l)});function Ll(o,l){var b=tt(o)?qt:d0;return b(o,Ge(l,3))}function V2(o,l,b,U){return o==null?[]:(tt(l)||(l=l==null?[]:[l]),b=U?t:b,tt(b)||(b=b==null?[]:[b]),m0(o,l,b))}var F2=Cl(function(o,l,b){o[b?0:1].push(l)},function(){return[[],[]]});function $2(o,l,b){var U=tt(o)?xi:Ws,F=arguments.length<3;return U(o,Ge(l,4),b,F,Io)}function z2(o,l,b){var U=tt(o)?$a:Ws,F=arguments.length<3;return U(o,Ge(l,4),b,F,a0)}function H2(o,l){var b=tt(o)?Un:s0;return b(o,Ul(Ge(l,3)))}function K2(o){var l=tt(o)?r0:j_;return l(o)}function W2(o,l,b){(b?en(o,l,b):l===t)?l=1:l=it(l);var U=tt(o)?y_:q_;return U(o,l)}function G2(o){var l=tt(o)?g_:V_;return l(o)}function Q2(o){if(o==null)return 0;if(fn(o))return jl(o)?Co(o):o.length;var l=Kr(o);return l==A||l==ge?o.size:Wh(o).length}function Y2(o,l,b){var U=tt(o)?za:F_;return b&&en(o,l,b)&&(l=t),U(o,Ge(l,3))}var X2=ut(function(o,l){if(o==null)return[];var b=l.length;return b>1&&en(o,l[0],l[1])?l=[]:b>2&&en(l[0],l[1],l[2])&&(l=[l[0]]),m0(o,xr(l,1),[])}),Nl=jh||function(){return vr.Date.now()};function J2(o,l){if(typeof l!="function")throw new Br(u);return o=it(o),function(){if(--o<1)return l.apply(this,arguments)}}function hy(o,l,b){return l=b?t:l,l=o&&l==null?o.length:l,Gi(o,D,t,t,t,t,l)}function fy(o,l){var b;if(typeof l!="function")throw new Br(u);return o=it(o),function(){return--o>0&&(b=l.apply(this,arguments)),o<=1&&(l=t),b}}var vf=ut(function(o,l,b){var U=T;if(b.length){var F=yi(b,rs(vf));U|=w}return Gi(o,U,l,b,F)}),dy=ut(function(o,l,b){var U=T|O;if(b.length){var F=yi(b,rs(dy));U|=w}return Gi(l,U,o,b,F)});function py(o,l,b){l=b?t:l;var U=Gi(o,y,t,t,t,t,t,l);return U.placeholder=py.placeholder,U}function yy(o,l,b){l=b?t:l;var U=Gi(o,R,t,t,t,t,t,l);return U.placeholder=yy.placeholder,U}function gy(o,l,b){var U,F,J,ne,ue,fe,we=0,Se=!1,ke=!1,De=!0;if(typeof o!="function")throw new Br(u);l=Fn(l)||0,sr(b)&&(Se=!!b.leading,ke="maxWait"in b,J=ke?re(Fn(b.maxWait)||0,l):J,De="trailing"in b?!!b.trailing:De);function Ve(yr){var Jn=U,Zi=F;return U=F=t,we=yr,ne=o.apply(Zi,Jn),ne}function Ye(yr){return we=yr,ue=au(ft,l),Se?Ve(yr):ne}function ot(yr){var Jn=yr-fe,Zi=yr-we,xy=l-Jn;return ke?de(xy,J-Zi):xy}function Xe(yr){var Jn=yr-fe,Zi=yr-we;return fe===t||Jn>=l||Jn<0||ke&&Zi>=J}function ft(){var yr=Nl();if(Xe(yr))return gt(yr);ue=au(ft,ot(yr))}function gt(yr){return ue=t,De&&U?Ve(yr):(U=F=t,ne)}function kn(){ue!==t&&R0(ue),we=0,U=fe=F=ue=t}function tn(){return ue===t?ne:gt(Nl())}function On(){var yr=Nl(),Jn=Xe(yr);if(U=arguments,F=this,fe=yr,Jn){if(ue===t)return Ye(fe);if(ke)return R0(ue),ue=au(ft,l),Ve(fe)}return ue===t&&(ue=au(ft,l)),ne}return On.cancel=kn,On.flush=tn,On}var Z2=ut(function(o,l){return o0(o,1,l)}),eE=ut(function(o,l,b){return o0(o,Fn(l)||0,b)});function tE(o){return Gi(o,m)}function xl(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new Br(u);var b=function(){var U=arguments,F=l?l.apply(this,U):U[0],J=b.cache;if(J.has(F))return J.get(F);var ne=o.apply(this,U);return b.cache=J.set(F,ne)||J,ne};return b.cache=new(xl.Cache||Ki),b}xl.Cache=Ki;function Ul(o){if(typeof o!="function")throw new Br(u);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function rE(o){return fy(2,o)}var nE=$_(function(o,l){l=l.length==1&&tt(l[0])?qt(l[0],Ar(Ge())):qt(xr(l,1),Ar(Ge()));var b=l.length;return ut(function(U){for(var F=-1,J=de(U.length,b);++F=l}),ha=c0(function(){return arguments}())?c0:function(o){return fr(o)&&_t.call(o,"callee")&&!gl.call(o,"callee")},tt=ye.isArray,vE=Vs?Ar(Vs):R_;function fn(o){return o!=null&&Dl(o.length)&&!Xi(o)}function pr(o){return fr(o)&&fn(o)}function bE(o){return o===!0||o===!1||fr(o)&&Zr(o)==Ie}var Po=ml||Of,_E=nl?Ar(nl):I_;function wE(o){return fr(o)&&o.nodeType===1&&!su(o)}function EE(o){if(o==null)return!0;if(fn(o)&&(tt(o)||typeof o=="string"||typeof o.splice=="function"||Po(o)||ns(o)||ha(o)))return!o.length;var l=Kr(o);if(l==A||l==ge)return!o.size;if(ou(o))return!Wh(o).length;for(var b in o)if(_t.call(o,b))return!1;return!0}function SE(o,l){return ru(o,l)}function CE(o,l,b){b=typeof b=="function"?b:t;var U=b?b(o,l):t;return U===t?ru(o,l,t,b):!!U}function _f(o){if(!fr(o))return!1;var l=Zr(o);return l==x||l==Je||typeof o.message=="string"&&typeof o.name=="string"&&!su(o)}function TE(o){return typeof o=="number"&&_(o)}function Xi(o){if(!sr(o))return!1;var l=Zr(o);return l==X||l==Q||l==$e||l==xe}function vy(o){return typeof o=="number"&&o==it(o)}function Dl(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=M}function sr(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function fr(o){return o!=null&&typeof o=="object"}var by=Qo?Ar(Qo):k_;function RE(o,l){return o===l||Kh(o,l,cf(l))}function IE(o,l,b){return b=typeof b=="function"?b:t,Kh(o,l,cf(l),b)}function AE(o){return _y(o)&&o!=+o}function kE(o){if(fw(o))throw new Ke(s);return h0(o)}function OE(o){return o===null}function PE(o){return o==null}function _y(o){return typeof o=="number"||fr(o)&&Zr(o)==K}function su(o){if(!fr(o)||Zr(o)!=te)return!1;var l=mi(o);if(l===null)return!0;var b=_t.call(l,"constructor")&&l.constructor;return typeof b=="function"&&b instanceof b&&ea.call(b)==xh}var wf=il?Ar(il):O_;function BE(o){return vy(o)&&o>=-M&&o<=M}var wy=ol?Ar(ol):P_;function jl(o){return typeof o=="string"||!tt(o)&&fr(o)&&Zr(o)==Le}function An(o){return typeof o=="symbol"||fr(o)&&Zr(o)==We}var ns=Fs?Ar(Fs):B_;function LE(o){return o===t}function NE(o){return fr(o)&&Kr(o)==He}function xE(o){return fr(o)&&Zr(o)==kt}var UE=Al(Gh),DE=Al(function(o,l){return o<=l});function Ey(o){if(!o)return[];if(fn(o))return jl(o)?Sn(o):hn(o);if(To&&o[To])return Ka(o[To]());var l=Kr(o),b=l==A?Xs:l==ge?Wa:is;return b(o)}function Ji(o){if(!o)return o===0?o:0;if(o=Fn(o),o===N||o===-N){var l=o<0?-1:1;return l*ee}return o===o?o:0}function it(o){var l=Ji(o),b=l%1;return l===l?b?l-b:l:0}function Sy(o){return o?sa(it(o),0,ae):0}function Fn(o){if(typeof o=="number")return o;if(An(o))return oe;if(sr(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=sr(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Di(o);var b=po.test(o);return b||yo.test(o)?wh(o.slice(2),b?2:8):Na.test(o)?oe:+o}function Cy(o){return bi(o,dn(o))}function jE(o){return o?sa(it(o),-M,M):o===0?o:0}function Pt(o){return o==null?"":In(o)}var qE=es(function(o,l){if(ou(l)||fn(l)){bi(l,kr(l),o);return}for(var b in l)_t.call(l,b)&&Zs(o,b,l[b])}),Ty=es(function(o,l){bi(l,dn(l),o)}),ql=es(function(o,l,b,U){bi(l,dn(l),o,U)}),ME=es(function(o,l,b,U){bi(l,kr(l),o,U)}),VE=Qi(Vh);function FE(o,l){var b=Rn(o);return l==null?b:n0(b,l)}var $E=ut(function(o,l){o=yt(o);var b=-1,U=l.length,F=U>2?l[2]:t;for(F&&en(l[0],l[1],F)&&(U=1);++b1),J}),bi(o,uf(o),b),U&&(b=qn(b,f|g|I,ew));for(var F=l.length;F--;)Zh(b,l[F]);return b});function sS(o,l){return Iy(o,Ul(Ge(l)))}var uS=Qi(function(o,l){return o==null?{}:x_(o,l)});function Iy(o,l){if(o==null)return{};var b=qt(uf(o),function(U){return[U]});return l=Ge(l),v0(o,b,function(U,F){return l(U,F[0])})}function lS(o,l,b){l=ko(l,o);var U=-1,F=l.length;for(F||(F=1,o=t);++Ul){var U=o;o=l,l=U}if(b||o%1||l%1){var F=Me();return de(o+F*(l-o+el("1e-"+((F+"").length-1))),l)}return Yh(o,l)}var _S=ts(function(o,l,b){return l=l.toLowerCase(),o+(b?Oy(l):l)});function Oy(o){return Cf(Pt(o).toLowerCase())}function Py(o){return o=Pt(o),o&&o.replace(wn,pi).replace(yh,"")}function wS(o,l,b){o=Pt(o),l=In(l);var U=o.length;b=b===t?U:sa(it(b),0,U);var F=b;return b-=l.length,b>=0&&o.slice(b,F)==l}function ES(o){return o=Pt(o),o&&li.test(o)?o.replace(Yr,Ys):o}function SS(o){return o=Pt(o),o&&Zt.test(o)?o.replace(Wt,"\\$&"):o}var CS=ts(function(o,l,b){return o+(b?"-":"")+l.toLowerCase()}),TS=ts(function(o,l,b){return o+(b?" ":"")+l.toLowerCase()}),RS=N0("toLowerCase");function IS(o,l,b){o=Pt(o),l=it(l);var U=l?Co(o):0;if(!l||U>=l)return o;var F=(l-U)/2;return Il(Za(F),b)+o+Il(Ja(F),b)}function AS(o,l,b){o=Pt(o),l=it(l);var U=l?Co(o):0;return l&&U>>0,b?(o=Pt(o),o&&(typeof l=="string"||l!=null&&!wf(l))&&(l=In(l),!l&&qi(o))?Oo(Sn(o),0,b):o.split(l,b)):[]}var xS=ts(function(o,l,b){return o+(b?" ":"")+Cf(l)});function US(o,l,b){return o=Pt(o),b=b==null?0:sa(it(b),0,o.length),l=In(l),o.slice(b,b+l.length)==l}function DS(o,l,b){var U=Y.templateSettings;b&&en(o,l,b)&&(l=t),o=Pt(o),l=ql({},l,U,V0);var F=ql({},l.imports,U.imports,V0),J=kr(F),ne=ji(F,J),ue,fe,we=0,Se=l.interpolate||Tr,ke="__p += '",De=Ga((l.escape||Tr).source+"|"+Se.source+"|"+(Se===Ut?$t:Tr).source+"|"+(l.evaluate||Tr).source+"|$","g"),Ve="//# sourceURL="+(_t.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++bh+"]")+` -`;o.replace(De,function(Xe,ft,gt,kn,tn,On){return gt||(gt=kn),ke+=o.slice(we,On).replace(Ko,Rh),ft&&(ue=!0,ke+=`' + +`)}function tw(o){return tt(o)||ca(o)||!!(Xs&&o&&o[Xs])}function Yi(o,l){var b=typeof o;return l=l??M,!!l&&(b=="number"||b!="symbol"&&Oi.test(o))&&o>-1&&o%1==0&&o0){if(++l>=V)return arguments[0]}else l=0;return o.apply(t,arguments)}}function kl(o,l){var b=-1,U=o.length,F=U-1;for(l=l===t?U:l;++b1?o[l-1]:t;return b=typeof b=="function"?(o.pop(),b):t,ry(o,b)});function ny(o){var l=Y(o);return l.__chain__=!0,l}function f2(o,l){return l(o),o}function Ol(o,l){return l(o)}var d2=Qi(function(o){var l=o.length,b=l?o[0]:0,U=this.__wrapped__,F=function(J){return Uh(J,o)};return l>1||this.__actions__.length||!(U instanceof pt)||!Yi(b)?this.thru(F):(U=U.slice(b,+b+(l?1:0)),U.__actions__.push({func:Ol,args:[F],thisArg:t}),new Hr(U,this.__chain__).thru(function(J){return l&&!J.length&&J.push(t),J}))});function p2(){return ny(this)}function y2(){return new Hr(this.value(),this.__chain__)}function g2(){this.__values__===t&&(this.__values__=my(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function m2(){return this}function v2(o){for(var l,b=this;b instanceof Qn;){var U=Y0(b);U.__index__=0,U.__values__=t,l?F.__wrapped__=U:l=U;var F=U;b=b.__wrapped__}return F.__wrapped__=o,l}function b2(){var o=this.__wrapped__;if(o instanceof pt){var l=o;return this.__actions__.length&&(l=new pt(this)),l=l.reverse(),l.__actions__.push({func:Ol,args:[hf],thisArg:t}),new Hr(l,this.__chain__)}return this.thru(hf)}function _2(){return b0(this.__wrapped__,this.__actions__)}var w2=El(function(o,l,b){_t.call(o,b)?++o[b]:Wi(o,b,1)});function E2(o,l,b){var U=tt(o)?il:f_;return b&&en(o,l,b)&&(l=t),U(o,Ge(l,3))}function S2(o,l){var b=tt(o)?Un:r0;return b(o,Ge(l,3))}var C2=O0(X0),T2=O0(J0);function R2(o,l){return xr(Pl(o,l),1)}function I2(o,l){return xr(Pl(o,l),N)}function A2(o,l,b){return b=b===t?1:it(b),xr(Pl(o,l),b)}function iy(o,l){var b=tt(o)?Fr:Ro;return b(o,Ge(l,3))}function oy(o,l){var b=tt(o)?mh:t0;return b(o,Ge(l,3))}var k2=El(function(o,l,b){_t.call(o,b)?o[b].push(l):Wi(o,b,[l])});function O2(o,l,b,U){o=fn(o)?o:ns(o),b=b&&!U?it(b):0;var F=o.length;return b<0&&(b=re(F+b,0)),Ul(o)?b<=F&&o.indexOf(l,b)>-1:!!F&&di(o,l,b)>-1}var P2=ut(function(o,l,b){var U=-1,F=typeof l=="function",J=fn(o)?ye(o.length):[];return Ro(o,function(ne){J[++U]=F?Xr(l,ne,b):eu(ne,l,b)}),J}),B2=El(function(o,l,b){Wi(o,b,l)});function Pl(o,l){var b=tt(o)?qt:u0;return b(o,Ge(l,3))}function L2(o,l,b,U){return o==null?[]:(tt(l)||(l=l==null?[]:[l]),b=U?t:b,tt(b)||(b=b==null?[]:[b]),f0(o,l,b))}var N2=El(function(o,l,b){o[b?0:1].push(l)},function(){return[[],[]]});function x2(o,l,b){var U=tt(o)?xi:Ks,F=arguments.length<3;return U(o,Ge(l,4),b,F,Ro)}function U2(o,l,b){var U=tt(o)?Fa:Ks,F=arguments.length<3;return U(o,Ge(l,4),b,F,t0)}function D2(o,l){var b=tt(o)?Un:r0;return b(o,Nl(Ge(l,3)))}function j2(o){var l=tt(o)?Xp:O_;return l(o)}function q2(o,l,b){(b?en(o,l,b):l===t)?l=1:l=it(l);var U=tt(o)?s_:P_;return U(o,l)}function M2(o){var l=tt(o)?u_:L_;return l(o)}function V2(o){if(o==null)return 0;if(fn(o))return Ul(o)?So(o):o.length;var l=Kr(o);return l==A||l==ge?o.size:Fh(o).length}function F2(o,l,b){var U=tt(o)?$a:N_;return b&&en(o,l,b)&&(l=t),U(o,Ge(l,3))}var $2=ut(function(o,l){if(o==null)return[];var b=l.length;return b>1&&en(o,l[0],l[1])?l=[]:b>2&&en(l[0],l[1],l[2])&&(l=[l[0]]),f0(o,xr(l,1),[])}),Bl=Lh||function(){return vr.Date.now()};function z2(o,l){if(typeof l!="function")throw new Br(u);return o=it(o),function(){if(--o<1)return l.apply(this,arguments)}}function ay(o,l,b){return l=b?t:l,l=o&&l==null?o.length:l,Gi(o,D,t,t,t,t,l)}function sy(o,l){var b;if(typeof l!="function")throw new Br(u);return o=it(o),function(){return--o>0&&(b=l.apply(this,arguments)),o<=1&&(l=t),b}}var df=ut(function(o,l,b){var U=T;if(b.length){var F=yi(b,ts(df));U|=w}return Gi(o,U,l,b,F)}),uy=ut(function(o,l,b){var U=T|O;if(b.length){var F=yi(b,ts(uy));U|=w}return Gi(l,U,o,b,F)});function ly(o,l,b){l=b?t:l;var U=Gi(o,y,t,t,t,t,t,l);return U.placeholder=ly.placeholder,U}function cy(o,l,b){l=b?t:l;var U=Gi(o,R,t,t,t,t,t,l);return U.placeholder=cy.placeholder,U}function hy(o,l,b){var U,F,J,ne,ue,fe,we=0,Se=!1,ke=!1,De=!0;if(typeof o!="function")throw new Br(u);l=Fn(l)||0,sr(b)&&(Se=!!b.leading,ke="maxWait"in b,J=ke?re(Fn(b.maxWait)||0,l):J,De="trailing"in b?!!b.trailing:De);function Ve(yr){var Jn=U,Zi=F;return U=F=t,we=yr,ne=o.apply(Zi,Jn),ne}function Ye(yr){return we=yr,ue=ou(ft,l),Se?Ve(yr):ne}function ot(yr){var Jn=yr-fe,Zi=yr-we,Oy=l-Jn;return ke?de(Oy,J-Zi):Oy}function Xe(yr){var Jn=yr-fe,Zi=yr-we;return fe===t||Jn>=l||Jn<0||ke&&Zi>=J}function ft(){var yr=Bl();if(Xe(yr))return gt(yr);ue=ou(ft,ot(yr))}function gt(yr){return ue=t,De&&U?Ve(yr):(U=F=t,ne)}function kn(){ue!==t&&w0(ue),we=0,U=fe=F=ue=t}function tn(){return ue===t?ne:gt(Bl())}function On(){var yr=Bl(),Jn=Xe(yr);if(U=arguments,F=this,fe=yr,Jn){if(ue===t)return Ye(fe);if(ke)return w0(ue),ue=ou(ft,l),Ve(fe)}return ue===t&&(ue=ou(ft,l)),ne}return On.cancel=kn,On.flush=tn,On}var H2=ut(function(o,l){return e0(o,1,l)}),K2=ut(function(o,l,b){return e0(o,Fn(l)||0,b)});function W2(o){return Gi(o,m)}function Ll(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new Br(u);var b=function(){var U=arguments,F=l?l.apply(this,U):U[0],J=b.cache;if(J.has(F))return J.get(F);var ne=o.apply(this,U);return b.cache=J.set(F,ne)||J,ne};return b.cache=new(Ll.Cache||Ki),b}Ll.Cache=Ki;function Nl(o){if(typeof o!="function")throw new Br(u);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function G2(o){return sy(2,o)}var Q2=x_(function(o,l){l=l.length==1&&tt(l[0])?qt(l[0],Ar(Ge())):qt(xr(l,1),Ar(Ge()));var b=l.length;return ut(function(U){for(var F=-1,J=de(U.length,b);++F=l}),ca=o0(function(){return arguments}())?o0:function(o){return fr(o)&&_t.call(o,"callee")&&!pl.call(o,"callee")},tt=ye.isArray,cE=Ms?Ar(Ms):v_;function fn(o){return o!=null&&xl(o.length)&&!Xi(o)}function pr(o){return fr(o)&&fn(o)}function hE(o){return o===!0||o===!1||fr(o)&&Zr(o)==Ie}var Oo=yl||Tf,fE=tl?Ar(tl):b_;function dE(o){return fr(o)&&o.nodeType===1&&!au(o)}function pE(o){if(o==null)return!0;if(fn(o)&&(tt(o)||typeof o=="string"||typeof o.splice=="function"||Oo(o)||rs(o)||ca(o)))return!o.length;var l=Kr(o);if(l==A||l==ge)return!o.size;if(iu(o))return!Fh(o).length;for(var b in o)if(_t.call(o,b))return!1;return!0}function yE(o,l){return tu(o,l)}function gE(o,l,b){b=typeof b=="function"?b:t;var U=b?b(o,l):t;return U===t?tu(o,l,t,b):!!U}function yf(o){if(!fr(o))return!1;var l=Zr(o);return l==x||l==Je||typeof o.message=="string"&&typeof o.name=="string"&&!au(o)}function mE(o){return typeof o=="number"&&_(o)}function Xi(o){if(!sr(o))return!1;var l=Zr(o);return l==X||l==Q||l==$e||l==xe}function dy(o){return typeof o=="number"&&o==it(o)}function xl(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=M}function sr(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function fr(o){return o!=null&&typeof o=="object"}var py=Go?Ar(Go):w_;function vE(o,l){return o===l||Vh(o,l,of(l))}function bE(o,l,b){return b=typeof b=="function"?b:t,Vh(o,l,of(l),b)}function _E(o){return yy(o)&&o!=+o}function wE(o){if(iw(o))throw new Ke(s);return a0(o)}function EE(o){return o===null}function SE(o){return o==null}function yy(o){return typeof o=="number"||fr(o)&&Zr(o)==K}function au(o){if(!fr(o)||Zr(o)!=te)return!1;var l=mi(o);if(l===null)return!0;var b=_t.call(l,"constructor")&&l.constructor;return typeof b=="function"&&b instanceof b&&Zo.call(b)==Oh}var gf=rl?Ar(rl):E_;function CE(o){return dy(o)&&o>=-M&&o<=M}var gy=nl?Ar(nl):S_;function Ul(o){return typeof o=="string"||!tt(o)&&fr(o)&&Zr(o)==Le}function An(o){return typeof o=="symbol"||fr(o)&&Zr(o)==We}var rs=Vs?Ar(Vs):C_;function TE(o){return o===t}function RE(o){return fr(o)&&Kr(o)==He}function IE(o){return fr(o)&&Zr(o)==kt}var AE=Rl($h),kE=Rl(function(o,l){return o<=l});function my(o){if(!o)return[];if(fn(o))return Ul(o)?Sn(o):hn(o);if(Co&&o[Co])return Ha(o[Co]());var l=Kr(o),b=l==A?Ys:l==ge?Ka:ns;return b(o)}function Ji(o){if(!o)return o===0?o:0;if(o=Fn(o),o===N||o===-N){var l=o<0?-1:1;return l*ee}return o===o?o:0}function it(o){var l=Ji(o),b=l%1;return l===l?b?l-b:l:0}function vy(o){return o?aa(it(o),0,ae):0}function Fn(o){if(typeof o=="number")return o;if(An(o))return oe;if(sr(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=sr(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Di(o);var b=fo.test(o);return b||po.test(o)?gh(o.slice(2),b?2:8):La.test(o)?oe:+o}function by(o){return bi(o,dn(o))}function OE(o){return o?aa(it(o),-M,M):o===0?o:0}function Pt(o){return o==null?"":In(o)}var PE=Za(function(o,l){if(iu(l)||fn(l)){bi(l,kr(l),o);return}for(var b in l)_t.call(l,b)&&Js(o,b,l[b])}),_y=Za(function(o,l){bi(l,dn(l),o)}),Dl=Za(function(o,l,b,U){bi(l,dn(l),o,U)}),BE=Za(function(o,l,b,U){bi(l,kr(l),o,U)}),LE=Qi(Uh);function NE(o,l){var b=Rn(o);return l==null?b:Jp(b,l)}var xE=ut(function(o,l){o=yt(o);var b=-1,U=l.length,F=U>2?l[2]:t;for(F&&en(l[0],l[1],F)&&(U=1);++b1),J}),bi(o,rf(o),b),U&&(b=qn(b,f|g|I,K_));for(var F=l.length;F--;)Gh(b,l[F]);return b});function ZE(o,l){return Ey(o,Nl(Ge(l)))}var eS=Qi(function(o,l){return o==null?{}:I_(o,l)});function Ey(o,l){if(o==null)return{};var b=qt(rf(o),function(U){return[U]});return l=Ge(l),d0(o,b,function(U,F){return l(U,F[0])})}function tS(o,l,b){l=Ao(l,o);var U=-1,F=l.length;for(F||(F=1,o=t);++Ul){var U=o;o=l,l=U}if(b||o%1||l%1){var F=Me();return de(o+F*(l-o+Ju("1e-"+((F+"").length-1))),l)}return Hh(o,l)}var fS=es(function(o,l,b){return l=l.toLowerCase(),o+(b?Ty(l):l)});function Ty(o){return bf(Pt(o).toLowerCase())}function Ry(o){return o=Pt(o),o&&o.replace(wn,pi).replace(ch,"")}function dS(o,l,b){o=Pt(o),l=In(l);var U=o.length;b=b===t?U:aa(it(b),0,U);var F=b;return b-=l.length,b>=0&&o.slice(b,F)==l}function pS(o){return o=Pt(o),o&&li.test(o)?o.replace(Yr,Qs):o}function yS(o){return o=Pt(o),o&&Zt.test(o)?o.replace(Wt,"\\$&"):o}var gS=es(function(o,l,b){return o+(b?"-":"")+l.toLowerCase()}),mS=es(function(o,l,b){return o+(b?" ":"")+l.toLowerCase()}),vS=k0("toLowerCase");function bS(o,l,b){o=Pt(o),l=it(l);var U=l?So(o):0;if(!l||U>=l)return o;var F=(l-U)/2;return Tl(Ja(F),b)+o+Tl(Xa(F),b)}function _S(o,l,b){o=Pt(o),l=it(l);var U=l?So(o):0;return l&&U>>0,b?(o=Pt(o),o&&(typeof l=="string"||l!=null&&!gf(l))&&(l=In(l),!l&&qi(o))?ko(Sn(o),0,b):o.split(l,b)):[]}var IS=es(function(o,l,b){return o+(b?" ":"")+bf(l)});function AS(o,l,b){return o=Pt(o),b=b==null?0:aa(it(b),0,o.length),l=In(l),o.slice(b,b+l.length)==l}function kS(o,l,b){var U=Y.templateSettings;b&&en(o,l,b)&&(l=t),o=Pt(o),l=Dl({},l,U,U0);var F=Dl({},l.imports,U.imports,U0),J=kr(F),ne=ji(F,J),ue,fe,we=0,Se=l.interpolate||Tr,ke="__p += '",De=Wa((l.escape||Tr).source+"|"+Se.source+"|"+(Se===Ut?$t:Tr).source+"|"+(l.evaluate||Tr).source+"|$","g"),Ve="//# sourceURL="+(_t.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ph+"]")+` +`;o.replace(De,function(Xe,ft,gt,kn,tn,On){return gt||(gt=kn),ke+=o.slice(we,On).replace(Ho,wh),ft&&(ue=!0,ke+=`' + __e(`+ft+`) + '`),tn&&(fe=!0,ke+=`'; `+tn+`; @@ -26,36 +26,36 @@ __p += '`),gt&&(ke+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+ke+`return __p -}`;var ot=Ly(function(){return ht(J,Ve+"return "+ke).apply(t,ne)});if(ot.source=ke,_f(ot))throw ot;return ot}function jS(o){return Pt(o).toLowerCase()}function qS(o){return Pt(o).toUpperCase()}function MS(o,l,b){if(o=Pt(o),o&&(b||l===t))return Di(o);if(!o||!(l=In(l)))return o;var U=Sn(o),F=Sn(l),J=Jo(U,F),ne=Eo(U,F)+1;return Oo(U,J,ne).join("")}function VS(o,l,b){if(o=Pt(o),o&&(b||l===t))return o.slice(0,hl(o)+1);if(!o||!(l=In(l)))return o;var U=Sn(o),F=Eo(U,Sn(l))+1;return Oo(U,0,F).join("")}function FS(o,l,b){if(o=Pt(o),o&&(b||l===t))return o.replace(Gt,"");if(!o||!(l=In(l)))return o;var U=Sn(o),F=Jo(U,Sn(l));return Oo(U,F).join("")}function $S(o,l){var b=p,U=q;if(sr(l)){var F="separator"in l?l.separator:F;b="length"in l?it(l.length):b,U="omission"in l?In(l.omission):U}o=Pt(o);var J=o.length;if(qi(o)){var ne=Sn(o);J=ne.length}if(b>=J)return o;var ue=b-Co(U);if(ue<1)return U;var fe=ne?Oo(ne,0,ue).join(""):o.slice(0,ue);if(F===t)return fe+U;if(ne&&(ue+=fe.length-ue),wf(F)){if(o.slice(ue).search(F)){var we,Se=fe;for(F.global||(F=Ga(F.source,Pt(tr.exec(F))+"g")),F.lastIndex=0;we=F.exec(Se);)var ke=we.index;fe=fe.slice(0,ke===t?ue:ke)}}else if(o.indexOf(In(F),ue)!=ue){var De=fe.lastIndexOf(F);De>-1&&(fe=fe.slice(0,De))}return fe+U}function zS(o){return o=Pt(o),o&&_n.test(o)?o.replace(Qr,Ph):o}var HS=ts(function(o,l,b){return o+(b?" ":"")+l.toUpperCase()}),Cf=N0("toUpperCase");function By(o,l,b){return o=Pt(o),l=b?t:l,l===t?Ih(o)?Lh(o):Ch(o):o.match(l)||[]}var Ly=ut(function(o,l){try{return Xr(o,t,l)}catch(b){return _f(b)?b:new Ke(b)}}),KS=Qi(function(o,l){return Fr(l,function(b){b=_i(b),Wi(o,b,vf(o[b],o))}),o});function WS(o){var l=o==null?0:o.length,b=Ge();return o=l?qt(o,function(U){if(typeof U[1]!="function")throw new Br(u);return[b(U[0]),U[1]]}):[],ut(function(U){for(var F=-1;++FM)return[];var b=ae,U=de(o,ae);l=Ge(l),o-=ae;for(var F=Qs(U,l);++b0||l<0)?new pt(b):(o<0?b=b.takeRight(-o):o&&(b=b.drop(o)),l!==t&&(l=it(l),b=l<0?b.dropRight(-l):b.take(l-o)),b)},pt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},pt.prototype.toArray=function(){return this.take(ae)},vi(pt.prototype,function(o,l){var b=/^(?:filter|find|map|reject)|While$/.test(l),U=/^(?:head|last)$/.test(l),F=Y[U?"take"+(l=="last"?"Right":""):l],J=U||/^find/.test(l);F&&(Y.prototype[l]=function(){var ne=this.__wrapped__,ue=U?[1]:arguments,fe=ne instanceof pt,we=ue[0],Se=fe||tt(ne),ke=function(ft){var gt=F.apply(Y,$r([ft],ue));return U&&De?gt[0]:gt};Se&&b&&typeof we=="function"&&we.length!=1&&(fe=Se=!1);var De=this.__chain__,Ve=!!this.__actions__.length,Ye=J&&!De,ot=fe&&!Ve;if(!J&&Se){ne=ot?ne:new pt(this);var Xe=o.apply(ne,ue);return Xe.__actions__.push({func:Bl,args:[ke],thisArg:t}),new Hr(Xe,De)}return Ye&&ot?o.apply(this,ue):(Xe=this.thru(ke),Ye?U?Xe.value()[0]:Xe.value():Xe)})}),Fr(["pop","push","shift","sort","splice","unshift"],function(o){var l=Zo[o],b=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",U=/^(?:pop|shift)$/.test(o);Y.prototype[o]=function(){var F=arguments;if(U&&!this.__chain__){var J=this.value();return l.apply(tt(J)?J:[],F)}return this[b](function(ne){return l.apply(tt(ne)?ne:[],F)})}}),vi(pt.prototype,function(o,l){var b=Y[l];if(b){var U=b.name+"";_t.call(zr,U)||(zr[U]=[]),zr[U].push({name:l,func:b})}}),zr[Tl(t,O).name]=[{name:"wrapper",func:t}],pt.prototype.clone=zb,pt.prototype.reverse=Hb,pt.prototype.value=Kb,Y.prototype.at=w2,Y.prototype.chain=E2,Y.prototype.commit=S2,Y.prototype.next=C2,Y.prototype.plant=R2,Y.prototype.reverse=I2,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=A2,Y.prototype.first=Y.prototype.head,To&&(Y.prototype[To]=T2),Y},Dn=gi();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(vr._=Dn,define(function(){return Dn})):hi?((hi.exports=Dn)._=Dn,Va._=Dn):vr._=Dn}).call(e)}),g6=Ae((e,n)=>{var t=Cv(),r=Ov(),i=kv(),s=fp(),{includes:u,isBoolean:h,isInteger:c,isNumber:a,isPlainObject:d,isString:f,once:g}=y6(),{KeyObject:I,createSecretKey:C,createPrivateKey:v}=require("crypto"),T=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];r&&T.splice(3,0,"PS256","PS384","PS512");var O={expiresIn:{isValid:function(S){return c(S)||f(S)&&S},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(S){return c(S)||f(S)&&S},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(S){return f(S)||Array.isArray(S)},message:'"audience" must be a string or array'},algorithm:{isValid:u.bind(null,T),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:f,message:'"encoding" must be a string'},issuer:{isValid:f,message:'"issuer" must be a string'},subject:{isValid:f,message:'"subject" must be a string'},jwtid:{isValid:f,message:'"jwtid" must be a string'},noTimestamp:{isValid:h,message:'"noTimestamp" must be a boolean'},keyid:{isValid:f,message:'"keyid" must be a string'},mutatePayload:{isValid:h,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:h,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:h,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},k={iat:{isValid:a,message:'"iat" should be a number of seconds'},exp:{isValid:a,message:'"exp" should be a number of seconds'},nbf:{isValid:a,message:'"nbf" should be a number of seconds'}};function y(S,m,p,q){if(!d(p))throw new Error('Expected "'+q+'" to be a plain object.');Object.keys(p).forEach(function(V){let $=S[V];if(!$){if(!m)throw new Error('"'+V+'" is not allowed in "'+q+'"');return}if(!$.isValid(p[V]))throw new Error($.message)})}function R(S){return y(O,!1,S,"options")}function w(S){return y(k,!0,S,"payload")}var L={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},D=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];n.exports=function(S,m,p,q){typeof p=="function"?(q=p,p={}):p=p||{};let V=typeof S=="object"&&!Buffer.isBuffer(S),$=Object.assign({alg:p.algorithm||"HS256",typ:V?"JWT":void 0,kid:p.keyid},p.header);function E(N){if(q)return q(N);throw N}if(!m&&p.algorithm!=="none")return E(new Error("secretOrPrivateKey must have a value"));if(m!=null&&!(m instanceof I))try{m=v(m)}catch{try{m=C(typeof m=="string"?Buffer.from(m):m)}catch{return E(new Error("secretOrPrivateKey is not valid key material"))}}if($.alg.startsWith("HS")&&m.type!=="secret")return E(new Error(`secretOrPrivateKey must be a symmetric key when using ${$.alg}`));if(/^(?:RS|PS|ES)/.test($.alg)){if(m.type!=="private")return E(new Error(`secretOrPrivateKey must be an asymmetric key when using ${$.alg}`));if(!p.allowInsecureKeySizes&&!$.alg.startsWith("ES")&&m.asymmetricKeyDetails!==void 0&&m.asymmetricKeyDetails.modulusLength<2048)return E(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${$.alg}`))}if(typeof S>"u")return E(new Error("payload is required"));if(V){try{w(S)}catch(N){return E(N)}p.mutatePayload||(S=Object.assign({},S))}else{let N=D.filter(function(M){return typeof p[M]<"u"});if(N.length>0)return E(new Error("invalid "+N.join(",")+" option for "+typeof S+" payload"))}if(typeof S.exp<"u"&&typeof p.expiresIn<"u")return E(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof S.nbf<"u"&&typeof p.notBefore<"u")return E(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{R(p)}catch(N){return E(N)}if(!p.allowInvalidAsymmetricKeyTypes)try{i($.alg,m)}catch(N){return E(N)}let B=S.iat||Math.floor(Date.now()/1e3);if(p.noTimestamp?delete S.iat:V&&(S.iat=B),typeof p.notBefore<"u"){try{S.nbf=t(p.notBefore,B)}catch(N){return E(N)}if(typeof S.nbf>"u")return E(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof p.expiresIn<"u"&&typeof S=="object"){try{S.exp=t(p.expiresIn,B)}catch(N){return E(N)}if(typeof S.exp>"u")return E(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(L).forEach(function(N){let M=L[N];if(typeof p[N]<"u"){if(typeof S[M]<"u")return E(new Error('Bad "options.'+N+'" option. The payload already has an "'+M+'" property.'));S[M]=p[N]}});let j=p.encoding||"utf8";if(typeof q=="function")q=q&&g(q),s.createSign({header:$,privateKey:m,payload:S,encoding:j}).once("error",q).once("done",function(N){if(!p.allowInsecureKeySizes&&/^(?:RS|PS)/.test($.alg)&&N.length<256)return q(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${$.alg}`));q(null,N)});else{let N=s.sign({header:$,payload:S,secret:m,encoding:j});if(!p.allowInsecureKeySizes&&/^(?:RS|PS)/.test($.alg)&&N.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${$.alg}`);return N}}}),m6=Ae((e,n)=>{n.exports={verify:p6(),sign:g6(),JsonWebTokenError:Wc(),NotBeforeError:vv(),TokenExpiredError:bv()},Object.defineProperty(n.exports,"decode",{enumerable:!1,value:Sv()})}),Pv={};y3(Pv,{BrowserName:()=>Bv,marketNameMap:()=>Lv,submitChrome:()=>DR,submitEdge:()=>zR,submitFirefox:()=>NI,submitItero:()=>S8,submitOpera:()=>UI,supportedBrowserSet:()=>v6});Mb.exports=g3(Pv);var Bv=(e=>(e.Chrome="chrome",e.Firefox="firefox",e.Opera="opera",e.Edge="edge",e.Itero="itero",e))(Bv||{}),v6=new Set(["chrome","edge","firefox","itero"]),Lv={chrome:"Chrome Web Store",edge:"Edge Add-ons",firefox:"Firefox Add-ons",itero:"Itero TestBed"},b6=require("fs"),Nv=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function _6(e){return Nv.includes(e)}var w6=["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",...Nv];function E6(e){return w6.includes(e)}var S6=["null","undefined","string","number","bigint","boolean","symbol"];function C6(e){return S6.includes(e)}function As(e){return n=>typeof n===e}var{toString:T6}=Object.prototype,Vu=e=>{let n=T6.call(e).slice(8,-1);if(/HTML\w+Element/.test(n)&&ie.domElement(e))return"HTMLElement";if(E6(n))return n},Mt=e=>n=>Vu(n)===e;function ie(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(ie.observable(e))return"Observable";if(ie.array(e))return"Array";if(ie.buffer(e))return"Buffer";let n=Vu(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"}ie.undefined=As("undefined");ie.string=As("string");var R6=As("number");ie.number=e=>R6(e)&&!ie.nan(e);ie.bigint=As("bigint");ie.function_=As("function");ie.null_=e=>e===null;ie.class_=e=>ie.function_(e)&&e.toString().startsWith("class ");ie.boolean=e=>e===!0||e===!1;ie.symbol=As("symbol");ie.numericString=e=>ie.string(e)&&!ie.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));ie.array=(e,n)=>Array.isArray(e)?ie.function_(n)?e.every(t=>n(t)):!0:!1;ie.buffer=e=>e?.constructor?.isBuffer?.(e)??!1;ie.blob=e=>Mt("Blob")(e);ie.nullOrUndefined=e=>ie.null_(e)||ie.undefined(e);ie.object=e=>!ie.null_(e)&&(typeof e=="object"||ie.function_(e));ie.iterable=e=>ie.function_(e?.[Symbol.iterator]);ie.asyncIterable=e=>ie.function_(e?.[Symbol.asyncIterator]);ie.generator=e=>ie.iterable(e)&&ie.function_(e?.next)&&ie.function_(e?.throw);ie.asyncGenerator=e=>ie.asyncIterable(e)&&ie.function_(e.next)&&ie.function_(e.throw);ie.nativePromise=e=>Mt("Promise")(e);var I6=e=>ie.function_(e?.then)&&ie.function_(e?.catch);ie.promise=e=>ie.nativePromise(e)||I6(e);ie.generatorFunction=Mt("GeneratorFunction");ie.asyncGeneratorFunction=e=>Vu(e)==="AsyncGeneratorFunction";ie.asyncFunction=e=>Vu(e)==="AsyncFunction";ie.boundFunction=e=>ie.function_(e)&&!e.hasOwnProperty("prototype");ie.regExp=Mt("RegExp");ie.date=Mt("Date");ie.error=Mt("Error");ie.map=e=>Mt("Map")(e);ie.set=e=>Mt("Set")(e);ie.weakMap=e=>Mt("WeakMap")(e);ie.weakSet=e=>Mt("WeakSet")(e);ie.weakRef=e=>Mt("WeakRef")(e);ie.int8Array=Mt("Int8Array");ie.uint8Array=Mt("Uint8Array");ie.uint8ClampedArray=Mt("Uint8ClampedArray");ie.int16Array=Mt("Int16Array");ie.uint16Array=Mt("Uint16Array");ie.int32Array=Mt("Int32Array");ie.uint32Array=Mt("Uint32Array");ie.float32Array=Mt("Float32Array");ie.float64Array=Mt("Float64Array");ie.bigInt64Array=Mt("BigInt64Array");ie.bigUint64Array=Mt("BigUint64Array");ie.arrayBuffer=Mt("ArrayBuffer");ie.sharedArrayBuffer=Mt("SharedArrayBuffer");ie.dataView=Mt("DataView");ie.enumCase=(e,n)=>Object.values(n).includes(e);ie.directInstanceOf=(e,n)=>Object.getPrototypeOf(e)===n.prototype;ie.urlInstance=e=>Mt("URL")(e);ie.urlString=e=>{if(!ie.string(e))return!1;try{return new URL(e),!0}catch{return!1}};ie.truthy=e=>!!e;ie.falsy=e=>!e;ie.nan=e=>Number.isNaN(e);ie.primitive=e=>ie.null_(e)||C6(typeof e);ie.integer=e=>Number.isInteger(e);ie.safeInteger=e=>Number.isSafeInteger(e);ie.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)};ie.typedArray=e=>_6(Vu(e));var A6=e=>ie.safeInteger(e)&&e>=0;ie.arrayLike=e=>!ie.nullOrUndefined(e)&&!ie.function_(e)&&A6(e.length);ie.inRange=(e,n)=>{if(ie.number(n))return e>=Math.min(0,n)&&e<=Math.max(n,0);if(ie.array(n)&&n.length===2)return e>=Math.min(...n)&&e<=Math.max(...n);throw new TypeError(`Invalid range: ${JSON.stringify(n)}`)};var k6=1,O6=["innerHTML","ownerDocument","style","attributes","nodeValue"];ie.domElement=e=>ie.object(e)&&e.nodeType===k6&&ie.string(e.nodeName)&&!ie.plainObject(e)&&O6.every(n=>n in e);ie.observable=e=>e?e===e[Symbol.observable]?.()||e===e["@@observable"]?.():!1;ie.nodeStream=e=>ie.object(e)&&ie.function_(e.pipe)&&!ie.observable(e);ie.infinite=e=>e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY;var xv=e=>n=>ie.integer(n)&&Math.abs(n%2)===e;ie.evenInteger=xv(0);ie.oddInteger=xv(1);ie.emptyArray=e=>ie.array(e)&&e.length===0;ie.nonEmptyArray=e=>ie.array(e)&&e.length>0;ie.emptyString=e=>ie.string(e)&&e.length===0;var P6=e=>ie.string(e)&&!/\S/.test(e);ie.emptyStringOrWhitespace=e=>ie.emptyString(e)||P6(e);ie.nonEmptyString=e=>ie.string(e)&&e.length>0;ie.nonEmptyStringAndNotWhitespace=e=>ie.string(e)&&!ie.emptyStringOrWhitespace(e);ie.emptyObject=e=>ie.object(e)&&!ie.map(e)&&!ie.set(e)&&Object.keys(e).length===0;ie.nonEmptyObject=e=>ie.object(e)&&!ie.map(e)&&!ie.set(e)&&Object.keys(e).length>0;ie.emptySet=e=>ie.set(e)&&e.size===0;ie.nonEmptySet=e=>ie.set(e)&&e.size>0;ie.emptyMap=e=>ie.map(e)&&e.size===0;ie.nonEmptyMap=e=>ie.map(e)&&e.size>0;ie.propertyKey=e=>ie.any([ie.string,ie.number,ie.symbol],e);ie.formData=e=>Mt("FormData")(e);ie.urlSearchParams=e=>Mt("URLSearchParams")(e);var Uv=(e,n,t)=>{if(!ie.function_(n))throw new TypeError(`Invalid predicate: ${JSON.stringify(n)}`);if(t.length===0)throw new TypeError("Invalid number of values");return e.call(t,n)};ie.any=(e,...n)=>(ie.array(e)?e:[e]).some(t=>Uv(Array.prototype.some,t,n));ie.all=(e,...n)=>Uv(Array.prototype.every,e,n);var Pe=(e,n,t,r={})=>{if(!e){let{multipleValues:i}=r,s=i?`received values of types ${[...new Set(t.map(u=>`\`${ie(u)}\``))].join(", ")}`:`received value of type \`${ie(t)}\``;throw new TypeError(`Expected value which is \`${n}\`, ${s}.`)}},le={undefined:e=>Pe(ie.undefined(e),"undefined",e),string:e=>Pe(ie.string(e),"string",e),number:e=>Pe(ie.number(e),"number",e),bigint:e=>Pe(ie.bigint(e),"bigint",e),function_:e=>Pe(ie.function_(e),"Function",e),null_:e=>Pe(ie.null_(e),"null",e),class_:e=>Pe(ie.class_(e),"Class",e),boolean:e=>Pe(ie.boolean(e),"boolean",e),symbol:e=>Pe(ie.symbol(e),"symbol",e),numericString:e=>Pe(ie.numericString(e),"string with a number",e),array:(e,n)=>{Pe(ie.array(e),"Array",e),n&&e.forEach(n)},buffer:e=>Pe(ie.buffer(e),"Buffer",e),blob:e=>Pe(ie.blob(e),"Blob",e),nullOrUndefined:e=>Pe(ie.nullOrUndefined(e),"null or undefined",e),object:e=>Pe(ie.object(e),"Object",e),iterable:e=>Pe(ie.iterable(e),"Iterable",e),asyncIterable:e=>Pe(ie.asyncIterable(e),"AsyncIterable",e),generator:e=>Pe(ie.generator(e),"Generator",e),asyncGenerator:e=>Pe(ie.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>Pe(ie.nativePromise(e),"native Promise",e),promise:e=>Pe(ie.promise(e),"Promise",e),generatorFunction:e=>Pe(ie.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>Pe(ie.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>Pe(ie.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>Pe(ie.boundFunction(e),"Function",e),regExp:e=>Pe(ie.regExp(e),"RegExp",e),date:e=>Pe(ie.date(e),"Date",e),error:e=>Pe(ie.error(e),"Error",e),map:e=>Pe(ie.map(e),"Map",e),set:e=>Pe(ie.set(e),"Set",e),weakMap:e=>Pe(ie.weakMap(e),"WeakMap",e),weakSet:e=>Pe(ie.weakSet(e),"WeakSet",e),weakRef:e=>Pe(ie.weakRef(e),"WeakRef",e),int8Array:e=>Pe(ie.int8Array(e),"Int8Array",e),uint8Array:e=>Pe(ie.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>Pe(ie.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>Pe(ie.int16Array(e),"Int16Array",e),uint16Array:e=>Pe(ie.uint16Array(e),"Uint16Array",e),int32Array:e=>Pe(ie.int32Array(e),"Int32Array",e),uint32Array:e=>Pe(ie.uint32Array(e),"Uint32Array",e),float32Array:e=>Pe(ie.float32Array(e),"Float32Array",e),float64Array:e=>Pe(ie.float64Array(e),"Float64Array",e),bigInt64Array:e=>Pe(ie.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>Pe(ie.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>Pe(ie.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>Pe(ie.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>Pe(ie.dataView(e),"DataView",e),enumCase:(e,n)=>Pe(ie.enumCase(e,n),"EnumCase",e),urlInstance:e=>Pe(ie.urlInstance(e),"URL",e),urlString:e=>Pe(ie.urlString(e),"string with a URL",e),truthy:e=>Pe(ie.truthy(e),"truthy",e),falsy:e=>Pe(ie.falsy(e),"falsy",e),nan:e=>Pe(ie.nan(e),"NaN",e),primitive:e=>Pe(ie.primitive(e),"primitive",e),integer:e=>Pe(ie.integer(e),"integer",e),safeInteger:e=>Pe(ie.safeInteger(e),"integer",e),plainObject:e=>Pe(ie.plainObject(e),"plain object",e),typedArray:e=>Pe(ie.typedArray(e),"TypedArray",e),arrayLike:e=>Pe(ie.arrayLike(e),"array-like",e),domElement:e=>Pe(ie.domElement(e),"HTMLElement",e),observable:e=>Pe(ie.observable(e),"Observable",e),nodeStream:e=>Pe(ie.nodeStream(e),"Node.js Stream",e),infinite:e=>Pe(ie.infinite(e),"infinite number",e),emptyArray:e=>Pe(ie.emptyArray(e),"empty array",e),nonEmptyArray:e=>Pe(ie.nonEmptyArray(e),"non-empty array",e),emptyString:e=>Pe(ie.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>Pe(ie.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>Pe(ie.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>Pe(ie.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>Pe(ie.emptyObject(e),"empty object",e),nonEmptyObject:e=>Pe(ie.nonEmptyObject(e),"non-empty object",e),emptySet:e=>Pe(ie.emptySet(e),"empty set",e),nonEmptySet:e=>Pe(ie.nonEmptySet(e),"non-empty set",e),emptyMap:e=>Pe(ie.emptyMap(e),"empty map",e),nonEmptyMap:e=>Pe(ie.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>Pe(ie.propertyKey(e),"PropertyKey",e),formData:e=>Pe(ie.formData(e),"FormData",e),urlSearchParams:e=>Pe(ie.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>Pe(ie.evenInteger(e),"even integer",e),oddInteger:e=>Pe(ie.oddInteger(e),"odd integer",e),directInstanceOf:(e,n)=>Pe(ie.directInstanceOf(e,n),"T",e),inRange:(e,n)=>Pe(ie.inRange(e,n),"in range",e),any:(e,...n)=>Pe(ie.any(e,...n),"predicate returns truthy for any value",n,{multipleValues:!0}),all:(e,...n)=>Pe(ie.all(e,...n),"predicate returns truthy for all values",n,{multipleValues:!0})};Object.defineProperties(ie,{class:{value:ie.class_},function:{value:ie.function_},null:{value:ie.null_}});Object.defineProperties(le,{class:{value:le.class_},function:{value:le.function_},null:{value:le.null_}});var W=ie,B6=require("node:events"),L6=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Zc=class{static fn(e){return(...n)=>new Zc((t,r,i)=>{n.push(i),e(...n).then(t,r)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((n,t)=>{this._reject=t;let r=u=>{(!this._isCanceled||!s.shouldReject)&&(this._isPending=!1,n(u))},i=u=>{this._isPending=!1,t(u)},s=u=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(u)};Object.defineProperties(s,{shouldReject:{get:()=>this._rejectOnCancel,set:u=>{this._rejectOnCancel=u}}}),e(r,i,s)})}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 L6(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Zc.prototype,Promise.prototype);function N6(e){return W.object(e)&&"_onResponse"in e}var Er=class extends Error{constructor(e,n,t){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,N6(t)?(Object.defineProperty(this,"request",{enumerable:!1,value:t}),Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),this.options=t.options):this.options=t,this.timings=this.request?.timings,W.string(n.stack)&&W.string(this.stack)){let r=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(r).split(` +}`;var ot=Ay(function(){return ht(J,Ve+"return "+ke).apply(t,ne)});if(ot.source=ke,yf(ot))throw ot;return ot}function OS(o){return Pt(o).toLowerCase()}function PS(o){return Pt(o).toUpperCase()}function BS(o,l,b){if(o=Pt(o),o&&(b||l===t))return Di(o);if(!o||!(l=In(l)))return o;var U=Sn(o),F=Sn(l),J=Xo(U,F),ne=wo(U,F)+1;return ko(U,J,ne).join("")}function LS(o,l,b){if(o=Pt(o),o&&(b||l===t))return o.slice(0,ll(o)+1);if(!o||!(l=In(l)))return o;var U=Sn(o),F=wo(U,Sn(l))+1;return ko(U,0,F).join("")}function NS(o,l,b){if(o=Pt(o),o&&(b||l===t))return o.replace(Gt,"");if(!o||!(l=In(l)))return o;var U=Sn(o),F=Xo(U,Sn(l));return ko(U,F).join("")}function xS(o,l){var b=p,U=q;if(sr(l)){var F="separator"in l?l.separator:F;b="length"in l?it(l.length):b,U="omission"in l?In(l.omission):U}o=Pt(o);var J=o.length;if(qi(o)){var ne=Sn(o);J=ne.length}if(b>=J)return o;var ue=b-So(U);if(ue<1)return U;var fe=ne?ko(ne,0,ue).join(""):o.slice(0,ue);if(F===t)return fe+U;if(ne&&(ue+=fe.length-ue),gf(F)){if(o.slice(ue).search(F)){var we,Se=fe;for(F.global||(F=Wa(F.source,Pt(tr.exec(F))+"g")),F.lastIndex=0;we=F.exec(Se);)var ke=we.index;fe=fe.slice(0,ke===t?ue:ke)}}else if(o.indexOf(In(F),ue)!=ue){var De=fe.lastIndexOf(F);De>-1&&(fe=fe.slice(0,De))}return fe+U}function US(o){return o=Pt(o),o&&_n.test(o)?o.replace(Qr,Rh):o}var DS=es(function(o,l,b){return o+(b?" ":"")+l.toUpperCase()}),bf=k0("toUpperCase");function Iy(o,l,b){return o=Pt(o),l=b?t:l,l===t?Eh(o)?Ah(o):bh(o):o.match(l)||[]}var Ay=ut(function(o,l){try{return Xr(o,t,l)}catch(b){return yf(b)?b:new Ke(b)}}),jS=Qi(function(o,l){return Fr(l,function(b){b=_i(b),Wi(o,b,df(o[b],o))}),o});function qS(o){var l=o==null?0:o.length,b=Ge();return o=l?qt(o,function(U){if(typeof U[1]!="function")throw new Br(u);return[b(U[0]),U[1]]}):[],ut(function(U){for(var F=-1;++FM)return[];var b=ae,U=de(o,ae);l=Ge(l),o-=ae;for(var F=Gs(U,l);++b0||l<0)?new pt(b):(o<0?b=b.takeRight(-o):o&&(b=b.drop(o)),l!==t&&(l=it(l),b=l<0?b.dropRight(-l):b.take(l-o)),b)},pt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},pt.prototype.toArray=function(){return this.take(ae)},vi(pt.prototype,function(o,l){var b=/^(?:filter|find|map|reject)|While$/.test(l),U=/^(?:head|last)$/.test(l),F=Y[U?"take"+(l=="last"?"Right":""):l],J=U||/^find/.test(l);F&&(Y.prototype[l]=function(){var ne=this.__wrapped__,ue=U?[1]:arguments,fe=ne instanceof pt,we=ue[0],Se=fe||tt(ne),ke=function(ft){var gt=F.apply(Y,$r([ft],ue));return U&&De?gt[0]:gt};Se&&b&&typeof we=="function"&&we.length!=1&&(fe=Se=!1);var De=this.__chain__,Ve=!!this.__actions__.length,Ye=J&&!De,ot=fe&&!Ve;if(!J&&Se){ne=ot?ne:new pt(this);var Xe=o.apply(ne,ue);return Xe.__actions__.push({func:Ol,args:[ke],thisArg:t}),new Hr(Xe,De)}return Ye&&ot?o.apply(this,ue):(Xe=this.thru(ke),Ye?U?Xe.value()[0]:Xe.value():Xe)})}),Fr(["pop","push","shift","sort","splice","unshift"],function(o){var l=Jo[o],b=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",U=/^(?:pop|shift)$/.test(o);Y.prototype[o]=function(){var F=arguments;if(U&&!this.__chain__){var J=this.value();return l.apply(tt(J)?J:[],F)}return this[b](function(ne){return l.apply(tt(ne)?ne:[],F)})}}),vi(pt.prototype,function(o,l){var b=Y[l];if(b){var U=b.name+"";_t.call(zr,U)||(zr[U]=[]),zr[U].push({name:l,func:b})}}),zr[Sl(t,O).name]=[{name:"wrapper",func:t}],pt.prototype.clone=Ub,pt.prototype.reverse=Db,pt.prototype.value=jb,Y.prototype.at=d2,Y.prototype.chain=p2,Y.prototype.commit=y2,Y.prototype.next=g2,Y.prototype.plant=v2,Y.prototype.reverse=b2,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=_2,Y.prototype.first=Y.prototype.head,Co&&(Y.prototype[Co]=m2),Y},Dn=gi();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(vr._=Dn,define(function(){return Dn})):hi?((hi.exports=Dn)._=Dn,Ma._=Dn):vr._=Dn}).call(e)}),l6=Ae((e,n)=>{var t=gv(),r=Ev(),i=wv(),s=sp(),{includes:u,isBoolean:h,isInteger:c,isNumber:a,isPlainObject:d,isString:f,once:g}=u6(),{KeyObject:I,createSecretKey:C,createPrivateKey:v}=require("crypto"),T=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];r&&T.splice(3,0,"PS256","PS384","PS512");var O={expiresIn:{isValid:function(S){return c(S)||f(S)&&S},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(S){return c(S)||f(S)&&S},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(S){return f(S)||Array.isArray(S)},message:'"audience" must be a string or array'},algorithm:{isValid:u.bind(null,T),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:f,message:'"encoding" must be a string'},issuer:{isValid:f,message:'"issuer" must be a string'},subject:{isValid:f,message:'"subject" must be a string'},jwtid:{isValid:f,message:'"jwtid" must be a string'},noTimestamp:{isValid:h,message:'"noTimestamp" must be a boolean'},keyid:{isValid:f,message:'"keyid" must be a string'},mutatePayload:{isValid:h,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:h,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:h,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},k={iat:{isValid:a,message:'"iat" should be a number of seconds'},exp:{isValid:a,message:'"exp" should be a number of seconds'},nbf:{isValid:a,message:'"nbf" should be a number of seconds'}};function y(S,m,p,q){if(!d(p))throw new Error('Expected "'+q+'" to be a plain object.');Object.keys(p).forEach(function(V){let $=S[V];if(!$){if(!m)throw new Error('"'+V+'" is not allowed in "'+q+'"');return}if(!$.isValid(p[V]))throw new Error($.message)})}function R(S){return y(O,!1,S,"options")}function w(S){return y(k,!0,S,"payload")}var L={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},D=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];n.exports=function(S,m,p,q){typeof p=="function"?(q=p,p={}):p=p||{};let V=typeof S=="object"&&!Buffer.isBuffer(S),$=Object.assign({alg:p.algorithm||"HS256",typ:V?"JWT":void 0,kid:p.keyid},p.header);function E(N){if(q)return q(N);throw N}if(!m&&p.algorithm!=="none")return E(new Error("secretOrPrivateKey must have a value"));if(m!=null&&!(m instanceof I))try{m=v(m)}catch{try{m=C(typeof m=="string"?Buffer.from(m):m)}catch{return E(new Error("secretOrPrivateKey is not valid key material"))}}if($.alg.startsWith("HS")&&m.type!=="secret")return E(new Error(`secretOrPrivateKey must be a symmetric key when using ${$.alg}`));if(/^(?:RS|PS|ES)/.test($.alg)){if(m.type!=="private")return E(new Error(`secretOrPrivateKey must be an asymmetric key when using ${$.alg}`));if(!p.allowInsecureKeySizes&&!$.alg.startsWith("ES")&&m.asymmetricKeyDetails!==void 0&&m.asymmetricKeyDetails.modulusLength<2048)return E(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${$.alg}`))}if(typeof S>"u")return E(new Error("payload is required"));if(V){try{w(S)}catch(N){return E(N)}p.mutatePayload||(S=Object.assign({},S))}else{let N=D.filter(function(M){return typeof p[M]<"u"});if(N.length>0)return E(new Error("invalid "+N.join(",")+" option for "+typeof S+" payload"))}if(typeof S.exp<"u"&&typeof p.expiresIn<"u")return E(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof S.nbf<"u"&&typeof p.notBefore<"u")return E(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{R(p)}catch(N){return E(N)}if(!p.allowInvalidAsymmetricKeyTypes)try{i($.alg,m)}catch(N){return E(N)}let B=S.iat||Math.floor(Date.now()/1e3);if(p.noTimestamp?delete S.iat:V&&(S.iat=B),typeof p.notBefore<"u"){try{S.nbf=t(p.notBefore,B)}catch(N){return E(N)}if(typeof S.nbf>"u")return E(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof p.expiresIn<"u"&&typeof S=="object"){try{S.exp=t(p.expiresIn,B)}catch(N){return E(N)}if(typeof S.exp>"u")return E(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(L).forEach(function(N){let M=L[N];if(typeof p[N]<"u"){if(typeof S[M]<"u")return E(new Error('Bad "options.'+N+'" option. The payload already has an "'+M+'" property.'));S[M]=p[N]}});let j=p.encoding||"utf8";if(typeof q=="function")q=q&&g(q),s.createSign({header:$,privateKey:m,payload:S,encoding:j}).once("error",q).once("done",function(N){if(!p.allowInsecureKeySizes&&/^(?:RS|PS)/.test($.alg)&&N.length<256)return q(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${$.alg}`));q(null,N)});else{let N=s.sign({header:$,payload:S,secret:m,encoding:j});if(!p.allowInsecureKeySizes&&/^(?:RS|PS)/.test($.alg)&&N.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${$.alg}`);return N}}}),c6=Ae((e,n)=>{n.exports={verify:s6(),sign:l6(),JsonWebTokenError:Fc(),NotBeforeError:cv(),TokenExpiredError:hv()},Object.defineProperty(n.exports,"decode",{enumerable:!1,value:yv()})}),Sv={};u3(Sv,{BrowserName:()=>Cv,marketNameMap:()=>Tv,submitChrome:()=>OR,submitEdge:()=>DR,submitFirefox:()=>II,submitItero:()=>g8,submitOpera:()=>kI,supportedBrowserSet:()=>h6});Bb.exports=l3(Sv);var Cv=(e=>(e.Chrome="chrome",e.Firefox="firefox",e.Opera="opera",e.Edge="edge",e.Itero="itero",e))(Cv||{}),h6=new Set(["chrome","edge","firefox","itero"]),Tv={chrome:"Chrome Web Store",edge:"Edge Add-ons",firefox:"Firefox Add-ons",itero:"Itero TestBed"},f6=require("fs"),Rv=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function d6(e){return Rv.includes(e)}var p6=["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",...Rv];function y6(e){return p6.includes(e)}var g6=["null","undefined","string","number","bigint","boolean","symbol"];function m6(e){return g6.includes(e)}function Is(e){return n=>typeof n===e}var{toString:v6}=Object.prototype,qu=e=>{let n=v6.call(e).slice(8,-1);if(/HTML\w+Element/.test(n)&&ie.domElement(e))return"HTMLElement";if(y6(n))return n},Mt=e=>n=>qu(n)===e;function ie(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(ie.observable(e))return"Observable";if(ie.array(e))return"Array";if(ie.buffer(e))return"Buffer";let n=qu(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"}ie.undefined=Is("undefined");ie.string=Is("string");var b6=Is("number");ie.number=e=>b6(e)&&!ie.nan(e);ie.bigint=Is("bigint");ie.function_=Is("function");ie.null_=e=>e===null;ie.class_=e=>ie.function_(e)&&e.toString().startsWith("class ");ie.boolean=e=>e===!0||e===!1;ie.symbol=Is("symbol");ie.numericString=e=>ie.string(e)&&!ie.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));ie.array=(e,n)=>Array.isArray(e)?ie.function_(n)?e.every(t=>n(t)):!0:!1;ie.buffer=e=>e?.constructor?.isBuffer?.(e)??!1;ie.blob=e=>Mt("Blob")(e);ie.nullOrUndefined=e=>ie.null_(e)||ie.undefined(e);ie.object=e=>!ie.null_(e)&&(typeof e=="object"||ie.function_(e));ie.iterable=e=>ie.function_(e?.[Symbol.iterator]);ie.asyncIterable=e=>ie.function_(e?.[Symbol.asyncIterator]);ie.generator=e=>ie.iterable(e)&&ie.function_(e?.next)&&ie.function_(e?.throw);ie.asyncGenerator=e=>ie.asyncIterable(e)&&ie.function_(e.next)&&ie.function_(e.throw);ie.nativePromise=e=>Mt("Promise")(e);var _6=e=>ie.function_(e?.then)&&ie.function_(e?.catch);ie.promise=e=>ie.nativePromise(e)||_6(e);ie.generatorFunction=Mt("GeneratorFunction");ie.asyncGeneratorFunction=e=>qu(e)==="AsyncGeneratorFunction";ie.asyncFunction=e=>qu(e)==="AsyncFunction";ie.boundFunction=e=>ie.function_(e)&&!e.hasOwnProperty("prototype");ie.regExp=Mt("RegExp");ie.date=Mt("Date");ie.error=Mt("Error");ie.map=e=>Mt("Map")(e);ie.set=e=>Mt("Set")(e);ie.weakMap=e=>Mt("WeakMap")(e);ie.weakSet=e=>Mt("WeakSet")(e);ie.weakRef=e=>Mt("WeakRef")(e);ie.int8Array=Mt("Int8Array");ie.uint8Array=Mt("Uint8Array");ie.uint8ClampedArray=Mt("Uint8ClampedArray");ie.int16Array=Mt("Int16Array");ie.uint16Array=Mt("Uint16Array");ie.int32Array=Mt("Int32Array");ie.uint32Array=Mt("Uint32Array");ie.float32Array=Mt("Float32Array");ie.float64Array=Mt("Float64Array");ie.bigInt64Array=Mt("BigInt64Array");ie.bigUint64Array=Mt("BigUint64Array");ie.arrayBuffer=Mt("ArrayBuffer");ie.sharedArrayBuffer=Mt("SharedArrayBuffer");ie.dataView=Mt("DataView");ie.enumCase=(e,n)=>Object.values(n).includes(e);ie.directInstanceOf=(e,n)=>Object.getPrototypeOf(e)===n.prototype;ie.urlInstance=e=>Mt("URL")(e);ie.urlString=e=>{if(!ie.string(e))return!1;try{return new URL(e),!0}catch{return!1}};ie.truthy=e=>!!e;ie.falsy=e=>!e;ie.nan=e=>Number.isNaN(e);ie.primitive=e=>ie.null_(e)||m6(typeof e);ie.integer=e=>Number.isInteger(e);ie.safeInteger=e=>Number.isSafeInteger(e);ie.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)};ie.typedArray=e=>d6(qu(e));var w6=e=>ie.safeInteger(e)&&e>=0;ie.arrayLike=e=>!ie.nullOrUndefined(e)&&!ie.function_(e)&&w6(e.length);ie.inRange=(e,n)=>{if(ie.number(n))return e>=Math.min(0,n)&&e<=Math.max(n,0);if(ie.array(n)&&n.length===2)return e>=Math.min(...n)&&e<=Math.max(...n);throw new TypeError(`Invalid range: ${JSON.stringify(n)}`)};var E6=1,S6=["innerHTML","ownerDocument","style","attributes","nodeValue"];ie.domElement=e=>ie.object(e)&&e.nodeType===E6&&ie.string(e.nodeName)&&!ie.plainObject(e)&&S6.every(n=>n in e);ie.observable=e=>e?e===e[Symbol.observable]?.()||e===e["@@observable"]?.():!1;ie.nodeStream=e=>ie.object(e)&&ie.function_(e.pipe)&&!ie.observable(e);ie.infinite=e=>e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY;var Iv=e=>n=>ie.integer(n)&&Math.abs(n%2)===e;ie.evenInteger=Iv(0);ie.oddInteger=Iv(1);ie.emptyArray=e=>ie.array(e)&&e.length===0;ie.nonEmptyArray=e=>ie.array(e)&&e.length>0;ie.emptyString=e=>ie.string(e)&&e.length===0;var C6=e=>ie.string(e)&&!/\S/.test(e);ie.emptyStringOrWhitespace=e=>ie.emptyString(e)||C6(e);ie.nonEmptyString=e=>ie.string(e)&&e.length>0;ie.nonEmptyStringAndNotWhitespace=e=>ie.string(e)&&!ie.emptyStringOrWhitespace(e);ie.emptyObject=e=>ie.object(e)&&!ie.map(e)&&!ie.set(e)&&Object.keys(e).length===0;ie.nonEmptyObject=e=>ie.object(e)&&!ie.map(e)&&!ie.set(e)&&Object.keys(e).length>0;ie.emptySet=e=>ie.set(e)&&e.size===0;ie.nonEmptySet=e=>ie.set(e)&&e.size>0;ie.emptyMap=e=>ie.map(e)&&e.size===0;ie.nonEmptyMap=e=>ie.map(e)&&e.size>0;ie.propertyKey=e=>ie.any([ie.string,ie.number,ie.symbol],e);ie.formData=e=>Mt("FormData")(e);ie.urlSearchParams=e=>Mt("URLSearchParams")(e);var Av=(e,n,t)=>{if(!ie.function_(n))throw new TypeError(`Invalid predicate: ${JSON.stringify(n)}`);if(t.length===0)throw new TypeError("Invalid number of values");return e.call(t,n)};ie.any=(e,...n)=>(ie.array(e)?e:[e]).some(t=>Av(Array.prototype.some,t,n));ie.all=(e,...n)=>Av(Array.prototype.every,e,n);var Pe=(e,n,t,r={})=>{if(!e){let{multipleValues:i}=r,s=i?`received values of types ${[...new Set(t.map(u=>`\`${ie(u)}\``))].join(", ")}`:`received value of type \`${ie(t)}\``;throw new TypeError(`Expected value which is \`${n}\`, ${s}.`)}},le={undefined:e=>Pe(ie.undefined(e),"undefined",e),string:e=>Pe(ie.string(e),"string",e),number:e=>Pe(ie.number(e),"number",e),bigint:e=>Pe(ie.bigint(e),"bigint",e),function_:e=>Pe(ie.function_(e),"Function",e),null_:e=>Pe(ie.null_(e),"null",e),class_:e=>Pe(ie.class_(e),"Class",e),boolean:e=>Pe(ie.boolean(e),"boolean",e),symbol:e=>Pe(ie.symbol(e),"symbol",e),numericString:e=>Pe(ie.numericString(e),"string with a number",e),array:(e,n)=>{Pe(ie.array(e),"Array",e),n&&e.forEach(n)},buffer:e=>Pe(ie.buffer(e),"Buffer",e),blob:e=>Pe(ie.blob(e),"Blob",e),nullOrUndefined:e=>Pe(ie.nullOrUndefined(e),"null or undefined",e),object:e=>Pe(ie.object(e),"Object",e),iterable:e=>Pe(ie.iterable(e),"Iterable",e),asyncIterable:e=>Pe(ie.asyncIterable(e),"AsyncIterable",e),generator:e=>Pe(ie.generator(e),"Generator",e),asyncGenerator:e=>Pe(ie.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>Pe(ie.nativePromise(e),"native Promise",e),promise:e=>Pe(ie.promise(e),"Promise",e),generatorFunction:e=>Pe(ie.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>Pe(ie.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>Pe(ie.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>Pe(ie.boundFunction(e),"Function",e),regExp:e=>Pe(ie.regExp(e),"RegExp",e),date:e=>Pe(ie.date(e),"Date",e),error:e=>Pe(ie.error(e),"Error",e),map:e=>Pe(ie.map(e),"Map",e),set:e=>Pe(ie.set(e),"Set",e),weakMap:e=>Pe(ie.weakMap(e),"WeakMap",e),weakSet:e=>Pe(ie.weakSet(e),"WeakSet",e),weakRef:e=>Pe(ie.weakRef(e),"WeakRef",e),int8Array:e=>Pe(ie.int8Array(e),"Int8Array",e),uint8Array:e=>Pe(ie.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>Pe(ie.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>Pe(ie.int16Array(e),"Int16Array",e),uint16Array:e=>Pe(ie.uint16Array(e),"Uint16Array",e),int32Array:e=>Pe(ie.int32Array(e),"Int32Array",e),uint32Array:e=>Pe(ie.uint32Array(e),"Uint32Array",e),float32Array:e=>Pe(ie.float32Array(e),"Float32Array",e),float64Array:e=>Pe(ie.float64Array(e),"Float64Array",e),bigInt64Array:e=>Pe(ie.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>Pe(ie.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>Pe(ie.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>Pe(ie.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>Pe(ie.dataView(e),"DataView",e),enumCase:(e,n)=>Pe(ie.enumCase(e,n),"EnumCase",e),urlInstance:e=>Pe(ie.urlInstance(e),"URL",e),urlString:e=>Pe(ie.urlString(e),"string with a URL",e),truthy:e=>Pe(ie.truthy(e),"truthy",e),falsy:e=>Pe(ie.falsy(e),"falsy",e),nan:e=>Pe(ie.nan(e),"NaN",e),primitive:e=>Pe(ie.primitive(e),"primitive",e),integer:e=>Pe(ie.integer(e),"integer",e),safeInteger:e=>Pe(ie.safeInteger(e),"integer",e),plainObject:e=>Pe(ie.plainObject(e),"plain object",e),typedArray:e=>Pe(ie.typedArray(e),"TypedArray",e),arrayLike:e=>Pe(ie.arrayLike(e),"array-like",e),domElement:e=>Pe(ie.domElement(e),"HTMLElement",e),observable:e=>Pe(ie.observable(e),"Observable",e),nodeStream:e=>Pe(ie.nodeStream(e),"Node.js Stream",e),infinite:e=>Pe(ie.infinite(e),"infinite number",e),emptyArray:e=>Pe(ie.emptyArray(e),"empty array",e),nonEmptyArray:e=>Pe(ie.nonEmptyArray(e),"non-empty array",e),emptyString:e=>Pe(ie.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>Pe(ie.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>Pe(ie.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>Pe(ie.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>Pe(ie.emptyObject(e),"empty object",e),nonEmptyObject:e=>Pe(ie.nonEmptyObject(e),"non-empty object",e),emptySet:e=>Pe(ie.emptySet(e),"empty set",e),nonEmptySet:e=>Pe(ie.nonEmptySet(e),"non-empty set",e),emptyMap:e=>Pe(ie.emptyMap(e),"empty map",e),nonEmptyMap:e=>Pe(ie.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>Pe(ie.propertyKey(e),"PropertyKey",e),formData:e=>Pe(ie.formData(e),"FormData",e),urlSearchParams:e=>Pe(ie.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>Pe(ie.evenInteger(e),"even integer",e),oddInteger:e=>Pe(ie.oddInteger(e),"odd integer",e),directInstanceOf:(e,n)=>Pe(ie.directInstanceOf(e,n),"T",e),inRange:(e,n)=>Pe(ie.inRange(e,n),"in range",e),any:(e,...n)=>Pe(ie.any(e,...n),"predicate returns truthy for any value",n,{multipleValues:!0}),all:(e,...n)=>Pe(ie.all(e,...n),"predicate returns truthy for all values",n,{multipleValues:!0})};Object.defineProperties(ie,{class:{value:ie.class_},function:{value:ie.function_},null:{value:ie.null_}});Object.defineProperties(le,{class:{value:le.class_},function:{value:le.function_},null:{value:le.null_}});var W=ie,T6=require("node:events"),R6=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Gc=class{static fn(e){return(...n)=>new Gc((t,r,i)=>{n.push(i),e(...n).then(t,r)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((n,t)=>{this._reject=t;let r=u=>{(!this._isCanceled||!s.shouldReject)&&(this._isPending=!1,n(u))},i=u=>{this._isPending=!1,t(u)},s=u=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(u)};Object.defineProperties(s,{shouldReject:{get:()=>this._rejectOnCancel,set:u=>{this._rejectOnCancel=u}}}),e(r,i,s)})}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 R6(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Gc.prototype,Promise.prototype);function I6(e){return W.object(e)&&"_onResponse"in e}var Er=class extends Error{constructor(e,n,t){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,I6(t)?(Object.defineProperty(this,"request",{enumerable:!1,value:t}),Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),this.options=t.options):this.options=t,this.timings=this.request?.timings,W.string(n.stack)&&W.string(this.stack)){let r=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(r).split(` `).reverse(),s=n.stack.slice(n.stack.indexOf(n.message)+n.message.length).split(` `).reverse();for(;s.length>0&&s[0]===i[0];)i.shift();this.stack=`${this.stack.slice(0,r)}${i.reverse().join(` `)}${s.reverse().join(` -`)}`}}},x6=class extends Er{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},kc=class extends Er{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},U6=class extends Er{constructor(e,n){super(e.message,e,n),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},Mg=class extends Er{constructor(e,n){super(e.message,e,n),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},D6=class extends Er{constructor(e,n,t){super(e.message,e,t),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}},Vg=class extends Er{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}},j6=class extends Er{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},q6=class extends Er{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},Dv=xt(require("node:process"),1),ed=require("node:buffer"),M6=require("node:stream"),td=xt(require("node:http"),1),V6=require("events"),F6=require("util"),$6=xt(m3(),1),z6=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 t=u=>{u.once(V6.errorMonitor,()=>{n.error=Date.now(),n.phases.total=n.error-n.start})};t(e);let r=()=>{n.abort=Date.now(),n.phases.total=n.abort-n.start};e.prependOnceListener("abort",r);let i=u=>{if(n.socket=Date.now(),n.phases.wait=n.socket-n.start,F6.types.isProxy(u))return;let h=()=>{n.lookup=Date.now(),n.phases.dns=n.lookup-n.socket};u.prependOnceListener("lookup",h),(0,$6.default)(u,{connect:()=>{n.connect=Date.now(),n.lookup===void 0&&(u.removeListener("lookup",h),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 s=()=>{n.upload=Date.now(),n.phases.request=n.upload-(n.secureConnect??n.connect)};return e.writableFinished?s():e.prependOnceListener("finish",s),e.prependOnceListener("response",u=>{n.response=Date.now(),n.phases.firstByte=n.response-n.upload,u.timings=n,t(u),u.prependOnceListener("end",()=>{e.off("abort",r),u.off("aborted",r),!n.phases.total&&(n.end=Date.now(),n.phases.download=n.end-n.response,n.phases.total=n.end-n.start)}),u.prependOnceListener("aborted",r)}),n},jv=z6,H6=xt(require("node:events"),1),Xl=xt(require("node:url"),1),K6=xt(require("node:crypto"),1),qv=xt(require("node:stream"),1),W6="text/plain",G6="us-ascii",rd=(e,n)=>n.some(t=>t instanceof RegExp?t.test(e):t===e),Q6=new Set(["https:","http:","file:"]),Y6=e=>{try{let{protocol:n}=new URL(e);return n.endsWith(":")&&!Q6.has(n)}catch{return!1}},X6=(e,{stripHash:n})=>{let t=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!t)throw new Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:s}=t.groups,u=r.split(";");s=n?"":s;let h=!1;u[u.length-1]==="base64"&&(u.pop(),h=!0);let c=u.shift()?.toLowerCase()??"",a=[...u.map(d=>{let[f,g=""]=d.split("=").map(I=>I.trim());return f==="charset"&&(g=g.toLowerCase(),g===G6)?"":`${f}${g?`=${g}`:""}`}).filter(Boolean)];return h&&a.push("base64"),(a.length>0||c&&c!==W6)&&a.unshift(c),`data:${a.join(";")},${h?i.trim():i}${s?`#${s}`:""}`};function J6(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},typeof n.defaultProtocol=="string"&&!n.defaultProtocol.endsWith(":")&&(n.defaultProtocol=`${n.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return X6(e,n);if(Y6(e))return e;let t=e.startsWith("//");!t&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,n.defaultProtocol));let r=new URL(e);if(n.forceHttp&&n.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(n.forceHttp&&r.protocol==="https:"&&(r.protocol="http:"),n.forceHttps&&r.protocol==="http:"&&(r.protocol="https:"),n.stripAuthentication&&(r.username="",r.password=""),n.stripHash?r.hash="":n.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){let s=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,u=0,h="";for(;;){let a=s.exec(r.pathname);if(!a)break;let d=a[0],f=a.index,g=r.pathname.slice(u,f);h+=g.replace(/\/{2,}/g,"/"),h+=d,u=f+d.length}let c=r.pathname.slice(u,r.pathname.length);h+=c.replace(/\/{2,}/g,"/"),r.pathname=h}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(n.removeDirectoryIndex===!0&&(n.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(n.removeDirectoryIndex)&&n.removeDirectoryIndex.length>0){let s=r.pathname.split("/"),u=s[s.length-1];rd(u,n.removeDirectoryIndex)&&(s=s.slice(0,-1),r.pathname=s.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),n.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(n.removeQueryParameters))for(let s of[...r.searchParams.keys()])rd(s,n.removeQueryParameters)&&r.searchParams.delete(s);if(!Array.isArray(n.keepQueryParameters)&&n.removeQueryParameters===!0&&(r.search=""),Array.isArray(n.keepQueryParameters)&&n.keepQueryParameters.length>0)for(let s of[...r.searchParams.keys()])rd(s,n.keepQueryParameters)||r.searchParams.delete(s);if(n.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}n.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,"")),n.removeExplicitPort&&r.port&&(r.port="");let i=e;return e=r.toString(),!n.removeSingleSlash&&r.pathname==="/"&&!i.endsWith("/")&&r.hash===""&&(e=e.replace(/\/$/,"")),(n.removeTrailingSlash||r.pathname==="/")&&r.hash===""&&n.removeSingleSlash&&(e=e.replace(/\/$/,"")),t&&!n.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),n.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var Z6=xt(cp(),1),nd=xt(b3(),1),e4=require("node:stream");function ku(e){return Object.fromEntries(Object.entries(e).map(([n,t])=>[n.toLowerCase(),t]))}var Fg=class extends e4.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:n,body:t,url:r}){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(!(t instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof r!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(t),this.push(null)}}),this.statusCode=e,this.headers=ku(n),this.body=t,this.url=r}},Jl=xt(w3(),1),t4=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function r4(e,n){if(n._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set([...Object.keys(e),...t4]),r={};for(let i of t)i in n||(r[i]={get(){let s=e[i];return typeof s=="function"?s.bind(e):s},set(s){e[i]=s},enumerable:!0,configurable:!1});return Object.defineProperties(n,r),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 n4=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},ps=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},i4=class{constructor(e,n){this.hooks=new Map,this.request=()=>(t,r)=>{let i;if(typeof t=="string")i=id(Xl.default.parse(t)),t={};else if(t instanceof Xl.default.URL)i=id(Xl.default.parse(t.toString())),t={};else{let[f,...g]=(t.path??"").split("?"),I=g.length>0?`?${g.join("?")}`:"";i=id({...t,pathname:f,search:I})}t={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...t,...s4(i)},t.headers=Object.fromEntries(o4(t.headers).map(([f,g])=>[f.toLowerCase(),g]));let s=new H6.default,u=J6(Xl.default.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),h=`${t.method}:${u}`;t.body&&t.method!==void 0&&["POST","PATCH","PUT"].includes(t.method)&&(t.body instanceof qv.default.Readable?t.cache=!1:h+=`:${K6.default.createHash("md5").update(t.body).digest("hex")}`);let c=!1,a=!1,d=f=>{a=!0;let g=!1,I=()=>{},C=new Promise(T=>{I=()=>{g||(g=!0,T())}}),v=async T=>{if(c){T.status=T.statusCode;let k=nd.default.fromObject(c.cachePolicy).revalidatedPolicy(f,T);if(!k.modified){T.resume(),await new Promise(R=>{T.once("end",R)});let y=$g(k.policy.responseHeaders());T=new Fg({statusCode:c.statusCode,headers:y,body:c.body,url:c.url}),T.cachePolicy=k.policy,T.fromCache=!0}}T.fromCache||(T.cachePolicy=new nd.default(f,T,f),T.fromCache=!1);let O;f.cache&&T.cachePolicy.storable()?(O=a4(T),(async()=>{try{let k=Z6.default.buffer(T);await Promise.race([C,new Promise(L=>T.once("end",L)),new Promise(L=>T.once("close",L))]);let y=await k,R={url:T.url,statusCode:T.fromCache?c.statusCode:T.statusCode,body:y,cachePolicy:T.cachePolicy.toObject()},w=f.strictTtl?T.cachePolicy.timeToLive():void 0;if(f.maxTtl&&(w=w?Math.min(w,f.maxTtl):f.maxTtl),this.hooks.size>0)for(let L of this.hooks.keys())R=await this.runHook(L,R,T);await this.cache.set(h,R,w)}catch(k){s.emit("error",new ps(k))}})()):f.cache&&c&&(async()=>{try{await this.cache.delete(h)}catch(k){s.emit("error",new ps(k))}})(),s.emit("response",O??T),typeof r=="function"&&r(O??T)};try{let T=this.cacheRequest(f,v);T.once("error",I),T.once("abort",I),T.once("destroy",I),s.emit("request",T)}catch(T){s.emit("error",new n4(T))}};return(async()=>{let f=async I=>{await Promise.resolve();let C=I.cache?await this.cache.get(h):void 0;if(C===void 0&&!I.forceRefresh){d(I);return}let v=nd.default.fromObject(C.cachePolicy);if(v.satisfiesWithoutRevalidation(I)&&!I.forceRefresh){let T=$g(v.responseHeaders()),O=new Fg({statusCode:C.statusCode,headers:T,body:C.body,url:C.url});O.cachePolicy=v,O.fromCache=!0,s.emit("response",O),typeof r=="function"&&r(O)}else v.satisfiesWithoutRevalidation(I)&&Date.now()>=v.timeToLive()&&I.forceRefresh?(await this.cache.delete(h),I.headers=v.revalidationHeaders(I),d(I)):(c=C,I.headers=v.revalidationHeaders(I),d(I))},g=I=>s.emit("error",new ps(I));if(this.cache instanceof Jl.default){let I=this.cache;I.once("error",g),s.on("error",()=>I.removeListener("error",g)),s.on("response",()=>I.removeListener("error",g))}try{await f(t)}catch(I){t.automaticFailover&&!a&&d(t),s.emit("error",new ps(I))}})(),s},this.addHook=(t,r)=>{this.hooks.has(t)||this.hooks.set(t,r)},this.removeHook=t=>this.hooks.delete(t),this.getHook=t=>this.hooks.get(t),this.runHook=async(t,...r)=>this.hooks.get(t)?.(...r),n instanceof Jl.default?this.cache=n:typeof n=="string"?this.cache=new Jl.default({uri:n,namespace:"cacheable-request"}):this.cache=new Jl.default({store:n,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},o4=Object.entries,a4=e=>{let n=new qv.PassThrough({autoDestroy:!1});return r4(e,n),e.pipe(n)},s4=e=>{let n={...e};return n.path=`${e.pathname||"/"}${e.search||""}`,delete n.pathname,delete n.search,n},id=e=>({protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}),$g=e=>{let n=[];for(let t of Object.keys(e))n[t.toLowerCase()]=e[t];return n},Mv=i4,u4=xt(av(),1),l4=xt(cp(),1),io=e=>typeof e=="function",c4=e=>io(e[Symbol.asyncIterator]);async function*h4(e){let n=e.getReader();for(;;){let{done:t,value:r}=await n.read();if(t)break;yield r}}var f4=e=>{if(c4(e))return e;if(io(e.getReader))return h4(e);throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")},zg="abcdefghijklmnopqrstuvwxyz0123456789";function d4(){let e=16,n="";for(;e--;)n+=zg[Math.random()*zg.length<<0];return n}var Hg=e=>String(e).replace(/\r|\n/g,(n,t,r)=>n==="\r"&&r[t+1]!==` +`)}`}}},A6=class extends Er{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Tc=class extends Er{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},k6=class extends Er{constructor(e,n){super(e.message,e,n),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},Lg=class extends Er{constructor(e,n){super(e.message,e,n),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},O6=class extends Er{constructor(e,n,t){super(e.message,e,t),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}},Ng=class extends Er{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}},P6=class extends Er{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},B6=class extends Er{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},kv=xt(require("node:process"),1),Qf=require("node:buffer"),L6=require("node:stream"),Yf=xt(require("node:http"),1),N6=require("events"),x6=require("util"),U6=xt(c3(),1),D6=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 t=u=>{u.once(N6.errorMonitor,()=>{n.error=Date.now(),n.phases.total=n.error-n.start})};t(e);let r=()=>{n.abort=Date.now(),n.phases.total=n.abort-n.start};e.prependOnceListener("abort",r);let i=u=>{if(n.socket=Date.now(),n.phases.wait=n.socket-n.start,x6.types.isProxy(u))return;let h=()=>{n.lookup=Date.now(),n.phases.dns=n.lookup-n.socket};u.prependOnceListener("lookup",h),(0,U6.default)(u,{connect:()=>{n.connect=Date.now(),n.lookup===void 0&&(u.removeListener("lookup",h),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 s=()=>{n.upload=Date.now(),n.phases.request=n.upload-(n.secureConnect??n.connect)};return e.writableFinished?s():e.prependOnceListener("finish",s),e.prependOnceListener("response",u=>{n.response=Date.now(),n.phases.firstByte=n.response-n.upload,u.timings=n,t(u),u.prependOnceListener("end",()=>{e.off("abort",r),u.off("aborted",r),!n.phases.total&&(n.end=Date.now(),n.phases.download=n.end-n.response,n.phases.total=n.end-n.start)}),u.prependOnceListener("aborted",r)}),n},Ov=D6,j6=xt(require("node:events"),1),Ql=xt(require("node:url"),1),q6=xt(require("node:crypto"),1),Pv=xt(require("node:stream"),1),M6="text/plain",V6="us-ascii",Xf=(e,n)=>n.some(t=>t instanceof RegExp?t.test(e):t===e),F6=new Set(["https:","http:","file:"]),$6=e=>{try{let{protocol:n}=new URL(e);return n.endsWith(":")&&!F6.has(n)}catch{return!1}},z6=(e,{stripHash:n})=>{let t=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!t)throw new Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:s}=t.groups,u=r.split(";");s=n?"":s;let h=!1;u[u.length-1]==="base64"&&(u.pop(),h=!0);let c=u.shift()?.toLowerCase()??"",a=[...u.map(d=>{let[f,g=""]=d.split("=").map(I=>I.trim());return f==="charset"&&(g=g.toLowerCase(),g===V6)?"":`${f}${g?`=${g}`:""}`}).filter(Boolean)];return h&&a.push("base64"),(a.length>0||c&&c!==M6)&&a.unshift(c),`data:${a.join(";")},${h?i.trim():i}${s?`#${s}`:""}`};function H6(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},typeof n.defaultProtocol=="string"&&!n.defaultProtocol.endsWith(":")&&(n.defaultProtocol=`${n.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return z6(e,n);if($6(e))return e;let t=e.startsWith("//");!t&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,n.defaultProtocol));let r=new URL(e);if(n.forceHttp&&n.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(n.forceHttp&&r.protocol==="https:"&&(r.protocol="http:"),n.forceHttps&&r.protocol==="http:"&&(r.protocol="https:"),n.stripAuthentication&&(r.username="",r.password=""),n.stripHash?r.hash="":n.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){let s=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,u=0,h="";for(;;){let a=s.exec(r.pathname);if(!a)break;let d=a[0],f=a.index,g=r.pathname.slice(u,f);h+=g.replace(/\/{2,}/g,"/"),h+=d,u=f+d.length}let c=r.pathname.slice(u,r.pathname.length);h+=c.replace(/\/{2,}/g,"/"),r.pathname=h}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(n.removeDirectoryIndex===!0&&(n.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(n.removeDirectoryIndex)&&n.removeDirectoryIndex.length>0){let s=r.pathname.split("/"),u=s[s.length-1];Xf(u,n.removeDirectoryIndex)&&(s=s.slice(0,-1),r.pathname=s.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),n.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(n.removeQueryParameters))for(let s of[...r.searchParams.keys()])Xf(s,n.removeQueryParameters)&&r.searchParams.delete(s);if(!Array.isArray(n.keepQueryParameters)&&n.removeQueryParameters===!0&&(r.search=""),Array.isArray(n.keepQueryParameters)&&n.keepQueryParameters.length>0)for(let s of[...r.searchParams.keys()])Xf(s,n.keepQueryParameters)||r.searchParams.delete(s);if(n.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}n.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,"")),n.removeExplicitPort&&r.port&&(r.port="");let i=e;return e=r.toString(),!n.removeSingleSlash&&r.pathname==="/"&&!i.endsWith("/")&&r.hash===""&&(e=e.replace(/\/$/,"")),(n.removeTrailingSlash||r.pathname==="/")&&r.hash===""&&n.removeSingleSlash&&(e=e.replace(/\/$/,"")),t&&!n.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),n.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var K6=xt(op(),1),Jf=xt(f3(),1),W6=require("node:stream");function Au(e){return Object.fromEntries(Object.entries(e).map(([n,t])=>[n.toLowerCase(),t]))}var xg=class extends W6.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:n,body:t,url:r}){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(!(t instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof r!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(t),this.push(null)}}),this.statusCode=e,this.headers=Au(n),this.body=t,this.url=r}},Yl=xt(p3(),1),G6=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function Q6(e,n){if(n._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set([...Object.keys(e),...G6]),r={};for(let i of t)i in n||(r[i]={get(){let s=e[i];return typeof s=="function"?s.bind(e):s},set(s){e[i]=s},enumerable:!0,configurable:!1});return Object.defineProperties(n,r),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 Y6=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},ds=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},X6=class{constructor(e,n){this.hooks=new Map,this.request=()=>(t,r)=>{let i;if(typeof t=="string")i=Zf(Ql.default.parse(t)),t={};else if(t instanceof Ql.default.URL)i=Zf(Ql.default.parse(t.toString())),t={};else{let[f,...g]=(t.path??"").split("?"),I=g.length>0?`?${g.join("?")}`:"";i=Zf({...t,pathname:f,search:I})}t={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...t,...e4(i)},t.headers=Object.fromEntries(J6(t.headers).map(([f,g])=>[f.toLowerCase(),g]));let s=new j6.default,u=H6(Ql.default.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),h=`${t.method}:${u}`;t.body&&t.method!==void 0&&["POST","PATCH","PUT"].includes(t.method)&&(t.body instanceof Pv.default.Readable?t.cache=!1:h+=`:${q6.default.createHash("md5").update(t.body).digest("hex")}`);let c=!1,a=!1,d=f=>{a=!0;let g=!1,I=()=>{},C=new Promise(T=>{I=()=>{g||(g=!0,T())}}),v=async T=>{if(c){T.status=T.statusCode;let k=Jf.default.fromObject(c.cachePolicy).revalidatedPolicy(f,T);if(!k.modified){T.resume(),await new Promise(R=>{T.once("end",R)});let y=Ug(k.policy.responseHeaders());T=new xg({statusCode:c.statusCode,headers:y,body:c.body,url:c.url}),T.cachePolicy=k.policy,T.fromCache=!0}}T.fromCache||(T.cachePolicy=new Jf.default(f,T,f),T.fromCache=!1);let O;f.cache&&T.cachePolicy.storable()?(O=Z6(T),(async()=>{try{let k=K6.default.buffer(T);await Promise.race([C,new Promise(L=>T.once("end",L)),new Promise(L=>T.once("close",L))]);let y=await k,R={url:T.url,statusCode:T.fromCache?c.statusCode:T.statusCode,body:y,cachePolicy:T.cachePolicy.toObject()},w=f.strictTtl?T.cachePolicy.timeToLive():void 0;if(f.maxTtl&&(w=w?Math.min(w,f.maxTtl):f.maxTtl),this.hooks.size>0)for(let L of this.hooks.keys())R=await this.runHook(L,R,T);await this.cache.set(h,R,w)}catch(k){s.emit("error",new ds(k))}})()):f.cache&&c&&(async()=>{try{await this.cache.delete(h)}catch(k){s.emit("error",new ds(k))}})(),s.emit("response",O??T),typeof r=="function"&&r(O??T)};try{let T=this.cacheRequest(f,v);T.once("error",I),T.once("abort",I),T.once("destroy",I),s.emit("request",T)}catch(T){s.emit("error",new Y6(T))}};return(async()=>{let f=async I=>{await Promise.resolve();let C=I.cache?await this.cache.get(h):void 0;if(C===void 0&&!I.forceRefresh){d(I);return}let v=Jf.default.fromObject(C.cachePolicy);if(v.satisfiesWithoutRevalidation(I)&&!I.forceRefresh){let T=Ug(v.responseHeaders()),O=new xg({statusCode:C.statusCode,headers:T,body:C.body,url:C.url});O.cachePolicy=v,O.fromCache=!0,s.emit("response",O),typeof r=="function"&&r(O)}else v.satisfiesWithoutRevalidation(I)&&Date.now()>=v.timeToLive()&&I.forceRefresh?(await this.cache.delete(h),I.headers=v.revalidationHeaders(I),d(I)):(c=C,I.headers=v.revalidationHeaders(I),d(I))},g=I=>s.emit("error",new ds(I));if(this.cache instanceof Yl.default){let I=this.cache;I.once("error",g),s.on("error",()=>I.removeListener("error",g)),s.on("response",()=>I.removeListener("error",g))}try{await f(t)}catch(I){t.automaticFailover&&!a&&d(t),s.emit("error",new ds(I))}})(),s},this.addHook=(t,r)=>{this.hooks.has(t)||this.hooks.set(t,r)},this.removeHook=t=>this.hooks.delete(t),this.getHook=t=>this.hooks.get(t),this.runHook=async(t,...r)=>this.hooks.get(t)?.(...r),n instanceof Yl.default?this.cache=n:typeof n=="string"?this.cache=new Yl.default({uri:n,namespace:"cacheable-request"}):this.cache=new Yl.default({store:n,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},J6=Object.entries,Z6=e=>{let n=new Pv.PassThrough({autoDestroy:!1});return Q6(e,n),e.pipe(n)},e4=e=>{let n={...e};return n.path=`${e.pathname||"/"}${e.search||""}`,delete n.pathname,delete n.search,n},Zf=e=>({protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}),Ug=e=>{let n=[];for(let t of Object.keys(e))n[t.toLowerCase()]=e[t];return n},Bv=X6,t4=xt(Jm(),1),r4=xt(op(),1),io=e=>typeof e=="function",n4=e=>io(e[Symbol.asyncIterator]);async function*i4(e){let n=e.getReader();for(;;){let{done:t,value:r}=await n.read();if(t)break;yield r}}var o4=e=>{if(n4(e))return e;if(io(e.getReader))return i4(e);throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")},Dg="abcdefghijklmnopqrstuvwxyz0123456789";function a4(){let e=16,n="";for(;e--;)n+=Dg[Math.random()*Dg.length<<0];return n}var jg=e=>String(e).replace(/\r|\n/g,(n,t,r)=>n==="\r"&&r[t+1]!==` `||n===` `&&r[t-1]!=="\r"?`\r -`:n),p4=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function Kg(e){if(p4(e)!=="object")return!1;let n=Object.getPrototypeOf(e);return n==null?!0:(n.constructor&&n.constructor.toString())===Object.toString()}function Wg(e,n){if(typeof n=="string"){for(let[t,r]of Object.entries(e))if(n.toLowerCase()===t.toLowerCase())return r}}var y4=e=>new Proxy(e,{get:(n,t)=>Wg(n,t),has:(n,t)=>Wg(n,t)!==void 0}),Fu=e=>!!(e&&io(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&io(e.append)&&io(e.getAll)&&io(e.entries)&&io(e[Symbol.iterator])),Gg=e=>String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),da=e=>!!(e&&typeof e=="object"&&io(e.constructor)&&e[Symbol.toStringTag]==="File"&&io(e.stream)&&e.name!=null),fu=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},Yt=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},du,Do,pu,Zl,yu,pa,gu,mu,ec,od,Qg,g4={enableAdditionalHeaders:!1},tc={writable:!1,configurable:!1},Vv=class{constructor(e,n,t){if(du.add(this),Do.set(this,`\r -`),pu.set(this,void 0),Zl.set(this,void 0),yu.set(this,"-".repeat(2)),pa.set(this,new TextEncoder),gu.set(this,void 0),mu.set(this,void 0),ec.set(this,void 0),!Fu(e))throw new TypeError("Expected first argument to be a FormData instance.");let r;if(Kg(n)?t=n:r=n,r||(r=d4()),typeof r!="string")throw new TypeError("Expected boundary argument to be a string.");if(t&&!Kg(t))throw new TypeError("Expected options argument to be an object.");fu(this,mu,Array.from(e.entries()),"f"),fu(this,ec,{...g4,...t},"f"),fu(this,pu,Yt(this,pa,"f").encode(Yt(this,Do,"f")),"f"),fu(this,Zl,Yt(this,pu,"f").byteLength,"f"),this.boundary=`form-data-boundary-${r}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,fu(this,gu,Yt(this,pa,"f").encode(`${Yt(this,yu,"f")}${this.boundary}${Yt(this,yu,"f")}${Yt(this,Do,"f").repeat(2)}`),"f");let i={"Content-Type":this.contentType},s=Yt(this,du,"m",Qg).call(this);s&&(this.contentLength=s,i["Content-Length"]=s),this.headers=y4(Object.freeze(i)),Object.defineProperties(this,{boundary:tc,contentType:tc,contentLength:tc,headers:tc})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,n]of Yt(this,mu,"f")){let t=da(n)?n:Yt(this,pa,"f").encode(Hg(n));yield Yt(this,du,"m",od).call(this,e,t),yield t,yield Yt(this,pu,"f")}yield Yt(this,gu,"f")}async*encode(){for(let e of this.values())da(e)?yield*f4(e.stream()):yield e}[(Do=new WeakMap,pu=new WeakMap,Zl=new WeakMap,yu=new WeakMap,pa=new WeakMap,gu=new WeakMap,mu=new WeakMap,ec=new WeakMap,du=new WeakSet,od=function(e,n){let t="";t+=`${Yt(this,yu,"f")}${this.boundary}${Yt(this,Do,"f")}`,t+=`Content-Disposition: form-data; name="${Gg(e)}"`,da(n)&&(t+=`; filename="${Gg(n.name)}"${Yt(this,Do,"f")}`,t+=`Content-Type: ${n.type||"application/octet-stream"}`);let r=da(n)?n.size:n.byteLength;return Yt(this,ec,"f").enableAdditionalHeaders===!0&&r!=null&&!isNaN(r)&&(t+=`${Yt(this,Do,"f")}Content-Length: ${da(n)?n.size:n.byteLength}`),Yt(this,pa,"f").encode(`${t}${Yt(this,Do,"f").repeat(2)}`)},Qg=function(){let e=0;for(let[n,t]of Yt(this,mu,"f")){let r=da(t)?t:Yt(this,pa,"f").encode(Hg(t)),i=da(r)?r.size:r.byteLength;if(i==null||isNaN(i))return;e+=Yt(this,du,"m",od).call(this,n,r).byteLength,e+=i,e+=Yt(this,Zl,"f")}return String(e+Yt(this,gu,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}},m4=require("node:buffer"),v4=require("node:util");function Fv(e){return W.nodeStream(e)&&W.function_(e.getBoundary)}async function b4(e,n){if(n&&"content-length"in n)return Number(n["content-length"]);if(!e)return 0;if(W.string(e))return m4.Buffer.byteLength(e);if(W.buffer(e))return e.length;if(Fv(e))return(0,v4.promisify)(e.getLength.bind(e))()}function $v(e,n,t){let r={};for(let i of t){let s=(...u)=>{n.emit(i,...u)};r[i]=s,e.on(i,s)}return()=>{for(let[i,s]of Object.entries(r))e.off(i,s)}}var _4=xt(require("node:net"),1);function w4(){let e=[];return{once(n,t,r){n.once(t,r),e.push({origin:n,event:t,fn:r})},unhandleAll(){for(let n of e){let{origin:t,event:r,fn:i}=n;t.removeListener(r,i)}e.length=0}}}var Yg=Symbol("reentry"),E4=()=>{},zv=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 S4(e,n,t){if(Yg in e)return E4;e[Yg]=!0;let r=[],{once:i,unhandleAll:s}=w4(),u=(v,T,O)=>{let k=setTimeout(T,v,v,O);k.unref?.();let y=()=>{clearTimeout(k)};return r.push(y),y},{host:h,hostname:c}=t,a=(v,T)=>{e.destroy(new zv(v,T))},d=()=>{for(let v of r)v();s()};if(e.once("error",v=>{if(d(),e.listenerCount("error")===0)throw v}),n.request!==void 0){let v=u(n.request,a,"request");i(e,"response",T=>{i(T,"end",v)})}if(n.socket!==void 0){let{socket:v}=n,T=()=>{a(v,"socket")};e.setTimeout(v,T),r.push(()=>{e.removeListener("timeout",T)})}let f=n.lookup!==void 0,g=n.connect!==void 0,I=n.secureConnect!==void 0,C=n.send!==void 0;return(f||g||I||C)&&i(e,"socket",v=>{let{socketPath:T}=e;if(v.connecting){let O=!!(T??_4.default.isIP(c??h??"")!==0);if(f&&!O&&v.address().address===void 0){let k=u(n.lookup,a,"lookup");i(v,"lookup",k)}if(g){let k=()=>u(n.connect,a,"connect");O?i(v,"connect",k()):i(v,"lookup",y=>{y===null&&i(v,"connect",k())})}I&&t.protocol==="https:"&&i(v,"connect",()=>{let k=u(n.secureConnect,a,"secureConnect");i(v,"secureConnect",k)})}if(C){let O=()=>u(n.send,a,"send");v.connecting?i(v,"connect",()=>{i(e,"upload-complete",O())}):i(e,"upload-complete",O())}}),n.response!==void 0&&i(e,"upload-complete",()=>{let v=u(n.response,a,"response");i(e,"response",v)}),n.read!==void 0&&i(e,"response",v=>{let T=u(n.read,a,"read");i(v,"end",T)}),d}function C4(e){e=e;let n={protocol:e.protocol,hostname:W.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 W.string(e.port)&&e.port.length>0&&(n.port=Number(e.port)),(e.username||e.password)&&(n.auth=`${e.username||""}:${e.password||""}`),n}var T4=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)}},R4=({attemptCount:e,retryOptions:n,error:t,retryAfter:r,computedValue:i})=>{if(t.name==="RetryError")return 1;if(e>n.limit)return 0;let s=n.methods.includes(t.options.method),u=n.errorCodes.includes(t.code),h=t.response&&n.statusCodes.includes(t.response.statusCode);if(!s||!u&&!h)return 0;if(t.response){if(r)return r>i?0:r;if(t.response.statusCode===413)return 0}let c=Math.random()*n.noise;return Math.min(2**(e-1)*1e3,n.backoffLimit)+c},I4=R4,A4=xt(require("node:process"),1),ad=require("node:util"),k4=require("node:tls"),O4=xt(require("node:http"),1),P4=xt(require("node:https"),1),ys=require("node:dns"),sd=require("node:util"),B4=xt(require("node:os"),1),{Resolver:Xg}=ys.promises,hs=Symbol("cacheableLookupCreateConnection"),ud=Symbol("cacheableLookupInstance"),Jg=Symbol("expires"),L4=typeof ys.ALL=="number",Zg=e=>{if(!(e&&typeof e.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},N4=e=>{for(let n of e)n.family!==6&&(n.address=`::ffff:${n.address}`,n.family=6)},em=()=>{let e=!1,n=!1;for(let t of Object.values(B4.default.networkInterfaces()))for(let r of t)if(!r.internal&&(r.family==="IPv6"?n=!0:e=!0,e&&n))return{has4:e,has6:n};return{has4:e,has6:n}},x4=e=>Symbol.iterator in e,rc=e=>e.catch(n=>{if(n.code==="ENODATA"||n.code==="ENOTFOUND"||n.code==="ENOENT")return[];throw n}),tm={ttl:!0},U4={all:!0},D4={all:!0,family:4},j4={all:!0,family:6},Hv=class{constructor({cache:e=new Map,maxTtl:n=1/0,fallbackDuration:t=3600,errorTtl:r=.15,resolver:i=new Xg,lookup:s=ys.lookup}={}){if(this.maxTtl=n,this.errorTtl=r,this._cache=e,this._resolver=i,this._dnsLookup=s&&(0,sd.promisify)(s),this.stats={cache:0,query:0},this._resolver instanceof Xg?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,sd.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,sd.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=em(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=t,t>0){let u=setInterval(()=>{this._hostnamesToFallback.clear()},t*1e3);u.unref&&u.unref(),this._fallbackInterval=u}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,t){if(typeof n=="function"?(t=n,n={}):typeof n=="number"&&(n={family:n}),!t)throw new Error("Callback must be a function.");this.lookupAsync(e,n).then(r=>{n.all?t(null,r):t(null,r.address,r.family,r.expires,r.ttl,r.source)},t)}async lookupAsync(e,n={}){typeof n=="number"&&(n={family:n});let t=await this.query(e);if(n.family===6){let r=t.filter(i=>i.family===6);n.hints&ys.V4MAPPED&&(L4&&n.hints&ys.ALL||r.length===0)?N4(t):t=r}else n.family===4&&(t=t.filter(r=>r.family===4));if(n.hints&ys.ADDRCONFIG){let{_iface:r}=this;t=t.filter(i=>i.family===6?r.has6:r.has4)}if(t.length===0){let r=new Error(`cacheableLookup ENOTFOUND ${e}`);throw r.code="ENOTFOUND",r.hostname=e,r}return n.all?t:t[0]}async query(e){let n="cache",t=await this._cache.get(e);if(t&&this.stats.cache++,!t){let r=this._pending[e];if(r)this.stats.cache++,t=await r;else{n="query";let i=this.queryAndCache(e);this._pending[e]=i,this.stats.query++;try{t=await i}finally{delete this._pending[e]}}}return t=t.map(r=>({...r,source:n})),t}async _resolve(e){let[n,t]=await Promise.all([rc(this._resolve4(e,tm)),rc(this._resolve6(e,tm))]),r=0,i=0,s=0,u=Date.now();for(let h of n)h.family=4,h.expires=u+h.ttl*1e3,r=Math.max(r,h.ttl);for(let h of t)h.family=6,h.expires=u+h.ttl*1e3,i=Math.max(i,h.ttl);return n.length>0?t.length>0?s=Math.min(r,i):s=r:s=i,{entries:[...n,...t],cacheTtl:s}}async _lookup(e){try{let[n,t]=await Promise.all([rc(this._dnsLookup(e,D4)),rc(this._dnsLookup(e,j4))]);return{entries:[...n,...t],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,n,t){if(this.maxTtl>0&&t>0){t=Math.min(t,this.maxTtl)*1e3,n[Jg]=Date.now()+t;try{await this._cache.set(e,n,t)}catch(r){this.lookupAsync=async()=>{let i=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw i.cause=r,i}}x4(this._cache)&&this._tick(t)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,U4);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 t=n.entries.length===0?this.errorTtl:n.cacheTtl;return await this._set(e,n.entries,t),n.entries}_tick(e){let n=this._nextRemovalTime;(!n||e{this._nextRemovalTime=!1;let t=1/0,r=Date.now();for(let[i,s]of this._cache){let u=s[Jg];r>=u?this._cache.delete(i):u("lookup"in n||(n.lookup=this.lookup),e[hs](n,t))}uninstall(e){if(Zg(e),e[hs]){if(e[ud]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[hs],delete e[hs],delete e[ud]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=em(),(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()}},q4=xt(mv(),1);function M4(e){let n=[],t=e.split(",");for(let r of t){let[i,...s]=r.split(";"),u=i.trim();if(u[0]!=="<"||u[u.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${u}`);let h=u.slice(1,-1),c={};if(s.length===0)throw new Error(`Unexpected end of Link header parameters: ${s.join(";")}`);for(let a of s){let d=a.trim(),f=d.indexOf("=");if(f===-1)throw new Error(`Failed to parse Link header: ${e}`);let g=d.slice(0,f).trim(),I=d.slice(f+1).trim();c[g]=I}n.push({reference:h,parameters:c})}return n}var[rm,V4]=A4.default.versions.node.split(".").map(Number);function F4(e){for(let n in e){let t=e[n];le.any([W.string,W.number,W.boolean,W.null_,W.undefined],t)}}var $4=new Map,ld,z4=()=>ld||(ld=new Hv,ld),H4={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 t=M4(n).find(r=>r.parameters.rel==="next"||r.parameters.rel==='"next"');return t?{url:new URL(t.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:!1},K4=e=>{let{hooks:n,retry:t}=e,r={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...t,errorCodes:[...t.errorCodes],methods:[...t.methods],statusCodes:[...t.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 URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return r.url!==void 0&&(r.prefixUrl=""),r},W4=e=>{let{hooks:n,retry:t}=e,r={...e};return W.object(e.context)&&(r.context={...e.context}),W.object(e.cacheOptions)&&(r.cacheOptions={...e.cacheOptions}),W.object(e.https)&&(r.https={...e.https}),W.object(e.cacheOptions)&&(r.cacheOptions={...r.cacheOptions}),W.object(e.agent)&&(r.agent={...e.agent}),W.object(e.headers)&&(r.headers={...e.headers}),W.object(t)&&(r.retry={...t},W.array(t.errorCodes)&&(r.retry.errorCodes=[...t.errorCodes]),W.array(t.methods)&&(r.retry.methods=[...t.methods]),W.array(t.statusCodes)&&(r.retry.statusCodes=[...t.statusCodes])),W.object(e.timeout)&&(r.timeout={...e.timeout}),W.object(n)&&(r.hooks={...n},W.array(n.init)&&(r.hooks.init=[...n.init]),W.array(n.beforeRequest)&&(r.hooks.beforeRequest=[...n.beforeRequest]),W.array(n.beforeError)&&(r.hooks.beforeError=[...n.beforeError]),W.array(n.beforeRedirect)&&(r.hooks.beforeRedirect=[...n.beforeRedirect]),W.array(n.beforeRetry)&&(r.hooks.beforeRetry=[...n.beforeRetry]),W.array(n.afterResponse)&&(r.hooks.afterResponse=[...n.afterResponse])),W.object(e.pagination)&&(r.pagination={...e.pagination}),r},G4=e=>{let n=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(t=>typeof t=="number");if(n.length>0)return Math.min(...n)},nm=(e,n,t)=>{let r=e.hooks?.init;if(r)for(let i of r)i(n,t)},oo=class{constructor(e,n,t){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}),le.any([W.string,W.urlInstance,W.object,W.undefined],e),le.any([W.object,W.undefined],n),le.any([W.object,W.undefined],t),e instanceof oo||n instanceof oo)throw new TypeError("The defaults must be passed as the third argument");this._internals=K4(t?._internals??t??H4),this._init=[...t?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(W.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(r){throw r.options=this,r}}merge(e){if(e){if(e instanceof oo){for(let n of e._init)this.merge(n);return}e=W4(e),nm(this,e,this),nm(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let n=!1;for(let t in e){if(t==="mutableDefaults"||t==="handlers"||t==="url")continue;if(!(t in this))throw new Error(`Unexpected option: ${t}`);let r=e[t];r!==void 0&&(this[t]=r,n=!0)}n&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){le.any([W.function_,W.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.agent))throw new TypeError(`Unexpected agent option: ${n}`);le.any([W.object,W.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){le.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.timeout))throw new Error(`Unexpected timeout option: ${n}`);le.any([W.number,W.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(le.any([W.string,W.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){le.any([W.string,W.buffer,W.nodeStream,W.generator,W.asyncGenerator,Fu,W.undefined],e),W.nodeStream(e)&&le.truthy(e.readable),e!==void 0&&(le.undefined(this._internals.form),le.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){le.any([W.plainObject,W.undefined],e),e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(le.any([W.string,W.urlInstance,W.undefined],e),e===void 0){this._internals.url=void 0;return}if(W.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let n=`${this.prefixUrl}${e.toString()}`,t=new URL(n);if(this._internals.url=t,t.protocol==="unix:"&&(t.href=`http://unix${t.pathname}${t.search}`),t.protocol!=="http:"&&t.protocol!=="https:"){let r=new Error(`Unsupported protocol: ${t.protocol}`);throw r.code="ERR_UNSUPPORTED_PROTOCOL",r}if(this._internals.username&&(t.username=this._internals.username,this._internals.username=""),this._internals.password&&(t.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(t.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),t.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let r=/(?.+?):(?.+)/.exec(`${t.pathname}${t.search}`);if(r?.groups){let{socketPath:i,path:s}=r.groups;this._unixOptions={socketPath:i,path:s,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(le.any([W.object,W.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:n,getCookieString:t}=e;le.function_(n),le.function_(t),n.length===4&&t.length===0?(n=(0,ad.promisify)(n.bind(e)),t=(0,ad.promisify)(t.bind(e)),this._internals.cookieJar={setCookie:n,getCookieString:t}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){le.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){le.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 URLSearchParams),this._internals.searchParams)}set searchParams(e){le.any([W.string,W.object,W.undefined],e);let n=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,n&&(n.search="");return}let t=this.searchParams,r;if(W.string(e))r=new URLSearchParams(e);else if(e instanceof URLSearchParams)r=e;else{F4(e),r=new URLSearchParams;for(let i in e){let s=e[i];s===null?r.append(i,""):s===void 0?t.delete(i):r.append(i,s)}}if(this._merging){for(let i of r.keys())t.delete(i);for(let[i,s]of r)t.append(i,s)}else n?n.search=t.toString():this._internals.searchParams=t}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){le.any([W.function_,W.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){le.any([W.object,W.boolean,W.undefined],e),e===!0?this._internals.dnsCache=z4():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){le.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){le.object(e);for(let n in e){if(!(n in this._internals.hooks))throw new Error(`Unexpected hook event: ${n}`);let t=n,r=e[t];if(le.any([W.array,W.undefined],r),r)for(let i of r)le.function_(i);if(this._merging)r&&this._internals.hooks[t].push(...r);else{if(!r)throw new Error(`Missing hook event: ${n}`);this._internals.hooks[n]=[...r]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){le.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){le.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){le.any([W.object,W.string,W.boolean,W.undefined],e),e===!0?this._internals.cache=$4:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){le.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){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.username=t:this._internals.username=t}get password(){let e=this._internals.url,n=e?e.password:this._internals.password;return decodeURIComponent(n)}set password(e){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.password=t:this._internals.password=t}get http2(){return this._internals.http2}set http2(e){le.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){le.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){le.plainObject(e),this._merging?Object.assign(this._internals.headers,ku(e)):this._internals.headers=ku(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){le.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){le.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){le.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(le.plainObject(e),le.any([W.function_,W.undefined],e.calculateDelay),le.any([W.number,W.undefined],e.maxRetryAfter),le.any([W.number,W.undefined],e.limit),le.any([W.array,W.undefined],e.methods),le.any([W.array,W.undefined],e.statusCodes),le.any([W.array,W.undefined],e.errorCodes),le.any([W.number,W.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 t in e)if(!(t in this._internals.retry))throw new Error(`Unexpected retry option: ${t}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:n}=this._internals;n.methods=[...new Set(n.methods.map(t=>t.toUpperCase()))],n.statusCodes=[...new Set(n.statusCodes)],n.errorCodes=[...new Set(n.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){le.any([W.string,W.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){le.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){le.any([W.function_,W.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){le.plainObject(e),le.any([W.boolean,W.undefined],e.shared),le.any([W.number,W.undefined],e.cacheHeuristic),le.any([W.number,W.undefined],e.immutableMinTimeToLive),le.any([W.boolean,W.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){le.plainObject(e),le.any([W.boolean,W.undefined],e.rejectUnauthorized),le.any([W.function_,W.undefined],e.checkServerIdentity),le.any([W.string,W.object,W.array,W.undefined],e.certificateAuthority),le.any([W.string,W.object,W.array,W.undefined],e.key),le.any([W.string,W.object,W.array,W.undefined],e.certificate),le.any([W.string,W.undefined],e.passphrase),le.any([W.string,W.buffer,W.array,W.undefined],e.pfx),le.any([W.array,W.undefined],e.alpnProtocols),le.any([W.string,W.undefined],e.ciphers),le.any([W.string,W.buffer,W.undefined],e.dhparam),le.any([W.string,W.undefined],e.signatureAlgorithms),le.any([W.string,W.undefined],e.minVersion),le.any([W.string,W.undefined],e.maxVersion),le.any([W.boolean,W.undefined],e.honorCipherOrder),le.any([W.number,W.undefined],e.tlsSessionLifetime),le.any([W.string,W.undefined],e.ecdhCurve),le.any([W.string,W.buffer,W.array,W.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");le.any([W.string,W.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){le.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){le.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){le.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){le.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){le.any([W.number,W.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){le.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,n){return(0,ad.inspect)(this._internals,n)}createNativeRequestOptions(){let e=this._internals,n=e.url,t;n.protocol==="https:"?t=e.http2?e.agent:e.agent.https:t=e.agent.http;let{https:r}=e,{pfx:i}=r;return W.array(i)&&W.plainObject(i[0])&&(i=i.map(s=>({buf:s.buffer,passphrase:s.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:r.alpnProtocols,ca:r.certificateAuthority,cert:r.certificate,key:r.key,passphrase:r.passphrase,pfx:r.pfx,rejectUnauthorized:r.rejectUnauthorized,checkServerIdentity:r.checkServerIdentity??k4.checkServerIdentity,ciphers:r.ciphers,honorCipherOrder:r.honorCipherOrder,minVersion:r.minVersion,maxVersion:r.maxVersion,sigalgs:r.signatureAlgorithms,sessionTimeout:r.tlsSessionLifetime,dhparam:r.dhparam,ecdhCurve:r.ecdhCurve,crl:r.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:t,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?G4(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(rm<15||rm===15&&V4<10){let n=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw n.code="EUNSUPPORTED",n}return q4.default.auto}return P4.default.request}return O4.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)}},Oc=e=>{let{statusCode:n}=e,t=e.request.options.followRedirect?299:399;return n>=200&&n<=t||n===304},im=class extends Er{constructor(e,n){let{options:t}=n.request;super(`${e.message} in "${t.url.toString()}"`,e,n.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},om=(e,n,t,r)=>{let{rawBody:i}=e;try{if(n==="text")return i.toString(r);if(n==="json")return i.length===0?"":t(i.toString(r));if(n==="buffer")return i}catch(s){throw new im(s,e)}throw new im({message:`Unknown body type '${n}'`,name:"Error"},e)};function Q4(e){return e.writable&&!e.writableEnded}var Y4=Q4;function am(e){return e.protocol==="unix:"||e.hostname==="unix"}var{buffer:X4}=l4.default,J4=W.string(Dv.default.versions.brotli),Z4=new Set(["GET","HEAD"]),cd=new T4,eR=new Set([300,301,302,303,304,307,308]),tR=["socket","connect","continue","information","upgrade"],nc=()=>{},_p=class extends M6.Duplex{constructor(e,n,t){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,"_removeListeners",{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=nc,this._triggerRead=!1,this._cancelTimeouts=nc,this._removeListeners=nc,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=nc,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 oo(e,n,t),!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:s}=i;s&&(this.options=s),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:r}=this.options;if(W.nodeStream(r)&&r.once("error",i=>{this._flushed?this._beforeError(new Mg(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new Mg(i,this))}}),this.options.signal){let i=()=>{this.destroy(new q6(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal?.removeEventListener("abort",i)})}}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:t}=this,r=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Er||(e=new Er(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 s;try{let u;n&&"retry-after"in n.headers&&(u=Number(n.headers["retry-after"]),Number.isNaN(u)?(u=Date.parse(n.headers["retry-after"])-Date.now(),u<=0&&(u=1)):u*=1e3);let h=t.retry;s=await h.calculateDelay({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:I4({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:h.maxRetryAfter??t.timeout.request??Number.POSITIVE_INFINITY})})}catch(u){this._error(new Er(u.message,u,this));return}if(s){if(await new Promise(u=>{let h=setTimeout(u,s);this._stopRetry=()=>{clearTimeout(h),u()}}),this.destroyed)return;try{for(let u of this.options.hooks.beforeRetry)await u(i,this.retryCount+1)}catch(u){this._error(new Er(u.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,u=>{let h=new _p(t.url,u,t);return h.retryCount=this.retryCount+1,Dv.default.nextTick(()=>{h.flush()}),h});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 t=this.downloadProgress;t.percent<1&&this.emit("downloadProgress",t),this.push(n)}}}_write(e,n,t){let r=()=>{this._writeRequest(e,n,t)};this._requestInitialized?r():this._jobs.push(r)}_final(e){let n=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(t=>{this._request._writableState?.errored||(t||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(t))})};this._requestInitialized?n():this._jobs.push(n)}_destroy(e,n){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:t}=this.options;W.nodeStream(t)&&t.destroy()}this._request&&this._request.destroy(),e!==null&&!W.undefined(e)&&!(e instanceof Er)&&(e=new Er(e.message,e,this)),n(e)}pipe(e,n){return e instanceof td.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,n)}unpipe(e){return e instanceof td.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:n}=e,t=!W.undefined(e.form),r=!W.undefined(e.json),i=!W.undefined(e.body),s=Z4.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=s,t||r||i){if(s)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let u=!W.string(n["content-type"]);if(i){if(Fu(e.body)){let c=new Vv(e.body);u&&(n["content-type"]=c.headers["Content-Type"]),"Content-Length"in c.headers&&(n["content-length"]=c.headers["Content-Length"]),e.body=c.encode()}Fv(e.body)&&u&&(n["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(t){u&&(n["content-type"]="application/x-www-form-urlencoded");let{form:c}=e;e.form=void 0,e.body=new URLSearchParams(c).toString()}else{u&&(n["content-type"]="application/json");let{json:c}=e;e.json=void 0,e.body=e.stringifyJson(c)}let h=await b4(e.body,e.headers);W.undefined(n["content-length"])&&W.undefined(n["transfer-encoding"])&&!s&&!W.undefined(h)&&(n["content-length"]=String(h))}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:t}=n;this._nativeResponse=e,n.decompress&&(e=(0,u4.default)(e));let r=e.statusCode,i=e;i.statusMessage=i.statusMessage??td.default.STATUS_CODES[r],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=Oc(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",u=>{this._aborted=!0,e.destroy(),this._beforeError(new Vg(u,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Vg({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let s=e.headers["set-cookie"];if(W.object(n.cookieJar)&&s){let u=s.map(async h=>n.cookieJar.setCookie(h,t.toString()));n.ignoreInvalidCookies&&(u=u.map(async h=>{try{await h}catch{}}));try{await Promise.all(u)}catch(h){this._beforeError(h);return}}if(!this.isAborted){if(n.followRedirect&&e.headers.location&&eR.has(r)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=n.maxRedirects){this._beforeError(new x6(this));return}this._request=void 0;let u=new oo(void 0,void 0,this.options),h=r===303&&u.method!=="GET"&&u.method!=="HEAD",c=r!==307&&r!==308,a=u.methodRewriting&&c;(h||a)&&(u.method="GET",u.body=void 0,u.json=void 0,u.form=void 0,delete u.headers["content-length"]);try{let d=ed.Buffer.from(e.headers.location,"binary").toString(),f=new URL(d,t);if(!am(t)&&am(f)){this._beforeError(new Er("Cannot redirect to UNIX socket",{},this));return}f.hostname!==t.hostname||f.port!==t.port?("host"in u.headers&&delete u.headers.host,"cookie"in u.headers&&delete u.headers.cookie,"authorization"in u.headers&&delete u.headers.authorization,(u.username||u.password)&&(u.username="",u.password="")):(f.username=u.username,f.password=u.password),this.redirectUrls.push(f),u.prefixUrl="",u.url=f;for(let g of u.hooks.beforeRedirect)await g(u,i);this.emit("redirect",u,i),this.options=u,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(n.isStream&&n.throwHttpErrors&&!Oc(i)){this._beforeError(new kc(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 u of this._pipedServerResponses)if(!u.headersSent){for(let h in e.headers){let c=n.decompress?h!=="content-encoding":!0,a=e.headers[h];c&&u.setHeader(h,a)}u.statusCode=r}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let n=await X4(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:t,url:r}=n;jv(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=S4(e,t,r);let i=n.cache?"cacheableResponse":"response";e.once(i,s=>{this._onResponse(s)}),e.once("error",s=>{this._aborted=!0,e.destroy(),s=s instanceof zv?new D6(s,this.timings,this):new Er(s.message,s,this),this._beforeError(s)}),this._unproxyEvents=$v(e,this,tR),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((n,t)=>{super.write(e,r=>{if(r){t(r);return}n()})})}_sendBody(){let{body:e}=this.options,n=this.redirectUrls.length===0?this:this._request??this;W.nodeStream(e)?e.pipe(n):W.generator(e)||W.asyncGenerator(e)?(async()=>{try{for await(let t of e)await this._asyncWrite(t);super.end()}catch(t){this._beforeError(t)}})():W.undefined(e)?(this._cannotHaveBody||this._noPipe)&&n.end():(this._writeRequest(e,void 0,()=>{}),n.end())}_prepareCache(e){if(!cd.has(e)){let n=new Mv((t,r)=>{let i=t._request(t,r);return W.promise(i)&&(i.once=(s,u)=>{if(s==="error")(async()=>{try{await i}catch(h){u(h)}})();else if(s==="abort")(async()=>{try{(await i).once("abort",u)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${s}`);return i}),i},e);cd.set(e,n.request())}}async _createCacheableRequest(e,n){return new Promise((t,r)=>{Object.assign(n,C4(e));let i,s=cd.get(n.cache)(n,async u=>{if(u._readableState.autoDestroy=!1,i){let h=()=>{u.req&&(u.complete=u.req.res.complete)};u.prependOnceListener("end",h),h(),(await i).emit("cacheableResponse",u)}t(u)});s.once("error",r),s.once("request",async u=>{i=u,t(i)})})}async _makeRequest(){let{options:e}=this,{headers:n,username:t,password:r}=e,i=e.cookieJar;for(let c in n)if(W.undefined(n[c]))delete n[c];else if(W.null_(n[c]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${c}\` header`);if(e.decompress&&W.undefined(n["accept-encoding"])&&(n["accept-encoding"]=J4?"gzip, deflate, br":"gzip, deflate"),t||r){let c=ed.Buffer.from(`${t}:${r}`).toString("base64");n.authorization=`Basic ${c}`}if(i){let c=await i.getCookieString(e.url.toString());W.nonEmptyString(c)&&(n.cookie=c)}e.prefixUrl="";let s;for(let c of e.hooks.beforeRequest){let a=await c(e);if(!W.undefined(a)){s=()=>a;break}}s||(s=e.getRequestFunction());let u=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=s,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let h=e.cache?this._createCacheableRequest:s;try{let c=h(u,this._requestOptions);W.promise(c)&&(c=await c),W.undefined(c)&&(c=e.getFallbackRequestFunction()(u,this._requestOptions),W.promise(c)&&(c=await c)),Y4(c)?this._onRequest(c):this.writable?(this.once("finish",()=>{this._onResponse(c)}),this._sendBody()):this._onResponse(c)}catch(c){throw c instanceof ps?new U6(c,this):c}}async _error(e){try{if(!(e instanceof kc&&!this.options.throwHttpErrors))for(let n of this.options.hooks.beforeError)e=await n(e)}catch(n){e=new Er(n.message,n,this)}this.destroy(e)}_writeRequest(e,n,t){!this._request||this._request.destroyed||this._request.write(e,n,r=>{if(!r&&!this._request.destroyed){this._uploadedSize+=ed.Buffer.byteLength(e,n);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}t(r)})}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}},rR=class extends Er{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},nR=["request","response","redirect","uploadProgress","downloadProgress"];function sm(e){let n,t,r,i=new B6.EventEmitter,s=new Zc((h,c,a)=>{a(()=>{n.destroy()}),a.shouldReject=!1,a(()=>{c(new rR(n))});let d=f=>{a(()=>{});let g=e??new _p(void 0,void 0,r);g.retryCount=f,g._noPipe=!0,n=g,g.once("response",async v=>{let T=(v.headers["content-encoding"]??"").toLowerCase(),O=T==="gzip"||T==="deflate"||T==="br",{options:k}=g;if(O&&!k.decompress)v.body=v.rawBody;else try{v.body=om(v,k.responseType,k.parseJson,k.encoding)}catch(y){if(v.body=v.rawBody.toString(),Oc(v)){g._beforeError(y);return}}try{let y=k.hooks.afterResponse;for(let[R,w]of y.entries())if(v=await w(v,async L=>{throw k.merge(L),k.prefixUrl="",L.url&&(k.url=L.url),k.hooks.afterResponse=k.hooks.afterResponse.slice(0,R),new j6(g)}),!(W.object(v)&&W.number(v.statusCode)&&!W.nullOrUndefined(v.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(y){g._beforeError(y);return}if(t=v,!Oc(v)){g._beforeError(new kc(v));return}g.destroy(),h(g.options.resolveBodyOnly?v.body:v)});let I=v=>{if(s.isCanceled)return;let{options:T}=g;if(v instanceof kc&&!T.throwHttpErrors){let{response:O}=v;g.destroy(),h(g.options.resolveBodyOnly?O.body:O);return}c(v)};g.once("error",I);let C=g.options?.body;g.once("retry",(v,T)=>{e=void 0;let O=g.options.body;if(C===O&&W.nodeStream(O)){T.message="Cannot retry with consumed body stream",I(T);return}r=g.options,d(v)}),$v(g,i,nR),W.undefined(e)&&g.flush()};d(0)});s.on=(h,c)=>(i.on(h,c),s),s.off=(h,c)=>(i.off(h,c),s);let u=h=>{let c=(async()=>{await s;let{options:a}=t.request;return om(t,h,a.parseJson,a.encoding)})();return Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)),c};return s.json=()=>{if(n.options){let{headers:h}=n.options;!n.writableFinished&&!("accept"in h)&&(h.accept="application/json")}return u("json")},s.buffer=()=>u("buffer"),s.text=()=>u("text"),s}var iR=async e=>new Promise(n=>{setTimeout(n,e)}),oR=e=>W.function_(e),aR=["get","post","put","patch","head","delete"],Kv=e=>{e={options:new oo(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let n=(r,i,s=e.options)=>{let u=new _p(r,i,s),h,c=f=>(u.options=f,u._noPipe=!f.isStream,u.flush(),f.isStream?u:(h||(h=sm(u)),h)),a=0,d=f=>{let g=(e.handlers[a++]??c)(f,d);if(W.promise(g)&&!u.options.isStream&&(h||(h=sm(u)),g!==h)){let I=Object.getOwnPropertyDescriptors(h);for(let C in I)C in g&&delete I[C];Object.defineProperties(g,I),g.cancel=h.cancel}return g};return d(u.options)};n.extend=(...r)=>{let i=new oo(void 0,void 0,e.options),s=[...e.handlers],u;for(let h of r)oR(h)?(i.merge(h.defaults.options),s.push(...h.defaults.handlers),u=h.defaults.mutableDefaults):(i.merge(h),h.handlers&&s.push(...h.handlers),u=h.mutableDefaults);return Kv({options:i,handlers:s,mutableDefaults:!!u})};let t=async function*(r,i){let s=new oo(r,i,e.options);s.resolveBodyOnly=!1;let{pagination:u}=s;le.function_(u.transform),le.function_(u.shouldContinue),le.function_(u.filter),le.function_(u.paginate),le.number(u.countLimit),le.number(u.requestLimit),le.number(u.backoff);let h=[],{countLimit:c}=u,a=0;for(;a{let s=[];for await(let u of t(r,i))s.push(u);return s},n.paginate.each=t,n.stream=(r,i)=>n(r,{...i,isStream:!0});for(let r of aR)n[r]=(i,s)=>n(i,{...s,method:r}),n.stream[r]=(i,s)=>n(i,{...s,method:r,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},sR=Kv,uR={options:new oo,handlers:[],mutableDefaults:!1},lR=sR(uR),vn=lR,bc="https://www.googleapis.com",cR=`${bc}/oauth2/v4/token`,wp={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"},hR=Object.keys(wp),fR=class{options={};constructor(e){for(let n of hR){if(!e[n])throw new Error(wp[n]);this.options[n]=e[n]}}get uploadEndpoint(){return`${bc}/upload/chromewebstore/v1.1/items/${this.options.extId}`}getPublishEndpoint(e){return`${bc}/chromewebstore/v1.1/items/${this.options.extId}/publish?publishTarget=${e}`}getInfoEndpoint(e){return`${bc}/chromewebstore/v1.1/items/${this.options.extId}?projection=${e}`}async submit({filePath:e="",target:n="default"}){let t=await this.getAccessToken(),{uploadState:r,itemError:i}=await this.upload({readStream:(0,b6.createReadStream)(e)},t);if(r==="FAILURE"||r==="NOT_FOUND")throw new Error(i.map(({error_detail:s})=>s).join(` -`));if(!this.options.uploadOnly)return this.publish({target:n},t)}async upload({readStream:e=null},n=""){if(!e)throw new Error("Read stream missing");let t=n||await this.getAccessToken();return vn.put(this.uploadEndpoint,{headers:this.getHeaders(t),body:e,throwHttpErrors:!1}).json()}async publish({target:e="default"},n=""){let t=n||await this.getAccessToken();return vn.post(this.getPublishEndpoint(e),{headers:this.getHeaders(t)}).json()}async get({projection:e="DRAFT"},n=""){let t=n||await this.getAccessToken();return vn.get(this.getInfoEndpoint(e),{headers:this.getHeaders(t)}).json()}async getAccessToken(){return(await vn.post(cR,{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"}}},dR=require("module"),pR=(0,dR.createRequire)("/"),yR;try{yR=pR("worker_threads").Worker}catch{}var Ln=Uint8Array,gs=Uint16Array,gR=Int32Array,Wv=new Ln([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]),Gv=new Ln([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]),mR=new Ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qv=function(e,n){for(var t=new gs(31),r=0;r<31;++r)t[r]=n+=1<>1|(Rt&21845)<<1,to=(to&52428)>>2|(to&13107)<<2,to=(to&61680)>>4|(to&3855)<<4,Ud[Rt]=((to&65280)>>8|(to&255)<<8)>>1;var to,Rt,Ru=function(e,n,t){for(var r=e.length,i=0,s=new gs(n);i>c]=a}else for(h=new gs(r),i=0;i>15-e[i]);return h},$u=new Ln(288);for(Rt=0;Rt<144;++Rt)$u[Rt]=8;var Rt;for(Rt=144;Rt<256;++Rt)$u[Rt]=9;var Rt;for(Rt=256;Rt<280;++Rt)$u[Rt]=7;var Rt;for(Rt=280;Rt<288;++Rt)$u[Rt]=8;var Rt,Zv=new Ln(32);for(Rt=0;Rt<32;++Rt)Zv[Rt]=5;var Rt,_R=Ru($u,9,1),wR=Ru(Zv,5,1),hd=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},ei=function(e,n,t){var r=n/8|0;return(e[r]|e[r+1]<<8)>>(n&7)&t},fd=function(e,n){var t=n/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(n&7)},ER=function(e){return(e+7)/8|0},Ep=function(e,n,t){(n==null||n<0)&&(n=0),(t==null||t>e.length)&&(t=e.length);var r=new Ln(t-n);return r.set(e.subarray(n,t)),r},SR=["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"],Kn=function(e,n,t){var r=new Error(n||SR[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Kn),!t)throw r;return r},CR=function(e,n,t,r){var i=e.length,s=r?r.length:0;if(!i||n.f&&!n.l)return t||new Ln(0);var u=!t||n.i!=2,h=n.i;t||(t=new Ln(i*3));var c=function(Je){var x=t.length;if(Je>x){var X=new Ln(Math.max(x*2,Je));X.set(t),t=X}},a=n.f||0,d=n.p||0,f=n.b||0,g=n.l,I=n.d,C=n.m,v=n.n,T=i*8;do{if(!g){a=ei(e,d,1);var O=ei(e,d+1,3);if(d+=3,O)if(O==1)g=_R,I=wR,C=9,v=5;else if(O==2){var k=ei(e,d,31)+257,y=ei(e,d+10,15)+4,R=k+ei(e,d+5,31)+1;d+=14;for(var w=new Ln(R),L=new Ln(19),D=0;D>4;if(V<16)w[D++]=V;else{var $=0,E=0;for(V==16?(E=3+ei(e,d,3),d+=2,$=w[D-1]):V==17?(E=3+ei(e,d,7),d+=3):V==18&&(E=11+ei(e,d,127),d+=7);E--;)w[D++]=$}}var B=w.subarray(0,k),j=w.subarray(k);C=hd(B),v=hd(j),g=Ru(B,C,1),I=Ru(j,v,1)}else Kn(1);else{var V=ER(d)+4,N=e[V-4]|e[V-3]<<8,M=V+N;if(M>i){h&&Kn(0);break}u&&c(f+N),t.set(e.subarray(V,M),f),n.b=f+=N,n.p=d=M*8,n.f=a;continue}if(d>T){h&&Kn(0);break}}u&&c(f+131072);for(var ee=(1<>4;if(d+=$&15,d>T){h&&Kn(0);break}if($||Kn(2),pe<256)t[f++]=pe;else if(pe==256){ae=d,g=null;break}else{var _e=pe-254;if(pe>264){var D=pe-257,Re=Wv[D];_e=ei(e,d,(1<>4;qe||Kn(3),d+=qe&15;var j=bR[Ce];if(Ce>3){var Re=Gv[Ce];j+=fd(e,d)&(1<T){h&&Kn(0);break}u&&c(f+131072);var $e=f+_e;if(f>>0},dd=function(e,n){return ri(e,n)+ri(e,n+4)*4294967296};function RR(e,n){return CR(e,{i:2},n&&n.out,n&&n.dictionary)}var Dd=typeof TextDecoder<"u"&&new TextDecoder,IR=0;try{Dd.decode(TR,{stream:!0}),IR=1}catch{}var AR=function(e){for(var n="",t=0;;){var r=e[t++],i=(r>127)+(r>223)+(r>239);if(t+i>e.length)return{s:n,r:Ep(e,t-1)};i?i==3?(r=((r&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,n+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?n+=String.fromCharCode((r&31)<<6|e[t++]&63):n+=String.fromCharCode((r&15)<<12|(e[t++]&63)<<6|e[t++]&63):n+=String.fromCharCode(r)}};function e1(e,n){if(n){for(var t="",r=0;r65558)&&Kn(13);var i=Ci(e,r+8);if(!i)return{};var s=ri(e,r+16),u=s==4294967295||i==65535;if(u){var h=ri(e,r-12);u=ri(e,h)==101075792,u&&(i=ri(e,h+32),s=ri(e,h+48))}for(var c=n&&n.filter,a=0;a(0,LR.resolve)((0,NR.cwd)(),e),t1=e=>(0,Sp.existsSync)(Cp(e));function zu({zip:e="",file:n="",versionFile:t="package.json"}){let r=e||n;if(t1(t)&&r.includes("{version}")){let i=JSON.parse((0,Sp.readFileSync)(t).toString());return r.replace("{version}",i.version||"")}else return r}function eh(e){let n=(0,Sp.readFileSync)(Cp(e)),t=BR(n),r=e1(t["manifest.json"]);return JSON.parse(r)}function th({extId:e=null,market:n="",zip:t=""}){let{name:r,version:i}=eh(t),s=Lv[n]||n;console.log(`Successfully updated "${e}" (${r}) to version ${i} on ${s}!`)}var ic={};function r1({message:e="Message",prefix:n="",market:t=""}){var r;ic[t]=1+((r=ic?.[t])!=null?r:0);let i=`${t}: Step ${ic[t]}) ${e}`;return n!=="Error"&&(n=n||"Info",i=`${n} ${i}`),n==="Info"?i=i.trim():n==="Error"&&(i=i.trimStart()),i}var n1={},Hu=e=>{n1[e]=!0,process.env.VERBOSE="true"};function rh(e=""){return n=>n1[e]&&console.log(r1({market:e,message:n}))}var nh=(e,n,t)=>{let r=new Error(r1({market:n,message:`Item "${t}": ${e.message}`,prefix:"Error"}));return r.stack=e.stack,r};function pd(e,n){return`${e}: ${n}`}var Ku=({market:e="chrome",options:n={},errorMap:t={}})=>{if(Object.keys(t).some(i=>{if(!n[i])throw new Error(pd(e,t[i]))}),!n.zip&&!n.file)throw new Error(pd(e,"No extension bundle provided"));let r=n.zip||n.file;if(!t1(r))throw new Error(pd(e,`Extension bundle file doesn't exist: ${Cp(r)}`))},Ou="chrome",xR=rh(Ou);function UR(e){return ho(this,null,function*(){var n=e,{extId:t,target:r="default",zip:i,dryRun:s}=n,u=Hc(n,["extId","target","zip","dryRun"]);let h=new fR(zc({extId:t},u));if(xR(`Updating extension with ID ${t}`),s)return!0;try{return yield h.submit({filePath:i,target:r}),th({extId:t,market:Ou,zip:i}),!0}catch(c){let a=eh(i);throw nh(c,Ou,`"${t}" (${a.name})`)}})}function DR(e){return ho(this,null,function*(){return e.zip=zu(e),e.verbose&&Hu(Ou),Ku({market:Ou,options:e,errorMap:wp}),UR(e)})}var jR=require("fs"),Tp={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"},qR=Object.keys(Tp),MR=e=>new Promise(n=>setTimeout(n,e)),um="https://api.addons.microsoftedge.microsoft.com",VR=class{options={};constructor(e){for(let n of qR){if(!e[n])throw new Error(Tp[n]);this.options[n]=e[n]}}get productEndpoint(){return`${um}/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 t=await this.getAccessToken(),r=await this.upload((0,jR.createReadStream)(e),t);return await this.waitForUpload(r,t),this.publish(n,t)}async publish(e="",n=null){let t={headers:{Authorization:`Bearer ${n||await this.getAccessToken()}`,"Content-Type":"application/x-www-form-urlencoded"}};e.length>0&&(t.body=`{ "notes"="${e}" }`);let r=await vn.post(this.publishEndpoint,t);return this.handleTempStatus(r.statusCode,"Submit"),r.headers.location}async upload(e=null,n=null){let t=n||await this.getAccessToken(),r=await vn.post(this.uploadEndpoint,{body:e,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/zip"}});return this.handleTempStatus(r.statusCode,"Upload"),r.headers.location}async getPublishStatus(e,n=null){let t=n||await this.getAccessToken(),r=`${this.publishEndpoint}/operations/${e}`;return vn.get(r,{headers:{Authorization:`Bearer ${t}`}}).json()}async waitForUpload(e,n=null,t=5,r=3e3){let i=n||await this.getAccessToken(),s=`${this.uploadEndpoint}/operations/${e}`,u,h,c=0;for(;h!=="Succeeded"&&c{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 vn.post(`${this.options.accessTokenUrl}`,{body:`client_id=${this.options.clientId}&scope=${um}/.default&client_secret=${this.options.clientSecret}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).json()).access_token},Pu="edge",FR=rh(Pu);function $R(e){return ho(this,null,function*(){var n=e,{productId:t,notes:r,zip:i,dryRun:s}=n,u=Hc(n,["productId","notes","zip","dryRun"]);let h=eh(i),c=new VR(zc({productId:t},u));if(FR(`Updating extension with Product ID ${t}`),s)return!0;try{return yield c.submit({filePath:i,notes:r}),th({extId:t,market:Pu,zip:i}),!0}catch(a){throw nh(a,Pu,`"${t}" (${h.name})`)}})}function zR(e){return ho(this,null,function*(){return e.zip=zu(e),e.verbose&&Hu(Pu),Ku({market:Pu,options:e,errorMap:Tp}),$R(e)})}var Or=e=>typeof e=="function",mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:e=>`Symbol(${e})`;function i1(){}function Gr(e){return typeof e=="object"&&e!==null||typeof e=="function"}var o1=i1;function wt(e,n){try{Object.defineProperty(e,"name",{value:n,configurable:!0})}catch{}}var Rp=Promise,HR=Promise.prototype.then,KR=Promise.resolve.bind(Rp),WR=Promise.reject.bind(Rp);function on(e){return new Rp(e)}function It(e){return KR(e)}function Ze(e){return WR(e)}function ao(e,n,t){return HR.call(e,n,t)}function Wr(e,n,t){ao(ao(e,n,t),void 0,o1)}function lm(e,n){Wr(e,n)}function cm(e,n){Wr(e,void 0,n)}function ii(e,n,t){return ao(e,n,t)}function ws(e){ao(e,void 0,o1)}var _c=e=>{if(typeof queueMicrotask=="function")_c=queueMicrotask;else{let n=It(void 0);_c=t=>ao(n,t)}return _c(e)};function ih(e,n,t){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,n,t)}function Pa(e,n,t){try{return It(ih(e,n,t))}catch(r){return Ze(r)}}var Wn=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,t=n;n._elements.length===16383&&(t={_elements:[],_next:void 0}),n._elements.push(e),t!==n&&(this._back=t,n._next=t),++this._size}shift(){let e=this._front,n=e,t=this._cursor,r=t+1,i=e._elements,s=i[t];return r===16384&&(n=e._next,r=0),--this._size,this._cursor=r,e!==n&&(this._front=n),i[t]=void 0,s}forEach(e){let n=this._cursor,t=this._front,r=t._elements;for(;!(n===r.length&&t._next===void 0||n===r.length&&(t=t._next,r=t._elements,n=0,r.length===0));)e(r[n]),++n}peek(){let e=this._front,n=this._cursor;return e._elements[n]}},a1=mt("[[AbortSteps]]"),s1=mt("[[ErrorSteps]]"),Ip=mt("[[CancelSteps]]"),Ap=mt("[[PullSteps]]"),kp=mt("[[ReleaseSteps]]");function u1(e,n){e._ownerReadableStream=n,n._reader=e,n._state==="readable"?jd(e):n._state==="closed"?function(t){jd(t),f1(t)}(e):h1(e,n._storedError)}function l1(e,n){return $1(e._ownerReadableStream,n)}function c1(e){let n=e._ownerReadableStream;n._state==="readable"?Op(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,r){h1(t,r)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),n._readableStreamController[kp](),n._reader=void 0,e._ownerReadableStream=void 0}function Es(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function jd(e){e._closedPromise=on((n,t)=>{e._closedPromise_resolve=n,e._closedPromise_reject=t})}function h1(e,n){jd(e),Op(e,n)}function Op(e,n){e._closedPromise_reject!==void 0&&(ws(e._closedPromise),e._closedPromise_reject(n),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function f1(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var hm=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},GR=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function so(e,n){if(e!==void 0&&typeof(t=e)!="object"&&typeof t!="function")throw new TypeError(`${n} is not an object.`);var t}function si(e,n){if(typeof e!="function")throw new TypeError(`${n} is not a function.`)}function d1(e,n){if(!function(t){return typeof t=="object"&&t!==null||typeof t=="function"}(e))throw new TypeError(`${n} is not an object.`)}function co(e,n,t){if(e===void 0)throw new TypeError(`Parameter ${n} is required in '${t}'.`)}function qd(e,n,t){if(e===void 0)throw new TypeError(`${n} is required in '${t}'.`)}function Pp(e){return Number(e)}function fm(e){return e===0?0:e}function p1(e,n){let t=Number.MAX_SAFE_INTEGER,r=Number(e);if(r=fm(r),!hm(r))throw new TypeError(`${n} is not a finite number`);if(r=function(i){return fm(GR(i))}(r),r<0||r>t)throw new TypeError(`${n} is outside the accepted range of 0 to ${t}, inclusive`);return hm(r)&&r!==0?r:0}function Su(e){if(!Gr(e)||typeof e.getReader!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function y1(e){if(!Gr(e)||typeof e.getWriter!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function g1(e,n){if(!ka(e))throw new TypeError(`${n} is not a ReadableStream.`)}function m1(e,n){e._reader._readRequests.push(n)}function Bp(e,n,t){let r=e._reader._readRequests.shift();t?r._closeSteps():r._chunkSteps(n)}function oh(e){return e._reader._readRequests.length}function v1(e){let n=e._reader;return n!==void 0&&!!Aa(n)}var wa=class{constructor(e){if(co(e,1,"ReadableStreamDefaultReader"),g1(e,"First parameter"),Cs(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");u1(this,e),this._readRequests=new Wn}get closed(){return Aa(this)?this._closedPromise:Ze(oc("closed"))}cancel(e){return Aa(this)?this._ownerReadableStream===void 0?Ze(Es("cancel")):l1(this,e):Ze(oc("cancel"))}read(){if(!Aa(this))return Ze(oc("read"));if(this._ownerReadableStream===void 0)return Ze(Es("read from"));let e,n,t=on((r,i)=>{e=r,n=i});return function(r,i){let s=r._ownerReadableStream;s._disturbed=!0,s._state==="closed"?i._closeSteps():s._state==="errored"?i._errorSteps(s._storedError):s._readableStreamController[Ap](i)}(this,{_chunkSteps:r=>e({value:r,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:r=>n(r)}),t}releaseLock(){if(!Aa(this))throw oc("releaseLock");this._ownerReadableStream!==void 0&&function(e){c1(e);let n=new TypeError("Reader was released");b1(e,n)}(this)}};function Aa(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof wa}function b1(e,n){let t=e._readRequests;e._readRequests=new Wn,t.forEach(r=>{r._errorSteps(n)})}function oc(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(wa.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),wt(wa.prototype.cancel,"cancel"),wt(wa.prototype.read,"read"),wt(wa.prototype.releaseLock,"releaseLock"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(wa.prototype,mt.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var _1=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?ii(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let n=()=>this._returnSteps(e);return this._ongoingPromise?ii(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?Ze(Es("iterate")):ao(e.read(),n=>{var t;return this._ongoingPromise=void 0,n.done&&(this._isFinished=!0,(t=this._reader)===null||t===void 0||t.releaseLock(),this._reader=void 0),n},n=>{var t;throw this._ongoingPromise=void 0,this._isFinished=!0,(t=this._reader)===null||t===void 0||t.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 Ze(Es("finish iterating"));if(this._reader=void 0,!this._preventCancel){let t=n.cancel(e);return n.releaseLock(),ii(t,()=>({value:e,done:!0}))}return n.releaseLock(),It({value:e,done:!0})}},w1={next(){return dm(this)?this._asyncIteratorImpl.next():Ze(pm("next"))},return(e){return dm(this)?this._asyncIteratorImpl.return(e):Ze(pm("return"))}};function dm(e){if(!Gr(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof _1}catch{return!1}}function pm(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}typeof mt.asyncIterator=="symbol"&&Object.defineProperty(w1,mt.asyncIterator,{value(){return this},writable:!0,configurable:!0});var E1=Number.isNaN||function(e){return e!=e};function S1(e,n,t,r,i){new Uint8Array(e).set(new Uint8Array(t,r,i),n)}function ym(e){let n=function(t,r,i){if(t.slice)return t.slice(r,i);let s=i-r,u=new ArrayBuffer(s);return S1(u,0,t,r,s),u}(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}function Md(e){let n=e._queue.shift();return e._queueTotalSize-=n.size,e._queueTotalSize<0&&(e._queueTotalSize=0),n.value}function Lp(e,n,t){if(typeof(r=t)!="number"||E1(r)||r<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var r;e._queue.push({value:n,size:t}),e._queueTotalSize+=t}function Ho(e){e._queue=new Wn,e._queueTotalSize=0}var ms=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!yd(this))throw gd("view");return this._view}respond(e){if(!yd(this))throw gd("respond");if(co(e,1,"respond"),e=p1(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(n,t){let r=n._pendingPullIntos.peek();if(n._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(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=r.buffer,gm(n,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!yd(this))throw gd("respondWithNewView");if(co(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,t){let r=n._pendingPullIntos.peek();if(n._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(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=t.byteLength;r.buffer=t.buffer,gm(n,i)}(this._associatedReadableByteStreamController,e)}};Object.defineProperties(ms.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),wt(ms.prototype.respond,"respond"),wt(ms.prototype.respondWithNewView,"respondWithNewView"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(ms.prototype,mt.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Ea=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ds(this))throw vu("byobRequest");return function(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let n=e._pendingPullIntos.peek(),t=new Uint8Array(n.buffer,n.byteOffset+n.bytesFilled,n.byteLength-n.bytesFilled),r=Object.create(ms.prototype);(function(i,s,u){i._associatedReadableByteStreamController=s,i._view=u})(r,e,t),e._byobRequest=r}return e._byobRequest}(this)}get desiredSize(){if(!ds(this))throw vu("desiredSize");return P1(this)}close(){if(!ds(this))throw vu("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 t=n._controlledReadableByteStream;if(!(n._closeRequested||t._state!=="readable")){if(n._queueTotalSize>0)return void(n._closeRequested=!0);if(n._pendingPullIntos.length>0&&n._pendingPullIntos.peek().bytesFilled>0){let r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ss(n,r),r}Pc(n),Lu(t)}})(this)}enqueue(e){if(!ds(this))throw vu("enqueue");if(co(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(t,r){let i=t._controlledReadableByteStream;if(t._closeRequested||i._state!=="readable")return;let s=r.buffer,u=r.byteOffset,h=r.byteLength,c=s;if(t._pendingPullIntos.length>0){let a=t._pendingPullIntos.peek();a.buffer,Np(t),a.buffer=a.buffer,a.readerType==="none"&&I1(t,a)}v1(i)?(function(a){let d=a._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(a._queueTotalSize===0)return;mm(a,d._readRequests.shift())}}(t),oh(i)===0?wc(t,c,u,h):(t._pendingPullIntos.length>0&&bs(t),Bp(i,new Uint8Array(c,u,h),!1))):xp(i)?(wc(t,c,u,h),Fd(t)):wc(t,c,u,h),Oa(t)})(this,e)}error(e){if(!ds(this))throw vu("error");Ss(this,e)}[Ip](e){C1(this),Ho(this);let n=this._cancelAlgorithm(e);return Pc(this),n}[Ap](e){let n=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void mm(this,e);let t=this._autoAllocateChunkSize;if(t!==void 0){let r;try{r=new ArrayBuffer(t)}catch(s){return void e._errorSteps(s)}let i={buffer:r,bufferByteLength:t,byteOffset:0,byteLength:t,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}m1(n,e),Oa(this)}[kp](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new Wn,this._pendingPullIntos.push(e)}}};function ds(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Ea}function yd(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof ms}function Oa(e){if(function(n){let t=n._controlledReadableByteStream;return t._state!=="readable"||n._closeRequested||!n._started?!1:!!(v1(t)&&oh(t)>0||xp(t)&&B1(t)>0||P1(n)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Wr(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Oa(e)),null),n=>(Ss(e,n),null))}}function C1(e){Np(e),e._pendingPullIntos=new Wn}function Vd(e,n){let t=!1;e._state==="closed"&&(t=!0);let r=T1(n);n.readerType==="default"?Bp(e,r,t):function(i,s,u){let h=i._reader._readIntoRequests.shift();u?h._closeSteps(s):h._chunkSteps(s)}(e,r,t)}function T1(e){let n=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,n/t)}function wc(e,n,t,r){e._queue.push({buffer:n,byteOffset:t,byteLength:r}),e._queueTotalSize+=r}function R1(e,n,t,r){let i;try{i=n.slice(t,t+r)}catch(s){throw Ss(e,s),s}wc(e,i,0,r)}function I1(e,n){n.bytesFilled>0&&R1(e,n.buffer,n.byteOffset,n.bytesFilled),bs(e)}function A1(e,n){let t=n.elementSize,r=n.bytesFilled-n.bytesFilled%t,i=Math.min(e._queueTotalSize,n.byteLength-n.bytesFilled),s=n.bytesFilled+i,u=s-s%t,h=i,c=!1;u>r&&(h=u-n.bytesFilled,c=!0);let a=e._queue;for(;h>0;){let d=a.peek(),f=Math.min(h,d.byteLength),g=n.byteOffset+n.bytesFilled;S1(n.buffer,g,d.buffer,d.byteOffset,f),d.byteLength===f?a.shift():(d.byteOffset+=f,d.byteLength-=f),e._queueTotalSize-=f,k1(e,f,n),h-=f}return c}function k1(e,n,t){t.bytesFilled+=n}function O1(e){e._queueTotalSize===0&&e._closeRequested?(Pc(e),Lu(e._controlledReadableByteStream)):Oa(e)}function Np(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Fd(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let n=e._pendingPullIntos.peek();A1(e,n)&&(bs(e),Vd(e._controlledReadableByteStream,n))}}function gm(e,n){let t=e._pendingPullIntos.peek();Np(e),e._controlledReadableByteStream._state==="closed"?function(r,i){i.readerType==="none"&&bs(r);let s=r._controlledReadableByteStream;if(xp(s))for(;B1(s)>0;)Vd(s,bs(r))}(e,t):function(r,i,s){if(k1(0,i,s),s.readerType==="none")return I1(r,s),void Fd(r);if(s.bytesFilled0){let h=s.byteOffset+s.bytesFilled;R1(r,s.buffer,h-u,u)}s.bytesFilled-=u,Vd(r._controlledReadableByteStream,s),Fd(r)}(e,n,t),Oa(e)}function bs(e){return e._pendingPullIntos.shift()}function Pc(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ss(e,n){let t=e._controlledReadableByteStream;t._state==="readable"&&(C1(e),Ho(e),Pc(e),z1(t,n))}function mm(e,n){let t=e._queue.shift();e._queueTotalSize-=t.byteLength,O1(e);let r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);n._chunkSteps(r)}function P1(e){let n=e._controlledReadableByteStream._state;return n==="errored"?null:n==="closed"?0:e._strategyHWM-e._queueTotalSize}function QR(e,n,t){let r=Object.create(Ea.prototype),i,s,u;i=n.start!==void 0?()=>n.start(r):()=>{},s=n.pull!==void 0?()=>n.pull(r):()=>It(void 0),u=n.cancel!==void 0?c=>n.cancel(c):()=>It(void 0);let h=n.autoAllocateChunkSize;if(h===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(c,a,d,f,g,I,C){a._controlledReadableByteStream=c,a._pullAgain=!1,a._pulling=!1,a._byobRequest=null,a._queue=a._queueTotalSize=void 0,Ho(a),a._closeRequested=!1,a._started=!1,a._strategyHWM=I,a._pullAlgorithm=f,a._cancelAlgorithm=g,a._autoAllocateChunkSize=C,a._pendingPullIntos=new Wn,c._readableStreamController=a,Wr(It(d()),()=>(a._started=!0,Oa(a),null),v=>(Ss(a,v),null))})(e,r,i,s,u,t,h)}function gd(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function vu(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function vm(e,n){e._reader._readIntoRequests.push(n)}function B1(e){return e._reader._readIntoRequests.length}function xp(e){let n=e._reader;return n!==void 0&&!!vs(n)}Object.defineProperties(Ea.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),wt(Ea.prototype.close,"close"),wt(Ea.prototype.enqueue,"enqueue"),wt(Ea.prototype.error,"error"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ea.prototype,mt.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var Sa=class{constructor(e){if(co(e,1,"ReadableStreamBYOBReader"),g1(e,"First parameter"),Cs(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ds(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");u1(this,e),this._readIntoRequests=new Wn}get closed(){return vs(this)?this._closedPromise:Ze(ac("closed"))}cancel(e){return vs(this)?this._ownerReadableStream===void 0?Ze(Es("cancel")):l1(this,e):Ze(ac("cancel"))}read(e){if(!vs(this))return Ze(ac("read"));if(!ArrayBuffer.isView(e))return Ze(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return Ze(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return Ze(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,this._ownerReadableStream===void 0)return Ze(Es("read from"));let n,t,r=on((i,s)=>{n=i,t=s});return function(i,s,u){let h=i._ownerReadableStream;h._disturbed=!0,h._state==="errored"?u._errorSteps(h._storedError):function(c,a,d){let f=c._controlledReadableByteStream,g=1;a.constructor!==DataView&&(g=a.constructor.BYTES_PER_ELEMENT);let I=a.constructor,C=a.buffer,v={buffer:C,bufferByteLength:C.byteLength,byteOffset:a.byteOffset,byteLength:a.byteLength,bytesFilled:0,elementSize:g,viewConstructor:I,readerType:"byob"};if(c._pendingPullIntos.length>0)return c._pendingPullIntos.push(v),void vm(f,d);if(f._state!=="closed"){if(c._queueTotalSize>0){if(A1(c,v)){let T=T1(v);return O1(c),void d._chunkSteps(T)}if(c._closeRequested){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");return Ss(c,T),void d._errorSteps(T)}}c._pendingPullIntos.push(v),vm(f,d),Oa(c)}else{let T=new I(v.buffer,v.byteOffset,0);d._closeSteps(T)}}(h._readableStreamController,s,u)}(this,e,{_chunkSteps:i=>n({value:i,done:!1}),_closeSteps:i=>n({value:i,done:!0}),_errorSteps:i=>t(i)}),r}releaseLock(){if(!vs(this))throw ac("releaseLock");this._ownerReadableStream!==void 0&&function(e){c1(e);let n=new TypeError("Reader was released");L1(e,n)}(this)}};function vs(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Sa}function L1(e,n){let t=e._readIntoRequests;e._readIntoRequests=new Wn,t.forEach(r=>{r._errorSteps(n)})}function ac(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Bu(e,n){let{highWaterMark:t}=e;if(t===void 0)return n;if(E1(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function Bc(e){let{size:n}=e;return n||(()=>1)}function Lc(e,n){so(e,n);let t=e?.highWaterMark,r=e?.size;return{highWaterMark:t===void 0?void 0:Pp(t),size:r===void 0?void 0:YR(r,`${n} has member 'size' that`)}}function YR(e,n){return si(e,n),t=>Pp(e(t))}function XR(e,n,t){return si(e,t),r=>Pa(e,n,[r])}function JR(e,n,t){return si(e,t),()=>Pa(e,n,[])}function ZR(e,n,t){return si(e,t),r=>ih(e,n,[r])}function eI(e,n,t){return si(e,t),(r,i)=>Pa(e,n,[r,i])}Object.defineProperties(Sa.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),wt(Sa.prototype.cancel,"cancel"),wt(Sa.prototype.read,"read"),wt(Sa.prototype.releaseLock,"releaseLock"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Sa.prototype,mt.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var tI=typeof AbortController=="function",Ca=class{constructor(e={},n={}){e===void 0?e=null:d1(e,"First parameter");let t=Lc(n,"Second parameter"),r=function(u,h){so(u,h);let c=u?.abort,a=u?.close,d=u?.start,f=u?.type,g=u?.write;return{abort:c===void 0?void 0:XR(c,u,`${h} has member 'abort' that`),close:a===void 0?void 0:JR(a,u,`${h} has member 'close' that`),start:d===void 0?void 0:ZR(d,u,`${h} has member 'start' that`),write:g===void 0?void 0:eI(g,u,`${h} has member 'write' that`),type:f}}(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 Wn,i._inFlightWriteRequest=void 0,i._closeRequest=void 0,i._inFlightCloseRequest=void 0,i._pendingAbortRequest=void 0,i._backpressure=!1,r.type!==void 0)throw new RangeError("Invalid type is specified");let s=Bc(t);(function(u,h,c,a){let d=Object.create(Nc.prototype),f,g,I,C;f=h.start!==void 0?()=>h.start(d):()=>{},g=h.write!==void 0?v=>h.write(v,d):()=>It(void 0),I=h.close!==void 0?()=>h.close():()=>It(void 0),C=h.abort!==void 0?v=>h.abort(v):()=>It(void 0),function(v,T,O,k,y,R,w,L){T._controlledWritableStream=v,v._writableStreamController=T,T._queue=void 0,T._queueTotalSize=void 0,Ho(T),T._abortReason=void 0,T._abortController=function(){if(tI)return new AbortController}(),T._started=!1,T._strategySizeAlgorithm=L,T._strategyHWM=w,T._writeAlgorithm=k,T._closeAlgorithm=y,T._abortAlgorithm=R;let D=qp(T);jp(v,D);let S=O();Wr(It(S),()=>(T._started=!0,ah(T),null),m=>(T._started=!0,$d(v,m),null))}(u,d,f,g,I,C,c,a)})(this,r,Bu(t,1),s)}get locked(){if(!Ri(this))throw uc("locked");return Ec(this)}abort(e){return Ri(this)?Ec(this)?Ze(new TypeError("Cannot abort a stream that already has a writer")):N1(this,e):Ze(uc("abort"))}close(){return Ri(this)?Ec(this)?Ze(new TypeError("Cannot close a stream that already has a writer")):Fo(this)?Ze(new TypeError("Cannot close an already-closing stream")):x1(this):Ze(uc("close"))}getWriter(){if(!Ri(this))throw uc("getWriter");return new Vo(this)}};function Ri(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Ca}function Ec(e){return e._writer!==void 0}function N1(e,n){var t;if(e._state==="closed"||e._state==="errored")return It(void 0);e._writableStreamController._abortReason=n,(t=e._writableStreamController._abortController)===null||t===void 0||t.abort(n);let r=e._state;if(r==="closed"||r==="errored")return It(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let i=!1;r==="erroring"&&(i=!0,n=void 0);let s=on((u,h)=>{e._pendingAbortRequest={_promise:void 0,_resolve:u,_reject:h,_reason:n,_wasAlreadyErroring:i}});return e._pendingAbortRequest._promise=s,i||Up(e,n),s}function x1(e){let n=e._state;if(n==="closed"||n==="errored")return Ze(new TypeError(`The stream (in ${n} state) is not in the writable state and cannot be closed`));let t=on((s,u)=>{let h={_resolve:s,_reject:u};e._closeRequest=h}),r=e._writer;var i;return r!==void 0&&e._backpressure&&n==="writable"&&Vp(r),Lp(i=e._writableStreamController,D1,0),ah(i),t}function $d(e,n){e._state!=="writable"?Dp(e):Up(e,n)}function Up(e,n){let t=e._writableStreamController;e._state="erroring",e._storedError=n;let r=e._writer;r!==void 0&&U1(r,n),!function(i){return!(i._inFlightWriteRequest===void 0&&i._inFlightCloseRequest===void 0)}(e)&&t._started&&Dp(e)}function Dp(e){e._state="errored",e._writableStreamController[s1]();let n=e._storedError;if(e._writeRequests.forEach(r=>{r._reject(n)}),e._writeRequests=new Wn,e._pendingAbortRequest===void 0)return void sc(e);let t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(n),void sc(e);Wr(e._writableStreamController[a1](t._reason),()=>(t._resolve(),sc(e),null),r=>(t._reject(r),sc(e),null))}function Fo(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function sc(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let n=e._writer;n!==void 0&&Mp(n,e._storedError)}function jp(e,n){let t=e._writer;t!==void 0&&n!==e._backpressure&&(n?function(r){sh(r)}(t):Vp(t)),e._backpressure=n}Object.defineProperties(Ca.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),wt(Ca.prototype.abort,"abort"),wt(Ca.prototype.close,"close"),wt(Ca.prototype.getWriter,"getWriter"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ca.prototype,mt.toStringTag,{value:"WritableStream",configurable:!0});var Vo=class{constructor(e){if(co(e,1,"WritableStreamDefaultWriter"),function(r,i){if(!Ri(r))throw new TypeError(`${i} is not a WritableStream.`)}(e,"First parameter"),Ec(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")!Fo(e)&&e._backpressure?sh(this):wm(this),Sc(this);else if(n==="erroring")zd(this,e._storedError),Sc(this);else if(n==="closed")wm(this),Sc(t=this),M1(t);else{let r=e._storedError;zd(this,r),_m(this,r)}var t}get closed(){return ya(this)?this._closedPromise:Ze(ga("closed"))}get desiredSize(){if(!ya(this))throw ga("desiredSize");if(this._ownerWritableStream===void 0)throw bu("desiredSize");return function(e){let n=e._ownerWritableStream,t=n._state;return t==="errored"||t==="erroring"?null:t==="closed"?0:j1(n._writableStreamController)}(this)}get ready(){return ya(this)?this._readyPromise:Ze(ga("ready"))}abort(e){return ya(this)?this._ownerWritableStream===void 0?Ze(bu("abort")):function(n,t){return N1(n._ownerWritableStream,t)}(this,e):Ze(ga("abort"))}close(){if(!ya(this))return Ze(ga("close"));let e=this._ownerWritableStream;return e===void 0?Ze(bu("close")):Fo(e)?Ze(new TypeError("Cannot close an already-closing stream")):x1(this._ownerWritableStream)}releaseLock(){if(!ya(this))throw ga("releaseLock");this._ownerWritableStream!==void 0&&function(e){let n=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");U1(e,t),function(r,i){r._closedPromiseState==="pending"?Mp(r,i):function(s,u){_m(s,u)}(r,i)}(e,t),n._writer=void 0,e._ownerWritableStream=void 0}(this)}write(e){return ya(this)?this._ownerWritableStream===void 0?Ze(bu("write to")):function(n,t){let r=n._ownerWritableStream,i=r._writableStreamController,s=function(c,a){try{return c._strategySizeAlgorithm(a)}catch(d){return bm(c,d),1}}(i,t);if(r!==n._ownerWritableStream)return Ze(bu("write to"));let u=r._state;if(u==="errored")return Ze(r._storedError);if(Fo(r)||u==="closed")return Ze(new TypeError("The stream is closing or closed and cannot be written to"));if(u==="erroring")return Ze(r._storedError);let h=function(c){return on((a,d)=>{let f={_resolve:a,_reject:d};c._writeRequests.push(f)})}(r);return function(c,a,d){try{Lp(c,a,d)}catch(g){return void bm(c,g)}let f=c._controlledWritableStream;!Fo(f)&&f._state==="writable"&&jp(f,qp(c)),ah(c)}(i,t,s),h}(this,e):Ze(ga("write"))}};function ya(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Vo}function U1(e,n){e._readyPromiseState==="pending"?V1(e,n):function(t,r){zd(t,r)}(e,n)}Object.defineProperties(Vo.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),wt(Vo.prototype.abort,"abort"),wt(Vo.prototype.close,"close"),wt(Vo.prototype.releaseLock,"releaseLock"),wt(Vo.prototype.write,"write"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Vo.prototype,mt.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var D1={},Nc=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!md(this))throw vd("abortReason");return this._abortReason}get signal(){if(!md(this))throw vd("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!md(this))throw vd("error");this._controlledWritableStream._state==="writable"&&q1(this,e)}[a1](e){let n=this._abortAlgorithm(e);return xc(this),n}[s1](){Ho(this)}};function md(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Nc}function xc(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function j1(e){return e._strategyHWM-e._queueTotalSize}function ah(e){let n=e._controlledWritableStream;if(!e._started||n._inFlightWriteRequest!==void 0)return;if(n._state==="erroring")return void Dp(n);if(e._queue.length===0)return;let t=e._queue.peek().value;t===D1?function(r){let i=r._controlledWritableStream;(function(u){u._inFlightCloseRequest=u._closeRequest,u._closeRequest=void 0})(i),Md(r);let s=r._closeAlgorithm();xc(r),Wr(s,()=>(function(u){u._inFlightCloseRequest._resolve(void 0),u._inFlightCloseRequest=void 0,u._state==="erroring"&&(u._storedError=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._resolve(),u._pendingAbortRequest=void 0)),u._state="closed";let h=u._writer;h!==void 0&&M1(h)}(i),null),u=>(function(h,c){h._inFlightCloseRequest._reject(c),h._inFlightCloseRequest=void 0,h._pendingAbortRequest!==void 0&&(h._pendingAbortRequest._reject(c),h._pendingAbortRequest=void 0),$d(h,c)}(i,u),null))}(e):function(r,i){let s=r._controlledWritableStream;(function(u){u._inFlightWriteRequest=u._writeRequests.shift()})(s),Wr(r._writeAlgorithm(i),()=>{(function(h){h._inFlightWriteRequest._resolve(void 0),h._inFlightWriteRequest=void 0})(s);let u=s._state;if(Md(r),!Fo(s)&&u==="writable"){let h=qp(r);jp(s,h)}return ah(r),null},u=>(s._state==="writable"&&xc(r),function(h,c){h._inFlightWriteRequest._reject(c),h._inFlightWriteRequest=void 0,$d(h,c)}(s,u),null))}(e,t)}function bm(e,n){e._controlledWritableStream._state==="writable"&&q1(e,n)}function qp(e){return j1(e)<=0}function q1(e,n){let t=e._controlledWritableStream;xc(e),Up(t,n)}function uc(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function vd(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function ga(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function bu(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Sc(e){e._closedPromise=on((n,t)=>{e._closedPromise_resolve=n,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function _m(e,n){Sc(e),Mp(e,n)}function Mp(e,n){e._closedPromise_reject!==void 0&&(ws(e._closedPromise),e._closedPromise_reject(n),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function M1(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 sh(e){e._readyPromise=on((n,t)=>{e._readyPromise_resolve=n,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function zd(e,n){sh(e),V1(e,n)}function wm(e){sh(e),Vp(e)}function V1(e,n){e._readyPromise_reject!==void 0&&(ws(e._readyPromise),e._readyPromise_reject(n),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Vp(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(Nc.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Nc.prototype,mt.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Em=typeof DOMException<"u"?DOMException:void 0,rI=function(e){if(typeof e!="function"&&typeof e!="object")return!1;try{return new e,!0}catch{return!1}}(Em)?Em:function(){let e=function(n,t){this.message=n||"",this.name=t||"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 Sm(e,n,t,r,i,s){let u=e.getReader(),h=n.getWriter();ka(e)&&(e._disturbed=!0);let c,a,d,f=!1,g=!1,I="readable",C="writable",v=!1,T=!1,O=on(y=>{d=y}),k=Promise.resolve(void 0);return on((y,R)=>{let w;function L(){if(f)return;let $=on((E,B)=>{(function j(N){N?E():ao(function(){return f?It(!0):ao(h.ready,()=>ao(u.read(),M=>!!M.done||(k=h.write(M.value),ws(k),!1)))}(),j,B)})(!1)});ws($)}function D(){return I="closed",t?q():p(()=>(Ri(n)&&(v=Fo(n),C=n._state),v||C==="closed"?It(void 0):C==="erroring"||C==="errored"?Ze(a):(v=!0,h.close())),!1,void 0),null}function S($){return f||(I="errored",c=$,r?q(!0,$):p(()=>h.abort($),!0,$)),null}function m($){return g||(C="errored",a=$,i?q(!0,$):p(()=>u.cancel($),!0,$)),null}if(s!==void 0&&(w=()=>{let $=s.reason!==void 0?s.reason:new rI("Aborted","AbortError"),E=[];r||E.push(()=>C==="writable"?h.abort($):It(void 0)),i||E.push(()=>I==="readable"?u.cancel($):It(void 0)),p(()=>Promise.all(E.map(B=>B())),!0,$)},s.aborted?w():s.addEventListener("abort",w)),ka(e)&&(I=e._state,c=e._storedError),Ri(n)&&(C=n._state,a=n._storedError,v=Fo(n)),ka(e)&&Ri(n)&&(T=!0,d()),I==="errored")S(c);else if(C==="erroring"||C==="errored")m(a);else if(I==="closed")D();else if(v||C==="closed"){let $=new TypeError("the destination writable stream closed before all data could be piped to it");i?q(!0,$):p(()=>u.cancel($),!0,$)}function p($,E,B){function j(){return C!=="writable"||v?N():lm(function(){let M;return It(function ee(){if(M!==k)return M=k,ii(k,ee,ee)}())}(),N),null}function N(){return $?Wr($(),()=>V(E,B),M=>V(!0,M)):V(E,B),null}f||(f=!0,T?j():lm(O,j))}function q($,E){p(void 0,$,E)}function V($,E){return g=!0,h.releaseLock(),u.releaseLock(),s!==void 0&&s.removeEventListener("abort",w),$?R(E):y(void 0),null}f||(Wr(u.closed,D,S),Wr(h.closed,function(){return g||(C="closed"),null},m)),T?L():_c(()=>{T=!0,d(),L()})})}function nI(e,n){return function(t){try{return t.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}(e)?function(t){let r,i,s,u,h,c=t.getReader(),a=!1,d=!1,f=!1,g=!1,I=!1,C=!1,v=on(m=>{h=m});function T(m){cm(m.closed,p=>(m!==c||(s.error(p),u.error(p),I&&C||h(void 0)),null))}function O(){a&&(c.releaseLock(),c=t.getReader(),T(c),a=!1),Wr(c.read(),m=>{var p,q;if(f=!1,g=!1,m.done)return I||s.close(),C||u.close(),(p=s.byobRequest)===null||p===void 0||p.respond(0),(q=u.byobRequest)===null||q===void 0||q.respond(0),I&&C||h(void 0),null;let V=m.value,$=V,E=V;if(!I&&!C)try{E=ym(V)}catch(B){return s.error(B),u.error(B),h(c.cancel(B)),null}return I||s.enqueue($),C||u.enqueue(E),d=!1,f?y():g&&R(),null},()=>(d=!1,null))}function k(m,p){a||(c.releaseLock(),c=t.getReader({mode:"byob"}),T(c),a=!0);let q=p?u:s,V=p?s:u;Wr(c.read(m),$=>{var E;f=!1,g=!1;let B=p?C:I,j=p?I:C;if($.done){B||q.close(),j||V.close();let M=$.value;return M!==void 0&&(B||q.byobRequest.respondWithNewView(M),j||(E=V.byobRequest)===null||E===void 0||E.respond(0)),B&&j||h(void 0),null}let N=$.value;if(j)B||q.byobRequest.respondWithNewView(N);else{let M;try{M=ym(N)}catch(ee){return q.error(ee),V.error(ee),h(c.cancel(ee)),null}B||q.byobRequest.respondWithNewView(N),V.enqueue(M)}return d=!1,f?y():g&&R(),null},()=>(d=!1,null))}function y(){if(d)return f=!0,It(void 0);d=!0;let m=s.byobRequest;return m===null?O():k(m.view,!1),It(void 0)}function R(){if(d)return g=!0,It(void 0);d=!0;let m=u.byobRequest;return m===null?O():k(m.view,!0),It(void 0)}function w(m){if(I=!0,r=m,C){let p=[r,i],q=c.cancel(p);h(q)}return v}function L(m){if(C=!0,i=m,I){let p=[r,i],q=c.cancel(p);h(q)}return v}let D=new jr({type:"bytes",start(m){s=m},pull:y,cancel:w}),S=new jr({type:"bytes",start(m){u=m},pull:R,cancel:L});return T(c),[D,S]}(e):function(t,r){let i=t.getReader(),s,u,h,c,a,d=!1,f=!1,g=!1,I=!1,C=on(R=>{a=R});function v(){return d?(f=!0,It(void 0)):(d=!0,Wr(i.read(),R=>{if(f=!1,R.done)return g||h.close(),I||c.close(),g&&I||a(void 0),null;let w=R.value,L=w,D=w;return g||h.enqueue(L),I||c.enqueue(D),d=!1,f&&v(),null},()=>(d=!1,null)),It(void 0))}function T(R){if(g=!0,s=R,I){let w=[s,u],L=i.cancel(w);a(L)}return C}function O(R){if(I=!0,u=R,g){let w=[s,u],L=i.cancel(w);a(L)}return C}let k=new jr({start(R){h=R},pull:v,cancel:T}),y=new jr({start(R){c=R},pull:v,cancel:O});return cm(i.closed,R=>(h.error(R),c.error(R),g&&I||a(void 0),null)),[k,y]}(e)}var Ta=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!lc(this))throw cc("desiredSize");return F1(this)}close(){if(!lc(this))throw cc("close");if(!Cu(this))throw new TypeError("The stream is not in a state that permits close");(function(e){if(!Cu(e))return;let n=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Cc(e),Lu(n))})(this)}enqueue(e){if(!lc(this))throw cc("enqueue");if(!Cu(this))throw new TypeError("The stream is not in a state that permits enqueue");return function(n,t){if(!Cu(n))return;let r=n._controlledReadableStream;if(Cs(r)&&oh(r)>0)Bp(r,t,!1);else{let i;try{i=n._strategySizeAlgorithm(t)}catch(s){throw Au(n,s),s}try{Lp(n,t,i)}catch(s){throw Au(n,s),s}}Iu(n)}(this,e)}error(e){if(!lc(this))throw cc("error");Au(this,e)}[Ip](e){Ho(this);let n=this._cancelAlgorithm(e);return Cc(this),n}[Ap](e){let n=this._controlledReadableStream;if(this._queue.length>0){let t=Md(this);this._closeRequested&&this._queue.length===0?(Cc(this),Lu(n)):Iu(this),e._chunkSteps(t)}else m1(n,e),Iu(this)}[kp](){}};function lc(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Ta}function Iu(e){if(function(n){let t=n._controlledReadableStream;return!Cu(n)||!n._started?!1:!!(Cs(t)&&oh(t)>0||F1(n)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Wr(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Iu(e)),null),n=>(Au(e,n),null))}}function Cc(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Au(e,n){let t=e._controlledReadableStream;t._state==="readable"&&(Ho(e),Cc(e),z1(t,n))}function F1(e){let n=e._controlledReadableStream._state;return n==="errored"?null:n==="closed"?0:e._strategyHWM-e._queueTotalSize}function Cu(e){return!e._closeRequested&&e._controlledReadableStream._state==="readable"}function iI(e,n,t,r){let i=Object.create(Ta.prototype),s,u,h;s=n.start!==void 0?()=>n.start(i):()=>{},u=n.pull!==void 0?()=>n.pull(i):()=>It(void 0),h=n.cancel!==void 0?c=>n.cancel(c):()=>It(void 0),function(c,a,d,f,g,I,C){a._controlledReadableStream=c,a._queue=void 0,a._queueTotalSize=void 0,Ho(a),a._started=!1,a._closeRequested=!1,a._pullAgain=!1,a._pulling=!1,a._strategySizeAlgorithm=C,a._strategyHWM=I,a._pullAlgorithm=f,a._cancelAlgorithm=g,c._readableStreamController=a,Wr(It(d()),()=>(a._started=!0,Iu(a),null),v=>(Au(a,v),null))}(e,i,s,u,h,t,r)}function cc(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function oI(e,n,t){return si(e,t),r=>Pa(e,n,[r])}function aI(e,n,t){return si(e,t),r=>Pa(e,n,[r])}function sI(e,n,t){return si(e,t),r=>ih(e,n,[r])}function uI(e,n){if((e=`${e}`)!="bytes")throw new TypeError(`${n} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function lI(e,n){if((e=`${e}`)!="byob")throw new TypeError(`${n} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Cm(e,n){so(e,n);let t=e?.preventAbort,r=e?.preventCancel,i=e?.preventClose,s=e?.signal;return s!==void 0&&function(u,h){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(u))throw new TypeError(`${h} is not an AbortSignal.`)}(s,`${n} has member 'signal' that`),{preventAbort:!!t,preventCancel:!!r,preventClose:!!i,signal:s}}function cI(e,n){so(e,n);let t=e?.readable;qd(t,"readable","ReadableWritablePair"),function(i,s){if(!Su(i))throw new TypeError(`${s} is not a ReadableStream.`)}(t,`${n} has member 'readable' that`);let r=e?.writable;return qd(r,"writable","ReadableWritablePair"),function(i,s){if(!y1(i))throw new TypeError(`${s} is not a WritableStream.`)}(r,`${n} has member 'writable' that`),{readable:t,writable:r}}Object.defineProperties(Ta.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),wt(Ta.prototype.close,"close"),wt(Ta.prototype.enqueue,"enqueue"),wt(Ta.prototype.error,"error"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ta.prototype,mt.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var jr=class{constructor(e={},n={}){e===void 0?e=null:d1(e,"First parameter");let t=Lc(n,"Second parameter"),r=function(s,u){so(s,u);let h=s,c=h?.autoAllocateChunkSize,a=h?.cancel,d=h?.pull,f=h?.start,g=h?.type;return{autoAllocateChunkSize:c===void 0?void 0:p1(c,`${u} has member 'autoAllocateChunkSize' that`),cancel:a===void 0?void 0:oI(a,h,`${u} has member 'cancel' that`),pull:d===void 0?void 0:aI(d,h,`${u} has member 'pull' that`),start:f===void 0?void 0:sI(f,h,`${u} has member 'start' that`),type:g===void 0?void 0:uI(g,`${u} 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,r.type==="bytes"){if(t.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");QR(this,r,Bu(t,0))}else{let s=Bc(t);iI(this,r,Bu(t,1),s)}}get locked(){if(!ka(this))throw ma("locked");return Cs(this)}cancel(e){return ka(this)?Cs(this)?Ze(new TypeError("Cannot cancel a stream that already has a reader")):$1(this,e):Ze(ma("cancel"))}getReader(e){if(!ka(this))throw ma("getReader");return function(n,t){so(n,t);let r=n?.mode;return{mode:r===void 0?void 0:lI(r,`${t} has member 'mode' that`)}}(e,"First parameter").mode===void 0?new wa(this):function(n){return new Sa(n)}(this)}pipeThrough(e,n={}){if(!Su(this))throw ma("pipeThrough");co(e,1,"pipeThrough");let t=cI(e,"First parameter"),r=Cm(n,"Second parameter");if(this.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(t.writable.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return ws(Sm(this,t.writable,r.preventClose,r.preventAbort,r.preventCancel,r.signal)),t.readable}pipeTo(e,n={}){if(!Su(this))return Ze(ma("pipeTo"));if(e===void 0)return Ze("Parameter 1 is required in 'pipeTo'.");if(!y1(e))return Ze(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let t;try{t=Cm(n,"Second parameter")}catch(r){return Ze(r)}return this.locked?Ze(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):e.locked?Ze(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Sm(this,e,t.preventClose,t.preventAbort,t.preventCancel,t.signal)}tee(){if(!Su(this))throw ma("tee");if(this.locked)throw new TypeError("Cannot tee a stream that already has a reader");return nI(this)}values(e){if(!Su(this))throw ma("values");return function(n,t){let r=n.getReader(),i=new _1(r,t),s=Object.create(w1);return s._asyncIteratorImpl=i,s}(this,function(n,t){return so(n,t),{preventCancel:!!n?.preventCancel}}(e,"First parameter").preventCancel)}};function ka(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof jr}function Cs(e){return e._reader!==void 0}function $1(e,n){if(e._disturbed=!0,e._state==="closed")return It(void 0);if(e._state==="errored")return Ze(e._storedError);Lu(e);let t=e._reader;if(t!==void 0&&vs(t)){let r=t._readIntoRequests;t._readIntoRequests=new Wn,r.forEach(i=>{i._closeSteps(void 0)})}return ii(e._readableStreamController[Ip](n),i1)}function Lu(e){e._state="closed";let n=e._reader;if(n!==void 0&&(f1(n),Aa(n))){let t=n._readRequests;n._readRequests=new Wn,t.forEach(r=>{r._closeSteps()})}}function z1(e,n){e._state="errored",e._storedError=n;let t=e._reader;t!==void 0&&(Op(t,n),Aa(t)?b1(t,n):L1(t,n))}function ma(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function H1(e,n){so(e,n);let t=e?.highWaterMark;return qd(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Pp(t)}}Object.defineProperties(jr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),wt(jr.prototype.cancel,"cancel"),wt(jr.prototype.getReader,"getReader"),wt(jr.prototype.pipeThrough,"pipeThrough"),wt(jr.prototype.pipeTo,"pipeTo"),wt(jr.prototype.tee,"tee"),wt(jr.prototype.values,"values"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(jr.prototype,mt.toStringTag,{value:"ReadableStream",configurable:!0}),typeof mt.asyncIterator=="symbol"&&Object.defineProperty(jr.prototype,mt.asyncIterator,{value:jr.prototype.values,writable:!0,configurable:!0});var K1=e=>e.byteLength;wt(K1,"size");var Hd=class{constructor(e){co(e,1,"ByteLengthQueuingStrategy"),e=H1(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Rm(this))throw Tm("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Rm(this))throw Tm("size");return K1}};function Tm(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Rm(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Hd}Object.defineProperties(Hd.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Hd.prototype,mt.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var W1=()=>1;wt(W1,"size");var Kd=class{constructor(e){co(e,1,"CountQueuingStrategy"),e=H1(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Am(this))throw Im("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Am(this))throw Im("size");return W1}};function Im(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Am(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Kd}function hI(e,n,t){return si(e,t),r=>Pa(e,n,[r])}function fI(e,n,t){return si(e,t),r=>ih(e,n,[r])}function dI(e,n,t){return si(e,t),(r,i)=>Pa(e,n,[r,i])}Object.defineProperties(Kd.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Kd.prototype,mt.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var Wd=class{constructor(e={},n={},t={}){e===void 0&&(e=null);let r=Lc(n,"Second parameter"),i=Lc(t,"Third parameter"),s=function(f,g){so(f,g);let I=f?.flush,C=f?.readableType,v=f?.start,T=f?.transform,O=f?.writableType;return{flush:I===void 0?void 0:hI(I,f,`${g} has member 'flush' that`),readableType:C,start:v===void 0?void 0:fI(v,f,`${g} has member 'start' that`),transform:T===void 0?void 0:dI(T,f,`${g} has member 'transform' that`),writableType:O}}(e,"First parameter");if(s.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(s.writableType!==void 0)throw new RangeError("Invalid writableType specified");let u=Bu(i,0),h=Bc(i),c=Bu(r,1),a=Bc(r),d;(function(f,g,I,C,v,T){function O(){return g}function k(D){return function(S,m){let p=S._transformStreamController;return S._backpressure?ii(S._backpressureChangePromise,()=>{if((Ri(S._writable)?S._writable._state:S._writableState)==="erroring")throw Ri(S._writable)?S._writable._storedError:S._writableStoredError;return Om(p,m)}):Om(p,m)}(f,D)}function y(D){return function(S,m){return Uc(S,m),It(void 0)}(f,D)}function R(){return function(D){let S=D._transformStreamController,m=S._flushAlgorithm();return G1(S),ii(m,()=>{if(D._readableState==="errored")throw D._readableStoredError;jc(D)&&Y1(D)},p=>{throw Uc(D,p),D._readableStoredError})}(f)}function w(){return function(D){return Dc(D,!1),D._backpressureChangePromise}(f)}function L(D){return uh(f,D),It(void 0)}f._writableState="writable",f._writableStoredError=void 0,f._writableHasInFlightOperation=!1,f._writableStarted=!1,f._writable=function(D,S,m,p,q,V,$){return new Ca({start(E){D._writableController=E;try{let B=E.signal;B!==void 0&&B.addEventListener("abort",()=>{D._writableState==="writable"&&(D._writableState="erroring",B.reason&&(D._writableStoredError=B.reason))})}catch{}return ii(S(),()=>(D._writableStarted=!0,Bm(D),null),B=>{throw D._writableStarted=!0,bd(D,B),B})},write:E=>(function(B){B._writableHasInFlightOperation=!0}(D),ii(m(E),()=>(function(B){B._writableHasInFlightOperation=!1}(D),Bm(D),null),B=>{throw function(j,N){j._writableHasInFlightOperation=!1,bd(j,N)}(D,B),B})),close:()=>(function(E){E._writableHasInFlightOperation=!0}(D),ii(p(),()=>(function(E){E._writableHasInFlightOperation=!1,E._writableState==="erroring"&&(E._writableStoredError=void 0),E._writableState="closed"}(D),null),E=>{throw function(B,j){B._writableHasInFlightOperation=!1,B._writableState,bd(B,j)}(D,E),E})),abort:E=>(D._writableState="errored",D._writableStoredError=E,q(E))},{highWaterMark:V,size:$})}(f,O,k,R,y,I,C),f._readableState="readable",f._readableStoredError=void 0,f._readableCloseRequested=!1,f._readablePulling=!1,f._readable=function(D,S,m,p,q,V){return new jr({start:$=>(D._readableController=$,S().catch(E=>{qc(D,E)})),pull:()=>(D._readablePulling=!0,m().catch($=>{qc(D,$)})),cancel:$=>(D._readableState="closed",p($))},{highWaterMark:q,size:V})}(f,O,w,L,v,T),f._backpressure=void 0,f._backpressureChangePromise=void 0,f._backpressureChangePromise_resolve=void 0,Dc(f,!0),f._transformStreamController=void 0})(this,on(f=>{d=f}),c,a,u,h),function(f,g){let I=Object.create(Ra.prototype),C,v;C=g.transform!==void 0?T=>g.transform(T,I):T=>{try{return Q1(I,T),It(void 0)}catch(O){return Ze(O)}},v=g.flush!==void 0?()=>g.flush(I):()=>It(void 0),function(T,O,k,y){O._controlledTransformStream=T,T._transformStreamController=O,O._transformAlgorithm=k,O._flushAlgorithm=y}(f,I,C,v)}(this,s),s.start!==void 0?d(s.start(this._transformStreamController)):d(void 0)}get readable(){if(!km(this))throw Pm("readable");return this._readable}get writable(){if(!km(this))throw Pm("writable");return this._writable}};function km(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof Wd}function Uc(e,n){qc(e,n),uh(e,n)}function uh(e,n){G1(e._transformStreamController),function(t,r){t._writableController.error(r),t._writableState==="writable"&&J1(t,r)}(e,n),e._backpressure&&Dc(e,!1)}function Dc(e,n){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=on(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=n}Object.defineProperties(Wd.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Wd.prototype,mt.toStringTag,{value:"TransformStream",configurable:!0});var Ra=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!hc(this))throw fc("desiredSize");return X1(this._controlledTransformStream)}enqueue(e){if(!hc(this))throw fc("enqueue");Q1(this,e)}error(e){if(!hc(this))throw fc("error");var n;n=e,Uc(this._controlledTransformStream,n)}terminate(){if(!hc(this))throw fc("terminate");(function(e){let n=e._controlledTransformStream;jc(n)&&Y1(n);let t=new TypeError("TransformStream terminated");uh(n,t)})(this)}};function hc(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Ra}function G1(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Q1(e,n){let t=e._controlledTransformStream;if(!jc(t))throw new TypeError("Readable side is not in a state that permits enqueue");try{(function(r,i){r._readablePulling=!1;try{r._readableController.enqueue(i)}catch(s){throw qc(r,s),s}})(t,n)}catch(r){throw uh(t,r),t._readableStoredError}(function(r){return!function(i){return jc(i)?!!(i._readablePulling||X1(i)>0):!1}(r)})(t)!==t._backpressure&&Dc(t,!0)}function Om(e,n){return ii(e._transformAlgorithm(n),void 0,t=>{throw Uc(e._controlledTransformStream,t),t})}function fc(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Pm(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}function jc(e){return!e._readableCloseRequested&&e._readableState==="readable"}function Y1(e){e._readableState="closed",e._readableCloseRequested=!0,e._readableController.close()}function qc(e,n){e._readableState==="readable"&&(e._readableState="errored",e._readableStoredError=n),e._readableController.error(n)}function X1(e){return e._readableController.desiredSize}function bd(e,n){e._writableState!=="writable"?Fp(e):J1(e,n)}function J1(e,n){e._writableState="erroring",e._writableStoredError=n,!function(t){return t._writableHasInFlightOperation}(e)&&e._writableStarted&&Fp(e)}function Fp(e){e._writableState="errored"}function Bm(e){e._writableState==="erroring"&&Fp(e)}Object.defineProperties(Ra.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),wt(Ra.prototype.enqueue,"enqueue"),wt(Ra.prototype.error,"error"),wt(Ra.prototype.terminate,"terminate"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ra.prototype,mt.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Z1=65536;async function*pI(e){let n=e.byteOffset+e.byteLength,t=e.byteOffset;for(;t!==n;){let r=Math.min(n-t,Z1),i=e.buffer.slice(t,t+r);t+=i.byteLength,yield new Uint8Array(i)}}async function*yI(e){let n=0;for(;n!==e.size;){let t=await e.slice(n,Math.min(e.size,n+Z1)).arrayBuffer();n+=t.byteLength,yield new Uint8Array(t)}}async function*_d(e,n=!1){for(let t of e)ArrayBuffer.isView(t)?n?yield*pI(t):yield t:Or(t.stream)?yield*t.stream():yield*yI(t)}function*gI(e,n,t=0,r){r??(r=n);let i=t<0?Math.max(n+t,0):Math.min(t,n),s=r<0?Math.max(n+r,0):Math.min(r,n),u=Math.max(s-i,0),h=0;for(let c of e){if(h>=u)break;let a=ArrayBuffer.isView(c)?c.byteLength:c.size;if(i&&a<=i)i-=a,s-=a;else{let d;ArrayBuffer.isView(c)?(d=c.subarray(i,Math.min(a,s)),h+=d.byteLength):(d=c.slice(i,Math.min(a,s)),h+=d.size),s-=a,i=0,yield d}}}var jo=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},Lm=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},va,dc,_u,Ts=class{constructor(e=[],n={}){if(va.set(this,[]),dc.set(this,""),_u.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(!Or(e[Symbol.iterator]))throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&!Or(n))throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");let t=new TextEncoder;for(let i of e){let s;ArrayBuffer.isView(i)?s=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):i instanceof ArrayBuffer?s=new Uint8Array(i.slice(0)):i instanceof Ts?s=i:s=t.encode(String(i)),Lm(this,_u,jo(this,_u,"f")+(ArrayBuffer.isView(s)?s.byteLength:s.size),"f"),jo(this,va,"f").push(s)}let r=n.type===void 0?"":String(n.type);Lm(this,dc,/^[\x20-\x7E]*$/.test(r)?r:"","f")}static[(va=new WeakMap,dc=new WeakMap,_u=new WeakMap,Symbol.hasInstance)](e){return!!(e&&typeof e=="object"&&Or(e.constructor)&&(Or(e.stream)||Or(e.arrayBuffer))&&/^(Blob|File)$/.test(e[Symbol.toStringTag]))}get type(){return jo(this,dc,"f")}get size(){return jo(this,_u,"f")}slice(e,n,t){return new Ts(gI(jo(this,va,"f"),this.size,e,n),{type:t})}async text(){let e=new TextDecoder,n="";for await(let t of _d(jo(this,va,"f")))n+=e.decode(t,{stream:!0});return n+=e.decode(),n}async arrayBuffer(){let e=new Uint8Array(this.size),n=0;for await(let t of _d(jo(this,va,"f")))e.set(t,n),n+=t.length;return e.buffer}stream(){let e=_d(jo(this,va,"f"),!0);return new jr({async pull(n){let{value:t,done:r}=await e.next();if(r)return queueMicrotask(()=>n.close());n.enqueue(t)},async cancel(){await e.return()}})}get[Symbol.toStringTag](){return"Blob"}};Object.defineProperties(Ts.prototype,{type:{enumerable:!0},size:{enumerable:!0},slice:{enumerable:!0},stream:{enumerable:!0},text:{enumerable:!0},arrayBuffer:{enumerable:!0}});var mI=e=>e instanceof Ts,Nm=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},xm=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},pc,yc,Mc=class extends Ts{constructor(e,n,t={}){if(super(e,t),pc.set(this,void 0),yc.set(this,0),arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);Nm(this,pc,String(n),"f");let r=t.lastModified===void 0?Date.now():Number(t.lastModified);Number.isNaN(r)||Nm(this,yc,r,"f")}static[(pc=new WeakMap,yc=new WeakMap,Symbol.hasInstance)](e){return e instanceof Ts&&e[Symbol.toStringTag]==="File"&&typeof e.name=="string"}get name(){return xm(this,pc,"f")}get webkitRelativePath(){return""}get lastModified(){return xm(this,yc,"f")}get[Symbol.toStringTag](){return"File"}},vI=e=>e instanceof Mc,Ei=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},gc,Si,wd,Um=class{constructor(){gc.add(this),Si.set(this,new Map)}static[(Si=new WeakMap,gc=new WeakSet,Symbol.hasInstance)](e){if(!e)return!1;let n=e;return!!(Or(n.constructor)&&n[Symbol.toStringTag]==="FormData"&&Or(n.append)&&Or(n.set)&&Or(n.get)&&Or(n.getAll)&&Or(n.has)&&Or(n.delete)&&Or(n.entries)&&Or(n.values)&&Or(n.keys)&&Or(n[Symbol.iterator])&&Or(n.forEach))}append(e,n,t){Ei(this,gc,"m",wd).call(this,{name:e,fileName:t,append:!0,rawValue:n,argsLength:arguments.length})}set(e,n,t){Ei(this,gc,"m",wd).call(this,{name:e,fileName:t,append:!1,rawValue:n,argsLength:arguments.length})}get(e){let n=Ei(this,Si,"f").get(String(e));return n?n[0]:null}getAll(e){let n=Ei(this,Si,"f").get(String(e));return n?n.slice():[]}has(e){return Ei(this,Si,"f").has(String(e))}delete(e){Ei(this,Si,"f").delete(String(e))}*keys(){for(let e of Ei(this,Si,"f").keys())yield e}*entries(){for(let e of this.keys()){let n=this.getAll(e);for(let t of n)yield[e,t]}}*values(){for(let[,e]of this)yield e}[(wd=function({name:e,rawValue:n,append:t,fileName:r,argsLength:i}){let s=t?"append":"set";if(i<2)throw new TypeError(`Failed to execute '${s}' on 'FormData': 2 arguments required, but only ${i} present.`);e=String(e);let u;if(vI(n))u=r===void 0?n:new Mc([n],r,{type:n.type,lastModified:n.lastModified});else if(mI(n))u=new Mc([n],r===void 0?"blob":r,{type:n.type});else{if(r)throw new TypeError(`Failed to execute '${s}' on 'FormData': parameter 2 is not of type 'Blob'.`);u=String(n)}let h=Ei(this,Si,"f").get(e);if(!h)return void Ei(this,Si,"f").set(e,[u]);if(!t)return void Ei(this,Si,"f").set(e,[u]);h.push(u)},Symbol.iterator)](){return this.entries()}forEach(e,n){for(let[t,r]of this)e.call(n,r,t,this)}get[Symbol.toStringTag](){return"FormData"}},bI=require("node:fs"),eb=require("node:fs/promises"),_I=require("node:path"),wI=xt(L3(),1),EI=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function SI(e){if(EI(e)!=="object")return!1;let n=Object.getPrototypeOf(e);return n==null?!0:(n.constructor&&n.constructor.toString())===Object.toString()}var CI=SI,Dm=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},ba=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},_a,fs,TI="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",tb=class{constructor(e){_a.set(this,void 0),fs.set(this,void 0),Dm(this,_a,e.path,"f"),Dm(this,fs,e.start||0,"f"),this.name=(0,_I.basename)(ba(this,_a,"f")),this.size=e.size,this.lastModified=e.lastModified}slice(e,n){return new tb({path:ba(this,_a,"f"),lastModified:this.lastModified,start:ba(this,fs,"f")+e,size:n-e})}async*stream(){let{mtimeMs:e}=await(0,eb.stat)(ba(this,_a,"f"));if(e>this.lastModified)throw new wI.default(TI,"NotReadableError");this.size&&(yield*(0,bI.createReadStream)(ba(this,_a,"f"),{start:ba(this,fs,"f"),end:ba(this,fs,"f")+this.size-1}))}get[(_a=new WeakMap,fs=new WeakMap,Symbol.toStringTag)](){return"File"}};function RI(e,{mtimeMs:n,size:t},r,i={}){let s;CI(r)?[i,s]=[r,void 0]:s=r;let u=new tb({path:e,size:t,lastModified:n});return s||(s=u.name),new Mc([u],s,{...i,lastModified:u.lastModified})}async function II(e,n,t){let r=await(0,eb.stat)(e);return RI(e,r,n,t)}var AI=xt(m6(),1);async function kI(e,n,t){for(let r=0;rsetTimeout(i,t))}return!1}var $p={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"},OI=Object.keys($p),mc="https://addons.mozilla.org/api",PI=class{options={};get productEndpoint(){return`${mc}/v5/addons/addon/${encodeURIComponent(this.options.extId)}`}constructor(e){for(let n of OI){if(!e[n])throw new Error($p[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,this.options.channel=e.channel||"listed",e.license==="inherit"?delete e.license:e.license=e.license||"all-rights-reserved"}submit=async({filePath:e,version:n="1.0.0"})=>{let t=await this.uploadFile({filePath:e});if(!await kI(async()=>(await this.getUpload({uploadUuid:t.uuid})).valid,8,2400))throw new Error("Upload has not been validated in time.");return await this.createVersion({uploadUuid:t.uuid,version:n})};uploadFile=async({filePath:e})=>{let n=await this.getAccessToken(),t=`${mc}/v5/addons/upload/`,r=new Um;r.append("upload",await II(e)),r.append("channel",this.options.channel);let i=await vn.post(t,{body:r,headers:{Authorization:`JWT ${n}`},throwHttpErrors:!1});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"):(console.log(i.body),new Error(JSON.parse(i.body).error||"Unknown error"));return JSON.parse(i.body)};createVersion=async({uploadUuid:e,version:n})=>{let t=await this.getAccessToken(),r=`${this.productEndpoint}/versions/`,i=new Um;i.append("upload",e);let s=await vn.post(r,{body:i,headers:{Authorization:`JWT ${t}`},throwHttpErrors:!1});if(s.statusCode>=400)throw s.statusCode===401?new Error("Invalid access token"):s.statusCode===403?new Error("You do not own this add-on"):s.statusCode===409?new Error(`Version ${n} already exists`):(console.log(s.body),new Error(JSON.parse(s.body).error||"Unknown error"));return JSON.parse(s.body)};getUpload=async({uploadUuid:e})=>{let n=await this.getAccessToken(),t=`${mc}/v5/addons/upload/${e}`;return vn.get(t,{headers:{Authorization:`JWT ${n}`}}).json()};getVersion=async({version:e="1.0.0"})=>{let n=await this.getAccessToken(),t=`${this.productEndpoint}/versions/${encodeURIComponent(e)}/`;return vn.get(t,{headers:{Authorization:`JWT ${n}`}}).json()};getProfile=async()=>{let e=await this.getAccessToken(),n=`${mc}/v5/accounts/profile`;return vn.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 AI.default.sign(n,this.options.apiSecret,{algorithm:"HS256"})}},Nu="firefox",BI=rh(Nu);function LI(e){return ho(this,null,function*(){var n=e,{extId:t,zip:r,dryRun:i}=n,s=Hc(n,["extId","zip","dryRun"]),u,h,c,a;let d=eh(r),f=((h=(u=d.browser_specific_settings)==null?void 0:u.gecko)==null?void 0:h.id)||((a=(c=d.applications)==null?void 0:c.gecko)==null?void 0:a.id)||t,g=new PI(zc({extId:f},s));if(BI(`Updating extension with ID ${f}`),i)return!0;try{return yield g.submit({filePath:r,version:d.version}),th({extId:f,market:Nu,zip:r}),!0}catch(I){throw nh(I,Nu,`"${f}" (${d.name})`)}})}function NI(e){return ho(this,null,function*(){return e.zip=zu(e),e.verbose&&Hu(Nu),Ku({market:Nu,options:e,errorMap:$p}),LI(e)})}var xI={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: +`:n),s4=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function qg(e){if(s4(e)!=="object")return!1;let n=Object.getPrototypeOf(e);return n==null?!0:(n.constructor&&n.constructor.toString())===Object.toString()}function Mg(e,n){if(typeof n=="string"){for(let[t,r]of Object.entries(e))if(n.toLowerCase()===t.toLowerCase())return r}}var u4=e=>new Proxy(e,{get:(n,t)=>Mg(n,t),has:(n,t)=>Mg(n,t)!==void 0}),Mu=e=>!!(e&&io(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&io(e.append)&&io(e.getAll)&&io(e.entries)&&io(e[Symbol.iterator])),Vg=e=>String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),fa=e=>!!(e&&typeof e=="object"&&io(e.constructor)&&e[Symbol.toStringTag]==="File"&&io(e.stream)&&e.name!=null),hu=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},Yt=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},fu,Uo,du,Xl,pu,da,yu,gu,Jl,ed,Fg,l4={enableAdditionalHeaders:!1},Zl={writable:!1,configurable:!1},Lv=class{constructor(e,n,t){if(fu.add(this),Uo.set(this,`\r +`),du.set(this,void 0),Xl.set(this,void 0),pu.set(this,"-".repeat(2)),da.set(this,new TextEncoder),yu.set(this,void 0),gu.set(this,void 0),Jl.set(this,void 0),!Mu(e))throw new TypeError("Expected first argument to be a FormData instance.");let r;if(qg(n)?t=n:r=n,r||(r=a4()),typeof r!="string")throw new TypeError("Expected boundary argument to be a string.");if(t&&!qg(t))throw new TypeError("Expected options argument to be an object.");hu(this,gu,Array.from(e.entries()),"f"),hu(this,Jl,{...l4,...t},"f"),hu(this,du,Yt(this,da,"f").encode(Yt(this,Uo,"f")),"f"),hu(this,Xl,Yt(this,du,"f").byteLength,"f"),this.boundary=`form-data-boundary-${r}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,hu(this,yu,Yt(this,da,"f").encode(`${Yt(this,pu,"f")}${this.boundary}${Yt(this,pu,"f")}${Yt(this,Uo,"f").repeat(2)}`),"f");let i={"Content-Type":this.contentType},s=Yt(this,fu,"m",Fg).call(this);s&&(this.contentLength=s,i["Content-Length"]=s),this.headers=u4(Object.freeze(i)),Object.defineProperties(this,{boundary:Zl,contentType:Zl,contentLength:Zl,headers:Zl})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,n]of Yt(this,gu,"f")){let t=fa(n)?n:Yt(this,da,"f").encode(jg(n));yield Yt(this,fu,"m",ed).call(this,e,t),yield t,yield Yt(this,du,"f")}yield Yt(this,yu,"f")}async*encode(){for(let e of this.values())fa(e)?yield*o4(e.stream()):yield e}[(Uo=new WeakMap,du=new WeakMap,Xl=new WeakMap,pu=new WeakMap,da=new WeakMap,yu=new WeakMap,gu=new WeakMap,Jl=new WeakMap,fu=new WeakSet,ed=function(e,n){let t="";t+=`${Yt(this,pu,"f")}${this.boundary}${Yt(this,Uo,"f")}`,t+=`Content-Disposition: form-data; name="${Vg(e)}"`,fa(n)&&(t+=`; filename="${Vg(n.name)}"${Yt(this,Uo,"f")}`,t+=`Content-Type: ${n.type||"application/octet-stream"}`);let r=fa(n)?n.size:n.byteLength;return Yt(this,Jl,"f").enableAdditionalHeaders===!0&&r!=null&&!isNaN(r)&&(t+=`${Yt(this,Uo,"f")}Content-Length: ${fa(n)?n.size:n.byteLength}`),Yt(this,da,"f").encode(`${t}${Yt(this,Uo,"f").repeat(2)}`)},Fg=function(){let e=0;for(let[n,t]of Yt(this,gu,"f")){let r=fa(t)?t:Yt(this,da,"f").encode(jg(t)),i=fa(r)?r.size:r.byteLength;if(i==null||isNaN(i))return;e+=Yt(this,fu,"m",ed).call(this,n,r).byteLength,e+=i,e+=Yt(this,Xl,"f")}return String(e+Yt(this,yu,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}},c4=require("node:buffer"),h4=require("node:util");function Nv(e){return W.nodeStream(e)&&W.function_(e.getBoundary)}async function f4(e,n){if(n&&"content-length"in n)return Number(n["content-length"]);if(!e)return 0;if(W.string(e))return c4.Buffer.byteLength(e);if(W.buffer(e))return e.length;if(Nv(e))return(0,h4.promisify)(e.getLength.bind(e))()}function xv(e,n,t){let r={};for(let i of t){let s=(...u)=>{n.emit(i,...u)};r[i]=s,e.on(i,s)}return()=>{for(let[i,s]of Object.entries(r))e.off(i,s)}}var d4=xt(require("node:net"),1);function p4(){let e=[];return{once(n,t,r){n.once(t,r),e.push({origin:n,event:t,fn:r})},unhandleAll(){for(let n of e){let{origin:t,event:r,fn:i}=n;t.removeListener(r,i)}e.length=0}}}var $g=Symbol("reentry"),y4=()=>{},Uv=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 g4(e,n,t){if($g in e)return y4;e[$g]=!0;let r=[],{once:i,unhandleAll:s}=p4(),u=(v,T,O)=>{let k=setTimeout(T,v,v,O);k.unref?.();let y=()=>{clearTimeout(k)};return r.push(y),y},{host:h,hostname:c}=t,a=(v,T)=>{e.destroy(new Uv(v,T))},d=()=>{for(let v of r)v();s()};if(e.once("error",v=>{if(d(),e.listenerCount("error")===0)throw v}),n.request!==void 0){let v=u(n.request,a,"request");i(e,"response",T=>{i(T,"end",v)})}if(n.socket!==void 0){let{socket:v}=n,T=()=>{a(v,"socket")};e.setTimeout(v,T),r.push(()=>{e.removeListener("timeout",T)})}let f=n.lookup!==void 0,g=n.connect!==void 0,I=n.secureConnect!==void 0,C=n.send!==void 0;return(f||g||I||C)&&i(e,"socket",v=>{let{socketPath:T}=e;if(v.connecting){let O=!!(T??d4.default.isIP(c??h??"")!==0);if(f&&!O&&v.address().address===void 0){let k=u(n.lookup,a,"lookup");i(v,"lookup",k)}if(g){let k=()=>u(n.connect,a,"connect");O?i(v,"connect",k()):i(v,"lookup",y=>{y===null&&i(v,"connect",k())})}I&&t.protocol==="https:"&&i(v,"connect",()=>{let k=u(n.secureConnect,a,"secureConnect");i(v,"secureConnect",k)})}if(C){let O=()=>u(n.send,a,"send");v.connecting?i(v,"connect",()=>{i(e,"upload-complete",O())}):i(e,"upload-complete",O())}}),n.response!==void 0&&i(e,"upload-complete",()=>{let v=u(n.response,a,"response");i(e,"response",v)}),n.read!==void 0&&i(e,"response",v=>{let T=u(n.read,a,"read");i(v,"end",T)}),d}function m4(e){e=e;let n={protocol:e.protocol,hostname:W.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 W.string(e.port)&&e.port.length>0&&(n.port=Number(e.port)),(e.username||e.password)&&(n.auth=`${e.username||""}:${e.password||""}`),n}var v4=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)}},b4=({attemptCount:e,retryOptions:n,error:t,retryAfter:r,computedValue:i})=>{if(t.name==="RetryError")return 1;if(e>n.limit)return 0;let s=n.methods.includes(t.options.method),u=n.errorCodes.includes(t.code),h=t.response&&n.statusCodes.includes(t.response.statusCode);if(!s||!u&&!h)return 0;if(t.response){if(r)return r>i?0:r;if(t.response.statusCode===413)return 0}let c=Math.random()*n.noise;return Math.min(2**(e-1)*1e3,n.backoffLimit)+c},_4=b4,w4=xt(require("node:process"),1),td=require("node:util"),E4=require("node:tls"),S4=xt(require("node:http"),1),C4=xt(require("node:https"),1),ps=require("node:dns"),rd=require("node:util"),T4=xt(require("node:os"),1),{Resolver:zg}=ps.promises,cs=Symbol("cacheableLookupCreateConnection"),nd=Symbol("cacheableLookupInstance"),Hg=Symbol("expires"),R4=typeof ps.ALL=="number",Kg=e=>{if(!(e&&typeof e.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},I4=e=>{for(let n of e)n.family!==6&&(n.address=`::ffff:${n.address}`,n.family=6)},Wg=()=>{let e=!1,n=!1;for(let t of Object.values(T4.default.networkInterfaces()))for(let r of t)if(!r.internal&&(r.family==="IPv6"?n=!0:e=!0,e&&n))return{has4:e,has6:n};return{has4:e,has6:n}},A4=e=>Symbol.iterator in e,ec=e=>e.catch(n=>{if(n.code==="ENODATA"||n.code==="ENOTFOUND"||n.code==="ENOENT")return[];throw n}),Gg={ttl:!0},k4={all:!0},O4={all:!0,family:4},P4={all:!0,family:6},Dv=class{constructor({cache:e=new Map,maxTtl:n=1/0,fallbackDuration:t=3600,errorTtl:r=.15,resolver:i=new zg,lookup:s=ps.lookup}={}){if(this.maxTtl=n,this.errorTtl=r,this._cache=e,this._resolver=i,this._dnsLookup=s&&(0,rd.promisify)(s),this.stats={cache:0,query:0},this._resolver instanceof zg?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,rd.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,rd.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=Wg(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=t,t>0){let u=setInterval(()=>{this._hostnamesToFallback.clear()},t*1e3);u.unref&&u.unref(),this._fallbackInterval=u}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,t){if(typeof n=="function"?(t=n,n={}):typeof n=="number"&&(n={family:n}),!t)throw new Error("Callback must be a function.");this.lookupAsync(e,n).then(r=>{n.all?t(null,r):t(null,r.address,r.family,r.expires,r.ttl,r.source)},t)}async lookupAsync(e,n={}){typeof n=="number"&&(n={family:n});let t=await this.query(e);if(n.family===6){let r=t.filter(i=>i.family===6);n.hints&ps.V4MAPPED&&(R4&&n.hints&ps.ALL||r.length===0)?I4(t):t=r}else n.family===4&&(t=t.filter(r=>r.family===4));if(n.hints&ps.ADDRCONFIG){let{_iface:r}=this;t=t.filter(i=>i.family===6?r.has6:r.has4)}if(t.length===0){let r=new Error(`cacheableLookup ENOTFOUND ${e}`);throw r.code="ENOTFOUND",r.hostname=e,r}return n.all?t:t[0]}async query(e){let n="cache",t=await this._cache.get(e);if(t&&this.stats.cache++,!t){let r=this._pending[e];if(r)this.stats.cache++,t=await r;else{n="query";let i=this.queryAndCache(e);this._pending[e]=i,this.stats.query++;try{t=await i}finally{delete this._pending[e]}}}return t=t.map(r=>({...r,source:n})),t}async _resolve(e){let[n,t]=await Promise.all([ec(this._resolve4(e,Gg)),ec(this._resolve6(e,Gg))]),r=0,i=0,s=0,u=Date.now();for(let h of n)h.family=4,h.expires=u+h.ttl*1e3,r=Math.max(r,h.ttl);for(let h of t)h.family=6,h.expires=u+h.ttl*1e3,i=Math.max(i,h.ttl);return n.length>0?t.length>0?s=Math.min(r,i):s=r:s=i,{entries:[...n,...t],cacheTtl:s}}async _lookup(e){try{let[n,t]=await Promise.all([ec(this._dnsLookup(e,O4)),ec(this._dnsLookup(e,P4))]);return{entries:[...n,...t],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,n,t){if(this.maxTtl>0&&t>0){t=Math.min(t,this.maxTtl)*1e3,n[Hg]=Date.now()+t;try{await this._cache.set(e,n,t)}catch(r){this.lookupAsync=async()=>{let i=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw i.cause=r,i}}A4(this._cache)&&this._tick(t)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,k4);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 t=n.entries.length===0?this.errorTtl:n.cacheTtl;return await this._set(e,n.entries,t),n.entries}_tick(e){let n=this._nextRemovalTime;(!n||e{this._nextRemovalTime=!1;let t=1/0,r=Date.now();for(let[i,s]of this._cache){let u=s[Hg];r>=u?this._cache.delete(i):u("lookup"in n||(n.lookup=this.lookup),e[cs](n,t))}uninstall(e){if(Kg(e),e[cs]){if(e[nd]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[cs],delete e[cs],delete e[nd]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Wg(),(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()}},B4=xt(lv(),1);function L4(e){let n=[],t=e.split(",");for(let r of t){let[i,...s]=r.split(";"),u=i.trim();if(u[0]!=="<"||u[u.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${u}`);let h=u.slice(1,-1),c={};if(s.length===0)throw new Error(`Unexpected end of Link header parameters: ${s.join(";")}`);for(let a of s){let d=a.trim(),f=d.indexOf("=");if(f===-1)throw new Error(`Failed to parse Link header: ${e}`);let g=d.slice(0,f).trim(),I=d.slice(f+1).trim();c[g]=I}n.push({reference:h,parameters:c})}return n}var[Qg,N4]=w4.default.versions.node.split(".").map(Number);function x4(e){for(let n in e){let t=e[n];le.any([W.string,W.number,W.boolean,W.null_,W.undefined],t)}}var U4=new Map,id,D4=()=>id||(id=new Dv,id),j4={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 t=L4(n).find(r=>r.parameters.rel==="next"||r.parameters.rel==='"next"');return t?{url:new URL(t.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:!1},q4=e=>{let{hooks:n,retry:t}=e,r={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...t,errorCodes:[...t.errorCodes],methods:[...t.methods],statusCodes:[...t.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 URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return r.url!==void 0&&(r.prefixUrl=""),r},M4=e=>{let{hooks:n,retry:t}=e,r={...e};return W.object(e.context)&&(r.context={...e.context}),W.object(e.cacheOptions)&&(r.cacheOptions={...e.cacheOptions}),W.object(e.https)&&(r.https={...e.https}),W.object(e.cacheOptions)&&(r.cacheOptions={...r.cacheOptions}),W.object(e.agent)&&(r.agent={...e.agent}),W.object(e.headers)&&(r.headers={...e.headers}),W.object(t)&&(r.retry={...t},W.array(t.errorCodes)&&(r.retry.errorCodes=[...t.errorCodes]),W.array(t.methods)&&(r.retry.methods=[...t.methods]),W.array(t.statusCodes)&&(r.retry.statusCodes=[...t.statusCodes])),W.object(e.timeout)&&(r.timeout={...e.timeout}),W.object(n)&&(r.hooks={...n},W.array(n.init)&&(r.hooks.init=[...n.init]),W.array(n.beforeRequest)&&(r.hooks.beforeRequest=[...n.beforeRequest]),W.array(n.beforeError)&&(r.hooks.beforeError=[...n.beforeError]),W.array(n.beforeRedirect)&&(r.hooks.beforeRedirect=[...n.beforeRedirect]),W.array(n.beforeRetry)&&(r.hooks.beforeRetry=[...n.beforeRetry]),W.array(n.afterResponse)&&(r.hooks.afterResponse=[...n.afterResponse])),W.object(e.pagination)&&(r.pagination={...e.pagination}),r},V4=e=>{let n=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(t=>typeof t=="number");if(n.length>0)return Math.min(...n)},Yg=(e,n,t)=>{let r=e.hooks?.init;if(r)for(let i of r)i(n,t)},oo=class{constructor(e,n,t){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}),le.any([W.string,W.urlInstance,W.object,W.undefined],e),le.any([W.object,W.undefined],n),le.any([W.object,W.undefined],t),e instanceof oo||n instanceof oo)throw new TypeError("The defaults must be passed as the third argument");this._internals=q4(t?._internals??t??j4),this._init=[...t?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(W.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(r){throw r.options=this,r}}merge(e){if(e){if(e instanceof oo){for(let n of e._init)this.merge(n);return}e=M4(e),Yg(this,e,this),Yg(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let n=!1;for(let t in e){if(t==="mutableDefaults"||t==="handlers"||t==="url")continue;if(!(t in this))throw new Error(`Unexpected option: ${t}`);let r=e[t];r!==void 0&&(this[t]=r,n=!0)}n&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){le.any([W.function_,W.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.agent))throw new TypeError(`Unexpected agent option: ${n}`);le.any([W.object,W.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){le.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.timeout))throw new Error(`Unexpected timeout option: ${n}`);le.any([W.number,W.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(le.any([W.string,W.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){le.any([W.string,W.buffer,W.nodeStream,W.generator,W.asyncGenerator,Mu,W.undefined],e),W.nodeStream(e)&&le.truthy(e.readable),e!==void 0&&(le.undefined(this._internals.form),le.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){le.any([W.plainObject,W.undefined],e),e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(le.any([W.string,W.urlInstance,W.undefined],e),e===void 0){this._internals.url=void 0;return}if(W.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let n=`${this.prefixUrl}${e.toString()}`,t=new URL(n);if(this._internals.url=t,t.protocol==="unix:"&&(t.href=`http://unix${t.pathname}${t.search}`),t.protocol!=="http:"&&t.protocol!=="https:"){let r=new Error(`Unsupported protocol: ${t.protocol}`);throw r.code="ERR_UNSUPPORTED_PROTOCOL",r}if(this._internals.username&&(t.username=this._internals.username,this._internals.username=""),this._internals.password&&(t.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(t.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),t.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let r=/(?.+?):(?.+)/.exec(`${t.pathname}${t.search}`);if(r?.groups){let{socketPath:i,path:s}=r.groups;this._unixOptions={socketPath:i,path:s,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(le.any([W.object,W.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:n,getCookieString:t}=e;le.function_(n),le.function_(t),n.length===4&&t.length===0?(n=(0,td.promisify)(n.bind(e)),t=(0,td.promisify)(t.bind(e)),this._internals.cookieJar={setCookie:n,getCookieString:t}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){le.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){le.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 URLSearchParams),this._internals.searchParams)}set searchParams(e){le.any([W.string,W.object,W.undefined],e);let n=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,n&&(n.search="");return}let t=this.searchParams,r;if(W.string(e))r=new URLSearchParams(e);else if(e instanceof URLSearchParams)r=e;else{x4(e),r=new URLSearchParams;for(let i in e){let s=e[i];s===null?r.append(i,""):s===void 0?t.delete(i):r.append(i,s)}}if(this._merging){for(let i of r.keys())t.delete(i);for(let[i,s]of r)t.append(i,s)}else n?n.search=t.toString():this._internals.searchParams=t}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){le.any([W.function_,W.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){le.any([W.object,W.boolean,W.undefined],e),e===!0?this._internals.dnsCache=D4():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){le.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){le.object(e);for(let n in e){if(!(n in this._internals.hooks))throw new Error(`Unexpected hook event: ${n}`);let t=n,r=e[t];if(le.any([W.array,W.undefined],r),r)for(let i of r)le.function_(i);if(this._merging)r&&this._internals.hooks[t].push(...r);else{if(!r)throw new Error(`Missing hook event: ${n}`);this._internals.hooks[n]=[...r]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){le.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){le.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){le.any([W.object,W.string,W.boolean,W.undefined],e),e===!0?this._internals.cache=U4:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){le.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){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.username=t:this._internals.username=t}get password(){let e=this._internals.url,n=e?e.password:this._internals.password;return decodeURIComponent(n)}set password(e){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.password=t:this._internals.password=t}get http2(){return this._internals.http2}set http2(e){le.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){le.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){le.plainObject(e),this._merging?Object.assign(this._internals.headers,Au(e)):this._internals.headers=Au(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){le.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){le.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){le.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(le.plainObject(e),le.any([W.function_,W.undefined],e.calculateDelay),le.any([W.number,W.undefined],e.maxRetryAfter),le.any([W.number,W.undefined],e.limit),le.any([W.array,W.undefined],e.methods),le.any([W.array,W.undefined],e.statusCodes),le.any([W.array,W.undefined],e.errorCodes),le.any([W.number,W.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 t in e)if(!(t in this._internals.retry))throw new Error(`Unexpected retry option: ${t}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:n}=this._internals;n.methods=[...new Set(n.methods.map(t=>t.toUpperCase()))],n.statusCodes=[...new Set(n.statusCodes)],n.errorCodes=[...new Set(n.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){le.any([W.string,W.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){le.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){le.any([W.function_,W.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){le.plainObject(e),le.any([W.boolean,W.undefined],e.shared),le.any([W.number,W.undefined],e.cacheHeuristic),le.any([W.number,W.undefined],e.immutableMinTimeToLive),le.any([W.boolean,W.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){le.plainObject(e),le.any([W.boolean,W.undefined],e.rejectUnauthorized),le.any([W.function_,W.undefined],e.checkServerIdentity),le.any([W.string,W.object,W.array,W.undefined],e.certificateAuthority),le.any([W.string,W.object,W.array,W.undefined],e.key),le.any([W.string,W.object,W.array,W.undefined],e.certificate),le.any([W.string,W.undefined],e.passphrase),le.any([W.string,W.buffer,W.array,W.undefined],e.pfx),le.any([W.array,W.undefined],e.alpnProtocols),le.any([W.string,W.undefined],e.ciphers),le.any([W.string,W.buffer,W.undefined],e.dhparam),le.any([W.string,W.undefined],e.signatureAlgorithms),le.any([W.string,W.undefined],e.minVersion),le.any([W.string,W.undefined],e.maxVersion),le.any([W.boolean,W.undefined],e.honorCipherOrder),le.any([W.number,W.undefined],e.tlsSessionLifetime),le.any([W.string,W.undefined],e.ecdhCurve),le.any([W.string,W.buffer,W.array,W.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");le.any([W.string,W.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){le.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){le.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){le.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){le.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){le.any([W.number,W.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){le.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,n){return(0,td.inspect)(this._internals,n)}createNativeRequestOptions(){let e=this._internals,n=e.url,t;n.protocol==="https:"?t=e.http2?e.agent:e.agent.https:t=e.agent.http;let{https:r}=e,{pfx:i}=r;return W.array(i)&&W.plainObject(i[0])&&(i=i.map(s=>({buf:s.buffer,passphrase:s.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:r.alpnProtocols,ca:r.certificateAuthority,cert:r.certificate,key:r.key,passphrase:r.passphrase,pfx:r.pfx,rejectUnauthorized:r.rejectUnauthorized,checkServerIdentity:r.checkServerIdentity??E4.checkServerIdentity,ciphers:r.ciphers,honorCipherOrder:r.honorCipherOrder,minVersion:r.minVersion,maxVersion:r.maxVersion,sigalgs:r.signatureAlgorithms,sessionTimeout:r.tlsSessionLifetime,dhparam:r.dhparam,ecdhCurve:r.ecdhCurve,crl:r.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:t,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?V4(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(Qg<15||Qg===15&&N4<10){let n=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw n.code="EUNSUPPORTED",n}return B4.default.auto}return C4.default.request}return S4.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)}},Rc=e=>{let{statusCode:n}=e,t=e.request.options.followRedirect?299:399;return n>=200&&n<=t||n===304},Xg=class extends Er{constructor(e,n){let{options:t}=n.request;super(`${e.message} in "${t.url.toString()}"`,e,n.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},Jg=(e,n,t,r)=>{let{rawBody:i}=e;try{if(n==="text")return i.toString(r);if(n==="json")return i.length===0?"":t(i.toString(r));if(n==="buffer")return i}catch(s){throw new Xg(s,e)}throw new Xg({message:`Unknown body type '${n}'`,name:"Error"},e)};function F4(e){return e.writable&&!e.writableEnded}var $4=F4;function Zg(e){return e.protocol==="unix:"||e.hostname==="unix"}var{buffer:z4}=r4.default,H4=W.string(kv.default.versions.brotli),K4=new Set(["GET","HEAD"]),od=new v4,W4=new Set([300,301,302,303,304,307,308]),G4=["socket","connect","continue","information","upgrade"],tc=()=>{},yp=class extends L6.Duplex{constructor(e,n,t){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,"_removeListeners",{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=tc,this._triggerRead=!1,this._cancelTimeouts=tc,this._removeListeners=tc,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=tc,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 oo(e,n,t),!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:s}=i;s&&(this.options=s),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:r}=this.options;if(W.nodeStream(r)&&r.once("error",i=>{this._flushed?this._beforeError(new Lg(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new Lg(i,this))}}),this.options.signal){let i=()=>{this.destroy(new B6(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal?.removeEventListener("abort",i)})}}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:t}=this,r=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Er||(e=new Er(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 s;try{let u;n&&"retry-after"in n.headers&&(u=Number(n.headers["retry-after"]),Number.isNaN(u)?(u=Date.parse(n.headers["retry-after"])-Date.now(),u<=0&&(u=1)):u*=1e3);let h=t.retry;s=await h.calculateDelay({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:_4({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:h.maxRetryAfter??t.timeout.request??Number.POSITIVE_INFINITY})})}catch(u){this._error(new Er(u.message,u,this));return}if(s){if(await new Promise(u=>{let h=setTimeout(u,s);this._stopRetry=()=>{clearTimeout(h),u()}}),this.destroyed)return;try{for(let u of this.options.hooks.beforeRetry)await u(i,this.retryCount+1)}catch(u){this._error(new Er(u.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,u=>{let h=new yp(t.url,u,t);return h.retryCount=this.retryCount+1,kv.default.nextTick(()=>{h.flush()}),h});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 t=this.downloadProgress;t.percent<1&&this.emit("downloadProgress",t),this.push(n)}}}_write(e,n,t){let r=()=>{this._writeRequest(e,n,t)};this._requestInitialized?r():this._jobs.push(r)}_final(e){let n=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(t=>{this._request._writableState?.errored||(t||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(t))})};this._requestInitialized?n():this._jobs.push(n)}_destroy(e,n){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:t}=this.options;W.nodeStream(t)&&t.destroy()}this._request&&this._request.destroy(),e!==null&&!W.undefined(e)&&!(e instanceof Er)&&(e=new Er(e.message,e,this)),n(e)}pipe(e,n){return e instanceof Yf.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,n)}unpipe(e){return e instanceof Yf.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:n}=e,t=!W.undefined(e.form),r=!W.undefined(e.json),i=!W.undefined(e.body),s=K4.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=s,t||r||i){if(s)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let u=!W.string(n["content-type"]);if(i){if(Mu(e.body)){let c=new Lv(e.body);u&&(n["content-type"]=c.headers["Content-Type"]),"Content-Length"in c.headers&&(n["content-length"]=c.headers["Content-Length"]),e.body=c.encode()}Nv(e.body)&&u&&(n["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(t){u&&(n["content-type"]="application/x-www-form-urlencoded");let{form:c}=e;e.form=void 0,e.body=new URLSearchParams(c).toString()}else{u&&(n["content-type"]="application/json");let{json:c}=e;e.json=void 0,e.body=e.stringifyJson(c)}let h=await f4(e.body,e.headers);W.undefined(n["content-length"])&&W.undefined(n["transfer-encoding"])&&!s&&!W.undefined(h)&&(n["content-length"]=String(h))}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:t}=n;this._nativeResponse=e,n.decompress&&(e=(0,t4.default)(e));let r=e.statusCode,i=e;i.statusMessage=i.statusMessage??Yf.default.STATUS_CODES[r],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=Rc(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",u=>{this._aborted=!0,e.destroy(),this._beforeError(new Ng(u,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Ng({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let s=e.headers["set-cookie"];if(W.object(n.cookieJar)&&s){let u=s.map(async h=>n.cookieJar.setCookie(h,t.toString()));n.ignoreInvalidCookies&&(u=u.map(async h=>{try{await h}catch{}}));try{await Promise.all(u)}catch(h){this._beforeError(h);return}}if(!this.isAborted){if(n.followRedirect&&e.headers.location&&W4.has(r)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=n.maxRedirects){this._beforeError(new A6(this));return}this._request=void 0;let u=new oo(void 0,void 0,this.options),h=r===303&&u.method!=="GET"&&u.method!=="HEAD",c=r!==307&&r!==308,a=u.methodRewriting&&c;(h||a)&&(u.method="GET",u.body=void 0,u.json=void 0,u.form=void 0,delete u.headers["content-length"]);try{let d=Qf.Buffer.from(e.headers.location,"binary").toString(),f=new URL(d,t);if(!Zg(t)&&Zg(f)){this._beforeError(new Er("Cannot redirect to UNIX socket",{},this));return}f.hostname!==t.hostname||f.port!==t.port?("host"in u.headers&&delete u.headers.host,"cookie"in u.headers&&delete u.headers.cookie,"authorization"in u.headers&&delete u.headers.authorization,(u.username||u.password)&&(u.username="",u.password="")):(f.username=u.username,f.password=u.password),this.redirectUrls.push(f),u.prefixUrl="",u.url=f;for(let g of u.hooks.beforeRedirect)await g(u,i);this.emit("redirect",u,i),this.options=u,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(n.isStream&&n.throwHttpErrors&&!Rc(i)){this._beforeError(new Tc(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 u of this._pipedServerResponses)if(!u.headersSent){for(let h in e.headers){let c=n.decompress?h!=="content-encoding":!0,a=e.headers[h];c&&u.setHeader(h,a)}u.statusCode=r}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let n=await z4(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:t,url:r}=n;Ov(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=g4(e,t,r);let i=n.cache?"cacheableResponse":"response";e.once(i,s=>{this._onResponse(s)}),e.once("error",s=>{this._aborted=!0,e.destroy(),s=s instanceof Uv?new O6(s,this.timings,this):new Er(s.message,s,this),this._beforeError(s)}),this._unproxyEvents=xv(e,this,G4),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((n,t)=>{super.write(e,r=>{if(r){t(r);return}n()})})}_sendBody(){let{body:e}=this.options,n=this.redirectUrls.length===0?this:this._request??this;W.nodeStream(e)?e.pipe(n):W.generator(e)||W.asyncGenerator(e)?(async()=>{try{for await(let t of e)await this._asyncWrite(t);super.end()}catch(t){this._beforeError(t)}})():W.undefined(e)?(this._cannotHaveBody||this._noPipe)&&n.end():(this._writeRequest(e,void 0,()=>{}),n.end())}_prepareCache(e){if(!od.has(e)){let n=new Bv((t,r)=>{let i=t._request(t,r);return W.promise(i)&&(i.once=(s,u)=>{if(s==="error")(async()=>{try{await i}catch(h){u(h)}})();else if(s==="abort")(async()=>{try{(await i).once("abort",u)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${s}`);return i}),i},e);od.set(e,n.request())}}async _createCacheableRequest(e,n){return new Promise((t,r)=>{Object.assign(n,m4(e));let i,s=od.get(n.cache)(n,async u=>{if(u._readableState.autoDestroy=!1,i){let h=()=>{u.req&&(u.complete=u.req.res.complete)};u.prependOnceListener("end",h),h(),(await i).emit("cacheableResponse",u)}t(u)});s.once("error",r),s.once("request",async u=>{i=u,t(i)})})}async _makeRequest(){let{options:e}=this,{headers:n,username:t,password:r}=e,i=e.cookieJar;for(let c in n)if(W.undefined(n[c]))delete n[c];else if(W.null_(n[c]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${c}\` header`);if(e.decompress&&W.undefined(n["accept-encoding"])&&(n["accept-encoding"]=H4?"gzip, deflate, br":"gzip, deflate"),t||r){let c=Qf.Buffer.from(`${t}:${r}`).toString("base64");n.authorization=`Basic ${c}`}if(i){let c=await i.getCookieString(e.url.toString());W.nonEmptyString(c)&&(n.cookie=c)}e.prefixUrl="";let s;for(let c of e.hooks.beforeRequest){let a=await c(e);if(!W.undefined(a)){s=()=>a;break}}s||(s=e.getRequestFunction());let u=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=s,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let h=e.cache?this._createCacheableRequest:s;try{let c=h(u,this._requestOptions);W.promise(c)&&(c=await c),W.undefined(c)&&(c=e.getFallbackRequestFunction()(u,this._requestOptions),W.promise(c)&&(c=await c)),$4(c)?this._onRequest(c):this.writable?(this.once("finish",()=>{this._onResponse(c)}),this._sendBody()):this._onResponse(c)}catch(c){throw c instanceof ds?new k6(c,this):c}}async _error(e){try{if(!(e instanceof Tc&&!this.options.throwHttpErrors))for(let n of this.options.hooks.beforeError)e=await n(e)}catch(n){e=new Er(n.message,n,this)}this.destroy(e)}_writeRequest(e,n,t){!this._request||this._request.destroyed||this._request.write(e,n,r=>{if(!r&&!this._request.destroyed){this._uploadedSize+=Qf.Buffer.byteLength(e,n);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}t(r)})}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}},Q4=class extends Er{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},Y4=["request","response","redirect","uploadProgress","downloadProgress"];function em(e){let n,t,r,i=new T6.EventEmitter,s=new Gc((h,c,a)=>{a(()=>{n.destroy()}),a.shouldReject=!1,a(()=>{c(new Q4(n))});let d=f=>{a(()=>{});let g=e??new yp(void 0,void 0,r);g.retryCount=f,g._noPipe=!0,n=g,g.once("response",async v=>{let T=(v.headers["content-encoding"]??"").toLowerCase(),O=T==="gzip"||T==="deflate"||T==="br",{options:k}=g;if(O&&!k.decompress)v.body=v.rawBody;else try{v.body=Jg(v,k.responseType,k.parseJson,k.encoding)}catch(y){if(v.body=v.rawBody.toString(),Rc(v)){g._beforeError(y);return}}try{let y=k.hooks.afterResponse;for(let[R,w]of y.entries())if(v=await w(v,async L=>{throw k.merge(L),k.prefixUrl="",L.url&&(k.url=L.url),k.hooks.afterResponse=k.hooks.afterResponse.slice(0,R),new P6(g)}),!(W.object(v)&&W.number(v.statusCode)&&!W.nullOrUndefined(v.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(y){g._beforeError(y);return}if(t=v,!Rc(v)){g._beforeError(new Tc(v));return}g.destroy(),h(g.options.resolveBodyOnly?v.body:v)});let I=v=>{if(s.isCanceled)return;let{options:T}=g;if(v instanceof Tc&&!T.throwHttpErrors){let{response:O}=v;g.destroy(),h(g.options.resolveBodyOnly?O.body:O);return}c(v)};g.once("error",I);let C=g.options?.body;g.once("retry",(v,T)=>{e=void 0;let O=g.options.body;if(C===O&&W.nodeStream(O)){T.message="Cannot retry with consumed body stream",I(T);return}r=g.options,d(v)}),xv(g,i,Y4),W.undefined(e)&&g.flush()};d(0)});s.on=(h,c)=>(i.on(h,c),s),s.off=(h,c)=>(i.off(h,c),s);let u=h=>{let c=(async()=>{await s;let{options:a}=t.request;return Jg(t,h,a.parseJson,a.encoding)})();return Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)),c};return s.json=()=>{if(n.options){let{headers:h}=n.options;!n.writableFinished&&!("accept"in h)&&(h.accept="application/json")}return u("json")},s.buffer=()=>u("buffer"),s.text=()=>u("text"),s}var X4=async e=>new Promise(n=>{setTimeout(n,e)}),J4=e=>W.function_(e),Z4=["get","post","put","patch","head","delete"],jv=e=>{e={options:new oo(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let n=(r,i,s=e.options)=>{let u=new yp(r,i,s),h,c=f=>(u.options=f,u._noPipe=!f.isStream,u.flush(),f.isStream?u:(h||(h=em(u)),h)),a=0,d=f=>{let g=(e.handlers[a++]??c)(f,d);if(W.promise(g)&&!u.options.isStream&&(h||(h=em(u)),g!==h)){let I=Object.getOwnPropertyDescriptors(h);for(let C in I)C in g&&delete I[C];Object.defineProperties(g,I),g.cancel=h.cancel}return g};return d(u.options)};n.extend=(...r)=>{let i=new oo(void 0,void 0,e.options),s=[...e.handlers],u;for(let h of r)J4(h)?(i.merge(h.defaults.options),s.push(...h.defaults.handlers),u=h.defaults.mutableDefaults):(i.merge(h),h.handlers&&s.push(...h.handlers),u=h.mutableDefaults);return jv({options:i,handlers:s,mutableDefaults:!!u})};let t=async function*(r,i){let s=new oo(r,i,e.options);s.resolveBodyOnly=!1;let{pagination:u}=s;le.function_(u.transform),le.function_(u.shouldContinue),le.function_(u.filter),le.function_(u.paginate),le.number(u.countLimit),le.number(u.requestLimit),le.number(u.backoff);let h=[],{countLimit:c}=u,a=0;for(;a{let s=[];for await(let u of t(r,i))s.push(u);return s},n.paginate.each=t,n.stream=(r,i)=>n(r,{...i,isStream:!0});for(let r of Z4)n[r]=(i,s)=>n(i,{...s,method:r}),n.stream[r]=(i,s)=>n(i,{...s,method:r,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},eR=jv,tR={options:new oo,handlers:[],mutableDefaults:!1},rR=eR(tR),vn=rR,gc="https://www.googleapis.com",nR=`${gc}/oauth2/v4/token`,gp={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"},iR=Object.keys(gp),oR=class{options={};constructor(e){for(let n of iR){if(!e[n])throw new Error(gp[n]);this.options[n]=e[n]}}get uploadEndpoint(){return`${gc}/upload/chromewebstore/v1.1/items/${this.options.extId}`}getPublishEndpoint(e){return`${gc}/chromewebstore/v1.1/items/${this.options.extId}/publish?publishTarget=${e}`}getInfoEndpoint(e){return`${gc}/chromewebstore/v1.1/items/${this.options.extId}?projection=${e}`}async submit({filePath:e="",target:n="default"}){let t=await this.getAccessToken(),{uploadState:r,itemError:i}=await this.upload({readStream:(0,f6.createReadStream)(e)},t);if(r==="FAILURE"||r==="NOT_FOUND")throw new Error(i.map(({error_detail:s})=>s).join(` +`));if(!this.options.uploadOnly)return this.publish({target:n},t)}async upload({readStream:e=null},n=""){if(!e)throw new Error("Read stream missing");let t=n||await this.getAccessToken();return vn.put(this.uploadEndpoint,{headers:this.getHeaders(t),body:e,throwHttpErrors:!1}).json()}async publish({target:e="default"},n=""){let t=n||await this.getAccessToken();return vn.post(this.getPublishEndpoint(e),{headers:this.getHeaders(t)}).json()}async get({projection:e="DRAFT"},n=""){let t=n||await this.getAccessToken();return vn.get(this.getInfoEndpoint(e),{headers:this.getHeaders(t)}).json()}async getAccessToken(){return(await vn.post(nR,{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"}}},aR=require("module"),sR=(0,aR.createRequire)("/"),uR;try{uR=sR("worker_threads").Worker}catch{}var Ln=Uint8Array,ys=Uint16Array,lR=Int32Array,qv=new Ln([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]),Mv=new Ln([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]),cR=new Ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vv=function(e,n){for(var t=new ys(31),r=0;r<31;++r)t[r]=n+=1<>1|(Rt&21845)<<1,to=(to&52428)>>2|(to&13107)<<2,to=(to&61680)>>4|(to&3855)<<4,Bd[Rt]=((to&65280)>>8|(to&255)<<8)>>1;var to,Rt,Tu=function(e,n,t){for(var r=e.length,i=0,s=new ys(n);i>c]=a}else for(h=new ys(r),i=0;i>15-e[i]);return h},Vu=new Ln(288);for(Rt=0;Rt<144;++Rt)Vu[Rt]=8;var Rt;for(Rt=144;Rt<256;++Rt)Vu[Rt]=9;var Rt;for(Rt=256;Rt<280;++Rt)Vu[Rt]=7;var Rt;for(Rt=280;Rt<288;++Rt)Vu[Rt]=8;var Rt,Hv=new Ln(32);for(Rt=0;Rt<32;++Rt)Hv[Rt]=5;var Rt,dR=Tu(Vu,9,1),pR=Tu(Hv,5,1),ad=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},ei=function(e,n,t){var r=n/8|0;return(e[r]|e[r+1]<<8)>>(n&7)&t},sd=function(e,n){var t=n/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(n&7)},yR=function(e){return(e+7)/8|0},mp=function(e,n,t){(n==null||n<0)&&(n=0),(t==null||t>e.length)&&(t=e.length);var r=new Ln(t-n);return r.set(e.subarray(n,t)),r},gR=["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"],Kn=function(e,n,t){var r=new Error(n||gR[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Kn),!t)throw r;return r},mR=function(e,n,t,r){var i=e.length,s=r?r.length:0;if(!i||n.f&&!n.l)return t||new Ln(0);var u=!t||n.i!=2,h=n.i;t||(t=new Ln(i*3));var c=function(Je){var x=t.length;if(Je>x){var X=new Ln(Math.max(x*2,Je));X.set(t),t=X}},a=n.f||0,d=n.p||0,f=n.b||0,g=n.l,I=n.d,C=n.m,v=n.n,T=i*8;do{if(!g){a=ei(e,d,1);var O=ei(e,d+1,3);if(d+=3,O)if(O==1)g=dR,I=pR,C=9,v=5;else if(O==2){var k=ei(e,d,31)+257,y=ei(e,d+10,15)+4,R=k+ei(e,d+5,31)+1;d+=14;for(var w=new Ln(R),L=new Ln(19),D=0;D>4;if(V<16)w[D++]=V;else{var $=0,E=0;for(V==16?(E=3+ei(e,d,3),d+=2,$=w[D-1]):V==17?(E=3+ei(e,d,7),d+=3):V==18&&(E=11+ei(e,d,127),d+=7);E--;)w[D++]=$}}var B=w.subarray(0,k),j=w.subarray(k);C=ad(B),v=ad(j),g=Tu(B,C,1),I=Tu(j,v,1)}else Kn(1);else{var V=yR(d)+4,N=e[V-4]|e[V-3]<<8,M=V+N;if(M>i){h&&Kn(0);break}u&&c(f+N),t.set(e.subarray(V,M),f),n.b=f+=N,n.p=d=M*8,n.f=a;continue}if(d>T){h&&Kn(0);break}}u&&c(f+131072);for(var ee=(1<>4;if(d+=$&15,d>T){h&&Kn(0);break}if($||Kn(2),pe<256)t[f++]=pe;else if(pe==256){ae=d,g=null;break}else{var _e=pe-254;if(pe>264){var D=pe-257,Re=qv[D];_e=ei(e,d,(1<>4;qe||Kn(3),d+=qe&15;var j=fR[Ce];if(Ce>3){var Re=Mv[Ce];j+=sd(e,d)&(1<T){h&&Kn(0);break}u&&c(f+131072);var $e=f+_e;if(f>>0},ud=function(e,n){return ri(e,n)+ri(e,n+4)*4294967296};function bR(e,n){return mR(e,{i:2},n&&n.out,n&&n.dictionary)}var Ld=typeof TextDecoder<"u"&&new TextDecoder,_R=0;try{Ld.decode(vR,{stream:!0}),_R=1}catch{}var wR=function(e){for(var n="",t=0;;){var r=e[t++],i=(r>127)+(r>223)+(r>239);if(t+i>e.length)return{s:n,r:mp(e,t-1)};i?i==3?(r=((r&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,n+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?n+=String.fromCharCode((r&31)<<6|e[t++]&63):n+=String.fromCharCode((r&15)<<12|(e[t++]&63)<<6|e[t++]&63):n+=String.fromCharCode(r)}};function Kv(e,n){if(n){for(var t="",r=0;r65558)&&Kn(13);var i=Ci(e,r+8);if(!i)return{};var s=ri(e,r+16),u=s==4294967295||i==65535;if(u){var h=ri(e,r-12);u=ri(e,h)==101075792,u&&(i=ri(e,h+32),s=ri(e,h+48))}for(var c=n&&n.filter,a=0;a(0,RR.resolve)((0,IR.cwd)(),e),Wv=e=>(0,vp.existsSync)(bp(e));function Fu({zip:e="",file:n="",versionFile:t="package.json"}){let r=e||n;if(Wv(t)&&r.includes("{version}")){let i=JSON.parse((0,vp.readFileSync)(t).toString());return r.replace("{version}",i.version||"")}else return r}function Qc(e){let n=(0,vp.readFileSync)(bp(e)),t=TR(n),r=Kv(t["manifest.json"]);return JSON.parse(r)}function Yc({extId:e=null,market:n="",zip:t=""}){let{name:r,version:i}=Qc(t),s=Tv[n]||n;console.log(`Successfully updated "${e}" (${r}) to version ${i} on ${s}!`)}var ld={};function Gv({message:e="Message",prefix:n="",market:t=""}){ld[t]=1+(ld?.[t]??0);let r=`${t}: Step ${ld[t]}) ${e}`;return n!=="Error"&&(n=n||"Info",r=`${n} ${r}`),n==="Info"?r=r.trim():n==="Error"&&(r=r.trimStart()),r}var Qv={},$u=e=>{Qv[e]=!0,process.env.VERBOSE="true"};function Xc(e=""){return n=>Qv[e]&&console.log(Gv({market:e,message:n}))}var Jc=(e,n,t)=>{let r=new Error(Gv({market:n,message:`Item "${t}": ${e.message}`,prefix:"Error"}));return r.stack=e.stack,r};function cd(e,n){return`${e}: ${n}`}var zu=({market:e="chrome",options:n={},errorMap:t={}})=>{if(Object.keys(t).some(i=>{if(!n[i])throw new Error(cd(e,t[i]))}),!n.zip&&!n.file)throw new Error(cd(e,"No extension bundle provided"));let r=n.zip||n.file;if(!Wv(r))throw new Error(cd(e,`Extension bundle file doesn't exist: ${bp(r)}`))},ku="chrome",AR=Xc(ku);async function kR({extId:e,target:n="default",zip:t,dryRun:r,...i}){let s=new oR({extId:e,...i});if(AR(`Updating extension with ID ${e}`),r)return!0;try{return await s.submit({filePath:t,target:n}),Yc({extId:e,market:ku,zip:t}),!0}catch(u){let h=Qc(t);throw Jc(u,ku,`"${e}" (${h.name})`)}}async function OR(e){return e.zip=Fu(e),e.verbose&&$u(ku),zu({market:ku,options:e,errorMap:gp}),kR(e)}var PR=require("fs"),_p={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"},BR=Object.keys(_p),LR=e=>new Promise(n=>setTimeout(n,e)),tm="https://api.addons.microsoftedge.microsoft.com",NR=class{options={};constructor(e){for(let n of BR){if(!e[n])throw new Error(_p[n]);this.options[n]=e[n]}}get productEndpoint(){return`${tm}/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 t=await this.getAccessToken(),r=await this.upload((0,PR.createReadStream)(e),t);return await this.waitForUpload(r,t),this.publish(n,t)}async publish(e="",n=null){let t={headers:{Authorization:`Bearer ${n||await this.getAccessToken()}`,"Content-Type":"application/x-www-form-urlencoded"}};e.length>0&&(t.body=`{ "notes"="${e}" }`);let r=await vn.post(this.publishEndpoint,t);return this.handleTempStatus(r.statusCode,"Submit"),r.headers.location}async upload(e=null,n=null){let t=n||await this.getAccessToken(),r=await vn.post(this.uploadEndpoint,{body:e,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/zip"}});return this.handleTempStatus(r.statusCode,"Upload"),r.headers.location}async getPublishStatus(e,n=null){let t=n||await this.getAccessToken(),r=`${this.publishEndpoint}/operations/${e}`;return vn.get(r,{headers:{Authorization:`Bearer ${t}`}}).json()}async waitForUpload(e,n=null,t=5,r=3e3){let i=n||await this.getAccessToken(),s=`${this.uploadEndpoint}/operations/${e}`,u,h,c=0;for(;h!=="Succeeded"&&c{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 vn.post(`${this.options.accessTokenUrl}`,{body:`client_id=${this.options.clientId}&scope=${tm}/.default&client_secret=${this.options.clientSecret}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).json()).access_token},Ou="edge",xR=Xc(Ou);async function UR({productId:e,notes:n,zip:t,dryRun:r,...i}){let s=Qc(t),u=new NR({productId:e,...i});if(xR(`Updating extension with Product ID ${e}`),r)return!0;try{return await u.submit({filePath:t,notes:n}),Yc({extId:e,market:Ou,zip:t}),!0}catch(h){throw Jc(h,Ou,`"${e}" (${s.name})`)}}async function DR(e){return e.zip=Fu(e),e.verbose&&$u(Ou),zu({market:Ou,options:e,errorMap:_p}),UR(e)}var Or=e=>typeof e=="function",mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:e=>`Symbol(${e})`;function Yv(){}function Gr(e){return typeof e=="object"&&e!==null||typeof e=="function"}var Xv=Yv;function wt(e,n){try{Object.defineProperty(e,"name",{value:n,configurable:!0})}catch{}}var wp=Promise,jR=Promise.prototype.then,qR=Promise.resolve.bind(wp),MR=Promise.reject.bind(wp);function on(e){return new wp(e)}function It(e){return qR(e)}function Ze(e){return MR(e)}function ao(e,n,t){return jR.call(e,n,t)}function Wr(e,n,t){ao(ao(e,n,t),void 0,Xv)}function rm(e,n){Wr(e,n)}function nm(e,n){Wr(e,void 0,n)}function ii(e,n,t){return ao(e,n,t)}function _s(e){ao(e,void 0,Xv)}var mc=e=>{if(typeof queueMicrotask=="function")mc=queueMicrotask;else{let n=It(void 0);mc=t=>ao(n,t)}return mc(e)};function Zc(e,n,t){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,n,t)}function Oa(e,n,t){try{return It(Zc(e,n,t))}catch(r){return Ze(r)}}var Wn=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,t=n;n._elements.length===16383&&(t={_elements:[],_next:void 0}),n._elements.push(e),t!==n&&(this._back=t,n._next=t),++this._size}shift(){let e=this._front,n=e,t=this._cursor,r=t+1,i=e._elements,s=i[t];return r===16384&&(n=e._next,r=0),--this._size,this._cursor=r,e!==n&&(this._front=n),i[t]=void 0,s}forEach(e){let n=this._cursor,t=this._front,r=t._elements;for(;!(n===r.length&&t._next===void 0||n===r.length&&(t=t._next,r=t._elements,n=0,r.length===0));)e(r[n]),++n}peek(){let e=this._front,n=this._cursor;return e._elements[n]}},Jv=mt("[[AbortSteps]]"),Zv=mt("[[ErrorSteps]]"),Ep=mt("[[CancelSteps]]"),Sp=mt("[[PullSteps]]"),Cp=mt("[[ReleaseSteps]]");function e1(e,n){e._ownerReadableStream=n,n._reader=e,n._state==="readable"?Nd(e):n._state==="closed"?function(t){Nd(t),i1(t)}(e):n1(e,n._storedError)}function t1(e,n){return x1(e._ownerReadableStream,n)}function r1(e){let n=e._ownerReadableStream;n._state==="readable"?Tp(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,r){n1(t,r)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),n._readableStreamController[Cp](),n._reader=void 0,e._ownerReadableStream=void 0}function ws(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Nd(e){e._closedPromise=on((n,t)=>{e._closedPromise_resolve=n,e._closedPromise_reject=t})}function n1(e,n){Nd(e),Tp(e,n)}function Tp(e,n){e._closedPromise_reject!==void 0&&(_s(e._closedPromise),e._closedPromise_reject(n),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function i1(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var im=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},VR=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function so(e,n){if(e!==void 0&&typeof(t=e)!="object"&&typeof t!="function")throw new TypeError(`${n} is not an object.`);var t}function si(e,n){if(typeof e!="function")throw new TypeError(`${n} is not a function.`)}function o1(e,n){if(!function(t){return typeof t=="object"&&t!==null||typeof t=="function"}(e))throw new TypeError(`${n} is not an object.`)}function co(e,n,t){if(e===void 0)throw new TypeError(`Parameter ${n} is required in '${t}'.`)}function xd(e,n,t){if(e===void 0)throw new TypeError(`${n} is required in '${t}'.`)}function Rp(e){return Number(e)}function om(e){return e===0?0:e}function a1(e,n){let t=Number.MAX_SAFE_INTEGER,r=Number(e);if(r=om(r),!im(r))throw new TypeError(`${n} is not a finite number`);if(r=function(i){return om(VR(i))}(r),r<0||r>t)throw new TypeError(`${n} is outside the accepted range of 0 to ${t}, inclusive`);return im(r)&&r!==0?r:0}function Eu(e){if(!Gr(e)||typeof e.getReader!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function s1(e){if(!Gr(e)||typeof e.getWriter!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function u1(e,n){if(!Aa(e))throw new TypeError(`${n} is not a ReadableStream.`)}function l1(e,n){e._reader._readRequests.push(n)}function Ip(e,n,t){let r=e._reader._readRequests.shift();t?r._closeSteps():r._chunkSteps(n)}function eh(e){return e._reader._readRequests.length}function c1(e){let n=e._reader;return n!==void 0&&!!Ia(n)}var _a=class{constructor(e){if(co(e,1,"ReadableStreamDefaultReader"),u1(e,"First parameter"),Ss(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");e1(this,e),this._readRequests=new Wn}get closed(){return Ia(this)?this._closedPromise:Ze(rc("closed"))}cancel(e){return Ia(this)?this._ownerReadableStream===void 0?Ze(ws("cancel")):t1(this,e):Ze(rc("cancel"))}read(){if(!Ia(this))return Ze(rc("read"));if(this._ownerReadableStream===void 0)return Ze(ws("read from"));let e,n,t=on((r,i)=>{e=r,n=i});return function(r,i){let s=r._ownerReadableStream;s._disturbed=!0,s._state==="closed"?i._closeSteps():s._state==="errored"?i._errorSteps(s._storedError):s._readableStreamController[Sp](i)}(this,{_chunkSteps:r=>e({value:r,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:r=>n(r)}),t}releaseLock(){if(!Ia(this))throw rc("releaseLock");this._ownerReadableStream!==void 0&&function(e){r1(e);let n=new TypeError("Reader was released");h1(e,n)}(this)}};function Ia(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof _a}function h1(e,n){let t=e._readRequests;e._readRequests=new Wn,t.forEach(r=>{r._errorSteps(n)})}function rc(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(_a.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),wt(_a.prototype.cancel,"cancel"),wt(_a.prototype.read,"read"),wt(_a.prototype.releaseLock,"releaseLock"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(_a.prototype,mt.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var f1=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?ii(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let n=()=>this._returnSteps(e);return this._ongoingPromise?ii(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?Ze(ws("iterate")):ao(e.read(),n=>{var t;return this._ongoingPromise=void 0,n.done&&(this._isFinished=!0,(t=this._reader)===null||t===void 0||t.releaseLock(),this._reader=void 0),n},n=>{var t;throw this._ongoingPromise=void 0,this._isFinished=!0,(t=this._reader)===null||t===void 0||t.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 Ze(ws("finish iterating"));if(this._reader=void 0,!this._preventCancel){let t=n.cancel(e);return n.releaseLock(),ii(t,()=>({value:e,done:!0}))}return n.releaseLock(),It({value:e,done:!0})}},d1={next(){return am(this)?this._asyncIteratorImpl.next():Ze(sm("next"))},return(e){return am(this)?this._asyncIteratorImpl.return(e):Ze(sm("return"))}};function am(e){if(!Gr(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof f1}catch{return!1}}function sm(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}typeof mt.asyncIterator=="symbol"&&Object.defineProperty(d1,mt.asyncIterator,{value(){return this},writable:!0,configurable:!0});var p1=Number.isNaN||function(e){return e!=e};function y1(e,n,t,r,i){new Uint8Array(e).set(new Uint8Array(t,r,i),n)}function um(e){let n=function(t,r,i){if(t.slice)return t.slice(r,i);let s=i-r,u=new ArrayBuffer(s);return y1(u,0,t,r,s),u}(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}function Ud(e){let n=e._queue.shift();return e._queueTotalSize-=n.size,e._queueTotalSize<0&&(e._queueTotalSize=0),n.value}function Ap(e,n,t){if(typeof(r=t)!="number"||p1(r)||r<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var r;e._queue.push({value:n,size:t}),e._queueTotalSize+=t}function zo(e){e._queue=new Wn,e._queueTotalSize=0}var gs=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!hd(this))throw fd("view");return this._view}respond(e){if(!hd(this))throw fd("respond");if(co(e,1,"respond"),e=a1(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(n,t){let r=n._pendingPullIntos.peek();if(n._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(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=r.buffer,lm(n,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!hd(this))throw fd("respondWithNewView");if(co(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,t){let r=n._pendingPullIntos.peek();if(n._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(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=t.byteLength;r.buffer=t.buffer,lm(n,i)}(this._associatedReadableByteStreamController,e)}};Object.defineProperties(gs.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),wt(gs.prototype.respond,"respond"),wt(gs.prototype.respondWithNewView,"respondWithNewView"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(gs.prototype,mt.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var wa=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!fs(this))throw mu("byobRequest");return function(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let n=e._pendingPullIntos.peek(),t=new Uint8Array(n.buffer,n.byteOffset+n.bytesFilled,n.byteLength-n.bytesFilled),r=Object.create(gs.prototype);(function(i,s,u){i._associatedReadableByteStreamController=s,i._view=u})(r,e,t),e._byobRequest=r}return e._byobRequest}(this)}get desiredSize(){if(!fs(this))throw mu("desiredSize");return S1(this)}close(){if(!fs(this))throw mu("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 t=n._controlledReadableByteStream;if(!(n._closeRequested||t._state!=="readable")){if(n._queueTotalSize>0)return void(n._closeRequested=!0);if(n._pendingPullIntos.length>0&&n._pendingPullIntos.peek().bytesFilled>0){let r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Es(n,r),r}Ic(n),Bu(t)}})(this)}enqueue(e){if(!fs(this))throw mu("enqueue");if(co(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(t,r){let i=t._controlledReadableByteStream;if(t._closeRequested||i._state!=="readable")return;let s=r.buffer,u=r.byteOffset,h=r.byteLength,c=s;if(t._pendingPullIntos.length>0){let a=t._pendingPullIntos.peek();a.buffer,kp(t),a.buffer=a.buffer,a.readerType==="none"&&b1(t,a)}c1(i)?(function(a){let d=a._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(a._queueTotalSize===0)return;cm(a,d._readRequests.shift())}}(t),eh(i)===0?vc(t,c,u,h):(t._pendingPullIntos.length>0&&vs(t),Ip(i,new Uint8Array(c,u,h),!1))):Op(i)?(vc(t,c,u,h),jd(t)):vc(t,c,u,h),ka(t)})(this,e)}error(e){if(!fs(this))throw mu("error");Es(this,e)}[Ep](e){g1(this),zo(this);let n=this._cancelAlgorithm(e);return Ic(this),n}[Sp](e){let n=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void cm(this,e);let t=this._autoAllocateChunkSize;if(t!==void 0){let r;try{r=new ArrayBuffer(t)}catch(s){return void e._errorSteps(s)}let i={buffer:r,bufferByteLength:t,byteOffset:0,byteLength:t,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}l1(n,e),ka(this)}[Cp](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new Wn,this._pendingPullIntos.push(e)}}};function fs(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof wa}function hd(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof gs}function ka(e){if(function(n){let t=n._controlledReadableByteStream;return t._state!=="readable"||n._closeRequested||!n._started?!1:!!(c1(t)&&eh(t)>0||Op(t)&&C1(t)>0||S1(n)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Wr(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,ka(e)),null),n=>(Es(e,n),null))}}function g1(e){kp(e),e._pendingPullIntos=new Wn}function Dd(e,n){let t=!1;e._state==="closed"&&(t=!0);let r=m1(n);n.readerType==="default"?Ip(e,r,t):function(i,s,u){let h=i._reader._readIntoRequests.shift();u?h._closeSteps(s):h._chunkSteps(s)}(e,r,t)}function m1(e){let n=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,n/t)}function vc(e,n,t,r){e._queue.push({buffer:n,byteOffset:t,byteLength:r}),e._queueTotalSize+=r}function v1(e,n,t,r){let i;try{i=n.slice(t,t+r)}catch(s){throw Es(e,s),s}vc(e,i,0,r)}function b1(e,n){n.bytesFilled>0&&v1(e,n.buffer,n.byteOffset,n.bytesFilled),vs(e)}function _1(e,n){let t=n.elementSize,r=n.bytesFilled-n.bytesFilled%t,i=Math.min(e._queueTotalSize,n.byteLength-n.bytesFilled),s=n.bytesFilled+i,u=s-s%t,h=i,c=!1;u>r&&(h=u-n.bytesFilled,c=!0);let a=e._queue;for(;h>0;){let d=a.peek(),f=Math.min(h,d.byteLength),g=n.byteOffset+n.bytesFilled;y1(n.buffer,g,d.buffer,d.byteOffset,f),d.byteLength===f?a.shift():(d.byteOffset+=f,d.byteLength-=f),e._queueTotalSize-=f,w1(e,f,n),h-=f}return c}function w1(e,n,t){t.bytesFilled+=n}function E1(e){e._queueTotalSize===0&&e._closeRequested?(Ic(e),Bu(e._controlledReadableByteStream)):ka(e)}function kp(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function jd(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let n=e._pendingPullIntos.peek();_1(e,n)&&(vs(e),Dd(e._controlledReadableByteStream,n))}}function lm(e,n){let t=e._pendingPullIntos.peek();kp(e),e._controlledReadableByteStream._state==="closed"?function(r,i){i.readerType==="none"&&vs(r);let s=r._controlledReadableByteStream;if(Op(s))for(;C1(s)>0;)Dd(s,vs(r))}(e,t):function(r,i,s){if(w1(0,i,s),s.readerType==="none")return b1(r,s),void jd(r);if(s.bytesFilled0){let h=s.byteOffset+s.bytesFilled;v1(r,s.buffer,h-u,u)}s.bytesFilled-=u,Dd(r._controlledReadableByteStream,s),jd(r)}(e,n,t),ka(e)}function vs(e){return e._pendingPullIntos.shift()}function Ic(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Es(e,n){let t=e._controlledReadableByteStream;t._state==="readable"&&(g1(e),zo(e),Ic(e),U1(t,n))}function cm(e,n){let t=e._queue.shift();e._queueTotalSize-=t.byteLength,E1(e);let r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);n._chunkSteps(r)}function S1(e){let n=e._controlledReadableByteStream._state;return n==="errored"?null:n==="closed"?0:e._strategyHWM-e._queueTotalSize}function FR(e,n,t){let r=Object.create(wa.prototype),i,s,u;i=n.start!==void 0?()=>n.start(r):()=>{},s=n.pull!==void 0?()=>n.pull(r):()=>It(void 0),u=n.cancel!==void 0?c=>n.cancel(c):()=>It(void 0);let h=n.autoAllocateChunkSize;if(h===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(c,a,d,f,g,I,C){a._controlledReadableByteStream=c,a._pullAgain=!1,a._pulling=!1,a._byobRequest=null,a._queue=a._queueTotalSize=void 0,zo(a),a._closeRequested=!1,a._started=!1,a._strategyHWM=I,a._pullAlgorithm=f,a._cancelAlgorithm=g,a._autoAllocateChunkSize=C,a._pendingPullIntos=new Wn,c._readableStreamController=a,Wr(It(d()),()=>(a._started=!0,ka(a),null),v=>(Es(a,v),null))})(e,r,i,s,u,t,h)}function fd(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function mu(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function hm(e,n){e._reader._readIntoRequests.push(n)}function C1(e){return e._reader._readIntoRequests.length}function Op(e){let n=e._reader;return n!==void 0&&!!ms(n)}Object.defineProperties(wa.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),wt(wa.prototype.close,"close"),wt(wa.prototype.enqueue,"enqueue"),wt(wa.prototype.error,"error"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(wa.prototype,mt.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var Ea=class{constructor(e){if(co(e,1,"ReadableStreamBYOBReader"),u1(e,"First parameter"),Ss(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!fs(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");e1(this,e),this._readIntoRequests=new Wn}get closed(){return ms(this)?this._closedPromise:Ze(nc("closed"))}cancel(e){return ms(this)?this._ownerReadableStream===void 0?Ze(ws("cancel")):t1(this,e):Ze(nc("cancel"))}read(e){if(!ms(this))return Ze(nc("read"));if(!ArrayBuffer.isView(e))return Ze(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return Ze(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return Ze(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,this._ownerReadableStream===void 0)return Ze(ws("read from"));let n,t,r=on((i,s)=>{n=i,t=s});return function(i,s,u){let h=i._ownerReadableStream;h._disturbed=!0,h._state==="errored"?u._errorSteps(h._storedError):function(c,a,d){let f=c._controlledReadableByteStream,g=1;a.constructor!==DataView&&(g=a.constructor.BYTES_PER_ELEMENT);let I=a.constructor,C=a.buffer,v={buffer:C,bufferByteLength:C.byteLength,byteOffset:a.byteOffset,byteLength:a.byteLength,bytesFilled:0,elementSize:g,viewConstructor:I,readerType:"byob"};if(c._pendingPullIntos.length>0)return c._pendingPullIntos.push(v),void hm(f,d);if(f._state!=="closed"){if(c._queueTotalSize>0){if(_1(c,v)){let T=m1(v);return E1(c),void d._chunkSteps(T)}if(c._closeRequested){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");return Es(c,T),void d._errorSteps(T)}}c._pendingPullIntos.push(v),hm(f,d),ka(c)}else{let T=new I(v.buffer,v.byteOffset,0);d._closeSteps(T)}}(h._readableStreamController,s,u)}(this,e,{_chunkSteps:i=>n({value:i,done:!1}),_closeSteps:i=>n({value:i,done:!0}),_errorSteps:i=>t(i)}),r}releaseLock(){if(!ms(this))throw nc("releaseLock");this._ownerReadableStream!==void 0&&function(e){r1(e);let n=new TypeError("Reader was released");T1(e,n)}(this)}};function ms(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Ea}function T1(e,n){let t=e._readIntoRequests;e._readIntoRequests=new Wn,t.forEach(r=>{r._errorSteps(n)})}function nc(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Pu(e,n){let{highWaterMark:t}=e;if(t===void 0)return n;if(p1(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function Ac(e){let{size:n}=e;return n||(()=>1)}function kc(e,n){so(e,n);let t=e?.highWaterMark,r=e?.size;return{highWaterMark:t===void 0?void 0:Rp(t),size:r===void 0?void 0:$R(r,`${n} has member 'size' that`)}}function $R(e,n){return si(e,n),t=>Rp(e(t))}function zR(e,n,t){return si(e,t),r=>Oa(e,n,[r])}function HR(e,n,t){return si(e,t),()=>Oa(e,n,[])}function KR(e,n,t){return si(e,t),r=>Zc(e,n,[r])}function WR(e,n,t){return si(e,t),(r,i)=>Oa(e,n,[r,i])}Object.defineProperties(Ea.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),wt(Ea.prototype.cancel,"cancel"),wt(Ea.prototype.read,"read"),wt(Ea.prototype.releaseLock,"releaseLock"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ea.prototype,mt.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var GR=typeof AbortController=="function",Sa=class{constructor(e={},n={}){e===void 0?e=null:o1(e,"First parameter");let t=kc(n,"Second parameter"),r=function(u,h){so(u,h);let c=u?.abort,a=u?.close,d=u?.start,f=u?.type,g=u?.write;return{abort:c===void 0?void 0:zR(c,u,`${h} has member 'abort' that`),close:a===void 0?void 0:HR(a,u,`${h} has member 'close' that`),start:d===void 0?void 0:KR(d,u,`${h} has member 'start' that`),write:g===void 0?void 0:WR(g,u,`${h} has member 'write' that`),type:f}}(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 Wn,i._inFlightWriteRequest=void 0,i._closeRequest=void 0,i._inFlightCloseRequest=void 0,i._pendingAbortRequest=void 0,i._backpressure=!1,r.type!==void 0)throw new RangeError("Invalid type is specified");let s=Ac(t);(function(u,h,c,a){let d=Object.create(Oc.prototype),f,g,I,C;f=h.start!==void 0?()=>h.start(d):()=>{},g=h.write!==void 0?v=>h.write(v,d):()=>It(void 0),I=h.close!==void 0?()=>h.close():()=>It(void 0),C=h.abort!==void 0?v=>h.abort(v):()=>It(void 0),function(v,T,O,k,y,R,w,L){T._controlledWritableStream=v,v._writableStreamController=T,T._queue=void 0,T._queueTotalSize=void 0,zo(T),T._abortReason=void 0,T._abortController=function(){if(GR)return new AbortController}(),T._started=!1,T._strategySizeAlgorithm=L,T._strategyHWM=w,T._writeAlgorithm=k,T._closeAlgorithm=y,T._abortAlgorithm=R;let D=Np(T);Lp(v,D);let S=O();Wr(It(S),()=>(T._started=!0,th(T),null),m=>(T._started=!0,qd(v,m),null))}(u,d,f,g,I,C,c,a)})(this,r,Pu(t,1),s)}get locked(){if(!Ri(this))throw oc("locked");return bc(this)}abort(e){return Ri(this)?bc(this)?Ze(new TypeError("Cannot abort a stream that already has a writer")):R1(this,e):Ze(oc("abort"))}close(){return Ri(this)?bc(this)?Ze(new TypeError("Cannot close a stream that already has a writer")):Vo(this)?Ze(new TypeError("Cannot close an already-closing stream")):I1(this):Ze(oc("close"))}getWriter(){if(!Ri(this))throw oc("getWriter");return new Mo(this)}};function Ri(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Sa}function bc(e){return e._writer!==void 0}function R1(e,n){var t;if(e._state==="closed"||e._state==="errored")return It(void 0);e._writableStreamController._abortReason=n,(t=e._writableStreamController._abortController)===null||t===void 0||t.abort(n);let r=e._state;if(r==="closed"||r==="errored")return It(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let i=!1;r==="erroring"&&(i=!0,n=void 0);let s=on((u,h)=>{e._pendingAbortRequest={_promise:void 0,_resolve:u,_reject:h,_reason:n,_wasAlreadyErroring:i}});return e._pendingAbortRequest._promise=s,i||Pp(e,n),s}function I1(e){let n=e._state;if(n==="closed"||n==="errored")return Ze(new TypeError(`The stream (in ${n} state) is not in the writable state and cannot be closed`));let t=on((s,u)=>{let h={_resolve:s,_reject:u};e._closeRequest=h}),r=e._writer;var i;return r!==void 0&&e._backpressure&&n==="writable"&&Up(r),Ap(i=e._writableStreamController,k1,0),th(i),t}function qd(e,n){e._state!=="writable"?Bp(e):Pp(e,n)}function Pp(e,n){let t=e._writableStreamController;e._state="erroring",e._storedError=n;let r=e._writer;r!==void 0&&A1(r,n),!function(i){return!(i._inFlightWriteRequest===void 0&&i._inFlightCloseRequest===void 0)}(e)&&t._started&&Bp(e)}function Bp(e){e._state="errored",e._writableStreamController[Zv]();let n=e._storedError;if(e._writeRequests.forEach(r=>{r._reject(n)}),e._writeRequests=new Wn,e._pendingAbortRequest===void 0)return void ic(e);let t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(n),void ic(e);Wr(e._writableStreamController[Jv](t._reason),()=>(t._resolve(),ic(e),null),r=>(t._reject(r),ic(e),null))}function Vo(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function ic(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let n=e._writer;n!==void 0&&xp(n,e._storedError)}function Lp(e,n){let t=e._writer;t!==void 0&&n!==e._backpressure&&(n?function(r){rh(r)}(t):Up(t)),e._backpressure=n}Object.defineProperties(Sa.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),wt(Sa.prototype.abort,"abort"),wt(Sa.prototype.close,"close"),wt(Sa.prototype.getWriter,"getWriter"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Sa.prototype,mt.toStringTag,{value:"WritableStream",configurable:!0});var Mo=class{constructor(e){if(co(e,1,"WritableStreamDefaultWriter"),function(r,i){if(!Ri(r))throw new TypeError(`${i} is not a WritableStream.`)}(e,"First parameter"),bc(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")!Vo(e)&&e._backpressure?rh(this):pm(this),_c(this);else if(n==="erroring")Md(this,e._storedError),_c(this);else if(n==="closed")pm(this),_c(t=this),B1(t);else{let r=e._storedError;Md(this,r),dm(this,r)}var t}get closed(){return pa(this)?this._closedPromise:Ze(ya("closed"))}get desiredSize(){if(!pa(this))throw ya("desiredSize");if(this._ownerWritableStream===void 0)throw vu("desiredSize");return function(e){let n=e._ownerWritableStream,t=n._state;return t==="errored"||t==="erroring"?null:t==="closed"?0:O1(n._writableStreamController)}(this)}get ready(){return pa(this)?this._readyPromise:Ze(ya("ready"))}abort(e){return pa(this)?this._ownerWritableStream===void 0?Ze(vu("abort")):function(n,t){return R1(n._ownerWritableStream,t)}(this,e):Ze(ya("abort"))}close(){if(!pa(this))return Ze(ya("close"));let e=this._ownerWritableStream;return e===void 0?Ze(vu("close")):Vo(e)?Ze(new TypeError("Cannot close an already-closing stream")):I1(this._ownerWritableStream)}releaseLock(){if(!pa(this))throw ya("releaseLock");this._ownerWritableStream!==void 0&&function(e){let n=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");A1(e,t),function(r,i){r._closedPromiseState==="pending"?xp(r,i):function(s,u){dm(s,u)}(r,i)}(e,t),n._writer=void 0,e._ownerWritableStream=void 0}(this)}write(e){return pa(this)?this._ownerWritableStream===void 0?Ze(vu("write to")):function(n,t){let r=n._ownerWritableStream,i=r._writableStreamController,s=function(c,a){try{return c._strategySizeAlgorithm(a)}catch(d){return fm(c,d),1}}(i,t);if(r!==n._ownerWritableStream)return Ze(vu("write to"));let u=r._state;if(u==="errored")return Ze(r._storedError);if(Vo(r)||u==="closed")return Ze(new TypeError("The stream is closing or closed and cannot be written to"));if(u==="erroring")return Ze(r._storedError);let h=function(c){return on((a,d)=>{let f={_resolve:a,_reject:d};c._writeRequests.push(f)})}(r);return function(c,a,d){try{Ap(c,a,d)}catch(g){return void fm(c,g)}let f=c._controlledWritableStream;!Vo(f)&&f._state==="writable"&&Lp(f,Np(c)),th(c)}(i,t,s),h}(this,e):Ze(ya("write"))}};function pa(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Mo}function A1(e,n){e._readyPromiseState==="pending"?L1(e,n):function(t,r){Md(t,r)}(e,n)}Object.defineProperties(Mo.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),wt(Mo.prototype.abort,"abort"),wt(Mo.prototype.close,"close"),wt(Mo.prototype.releaseLock,"releaseLock"),wt(Mo.prototype.write,"write"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Mo.prototype,mt.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var k1={},Oc=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!dd(this))throw pd("abortReason");return this._abortReason}get signal(){if(!dd(this))throw pd("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!dd(this))throw pd("error");this._controlledWritableStream._state==="writable"&&P1(this,e)}[Jv](e){let n=this._abortAlgorithm(e);return Pc(this),n}[Zv](){zo(this)}};function dd(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Oc}function Pc(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function O1(e){return e._strategyHWM-e._queueTotalSize}function th(e){let n=e._controlledWritableStream;if(!e._started||n._inFlightWriteRequest!==void 0)return;if(n._state==="erroring")return void Bp(n);if(e._queue.length===0)return;let t=e._queue.peek().value;t===k1?function(r){let i=r._controlledWritableStream;(function(u){u._inFlightCloseRequest=u._closeRequest,u._closeRequest=void 0})(i),Ud(r);let s=r._closeAlgorithm();Pc(r),Wr(s,()=>(function(u){u._inFlightCloseRequest._resolve(void 0),u._inFlightCloseRequest=void 0,u._state==="erroring"&&(u._storedError=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._resolve(),u._pendingAbortRequest=void 0)),u._state="closed";let h=u._writer;h!==void 0&&B1(h)}(i),null),u=>(function(h,c){h._inFlightCloseRequest._reject(c),h._inFlightCloseRequest=void 0,h._pendingAbortRequest!==void 0&&(h._pendingAbortRequest._reject(c),h._pendingAbortRequest=void 0),qd(h,c)}(i,u),null))}(e):function(r,i){let s=r._controlledWritableStream;(function(u){u._inFlightWriteRequest=u._writeRequests.shift()})(s),Wr(r._writeAlgorithm(i),()=>{(function(h){h._inFlightWriteRequest._resolve(void 0),h._inFlightWriteRequest=void 0})(s);let u=s._state;if(Ud(r),!Vo(s)&&u==="writable"){let h=Np(r);Lp(s,h)}return th(r),null},u=>(s._state==="writable"&&Pc(r),function(h,c){h._inFlightWriteRequest._reject(c),h._inFlightWriteRequest=void 0,qd(h,c)}(s,u),null))}(e,t)}function fm(e,n){e._controlledWritableStream._state==="writable"&&P1(e,n)}function Np(e){return O1(e)<=0}function P1(e,n){let t=e._controlledWritableStream;Pc(e),Pp(t,n)}function oc(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function pd(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function ya(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function vu(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function _c(e){e._closedPromise=on((n,t)=>{e._closedPromise_resolve=n,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function dm(e,n){_c(e),xp(e,n)}function xp(e,n){e._closedPromise_reject!==void 0&&(_s(e._closedPromise),e._closedPromise_reject(n),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function B1(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 rh(e){e._readyPromise=on((n,t)=>{e._readyPromise_resolve=n,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function Md(e,n){rh(e),L1(e,n)}function pm(e){rh(e),Up(e)}function L1(e,n){e._readyPromise_reject!==void 0&&(_s(e._readyPromise),e._readyPromise_reject(n),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Up(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(Oc.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Oc.prototype,mt.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var ym=typeof DOMException<"u"?DOMException:void 0,QR=function(e){if(typeof e!="function"&&typeof e!="object")return!1;try{return new e,!0}catch{return!1}}(ym)?ym:function(){let e=function(n,t){this.message=n||"",this.name=t||"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 gm(e,n,t,r,i,s){let u=e.getReader(),h=n.getWriter();Aa(e)&&(e._disturbed=!0);let c,a,d,f=!1,g=!1,I="readable",C="writable",v=!1,T=!1,O=on(y=>{d=y}),k=Promise.resolve(void 0);return on((y,R)=>{let w;function L(){if(f)return;let $=on((E,B)=>{(function j(N){N?E():ao(function(){return f?It(!0):ao(h.ready,()=>ao(u.read(),M=>!!M.done||(k=h.write(M.value),_s(k),!1)))}(),j,B)})(!1)});_s($)}function D(){return I="closed",t?q():p(()=>(Ri(n)&&(v=Vo(n),C=n._state),v||C==="closed"?It(void 0):C==="erroring"||C==="errored"?Ze(a):(v=!0,h.close())),!1,void 0),null}function S($){return f||(I="errored",c=$,r?q(!0,$):p(()=>h.abort($),!0,$)),null}function m($){return g||(C="errored",a=$,i?q(!0,$):p(()=>u.cancel($),!0,$)),null}if(s!==void 0&&(w=()=>{let $=s.reason!==void 0?s.reason:new QR("Aborted","AbortError"),E=[];r||E.push(()=>C==="writable"?h.abort($):It(void 0)),i||E.push(()=>I==="readable"?u.cancel($):It(void 0)),p(()=>Promise.all(E.map(B=>B())),!0,$)},s.aborted?w():s.addEventListener("abort",w)),Aa(e)&&(I=e._state,c=e._storedError),Ri(n)&&(C=n._state,a=n._storedError,v=Vo(n)),Aa(e)&&Ri(n)&&(T=!0,d()),I==="errored")S(c);else if(C==="erroring"||C==="errored")m(a);else if(I==="closed")D();else if(v||C==="closed"){let $=new TypeError("the destination writable stream closed before all data could be piped to it");i?q(!0,$):p(()=>u.cancel($),!0,$)}function p($,E,B){function j(){return C!=="writable"||v?N():rm(function(){let M;return It(function ee(){if(M!==k)return M=k,ii(k,ee,ee)}())}(),N),null}function N(){return $?Wr($(),()=>V(E,B),M=>V(!0,M)):V(E,B),null}f||(f=!0,T?j():rm(O,j))}function q($,E){p(void 0,$,E)}function V($,E){return g=!0,h.releaseLock(),u.releaseLock(),s!==void 0&&s.removeEventListener("abort",w),$?R(E):y(void 0),null}f||(Wr(u.closed,D,S),Wr(h.closed,function(){return g||(C="closed"),null},m)),T?L():mc(()=>{T=!0,d(),L()})})}function YR(e,n){return function(t){try{return t.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}(e)?function(t){let r,i,s,u,h,c=t.getReader(),a=!1,d=!1,f=!1,g=!1,I=!1,C=!1,v=on(m=>{h=m});function T(m){nm(m.closed,p=>(m!==c||(s.error(p),u.error(p),I&&C||h(void 0)),null))}function O(){a&&(c.releaseLock(),c=t.getReader(),T(c),a=!1),Wr(c.read(),m=>{var p,q;if(f=!1,g=!1,m.done)return I||s.close(),C||u.close(),(p=s.byobRequest)===null||p===void 0||p.respond(0),(q=u.byobRequest)===null||q===void 0||q.respond(0),I&&C||h(void 0),null;let V=m.value,$=V,E=V;if(!I&&!C)try{E=um(V)}catch(B){return s.error(B),u.error(B),h(c.cancel(B)),null}return I||s.enqueue($),C||u.enqueue(E),d=!1,f?y():g&&R(),null},()=>(d=!1,null))}function k(m,p){a||(c.releaseLock(),c=t.getReader({mode:"byob"}),T(c),a=!0);let q=p?u:s,V=p?s:u;Wr(c.read(m),$=>{var E;f=!1,g=!1;let B=p?C:I,j=p?I:C;if($.done){B||q.close(),j||V.close();let M=$.value;return M!==void 0&&(B||q.byobRequest.respondWithNewView(M),j||(E=V.byobRequest)===null||E===void 0||E.respond(0)),B&&j||h(void 0),null}let N=$.value;if(j)B||q.byobRequest.respondWithNewView(N);else{let M;try{M=um(N)}catch(ee){return q.error(ee),V.error(ee),h(c.cancel(ee)),null}B||q.byobRequest.respondWithNewView(N),V.enqueue(M)}return d=!1,f?y():g&&R(),null},()=>(d=!1,null))}function y(){if(d)return f=!0,It(void 0);d=!0;let m=s.byobRequest;return m===null?O():k(m.view,!1),It(void 0)}function R(){if(d)return g=!0,It(void 0);d=!0;let m=u.byobRequest;return m===null?O():k(m.view,!0),It(void 0)}function w(m){if(I=!0,r=m,C){let p=[r,i],q=c.cancel(p);h(q)}return v}function L(m){if(C=!0,i=m,I){let p=[r,i],q=c.cancel(p);h(q)}return v}let D=new jr({type:"bytes",start(m){s=m},pull:y,cancel:w}),S=new jr({type:"bytes",start(m){u=m},pull:R,cancel:L});return T(c),[D,S]}(e):function(t,r){let i=t.getReader(),s,u,h,c,a,d=!1,f=!1,g=!1,I=!1,C=on(R=>{a=R});function v(){return d?(f=!0,It(void 0)):(d=!0,Wr(i.read(),R=>{if(f=!1,R.done)return g||h.close(),I||c.close(),g&&I||a(void 0),null;let w=R.value,L=w,D=w;return g||h.enqueue(L),I||c.enqueue(D),d=!1,f&&v(),null},()=>(d=!1,null)),It(void 0))}function T(R){if(g=!0,s=R,I){let w=[s,u],L=i.cancel(w);a(L)}return C}function O(R){if(I=!0,u=R,g){let w=[s,u],L=i.cancel(w);a(L)}return C}let k=new jr({start(R){h=R},pull:v,cancel:T}),y=new jr({start(R){c=R},pull:v,cancel:O});return nm(i.closed,R=>(h.error(R),c.error(R),g&&I||a(void 0),null)),[k,y]}(e)}var Ca=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ac(this))throw sc("desiredSize");return N1(this)}close(){if(!ac(this))throw sc("close");if(!Su(this))throw new TypeError("The stream is not in a state that permits close");(function(e){if(!Su(e))return;let n=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(wc(e),Bu(n))})(this)}enqueue(e){if(!ac(this))throw sc("enqueue");if(!Su(this))throw new TypeError("The stream is not in a state that permits enqueue");return function(n,t){if(!Su(n))return;let r=n._controlledReadableStream;if(Ss(r)&&eh(r)>0)Ip(r,t,!1);else{let i;try{i=n._strategySizeAlgorithm(t)}catch(s){throw Iu(n,s),s}try{Ap(n,t,i)}catch(s){throw Iu(n,s),s}}Ru(n)}(this,e)}error(e){if(!ac(this))throw sc("error");Iu(this,e)}[Ep](e){zo(this);let n=this._cancelAlgorithm(e);return wc(this),n}[Sp](e){let n=this._controlledReadableStream;if(this._queue.length>0){let t=Ud(this);this._closeRequested&&this._queue.length===0?(wc(this),Bu(n)):Ru(this),e._chunkSteps(t)}else l1(n,e),Ru(this)}[Cp](){}};function ac(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Ca}function Ru(e){if(function(n){let t=n._controlledReadableStream;return!Su(n)||!n._started?!1:!!(Ss(t)&&eh(t)>0||N1(n)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Wr(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Ru(e)),null),n=>(Iu(e,n),null))}}function wc(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Iu(e,n){let t=e._controlledReadableStream;t._state==="readable"&&(zo(e),wc(e),U1(t,n))}function N1(e){let n=e._controlledReadableStream._state;return n==="errored"?null:n==="closed"?0:e._strategyHWM-e._queueTotalSize}function Su(e){return!e._closeRequested&&e._controlledReadableStream._state==="readable"}function XR(e,n,t,r){let i=Object.create(Ca.prototype),s,u,h;s=n.start!==void 0?()=>n.start(i):()=>{},u=n.pull!==void 0?()=>n.pull(i):()=>It(void 0),h=n.cancel!==void 0?c=>n.cancel(c):()=>It(void 0),function(c,a,d,f,g,I,C){a._controlledReadableStream=c,a._queue=void 0,a._queueTotalSize=void 0,zo(a),a._started=!1,a._closeRequested=!1,a._pullAgain=!1,a._pulling=!1,a._strategySizeAlgorithm=C,a._strategyHWM=I,a._pullAlgorithm=f,a._cancelAlgorithm=g,c._readableStreamController=a,Wr(It(d()),()=>(a._started=!0,Ru(a),null),v=>(Iu(a,v),null))}(e,i,s,u,h,t,r)}function sc(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function JR(e,n,t){return si(e,t),r=>Oa(e,n,[r])}function ZR(e,n,t){return si(e,t),r=>Oa(e,n,[r])}function eI(e,n,t){return si(e,t),r=>Zc(e,n,[r])}function tI(e,n){if((e=`${e}`)!="bytes")throw new TypeError(`${n} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function rI(e,n){if((e=`${e}`)!="byob")throw new TypeError(`${n} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function mm(e,n){so(e,n);let t=e?.preventAbort,r=e?.preventCancel,i=e?.preventClose,s=e?.signal;return s!==void 0&&function(u,h){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(u))throw new TypeError(`${h} is not an AbortSignal.`)}(s,`${n} has member 'signal' that`),{preventAbort:!!t,preventCancel:!!r,preventClose:!!i,signal:s}}function nI(e,n){so(e,n);let t=e?.readable;xd(t,"readable","ReadableWritablePair"),function(i,s){if(!Eu(i))throw new TypeError(`${s} is not a ReadableStream.`)}(t,`${n} has member 'readable' that`);let r=e?.writable;return xd(r,"writable","ReadableWritablePair"),function(i,s){if(!s1(i))throw new TypeError(`${s} is not a WritableStream.`)}(r,`${n} has member 'writable' that`),{readable:t,writable:r}}Object.defineProperties(Ca.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),wt(Ca.prototype.close,"close"),wt(Ca.prototype.enqueue,"enqueue"),wt(Ca.prototype.error,"error"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ca.prototype,mt.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var jr=class{constructor(e={},n={}){e===void 0?e=null:o1(e,"First parameter");let t=kc(n,"Second parameter"),r=function(s,u){so(s,u);let h=s,c=h?.autoAllocateChunkSize,a=h?.cancel,d=h?.pull,f=h?.start,g=h?.type;return{autoAllocateChunkSize:c===void 0?void 0:a1(c,`${u} has member 'autoAllocateChunkSize' that`),cancel:a===void 0?void 0:JR(a,h,`${u} has member 'cancel' that`),pull:d===void 0?void 0:ZR(d,h,`${u} has member 'pull' that`),start:f===void 0?void 0:eI(f,h,`${u} has member 'start' that`),type:g===void 0?void 0:tI(g,`${u} 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,r.type==="bytes"){if(t.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");FR(this,r,Pu(t,0))}else{let s=Ac(t);XR(this,r,Pu(t,1),s)}}get locked(){if(!Aa(this))throw ga("locked");return Ss(this)}cancel(e){return Aa(this)?Ss(this)?Ze(new TypeError("Cannot cancel a stream that already has a reader")):x1(this,e):Ze(ga("cancel"))}getReader(e){if(!Aa(this))throw ga("getReader");return function(n,t){so(n,t);let r=n?.mode;return{mode:r===void 0?void 0:rI(r,`${t} has member 'mode' that`)}}(e,"First parameter").mode===void 0?new _a(this):function(n){return new Ea(n)}(this)}pipeThrough(e,n={}){if(!Eu(this))throw ga("pipeThrough");co(e,1,"pipeThrough");let t=nI(e,"First parameter"),r=mm(n,"Second parameter");if(this.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(t.writable.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return _s(gm(this,t.writable,r.preventClose,r.preventAbort,r.preventCancel,r.signal)),t.readable}pipeTo(e,n={}){if(!Eu(this))return Ze(ga("pipeTo"));if(e===void 0)return Ze("Parameter 1 is required in 'pipeTo'.");if(!s1(e))return Ze(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let t;try{t=mm(n,"Second parameter")}catch(r){return Ze(r)}return this.locked?Ze(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):e.locked?Ze(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):gm(this,e,t.preventClose,t.preventAbort,t.preventCancel,t.signal)}tee(){if(!Eu(this))throw ga("tee");if(this.locked)throw new TypeError("Cannot tee a stream that already has a reader");return YR(this)}values(e){if(!Eu(this))throw ga("values");return function(n,t){let r=n.getReader(),i=new f1(r,t),s=Object.create(d1);return s._asyncIteratorImpl=i,s}(this,function(n,t){return so(n,t),{preventCancel:!!n?.preventCancel}}(e,"First parameter").preventCancel)}};function Aa(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof jr}function Ss(e){return e._reader!==void 0}function x1(e,n){if(e._disturbed=!0,e._state==="closed")return It(void 0);if(e._state==="errored")return Ze(e._storedError);Bu(e);let t=e._reader;if(t!==void 0&&ms(t)){let r=t._readIntoRequests;t._readIntoRequests=new Wn,r.forEach(i=>{i._closeSteps(void 0)})}return ii(e._readableStreamController[Ep](n),Yv)}function Bu(e){e._state="closed";let n=e._reader;if(n!==void 0&&(i1(n),Ia(n))){let t=n._readRequests;n._readRequests=new Wn,t.forEach(r=>{r._closeSteps()})}}function U1(e,n){e._state="errored",e._storedError=n;let t=e._reader;t!==void 0&&(Tp(t,n),Ia(t)?h1(t,n):T1(t,n))}function ga(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function D1(e,n){so(e,n);let t=e?.highWaterMark;return xd(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Rp(t)}}Object.defineProperties(jr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),wt(jr.prototype.cancel,"cancel"),wt(jr.prototype.getReader,"getReader"),wt(jr.prototype.pipeThrough,"pipeThrough"),wt(jr.prototype.pipeTo,"pipeTo"),wt(jr.prototype.tee,"tee"),wt(jr.prototype.values,"values"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(jr.prototype,mt.toStringTag,{value:"ReadableStream",configurable:!0}),typeof mt.asyncIterator=="symbol"&&Object.defineProperty(jr.prototype,mt.asyncIterator,{value:jr.prototype.values,writable:!0,configurable:!0});var j1=e=>e.byteLength;wt(j1,"size");var Vd=class{constructor(e){co(e,1,"ByteLengthQueuingStrategy"),e=D1(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!bm(this))throw vm("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!bm(this))throw vm("size");return j1}};function vm(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function bm(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Vd}Object.defineProperties(Vd.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Vd.prototype,mt.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var q1=()=>1;wt(q1,"size");var Fd=class{constructor(e){co(e,1,"CountQueuingStrategy"),e=D1(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!wm(this))throw _m("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!wm(this))throw _m("size");return q1}};function _m(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function wm(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Fd}function iI(e,n,t){return si(e,t),r=>Oa(e,n,[r])}function oI(e,n,t){return si(e,t),r=>Zc(e,n,[r])}function aI(e,n,t){return si(e,t),(r,i)=>Oa(e,n,[r,i])}Object.defineProperties(Fd.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Fd.prototype,mt.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var $d=class{constructor(e={},n={},t={}){e===void 0&&(e=null);let r=kc(n,"Second parameter"),i=kc(t,"Third parameter"),s=function(f,g){so(f,g);let I=f?.flush,C=f?.readableType,v=f?.start,T=f?.transform,O=f?.writableType;return{flush:I===void 0?void 0:iI(I,f,`${g} has member 'flush' that`),readableType:C,start:v===void 0?void 0:oI(v,f,`${g} has member 'start' that`),transform:T===void 0?void 0:aI(T,f,`${g} has member 'transform' that`),writableType:O}}(e,"First parameter");if(s.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(s.writableType!==void 0)throw new RangeError("Invalid writableType specified");let u=Pu(i,0),h=Ac(i),c=Pu(r,1),a=Ac(r),d;(function(f,g,I,C,v,T){function O(){return g}function k(D){return function(S,m){let p=S._transformStreamController;return S._backpressure?ii(S._backpressureChangePromise,()=>{if((Ri(S._writable)?S._writable._state:S._writableState)==="erroring")throw Ri(S._writable)?S._writable._storedError:S._writableStoredError;return Sm(p,m)}):Sm(p,m)}(f,D)}function y(D){return function(S,m){return Bc(S,m),It(void 0)}(f,D)}function R(){return function(D){let S=D._transformStreamController,m=S._flushAlgorithm();return M1(S),ii(m,()=>{if(D._readableState==="errored")throw D._readableStoredError;Nc(D)&&F1(D)},p=>{throw Bc(D,p),D._readableStoredError})}(f)}function w(){return function(D){return Lc(D,!1),D._backpressureChangePromise}(f)}function L(D){return nh(f,D),It(void 0)}f._writableState="writable",f._writableStoredError=void 0,f._writableHasInFlightOperation=!1,f._writableStarted=!1,f._writable=function(D,S,m,p,q,V,$){return new Sa({start(E){D._writableController=E;try{let B=E.signal;B!==void 0&&B.addEventListener("abort",()=>{D._writableState==="writable"&&(D._writableState="erroring",B.reason&&(D._writableStoredError=B.reason))})}catch{}return ii(S(),()=>(D._writableStarted=!0,Tm(D),null),B=>{throw D._writableStarted=!0,yd(D,B),B})},write:E=>(function(B){B._writableHasInFlightOperation=!0}(D),ii(m(E),()=>(function(B){B._writableHasInFlightOperation=!1}(D),Tm(D),null),B=>{throw function(j,N){j._writableHasInFlightOperation=!1,yd(j,N)}(D,B),B})),close:()=>(function(E){E._writableHasInFlightOperation=!0}(D),ii(p(),()=>(function(E){E._writableHasInFlightOperation=!1,E._writableState==="erroring"&&(E._writableStoredError=void 0),E._writableState="closed"}(D),null),E=>{throw function(B,j){B._writableHasInFlightOperation=!1,B._writableState,yd(B,j)}(D,E),E})),abort:E=>(D._writableState="errored",D._writableStoredError=E,q(E))},{highWaterMark:V,size:$})}(f,O,k,R,y,I,C),f._readableState="readable",f._readableStoredError=void 0,f._readableCloseRequested=!1,f._readablePulling=!1,f._readable=function(D,S,m,p,q,V){return new jr({start:$=>(D._readableController=$,S().catch(E=>{xc(D,E)})),pull:()=>(D._readablePulling=!0,m().catch($=>{xc(D,$)})),cancel:$=>(D._readableState="closed",p($))},{highWaterMark:q,size:V})}(f,O,w,L,v,T),f._backpressure=void 0,f._backpressureChangePromise=void 0,f._backpressureChangePromise_resolve=void 0,Lc(f,!0),f._transformStreamController=void 0})(this,on(f=>{d=f}),c,a,u,h),function(f,g){let I=Object.create(Ta.prototype),C,v;C=g.transform!==void 0?T=>g.transform(T,I):T=>{try{return V1(I,T),It(void 0)}catch(O){return Ze(O)}},v=g.flush!==void 0?()=>g.flush(I):()=>It(void 0),function(T,O,k,y){O._controlledTransformStream=T,T._transformStreamController=O,O._transformAlgorithm=k,O._flushAlgorithm=y}(f,I,C,v)}(this,s),s.start!==void 0?d(s.start(this._transformStreamController)):d(void 0)}get readable(){if(!Em(this))throw Cm("readable");return this._readable}get writable(){if(!Em(this))throw Cm("writable");return this._writable}};function Em(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof $d}function Bc(e,n){xc(e,n),nh(e,n)}function nh(e,n){M1(e._transformStreamController),function(t,r){t._writableController.error(r),t._writableState==="writable"&&z1(t,r)}(e,n),e._backpressure&&Lc(e,!1)}function Lc(e,n){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=on(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=n}Object.defineProperties($d.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof mt.toStringTag=="symbol"&&Object.defineProperty($d.prototype,mt.toStringTag,{value:"TransformStream",configurable:!0});var Ta=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!uc(this))throw lc("desiredSize");return $1(this._controlledTransformStream)}enqueue(e){if(!uc(this))throw lc("enqueue");V1(this,e)}error(e){if(!uc(this))throw lc("error");var n;n=e,Bc(this._controlledTransformStream,n)}terminate(){if(!uc(this))throw lc("terminate");(function(e){let n=e._controlledTransformStream;Nc(n)&&F1(n);let t=new TypeError("TransformStream terminated");nh(n,t)})(this)}};function uc(e){return!!Gr(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Ta}function M1(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function V1(e,n){let t=e._controlledTransformStream;if(!Nc(t))throw new TypeError("Readable side is not in a state that permits enqueue");try{(function(r,i){r._readablePulling=!1;try{r._readableController.enqueue(i)}catch(s){throw xc(r,s),s}})(t,n)}catch(r){throw nh(t,r),t._readableStoredError}(function(r){return!function(i){return Nc(i)?!!(i._readablePulling||$1(i)>0):!1}(r)})(t)!==t._backpressure&&Lc(t,!0)}function Sm(e,n){return ii(e._transformAlgorithm(n),void 0,t=>{throw Bc(e._controlledTransformStream,t),t})}function lc(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Cm(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}function Nc(e){return!e._readableCloseRequested&&e._readableState==="readable"}function F1(e){e._readableState="closed",e._readableCloseRequested=!0,e._readableController.close()}function xc(e,n){e._readableState==="readable"&&(e._readableState="errored",e._readableStoredError=n),e._readableController.error(n)}function $1(e){return e._readableController.desiredSize}function yd(e,n){e._writableState!=="writable"?Dp(e):z1(e,n)}function z1(e,n){e._writableState="erroring",e._writableStoredError=n,!function(t){return t._writableHasInFlightOperation}(e)&&e._writableStarted&&Dp(e)}function Dp(e){e._writableState="errored"}function Tm(e){e._writableState==="erroring"&&Dp(e)}Object.defineProperties(Ta.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),wt(Ta.prototype.enqueue,"enqueue"),wt(Ta.prototype.error,"error"),wt(Ta.prototype.terminate,"terminate"),typeof mt.toStringTag=="symbol"&&Object.defineProperty(Ta.prototype,mt.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var H1=65536;async function*sI(e){let n=e.byteOffset+e.byteLength,t=e.byteOffset;for(;t!==n;){let r=Math.min(n-t,H1),i=e.buffer.slice(t,t+r);t+=i.byteLength,yield new Uint8Array(i)}}async function*uI(e){let n=0;for(;n!==e.size;){let t=await e.slice(n,Math.min(e.size,n+H1)).arrayBuffer();n+=t.byteLength,yield new Uint8Array(t)}}async function*gd(e,n=!1){for(let t of e)ArrayBuffer.isView(t)?n?yield*sI(t):yield t:Or(t.stream)?yield*t.stream():yield*uI(t)}function*lI(e,n,t=0,r){r??(r=n);let i=t<0?Math.max(n+t,0):Math.min(t,n),s=r<0?Math.max(n+r,0):Math.min(r,n),u=Math.max(s-i,0),h=0;for(let c of e){if(h>=u)break;let a=ArrayBuffer.isView(c)?c.byteLength:c.size;if(i&&a<=i)i-=a,s-=a;else{let d;ArrayBuffer.isView(c)?(d=c.subarray(i,Math.min(a,s)),h+=d.byteLength):(d=c.slice(i,Math.min(a,s)),h+=d.size),s-=a,i=0,yield d}}}var Do=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},Rm=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},ma,cc,bu,Cs=class{static[(ma=new WeakMap,cc=new WeakMap,bu=new WeakMap,Symbol.hasInstance)](e){return!!(e&&typeof e=="object"&&Or(e.constructor)&&(Or(e.stream)||Or(e.arrayBuffer))&&/^(Blob|File)$/.test(e[Symbol.toStringTag]))}constructor(e=[],n={}){if(ma.set(this,[]),cc.set(this,""),bu.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(!Or(e[Symbol.iterator]))throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&!Or(n))throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");let t=new TextEncoder;for(let i of e){let s;ArrayBuffer.isView(i)?s=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):i instanceof ArrayBuffer?s=new Uint8Array(i.slice(0)):i instanceof Cs?s=i:s=t.encode(String(i)),Rm(this,bu,Do(this,bu,"f")+(ArrayBuffer.isView(s)?s.byteLength:s.size),"f"),Do(this,ma,"f").push(s)}let r=n.type===void 0?"":String(n.type);Rm(this,cc,/^[\x20-\x7E]*$/.test(r)?r:"","f")}get type(){return Do(this,cc,"f")}get size(){return Do(this,bu,"f")}slice(e,n,t){return new Cs(lI(Do(this,ma,"f"),this.size,e,n),{type:t})}async text(){let e=new TextDecoder,n="";for await(let t of gd(Do(this,ma,"f")))n+=e.decode(t,{stream:!0});return n+=e.decode(),n}async arrayBuffer(){let e=new Uint8Array(this.size),n=0;for await(let t of gd(Do(this,ma,"f")))e.set(t,n),n+=t.length;return e.buffer}stream(){let e=gd(Do(this,ma,"f"),!0);return new jr({async pull(n){let{value:t,done:r}=await e.next();if(r)return queueMicrotask(()=>n.close());n.enqueue(t)},async cancel(){await e.return()}})}get[Symbol.toStringTag](){return"Blob"}};Object.defineProperties(Cs.prototype,{type:{enumerable:!0},size:{enumerable:!0},slice:{enumerable:!0},stream:{enumerable:!0},text:{enumerable:!0},arrayBuffer:{enumerable:!0}});var cI=e=>e instanceof Cs,Im=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},Am=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},hc,fc,Uc=class extends Cs{static[(hc=new WeakMap,fc=new WeakMap,Symbol.hasInstance)](e){return e instanceof Cs&&e[Symbol.toStringTag]==="File"&&typeof e.name=="string"}constructor(e,n,t={}){if(super(e,t),hc.set(this,void 0),fc.set(this,0),arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);Im(this,hc,String(n),"f");let r=t.lastModified===void 0?Date.now():Number(t.lastModified);Number.isNaN(r)||Im(this,fc,r,"f")}get name(){return Am(this,hc,"f")}get webkitRelativePath(){return""}get lastModified(){return Am(this,fc,"f")}get[Symbol.toStringTag](){return"File"}},hI=e=>e instanceof Uc,Ei=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},dc,Si,md,km=class{constructor(){dc.add(this),Si.set(this,new Map)}static[(Si=new WeakMap,dc=new WeakSet,Symbol.hasInstance)](e){if(!e)return!1;let n=e;return!!(Or(n.constructor)&&n[Symbol.toStringTag]==="FormData"&&Or(n.append)&&Or(n.set)&&Or(n.get)&&Or(n.getAll)&&Or(n.has)&&Or(n.delete)&&Or(n.entries)&&Or(n.values)&&Or(n.keys)&&Or(n[Symbol.iterator])&&Or(n.forEach))}append(e,n,t){Ei(this,dc,"m",md).call(this,{name:e,fileName:t,append:!0,rawValue:n,argsLength:arguments.length})}set(e,n,t){Ei(this,dc,"m",md).call(this,{name:e,fileName:t,append:!1,rawValue:n,argsLength:arguments.length})}get(e){let n=Ei(this,Si,"f").get(String(e));return n?n[0]:null}getAll(e){let n=Ei(this,Si,"f").get(String(e));return n?n.slice():[]}has(e){return Ei(this,Si,"f").has(String(e))}delete(e){Ei(this,Si,"f").delete(String(e))}*keys(){for(let e of Ei(this,Si,"f").keys())yield e}*entries(){for(let e of this.keys()){let n=this.getAll(e);for(let t of n)yield[e,t]}}*values(){for(let[,e]of this)yield e}[(md=function({name:e,rawValue:n,append:t,fileName:r,argsLength:i}){let s=t?"append":"set";if(i<2)throw new TypeError(`Failed to execute '${s}' on 'FormData': 2 arguments required, but only ${i} present.`);e=String(e);let u;if(hI(n))u=r===void 0?n:new Uc([n],r,{type:n.type,lastModified:n.lastModified});else if(cI(n))u=new Uc([n],r===void 0?"blob":r,{type:n.type});else{if(r)throw new TypeError(`Failed to execute '${s}' on 'FormData': parameter 2 is not of type 'Blob'.`);u=String(n)}let h=Ei(this,Si,"f").get(e);if(!h)return void Ei(this,Si,"f").set(e,[u]);if(!t)return void Ei(this,Si,"f").set(e,[u]);h.push(u)},Symbol.iterator)](){return this.entries()}forEach(e,n){for(let[t,r]of this)e.call(n,r,t,this)}get[Symbol.toStringTag](){return"FormData"}},fI=require("node:fs"),K1=require("node:fs/promises"),dI=require("node:path"),pI=xt(R3(),1),yI=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function gI(e){if(yI(e)!=="object")return!1;let n=Object.getPrototypeOf(e);return n==null?!0:(n.constructor&&n.constructor.toString())===Object.toString()}var mI=gI,Om=function(e,n,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(e,t):i?i.value=t:n.set(e,t),t},va=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},ba,hs,vI="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",W1=class{constructor(e){ba.set(this,void 0),hs.set(this,void 0),Om(this,ba,e.path,"f"),Om(this,hs,e.start||0,"f"),this.name=(0,dI.basename)(va(this,ba,"f")),this.size=e.size,this.lastModified=e.lastModified}slice(e,n){return new W1({path:va(this,ba,"f"),lastModified:this.lastModified,start:va(this,hs,"f")+e,size:n-e})}async*stream(){let{mtimeMs:e}=await(0,K1.stat)(va(this,ba,"f"));if(e>this.lastModified)throw new pI.default(vI,"NotReadableError");this.size&&(yield*(0,fI.createReadStream)(va(this,ba,"f"),{start:va(this,hs,"f"),end:va(this,hs,"f")+this.size-1}))}get[(ba=new WeakMap,hs=new WeakMap,Symbol.toStringTag)](){return"File"}};function bI(e,{mtimeMs:n,size:t},r,i={}){let s;mI(r)?[i,s]=[r,void 0]:s=r;let u=new W1({path:e,size:t,lastModified:n});return s||(s=u.name),new Uc([u],s,{...i,lastModified:u.lastModified})}async function _I(e,n,t){let r=await(0,K1.stat)(e);return bI(e,r,n,t)}var wI=xt(c6(),1);async function EI(e,n,t){for(let r=0;rsetTimeout(i,t))}return!1}var jp={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"},SI=Object.keys(jp),pc="https://addons.mozilla.org/api",CI=class{options={};get productEndpoint(){return`${pc}/v5/addons/addon/${encodeURIComponent(this.options.extId)}`}constructor(e){for(let n of SI){if(!e[n])throw new Error(jp[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,this.options.channel=e.channel||"listed",e.license==="inherit"?delete e.license:e.license=e.license||"all-rights-reserved"}submit=async({filePath:e,version:n="1.0.0"})=>{let t=await this.uploadFile({filePath:e});if(!await EI(async()=>(await this.getUpload({uploadUuid:t.uuid})).valid,8,2400))throw new Error("Upload has not been validated in time.");return await this.createVersion({uploadUuid:t.uuid,version:n})};uploadFile=async({filePath:e})=>{let n=await this.getAccessToken(),t=`${pc}/v5/addons/upload/`,r=new km;r.append("upload",await _I(e)),r.append("channel",this.options.channel);let i=await vn.post(t,{body:r,headers:{Authorization:`JWT ${n}`},throwHttpErrors:!1});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"):(console.log(i.body),new Error(JSON.parse(i.body).error||"Unknown error"));return JSON.parse(i.body)};createVersion=async({uploadUuid:e,version:n})=>{let t=await this.getAccessToken(),r=`${this.productEndpoint}/versions/`,i=new km;i.append("upload",e);let s=await vn.post(r,{body:i,headers:{Authorization:`JWT ${t}`},throwHttpErrors:!1});if(s.statusCode>=400)throw s.statusCode===401?new Error("Invalid access token"):s.statusCode===403?new Error("You do not own this add-on"):s.statusCode===409?new Error(`Version ${n} already exists`):(console.log(s.body),new Error(JSON.parse(s.body).error||"Unknown error"));return JSON.parse(s.body)};getUpload=async({uploadUuid:e})=>{let n=await this.getAccessToken(),t=`${pc}/v5/addons/upload/${e}`;return vn.get(t,{headers:{Authorization:`JWT ${n}`}}).json()};getVersion=async({version:e="1.0.0"})=>{let n=await this.getAccessToken(),t=`${this.productEndpoint}/versions/${encodeURIComponent(e)}/`;return vn.get(t,{headers:{Authorization:`JWT ${n}`}}).json()};getProfile=async()=>{let e=await this.getAccessToken(),n=`${pc}/v5/accounts/profile`;return vn.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 wI.default.sign(n,this.options.apiSecret,{algorithm:"HS256"})}},Lu="firefox",TI=Xc(Lu);async function RI({extId:e,zip:n,dryRun:t,...r}){let i=Qc(n),s=i.browser_specific_settings?.gecko?.id||i.applications?.gecko?.id||e,u=new CI({extId:s,...r});if(TI(`Updating extension with ID ${s}`),t)return!0;try{return await u.submit({filePath:n,version:i.version}),Yc({extId:s,market:Lu,zip:n}),!0}catch(h){throw Jc(h,Lu,`"${s}" (${i.name})`)}}async function II(e){return e.zip=Fu(e),e.verbose&&$u(Lu),zu({market:Lu,options:e,errorMap:jp}),RI(e)}var AI={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`},jm="opera";function UI(e){return ho(this,null,function*(){throw e.zip=zu(e),e.changelog&&(e.changelog=e.changelog.replace(/\/\/n/g,` -`)),e.verbose&&Hu(jm),Ku({market:jm,options:e,errorMap:xI}),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 DI=require("fs/promises"),jI=require("node:events");function qI(e){return W.object(e)&&"_onResponse"in e}var Sr=class extends Error{constructor(e,n,t){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,qI(t)?(Object.defineProperty(this,"request",{enumerable:!1,value:t}),Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),this.options=t.options):this.options=t,this.timings=this.request?.timings,W.string(n.stack)&&W.string(this.stack)){let r=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(r).split(` +web-ext-deploy --get-cookies=opera`},Pm="opera";async function kI(e){throw e.zip=Fu(e),e.changelog&&(e.changelog=e.changelog.replace(/\/\/n/g,` +`)),e.verbose&&$u(Pm),zu({market:Pm,options:e,errorMap:AI}),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 OI=require("fs/promises"),PI=require("node:events");function BI(e){return W.object(e)&&"_onResponse"in e}var Sr=class extends Error{constructor(e,n,t){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,BI(t)?(Object.defineProperty(this,"request",{enumerable:!1,value:t}),Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),this.options=t.options):this.options=t,this.timings=this.request?.timings,W.string(n.stack)&&W.string(this.stack)){let r=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(r).split(` `).reverse(),s=n.stack.slice(n.stack.indexOf(n.message)+n.message.length).split(` `).reverse();for(;s.length>0&&s[0]===i[0];)i.shift();this.stack=`${this.stack.slice(0,r)}${i.reverse().join(` `)}${s.reverse().join(` -`)}`}}},MI=class extends Sr{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Vc=class extends Sr{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},VI=class extends Sr{constructor(e,n){super(e.message,e,n),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},qm=class extends Sr{constructor(e,n){super(e.message,e,n),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},FI=class extends Sr{constructor(e,n,t){super(e.message,e,t),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}},Mm=class extends Sr{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}},$I=class extends Sr{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},zI=class extends Sr{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},rb=xt(require("node:process"),1),Ed=require("node:buffer"),HI=require("node:stream"),Vm=require("node:url"),Sd=xt(require("node:http"),1),KI=xt(av(),1),WI=xt(cp(),1),GI=require("node:buffer"),QI=require("node:util");function nb(e){return W.nodeStream(e)&&W.function_(e.getBoundary)}async function YI(e,n){if(n&&"content-length"in n)return Number(n["content-length"]);if(!e)return 0;if(W.string(e))return GI.Buffer.byteLength(e);if(W.buffer(e))return e.length;if(nb(e))return(0,QI.promisify)(e.getLength.bind(e))()}function ib(e,n,t){let r={};for(let i of t){let s=(...u)=>{n.emit(i,...u)};r[i]=s,e.on(i,s)}return()=>{for(let[i,s]of Object.entries(r))e.off(i,s)}}var XI=xt(require("node:net"),1);function JI(){let e=[];return{once(n,t,r){n.once(t,r),e.push({origin:n,event:t,fn:r})},unhandleAll(){for(let n of e){let{origin:t,event:r,fn:i}=n;t.removeListener(r,i)}e.length=0}}}var Fm=Symbol("reentry"),ZI=()=>{},ob=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 e5(e,n,t){if(Fm in e)return ZI;e[Fm]=!0;let r=[],{once:i,unhandleAll:s}=JI(),u=(v,T,O)=>{let k=setTimeout(T,v,v,O);k.unref?.();let y=()=>{clearTimeout(k)};return r.push(y),y},{host:h,hostname:c}=t,a=(v,T)=>{e.destroy(new ob(v,T))},d=()=>{for(let v of r)v();s()};if(e.once("error",v=>{if(d(),e.listenerCount("error")===0)throw v}),typeof n.request<"u"){let v=u(n.request,a,"request");i(e,"response",T=>{i(T,"end",v)})}if(typeof n.socket<"u"){let{socket:v}=n,T=()=>{a(v,"socket")};e.setTimeout(v,T),r.push(()=>{e.removeListener("timeout",T)})}let f=typeof n.lookup<"u",g=typeof n.connect<"u",I=typeof n.secureConnect<"u",C=typeof n.send<"u";return(f||g||I||C)&&i(e,"socket",v=>{let{socketPath:T}=e;if(v.connecting){let O=!!(T??XI.default.isIP(c??h??"")!==0);if(f&&!O&&typeof v.address().address>"u"){let k=u(n.lookup,a,"lookup");i(v,"lookup",k)}if(g){let k=()=>u(n.connect,a,"connect");O?i(v,"connect",k()):i(v,"lookup",y=>{y===null&&i(v,"connect",k())})}I&&t.protocol==="https:"&&i(v,"connect",()=>{let k=u(n.secureConnect,a,"secureConnect");i(v,"secureConnect",k)})}if(C){let O=()=>u(n.send,a,"send");v.connecting?i(v,"connect",()=>{i(e,"upload-complete",O())}):i(e,"upload-complete",O())}}),typeof n.response<"u"&&i(e,"upload-complete",()=>{let v=u(n.response,a,"response");i(e,"response",v)}),typeof n.read<"u"&&i(e,"response",v=>{let T=u(n.read,a,"read");i(v,"end",T)}),d}function t5(e){e=e;let n={protocol:e.protocol,hostname:W.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 W.string(e.port)&&e.port.length>0&&(n.port=Number(e.port)),(e.username||e.password)&&(n.auth=`${e.username||""}:${e.password||""}`),n}var r5=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)}},n5=({attemptCount:e,retryOptions:n,error:t,retryAfter:r,computedValue:i})=>{if(t.name==="RetryError")return 1;if(e>n.limit)return 0;let s=n.methods.includes(t.options.method),u=n.errorCodes.includes(t.code),h=t.response&&n.statusCodes.includes(t.response.statusCode);if(!s||!u&&!h)return 0;if(t.response){if(r)return r>i?0:r;if(t.response.statusCode===413)return 0}let c=Math.random()*n.noise;return Math.min(2**(e-1)*1e3,n.backoffLimit)+c},i5=n5,o5=xt(require("node:process"),1),Cd=require("node:util"),Ia=require("node:url"),a5=require("node:tls"),s5=xt(require("node:http"),1),u5=xt(require("node:https"),1),l5=xt(mv(),1);function c5(e){let n=[],t=e.split(",");for(let r of t){let[i,...s]=r.split(";"),u=i.trim();if(u[0]!=="<"||u[u.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${u}`);let h=u.slice(1,-1),c={};if(s.length===0)throw new Error(`Unexpected end of Link header parameters: ${s.join(";")}`);for(let a of s){let d=a.trim(),f=d.indexOf("=");if(f===-1)throw new Error(`Failed to parse Link header: ${e}`);let g=d.slice(0,f).trim(),I=d.slice(f+1).trim();c[g]=I}n.push({reference:h,parameters:c})}return n}var[$m,h5]=o5.default.versions.node.split(".").map(Number);function f5(e){for(let n in e){let t=e[n];le.any([W.string,W.number,W.boolean,W.null_,W.undefined],t)}}var d5=new Map,Td,p5=()=>Td||(Td=new Hv,Td),y5={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 t=c5(n).find(r=>r.parameters.rel==="next"||r.parameters.rel==='"next"');return t?{url:new Ia.URL(t.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},g5=e=>{let{hooks:n,retry:t}=e,r={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...t,errorCodes:[...t.errorCodes],methods:[...t.methods],statusCodes:[...t.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 Ia.URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return r.url!==void 0&&(r.prefixUrl=""),r},m5=e=>{let{hooks:n,retry:t}=e,r={...e};return W.object(e.context)&&(r.context={...e.context}),W.object(e.cacheOptions)&&(r.cacheOptions={...e.cacheOptions}),W.object(e.https)&&(r.https={...e.https}),W.object(e.cacheOptions)&&(r.cacheOptions={...r.cacheOptions}),W.object(e.agent)&&(r.agent={...e.agent}),W.object(e.headers)&&(r.headers={...e.headers}),W.object(t)&&(r.retry={...t},W.array(t.errorCodes)&&(r.retry.errorCodes=[...t.errorCodes]),W.array(t.methods)&&(r.retry.methods=[...t.methods]),W.array(t.statusCodes)&&(r.retry.statusCodes=[...t.statusCodes])),W.object(e.timeout)&&(r.timeout={...e.timeout}),W.object(n)&&(r.hooks={...n},W.array(n.init)&&(r.hooks.init=[...n.init]),W.array(n.beforeRequest)&&(r.hooks.beforeRequest=[...n.beforeRequest]),W.array(n.beforeError)&&(r.hooks.beforeError=[...n.beforeError]),W.array(n.beforeRedirect)&&(r.hooks.beforeRedirect=[...n.beforeRedirect]),W.array(n.beforeRetry)&&(r.hooks.beforeRetry=[...n.beforeRetry]),W.array(n.afterResponse)&&(r.hooks.afterResponse=[...n.afterResponse])),W.object(e.pagination)&&(r.pagination={...e.pagination}),r},v5=e=>{let n=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(t=>typeof t=="number");if(n.length>0)return Math.min(...n)},zm=(e,n,t)=>{let r=e.hooks?.init;if(r)for(let i of r)i(n,t)},uo=class{constructor(e,n,t){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}),le.any([W.string,W.urlInstance,W.object,W.undefined],e),le.any([W.object,W.undefined],n),le.any([W.object,W.undefined],t),e instanceof uo||n instanceof uo)throw new TypeError("The defaults must be passed as the third argument");this._internals=g5(t?._internals??t??y5),this._init=[...t?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(W.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(r){throw r.options=this,r}}merge(e){if(e){if(e instanceof uo){for(let n of e._init)this.merge(n);return}e=m5(e),zm(this,e,this),zm(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let n=!1;for(let t in e)if(!(t==="mutableDefaults"||t==="handlers")&&t!=="url"){if(!(t in this))throw new Error(`Unexpected option: ${t}`);this[t]=e[t],n=!0}n&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){le.any([W.function_,W.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.agent))throw new TypeError(`Unexpected agent option: ${n}`);le.any([W.object,W.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){le.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.timeout))throw new Error(`Unexpected timeout option: ${n}`);le.any([W.number,W.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(le.any([W.string,W.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){le.any([W.string,W.buffer,W.nodeStream,W.generator,W.asyncGenerator,Fu,W.undefined],e),W.nodeStream(e)&&le.truthy(e.readable),e!==void 0&&(le.undefined(this._internals.form),le.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){le.any([W.plainObject,W.undefined],e),e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(le.any([W.string,W.urlInstance,W.undefined],e),e===void 0){this._internals.url=void 0;return}if(W.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let n=`${this.prefixUrl}${e.toString()}`,t=new Ia.URL(n);if(this._internals.url=t,t.protocol==="unix:"&&(t.href=`http://unix${t.pathname}${t.search}`),t.protocol!=="http:"&&t.protocol!=="https:"){let r=new Error(`Unsupported protocol: ${t.protocol}`);throw r.code="ERR_UNSUPPORTED_PROTOCOL",r}if(this._internals.username&&(t.username=this._internals.username,this._internals.username=""),this._internals.password&&(t.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(t.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),t.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let r=/(?.+?):(?.+)/.exec(`${t.pathname}${t.search}`);if(r?.groups){let{socketPath:i,path:s}=r.groups;this._unixOptions={socketPath:i,path:s,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(le.any([W.object,W.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:n,getCookieString:t}=e;le.function_(n),le.function_(t),n.length===4&&t.length===0?(n=(0,Cd.promisify)(n.bind(e)),t=(0,Cd.promisify)(t.bind(e)),this._internals.cookieJar={setCookie:n,getCookieString:t}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){le.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){le.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 Ia.URLSearchParams),this._internals.searchParams)}set searchParams(e){le.any([W.string,W.object,W.undefined],e);let n=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,n&&(n.search="");return}let t=this.searchParams,r;if(W.string(e))r=new Ia.URLSearchParams(e);else if(e instanceof Ia.URLSearchParams)r=e;else{f5(e),r=new Ia.URLSearchParams;for(let i in e){let s=e[i];s===null?r.append(i,""):s===void 0?t.delete(i):r.append(i,s)}}if(this._merging){for(let i of r.keys())t.delete(i);for(let[i,s]of r)t.append(i,s)}else n?n.search=t.toString():this._internals.searchParams=t}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){le.any([W.function_,W.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){le.any([W.object,W.boolean,W.undefined],e),e===!0?this._internals.dnsCache=p5():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){le.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){le.object(e);for(let n in e){if(!(n in this._internals.hooks))throw new Error(`Unexpected hook event: ${n}`);let t=n,r=e[t];if(le.any([W.array,W.undefined],r),r)for(let i of r)le.function_(i);if(this._merging)r&&this._internals.hooks[t].push(...r);else{if(!r)throw new Error(`Missing hook event: ${n}`);this._internals.hooks[n]=[...r]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){le.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){le.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){le.any([W.object,W.string,W.boolean,W.undefined],e),e===!0?this._internals.cache=d5:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){le.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){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.username=t:this._internals.username=t}get password(){let e=this._internals.url,n=e?e.password:this._internals.password;return decodeURIComponent(n)}set password(e){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.password=t:this._internals.password=t}get http2(){return this._internals.http2}set http2(e){le.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){le.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){le.plainObject(e),this._merging?Object.assign(this._internals.headers,ku(e)):this._internals.headers=ku(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){le.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){le.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){le.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(le.plainObject(e),le.any([W.function_,W.undefined],e.calculateDelay),le.any([W.number,W.undefined],e.maxRetryAfter),le.any([W.number,W.undefined],e.limit),le.any([W.array,W.undefined],e.methods),le.any([W.array,W.undefined],e.statusCodes),le.any([W.array,W.undefined],e.errorCodes),le.any([W.number,W.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 t in e)if(!(t in this._internals.retry))throw new Error(`Unexpected retry option: ${t}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:n}=this._internals;n.methods=[...new Set(n.methods.map(t=>t.toUpperCase()))],n.statusCodes=[...new Set(n.statusCodes)],n.errorCodes=[...new Set(n.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){le.any([W.string,W.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){le.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){le.any([W.function_,W.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){le.plainObject(e),le.any([W.boolean,W.undefined],e.shared),le.any([W.number,W.undefined],e.cacheHeuristic),le.any([W.number,W.undefined],e.immutableMinTimeToLive),le.any([W.boolean,W.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){le.plainObject(e),le.any([W.boolean,W.undefined],e.rejectUnauthorized),le.any([W.function_,W.undefined],e.checkServerIdentity),le.any([W.string,W.object,W.array,W.undefined],e.certificateAuthority),le.any([W.string,W.object,W.array,W.undefined],e.key),le.any([W.string,W.object,W.array,W.undefined],e.certificate),le.any([W.string,W.undefined],e.passphrase),le.any([W.string,W.buffer,W.array,W.undefined],e.pfx),le.any([W.array,W.undefined],e.alpnProtocols),le.any([W.string,W.undefined],e.ciphers),le.any([W.string,W.buffer,W.undefined],e.dhparam),le.any([W.string,W.undefined],e.signatureAlgorithms),le.any([W.string,W.undefined],e.minVersion),le.any([W.string,W.undefined],e.maxVersion),le.any([W.boolean,W.undefined],e.honorCipherOrder),le.any([W.number,W.undefined],e.tlsSessionLifetime),le.any([W.string,W.undefined],e.ecdhCurve),le.any([W.string,W.buffer,W.array,W.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");le.any([W.string,W.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){le.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){le.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){le.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){le.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){le.any([W.number,W.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){le.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,n){return(0,Cd.inspect)(this._internals,n)}createNativeRequestOptions(){let e=this._internals,n=e.url,t;n.protocol==="https:"?t=e.http2?e.agent:e.agent.https:t=e.agent.http;let{https:r}=e,{pfx:i}=r;return W.array(i)&&W.plainObject(i[0])&&(i=i.map(s=>({buf:s.buffer,passphrase:s.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:r.alpnProtocols,ca:r.certificateAuthority,cert:r.certificate,key:r.key,passphrase:r.passphrase,pfx:r.pfx,rejectUnauthorized:r.rejectUnauthorized,checkServerIdentity:r.checkServerIdentity??a5.checkServerIdentity,ciphers:r.ciphers,honorCipherOrder:r.honorCipherOrder,minVersion:r.minVersion,maxVersion:r.maxVersion,sigalgs:r.signatureAlgorithms,sessionTimeout:r.tlsSessionLifetime,dhparam:r.dhparam,ecdhCurve:r.ecdhCurve,crl:r.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:t,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?v5(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($m<15||$m===15&&h5<10){let n=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw n.code="EUNSUPPORTED",n}return l5.default.auto}return u5.default.request}return s5.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)}},Fc=e=>{let{statusCode:n}=e,t=e.request.options.followRedirect?299:399;return n>=200&&n<=t||n===304},Hm=class extends Sr{constructor(e,n){let{options:t}=n.request;super(`${e.message} in "${t.url.toString()}"`,e,n.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},Km=(e,n,t,r)=>{let{rawBody:i}=e;try{if(n==="text")return i.toString(r);if(n==="json")return i.length===0?"":t(i.toString(r));if(n==="buffer")return i}catch(s){throw new Hm(s,e)}throw new Hm({message:`Unknown body type '${n}'`,name:"Error"},e)};function b5(e){return e.writable&&!e.writableEnded}var _5=b5;function Wm(e){return e.protocol==="unix:"||e.hostname==="unix"}var w5=W.string(rb.default.versions.brotli),E5=new Set(["GET","HEAD"]),Rd=new r5,S5=new Set([300,301,302,303,304,307,308]),C5=["socket","connect","continue","information","upgrade"],vc=()=>{},zp=class extends HI.Duplex{constructor(e,n,t){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,"_removeListeners",{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=vc,this._triggerRead=!1,this._cancelTimeouts=vc,this._removeListeners=vc,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=vc,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 uo(e,n,t),!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:s}=i;s&&(this.options=s),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:r}=this.options;if(W.nodeStream(r)&&r.once("error",i=>{this._flushed?this._beforeError(new qm(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new qm(i,this))}}),this.options.signal){let i=()=>{this.destroy(new zI(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",i)})}}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:t}=this,r=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Sr||(e=new Sr(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 s;try{let u;n&&"retry-after"in n.headers&&(u=Number(n.headers["retry-after"]),Number.isNaN(u)?(u=Date.parse(n.headers["retry-after"])-Date.now(),u<=0&&(u=1)):u*=1e3);let h=t.retry;s=await h.calculateDelay({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:i5({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:h.maxRetryAfter??t.timeout.request??Number.POSITIVE_INFINITY})})}catch(u){this._error(new Sr(u.message,u,this));return}if(s){if(await new Promise(u=>{let h=setTimeout(u,s);this._stopRetry=()=>{clearTimeout(h),u()}}),this.destroyed)return;try{for(let u of this.options.hooks.beforeRetry)await u(i,this.retryCount+1)}catch(u){this._error(new Sr(u.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,u=>{let h=new zp(t.url,u,t);return h.retryCount=this.retryCount+1,rb.default.nextTick(()=>{h.flush()}),h});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 t=this.downloadProgress;t.percent<1&&this.emit("downloadProgress",t),this.push(n)}}}_write(e,n,t){let r=()=>{this._writeRequest(e,n,t)};this._requestInitialized?r():this._jobs.push(r)}_final(e){let n=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(t=>{this._request._writableState?.errored||(t||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(t))})};this._requestInitialized?n():this._jobs.push(n)}_destroy(e,n){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:t}=this.options;W.nodeStream(t)&&t.destroy()}this._request&&this._request.destroy(),e!==null&&!W.undefined(e)&&!(e instanceof Sr)&&(e=new Sr(e.message,e,this)),n(e)}pipe(e,n){return e instanceof Sd.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,n)}unpipe(e){return e instanceof Sd.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:n}=e,t=!W.undefined(e.form),r=!W.undefined(e.json),i=!W.undefined(e.body),s=E5.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=s,t||r||i){if(s)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let u=!W.string(n["content-type"]);if(i){if(Fu(e.body)){let c=new Vv(e.body);u&&(n["content-type"]=c.headers["Content-Type"]),"Content-Length"in c.headers&&(n["content-length"]=c.headers["Content-Length"]),e.body=c.encode()}nb(e.body)&&u&&(n["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(t){u&&(n["content-type"]="application/x-www-form-urlencoded");let{form:c}=e;e.form=void 0,e.body=new Vm.URLSearchParams(c).toString()}else{u&&(n["content-type"]="application/json");let{json:c}=e;e.json=void 0,e.body=e.stringifyJson(c)}let h=await YI(e.body,e.headers);W.undefined(n["content-length"])&&W.undefined(n["transfer-encoding"])&&!s&&!W.undefined(h)&&(n["content-length"]=String(h))}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:t}=n;this._nativeResponse=e,n.decompress&&(e=(0,KI.default)(e));let r=e.statusCode,i=e;i.statusMessage=i.statusMessage??Sd.default.STATUS_CODES[r],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=Fc(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",u=>{this._aborted=!0,e.destroy(),this._beforeError(new Mm(u,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Mm({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let s=e.headers["set-cookie"];if(W.object(n.cookieJar)&&s){let u=s.map(async h=>n.cookieJar.setCookie(h,t.toString()));n.ignoreInvalidCookies&&(u=u.map(async h=>{try{await h}catch{}}));try{await Promise.all(u)}catch(h){this._beforeError(h);return}}if(!this.isAborted){if(n.followRedirect&&e.headers.location&&S5.has(r)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=n.maxRedirects){this._beforeError(new MI(this));return}this._request=void 0;let u=new uo(void 0,void 0,this.options),h=r===303&&u.method!=="GET"&&u.method!=="HEAD",c=r!==307&&r!==308,a=u.methodRewriting&&c;(h||a)&&(u.method="GET",u.body=void 0,u.json=void 0,u.form=void 0,delete u.headers["content-length"]);try{let d=Ed.Buffer.from(e.headers.location,"binary").toString(),f=new Vm.URL(d,t);if(!Wm(t)&&Wm(f)){this._beforeError(new Sr("Cannot redirect to UNIX socket",{},this));return}f.hostname!==t.hostname||f.port!==t.port?("host"in u.headers&&delete u.headers.host,"cookie"in u.headers&&delete u.headers.cookie,"authorization"in u.headers&&delete u.headers.authorization,(u.username||u.password)&&(u.username="",u.password="")):(f.username=u.username,f.password=u.password),this.redirectUrls.push(f),u.prefixUrl="",u.url=f;for(let g of u.hooks.beforeRedirect)await g(u,i);this.emit("redirect",u,i),this.options=u,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(n.isStream&&n.throwHttpErrors&&!Fc(i)){this._beforeError(new Vc(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 u of this._pipedServerResponses)if(!u.headersSent){for(let h in e.headers){let c=n.decompress?h!=="content-encoding":!0,a=e.headers[h];c&&u.setHeader(h,a)}u.statusCode=r}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let n=await(0,WI.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:t,url:r}=n;jv(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=e5(e,t,r);let i=n.cache?"cacheableResponse":"response";e.once(i,s=>{this._onResponse(s)}),e.once("error",s=>{this._aborted=!0,e.destroy(),s=s instanceof ob?new FI(s,this.timings,this):new Sr(s.message,s,this),this._beforeError(s)}),this._unproxyEvents=ib(e,this,C5),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((n,t)=>{super.write(e,r=>{if(r){t(r);return}n()})})}_sendBody(){let{body:e}=this.options,n=this.redirectUrls.length===0?this:this._request??this;W.nodeStream(e)?e.pipe(n):W.generator(e)||W.asyncGenerator(e)?(async()=>{try{for await(let t of e)await this._asyncWrite(t);super.end()}catch(t){this._beforeError(t)}})():W.undefined(e)?(this._cannotHaveBody||this._noPipe)&&n.end():(this._writeRequest(e,void 0,()=>{}),n.end())}_prepareCache(e){if(!Rd.has(e)){let n=new Mv((t,r)=>{let i=t._request(t,r);return W.promise(i)&&(i.once=(s,u)=>{if(s==="error")(async()=>{try{await i}catch(h){u(h)}})();else if(s==="abort")(async()=>{try{(await i).once("abort",u)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${s}`);return i}),i},e);Rd.set(e,n.request())}}async _createCacheableRequest(e,n){return new Promise((t,r)=>{Object.assign(n,t5(e));let i,s=Rd.get(n.cache)(n,async u=>{if(u._readableState.autoDestroy=!1,i){let h=()=>{u.req&&(u.complete=u.req.res.complete)};u.prependOnceListener("end",h),h(),(await i).emit("cacheableResponse",u)}t(u)});s.once("error",r),s.once("request",async u=>{i=u,t(i)})})}async _makeRequest(){let{options:e}=this,{headers:n,username:t,password:r}=e,i=e.cookieJar;for(let c in n)if(W.undefined(n[c]))delete n[c];else if(W.null_(n[c]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${c}\` header`);if(e.decompress&&W.undefined(n["accept-encoding"])&&(n["accept-encoding"]=w5?"gzip, deflate, br":"gzip, deflate"),t||r){let c=Ed.Buffer.from(`${t}:${r}`).toString("base64");n.authorization=`Basic ${c}`}if(i){let c=await i.getCookieString(e.url.toString());W.nonEmptyString(c)&&(n.cookie=c)}e.prefixUrl="";let s;for(let c of e.hooks.beforeRequest){let a=await c(e);if(!W.undefined(a)){s=()=>a;break}}s||(s=e.getRequestFunction());let u=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=s,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let h=e.cache?this._createCacheableRequest:s;try{let c=h(u,this._requestOptions);W.promise(c)&&(c=await c),W.undefined(c)&&(c=e.getFallbackRequestFunction()(u,this._requestOptions),W.promise(c)&&(c=await c)),_5(c)?this._onRequest(c):this.writable?(this.once("finish",()=>{this._onResponse(c)}),this._sendBody()):this._onResponse(c)}catch(c){throw c instanceof ps?new VI(c,this):c}}async _error(e){try{if(!(e instanceof Vc&&!this.options.throwHttpErrors))for(let n of this.options.hooks.beforeError)e=await n(e)}catch(n){e=new Sr(n.message,n,this)}this.destroy(e)}_writeRequest(e,n,t){!this._request||this._request.destroyed||this._request.write(e,n,r=>{if(!r&&!this._request.destroyed){this._uploadedSize+=Ed.Buffer.byteLength(e,n);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}t(r)})}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}},T5=class extends Sr{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},R5=["request","response","redirect","uploadProgress","downloadProgress"];function Gm(e){let n,t,r,i=new jI.EventEmitter,s=new Zc((h,c,a)=>{a(()=>{n.destroy()}),a.shouldReject=!1,a(()=>{c(new T5(n))});let d=f=>{a(()=>{});let g=e??new zp(void 0,void 0,r);g.retryCount=f,g._noPipe=!0,n=g,g.once("response",async v=>{let T=(v.headers["content-encoding"]??"").toLowerCase(),O=T==="gzip"||T==="deflate"||T==="br",{options:k}=g;if(O&&!k.decompress)v.body=v.rawBody;else try{v.body=Km(v,k.responseType,k.parseJson,k.encoding)}catch(y){if(v.body=v.rawBody.toString(),Fc(v)){g._beforeError(y);return}}try{let y=k.hooks.afterResponse;for(let[R,w]of y.entries())if(v=await w(v,async L=>{throw k.merge(L),k.prefixUrl="",L.url&&(k.url=L.url),k.hooks.afterResponse=k.hooks.afterResponse.slice(0,R),new $I(g)}),!(W.object(v)&&W.number(v.statusCode)&&!W.nullOrUndefined(v.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(y){g._beforeError(y);return}if(t=v,!Fc(v)){g._beforeError(new Vc(v));return}g.destroy(),h(g.options.resolveBodyOnly?v.body:v)});let I=v=>{if(s.isCanceled)return;let{options:T}=g;if(v instanceof Vc&&!T.throwHttpErrors){let{response:O}=v;g.destroy(),h(g.options.resolveBodyOnly?O.body:O);return}c(v)};g.once("error",I);let C=g.options?.body;g.once("retry",(v,T)=>{e=void 0;let O=g.options.body;if(C===O&&W.nodeStream(O)){T.message="Cannot retry with consumed body stream",I(T);return}r=g.options,d(v)}),ib(g,i,R5),W.undefined(e)&&g.flush()};d(0)});s.on=(h,c)=>(i.on(h,c),s),s.off=(h,c)=>(i.off(h,c),s);let u=h=>{let c=(async()=>{await s;let{options:a}=t.request;return Km(t,h,a.parseJson,a.encoding)})();return Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)),c};return s.json=()=>{if(n.options){let{headers:h}=n.options;!n.writableFinished&&!("accept"in h)&&(h.accept="application/json")}return u("json")},s.buffer=()=>u("buffer"),s.text=()=>u("text"),s}var I5=async e=>new Promise(n=>{setTimeout(n,e)}),A5=e=>W.function_(e),k5=["get","post","put","patch","head","delete"],ab=e=>{e={options:new uo(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let n=(r,i,s=e.options)=>{let u=new zp(r,i,s),h,c=f=>(u.options=f,u._noPipe=!f.isStream,u.flush(),f.isStream?u:(h||(h=Gm(u)),h)),a=0,d=f=>{let g=(e.handlers[a++]??c)(f,d);if(W.promise(g)&&!u.options.isStream&&(h||(h=Gm(u)),g!==h)){let I=Object.getOwnPropertyDescriptors(h);for(let C in I)C in g&&delete I[C];Object.defineProperties(g,I),g.cancel=h.cancel}return g};return d(u.options)};n.extend=(...r)=>{let i=new uo(void 0,void 0,e.options),s=[...e.handlers],u;for(let h of r)A5(h)?(i.merge(h.defaults.options),s.push(...h.defaults.handlers),u=h.defaults.mutableDefaults):(i.merge(h),h.handlers&&s.push(...h.handlers),u=h.mutableDefaults);return ab({options:i,handlers:s,mutableDefaults:!!u})};let t=async function*(r,i){let s=new uo(r,i,e.options);s.resolveBodyOnly=!1;let{pagination:u}=s;le.function_(u.transform),le.function_(u.shouldContinue),le.function_(u.filter),le.function_(u.paginate),le.number(u.countLimit),le.number(u.requestLimit),le.number(u.backoff);let h=[],{countLimit:c}=u,a=0;for(;a{let s=[];for await(let u of t(r,i))s.push(u);return s},n.paginate.each=t,n.stream=(r,i)=>n(r,{...i,isStream:!0});for(let r of k5)n[r]=(i,s)=>n(i,{...s,method:r}),n.stream[r]=(i,s)=>n(i,{...s,method:r,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},O5=ab,P5={options:new uo,handlers:[],mutableDefaults:!1},B5=O5(P5),Gd=B5,L5=require("module"),$c=require("path"),sb=require("crypto"),N5=Object.create,ub=Object.defineProperty,x5=Object.getOwnPropertyDescriptor,U5=Object.getOwnPropertyNames,D5=Object.getPrototypeOf,j5=Object.prototype.hasOwnProperty,_s=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Qe=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),q5=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of U5(n))!j5.call(e,i)&&i!==t&&ub(e,i,{get:()=>n[i],enumerable:!(r=x5(n,i))||r.enumerable});return e},ks=(e,n,t)=>(t=e!=null?N5(D5(e)):{},q5(n||!e||!e.__esModule?ub(t,"default",{value:e,enumerable:!0}):t,e)),M5=Qe((e,n)=>{(function(t,r){typeof e=="object"&&typeof n<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.WebStreamsPolyfill={}))})(e,function(t){"use strict";let r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:_=>`Symbol(${_})`;function i(){}function s(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}let u=s();function h(_){return typeof _=="object"&&_!==null||typeof _=="function"}let c=i,a=Promise,d=Promise.prototype.then,f=Promise.resolve.bind(a),g=Promise.reject.bind(a);function I(_){return new a(_)}function C(_){return f(_)}function v(_){return g(_)}function T(_,P,H){return d.call(_,P,H)}function O(_,P,H){T(T(_,P,H),void 0,c)}function k(_,P){O(_,P)}function y(_,P){O(_,void 0,P)}function R(_,P,H){return T(_,P,H)}function w(_){T(_,void 0,c)}let L=(()=>{let _=u&&u.queueMicrotask;if(typeof _=="function")return _;let P=C(void 0);return H=>T(P,H)})();function D(_,P,H){if(typeof _!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(_,P,H)}function S(_,P,H){try{return C(D(_,P,H))}catch(re){return v(re)}}let m=16384;class p{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(P){let H=this._back,re=H;H._elements.length===m-1&&(re={_elements:[],_next:void 0}),H._elements.push(P),re!==H&&(this._back=re,H._next=re),++this._size}shift(){let P=this._front,H=P,re=this._cursor,de=re+1,ve=P._elements,Oe=ve[re];return de===m&&(H=P._next,de=0),--this._size,this._cursor=de,P!==H&&(this._front=H),ve[re]=void 0,Oe}forEach(P){let H=this._cursor,re=this._front,de=re._elements;for(;(H!==de.length||re._next!==void 0)&&!(H===de.length&&(re=re._next,de=re._elements,H=0,de.length===0));)P(de[H]),++H}peek(){let P=this._front,H=this._cursor;return P._elements[H]}}function q(_,P){_._ownerReadableStream=P,P._reader=_,P._state==="readable"?B(_):P._state==="closed"?N(_):j(_,P._storedError)}function V(_,P){let H=_._ownerReadableStream;return Ke(H,P)}function $(_){_._ownerReadableStream._state==="readable"?M(_,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ee(_,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),_._ownerReadableStream._reader=void 0,_._ownerReadableStream=void 0}function E(_){return new TypeError("Cannot "+_+" a stream using a released reader")}function B(_){_._closedPromise=I((P,H)=>{_._closedPromise_resolve=P,_._closedPromise_reject=H})}function j(_,P){B(_),M(_,P)}function N(_){B(_),oe(_)}function M(_,P){_._closedPromise_reject!==void 0&&(w(_._closedPromise),_._closedPromise_reject(P),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0)}function ee(_,P){j(_,P)}function oe(_){_._closedPromise_resolve!==void 0&&(_._closedPromise_resolve(void 0),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0)}let ae=r("[[AbortSteps]]"),pe=r("[[ErrorSteps]]"),_e=r("[[CancelSteps]]"),Re=r("[[PullSteps]]"),qe=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},Ce=Math.trunc||function(_){return _<0?Math.ceil(_):Math.floor(_)};function $e(_){return typeof _=="object"||typeof _=="function"}function Ie(_,P){if(_!==void 0&&!$e(_))throw new TypeError(`${P} is not an object.`)}function et(_,P){if(typeof _!="function")throw new TypeError(`${P} is not a function.`)}function Je(_){return typeof _=="object"&&_!==null||typeof _=="function"}function x(_,P){if(!Je(_))throw new TypeError(`${P} is not an object.`)}function X(_,P,H){if(_===void 0)throw new TypeError(`Parameter ${P} is required in '${H}'.`)}function Q(_,P,H){if(_===void 0)throw new TypeError(`${P} is required in '${H}'.`)}function A(_){return Number(_)}function K(_){return _===0?0:_}function se(_){return K(Ce(_))}function te(_,P){let H=Number.MAX_SAFE_INTEGER,re=Number(_);if(re=K(re),!qe(re))throw new TypeError(`${P} is not a finite number`);if(re=se(re),re<0||re>H)throw new TypeError(`${P} is outside the accepted range of 0 to ${H}, inclusive`);return!qe(re)||re===0?0:re}function Ee(_,P){if(!ye(_))throw new TypeError(`${P} is not a ReadableStream.`)}function xe(_){return new rt(_)}function je(_,P){_._reader._readRequests.push(P)}function ge(_,P,H){let re=_._reader._readRequests.shift();H?re._closeSteps():re._chunkSteps(P)}function Le(_){return _._reader._readRequests.length}function We(_){let P=_._reader;return!(P===void 0||!He(P))}class rt{constructor(P){if(X(P,1,"ReadableStreamDefaultReader"),Ee(P,"First parameter"),Ue(P))throw new TypeError("This stream has already been locked for exclusive reading by another reader");q(this,P),this._readRequests=new p}get closed(){return He(this)?this._closedPromise:v(St("closed"))}cancel(P=void 0){return He(this)?this._ownerReadableStream===void 0?v(E("cancel")):V(this,P):v(St("cancel"))}read(){if(!He(this))return v(St("read"));if(this._ownerReadableStream===void 0)return v(E("read from"));let P,H,re=I((de,ve)=>{P=de,H=ve});return kt(this,{_chunkSteps:de=>P({value:de,done:!1}),_closeSteps:()=>P({value:void 0,done:!0}),_errorSteps:de=>H(de)}),re}releaseLock(){if(!He(this))throw St("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");$(this)}}}Object.defineProperties(rt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(rt.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function He(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_readRequests")?!1:_ instanceof rt}function kt(_,P){let H=_._ownerReadableStream;H._disturbed=!0,H._state==="closed"?P._closeSteps():H._state==="errored"?P._errorSteps(H._storedError):H._readableStreamController[Re](P)}function St(_){return new TypeError(`ReadableStreamDefaultReader.prototype.${_} can only be used on a ReadableStreamDefaultReader`)}let Ct=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Bt{constructor(P,H){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=P,this._preventCancel=H}next(){let P=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?R(this._ongoingPromise,P,P):P(),this._ongoingPromise}return(P){let H=()=>this._returnSteps(P);return this._ongoingPromise?R(this._ongoingPromise,H,H):H()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let P=this._reader;if(P._ownerReadableStream===void 0)return v(E("iterate"));let H,re,de=I((ve,Oe)=>{H=ve,re=Oe});return kt(P,{_chunkSteps:ve=>{this._ongoingPromise=void 0,L(()=>H({value:ve,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,$(P),H({value:void 0,done:!0})},_errorSteps:ve=>{this._ongoingPromise=void 0,this._isFinished=!0,$(P),re(ve)}}),de}_returnSteps(P){if(this._isFinished)return Promise.resolve({value:P,done:!0});this._isFinished=!0;let H=this._reader;if(H._ownerReadableStream===void 0)return v(E("finish iterating"));if(!this._preventCancel){let re=V(H,P);return $(H),R(re,()=>({value:P,done:!0}))}return $(H),C({value:P,done:!0})}}let Ot={next(){return zt(this)?this._asyncIteratorImpl.next():v(Xt("next"))},return(_){return zt(this)?this._asyncIteratorImpl.return(_):v(Xt("return"))}};Ct!==void 0&&Object.setPrototypeOf(Ot,Ct);function Lt(_,P){let H=xe(_),re=new Bt(H,P),de=Object.create(Ot);return de._asyncIteratorImpl=re,de}function zt(_){if(!h(_)||!Object.prototype.hasOwnProperty.call(_,"_asyncIteratorImpl"))return!1;try{return _._asyncIteratorImpl instanceof Bt}catch{return!1}}function Xt(_){return new TypeError(`ReadableStreamAsyncIterator.${_} can only be used on a ReadableSteamAsyncIterator`)}let Ht=Number.isNaN||function(_){return _!==_};function Kt(_){return _.slice()}function lr(_,P,H,re,de){new Uint8Array(_).set(new Uint8Array(H,re,de),P)}function Cr(_){return _}function gr(_){return!1}function qr(_,P,H){if(_.slice)return _.slice(P,H);let re=H-P,de=new ArrayBuffer(re);return lr(de,0,_,P,re),de}function un(_){return!(typeof _!="number"||Ht(_)||_<0)}function Qr(_){let P=qr(_.buffer,_.byteOffset,_.byteOffset+_.byteLength);return new Uint8Array(P)}function Yr(_){let P=_._queue.shift();return _._queueTotalSize-=P.size,_._queueTotalSize<0&&(_._queueTotalSize=0),P.value}function _n(_,P,H){if(!un(H)||H===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");_._queue.push({value:P,size:H}),_._queueTotalSize+=H}function li(_){return _._queue.peek().value}function Mr(_){_._queue=new p,_._queueTotalSize=0}class Nn{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Jt(this))throw vo("view");return this._view}respond(P){if(!Jt(this))throw vo("respond");if(X(P,1,"respond"),P=te(P,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");gr(this._view.buffer),go(this._associatedReadableByteStreamController,P)}respondWithNewView(P){if(!Jt(this))throw vo("respondWithNewView");if(X(P,1,"respondWithNewView"),!ArrayBuffer.isView(P))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");gr(P.buffer),mo(this._associatedReadableByteStreamController,P)}}Object.defineProperties(Nn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Nn.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Ut{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Dt(this))throw br("byobRequest");return Ko(this)}get desiredSize(){if(!Dt(this))throw br("desiredSize");return Pi(this)}close(){if(!Dt(this))throw br("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let P=this._controlledReadableByteStream._state;if(P!=="readable")throw new TypeError(`The stream (in ${P} state) is not in the readable state and cannot be closed`);Oi(this)}enqueue(P){if(!Dt(this))throw br("enqueue");if(X(P,1,"enqueue"),!ArrayBuffer.isView(P))throw new TypeError("chunk must be an array buffer view");if(P.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(P.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 H=this._controlledReadableByteStream._state;if(H!=="readable")throw new TypeError(`The stream (in ${H} state) is not in the readable state and cannot be enqueued to`);wn(this,P)}error(P=void 0){if(!Dt(this))throw br("error");Tr(this,P)}[_e](P){Wt(this),Mr(this);let H=this._cancelAlgorithm(P);return yo(this),H}[Re](P){let H=this._controlledReadableByteStream;if(this._queueTotalSize>0){let de=this._queue.shift();this._queueTotalSize-=de.byteLength,ir(this);let ve=new Uint8Array(de.buffer,de.byteOffset,de.byteLength);P._chunkSteps(ve);return}let re=this._autoAllocateChunkSize;if(re!==void 0){let de;try{de=new ArrayBuffer(re)}catch(Oe){P._errorSteps(Oe);return}let ve={buffer:de,bufferByteLength:re,byteOffset:0,byteLength:re,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(ve)}je(H,P),jt(this)}}Object.defineProperties(Ut.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Ut.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Dt(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledReadableByteStream")?!1:_ instanceof Ut}function Jt(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_associatedReadableByteStreamController")?!1:_ instanceof Nn}function jt(_){if(!Ps(_))return;if(_._pulling){_._pullAgain=!0;return}_._pulling=!0;let P=_._pullAlgorithm();O(P,()=>{_._pulling=!1,_._pullAgain&&(_._pullAgain=!1,jt(_))},H=>{Tr(_,H)})}function Wt(_){er(_),_._pendingPullIntos=new p}function Zt(_,P){let H=!1;_._state==="closed"&&(H=!0);let re=Gt(P);P.readerType==="default"?ge(_,re,H):Bs(_,re,H)}function Gt(_){let P=_.bytesFilled,H=_.elementSize;return new _.viewConstructor(_.buffer,_.byteOffset,P/H)}function Qt(_,P,H,re){_._queue.push({buffer:P,byteOffset:H,byteLength:re}),_._queueTotalSize+=re}function rr(_,P){let H=P.elementSize,re=P.bytesFilled-P.bytesFilled%H,de=Math.min(_._queueTotalSize,P.byteLength-P.bytesFilled),ve=P.bytesFilled+de,Oe=ve-ve%H,Me=de,nt=!1;Oe>re&&(Me=Oe-P.bytesFilled,nt=!0);let at=_._queue;for(;Me>0;){let ct=at.peek(),dt=Math.min(Me,ct.byteLength),Ft=P.byteOffset+P.bytesFilled;lr(P.buffer,Ft,ct.buffer,ct.byteOffset,dt),ct.byteLength===dt?at.shift():(ct.byteOffset+=dt,ct.byteLength-=dt),_._queueTotalSize-=dt,nr(_,dt,P),Me-=dt}return nt}function nr(_,P,H){H.bytesFilled+=P}function ir(_){_._queueTotalSize===0&&_._closeRequested?(yo(_),ht(_._controlledReadableByteStream)):jt(_)}function er(_){_._byobRequest!==null&&(_._byobRequest._associatedReadableByteStreamController=void 0,_._byobRequest._view=null,_._byobRequest=null)}function or(_){for(;_._pendingPullIntos.length>0;){if(_._queueTotalSize===0)return;let P=_._pendingPullIntos.peek();rr(_,P)&&(po(_),Zt(_._controlledReadableByteStream,P))}}function cr(_,P,H){let re=_._controlledReadableByteStream,de=1;P.constructor!==DataView&&(de=P.constructor.BYTES_PER_ELEMENT);let ve=P.constructor,Oe=P.buffer,Me={buffer:Oe,bufferByteLength:Oe.byteLength,byteOffset:P.byteOffset,byteLength:P.byteLength,bytesFilled:0,elementSize:de,viewConstructor:ve,readerType:"byob"};if(_._pendingPullIntos.length>0){_._pendingPullIntos.push(Me),qa(re,H);return}if(re._state==="closed"){let nt=new ve(Me.buffer,Me.byteOffset,0);H._closeSteps(nt);return}if(_._queueTotalSize>0){if(rr(_,Me)){let nt=Gt(Me);ir(_),H._chunkSteps(nt);return}if(_._closeRequested){let nt=new TypeError("Insufficient bytes to fill elements in the given buffer");Tr(_,nt),H._errorSteps(nt);return}}_._pendingPullIntos.push(Me),qa(re,H),jt(_)}function $t(_,P){let H=_._controlledReadableByteStream;if(z(H))for(;Wo(H)>0;){let re=po(_);Zt(H,re)}}function tr(_,P,H){if(nr(_,P,H),H.bytesFilled0){let de=H.byteOffset+H.bytesFilled,ve=qr(H.buffer,de-re,de);Qt(_,ve,0,ve.byteLength)}H.bytesFilled-=re,Zt(_._controlledReadableByteStream,H),or(_)}function Na(_,P){let H=_._pendingPullIntos.peek();er(_),_._controlledReadableByteStream._state==="closed"?$t(_):tr(_,P,H),jt(_)}function po(_){return _._pendingPullIntos.shift()}function Ps(_){let P=_._controlledReadableByteStream;return P._state!=="readable"||_._closeRequested||!_._started?!1:!!(We(P)&&Le(P)>0||z(P)&&Wo(P)>0||Pi(_)>0)}function yo(_){_._pullAlgorithm=void 0,_._cancelAlgorithm=void 0}function Oi(_){let P=_._controlledReadableByteStream;if(!(_._closeRequested||P._state!=="readable")){if(_._queueTotalSize>0){_._closeRequested=!0;return}if(_._pendingPullIntos.length>0&&_._pendingPullIntos.peek().bytesFilled>0){let H=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Tr(_,H),H}yo(_),ht(P)}}function wn(_,P){let H=_._controlledReadableByteStream;if(_._closeRequested||H._state!=="readable")return;let re=P.buffer,de=P.byteOffset,ve=P.byteLength,Oe=re;if(_._pendingPullIntos.length>0){let Me=_._pendingPullIntos.peek();gr(Me.buffer),Me.buffer=Me.buffer}if(er(_),We(H))if(Le(H)===0)Qt(_,Oe,de,ve);else{_._pendingPullIntos.length>0&&po(_);let Me=new Uint8Array(Oe,de,ve);ge(H,Me,!1)}else z(H)?(Qt(_,Oe,de,ve),or(_)):Qt(_,Oe,de,ve);jt(_)}function Tr(_,P){let H=_._controlledReadableByteStream;H._state==="readable"&&(Wt(_),Mr(_),yo(_),hr(H,P))}function Ko(_){if(_._byobRequest===null&&_._pendingPullIntos.length>0){let P=_._pendingPullIntos.peek(),H=new Uint8Array(P.buffer,P.byteOffset+P.bytesFilled,P.byteLength-P.bytesFilled),re=Object.create(Nn.prototype);Da(re,_,H),_._byobRequest=re}return _._byobRequest}function Pi(_){let P=_._controlledReadableByteStream._state;return P==="errored"?null:P==="closed"?0:_._strategyHWM-_._queueTotalSize}function go(_,P){let H=_._pendingPullIntos.peek();if(_._controlledReadableByteStream._state==="closed"){if(P!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(P===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(H.bytesFilled+P>H.byteLength)throw new RangeError("bytesWritten out of range")}H.buffer=H.buffer,Na(_,P)}function mo(_,P){let H=_._pendingPullIntos.peek();if(_._controlledReadableByteStream._state==="closed"){if(P.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(P.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(H.byteOffset+H.bytesFilled!==P.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(H.bufferByteLength!==P.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(H.bytesFilled+P.byteLength>H.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let re=P.byteLength;H.buffer=P.buffer,Na(_,re)}function xa(_,P,H,re,de,ve,Oe){P._controlledReadableByteStream=_,P._pullAgain=!1,P._pulling=!1,P._byobRequest=null,P._queue=P._queueTotalSize=void 0,Mr(P),P._closeRequested=!1,P._started=!1,P._strategyHWM=ve,P._pullAlgorithm=re,P._cancelAlgorithm=de,P._autoAllocateChunkSize=Oe,P._pendingPullIntos=new p,_._readableStreamController=P;let Me=H();O(C(Me),()=>{P._started=!0,jt(P)},nt=>{Tr(P,nt)})}function Ua(_,P,H){let re=Object.create(Ut.prototype),de=()=>{},ve=()=>C(void 0),Oe=()=>C(void 0);P.start!==void 0&&(de=()=>P.start(re)),P.pull!==void 0&&(ve=()=>P.pull(re)),P.cancel!==void 0&&(Oe=nt=>P.cancel(nt));let Me=P.autoAllocateChunkSize;if(Me===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");xa(_,re,de,ve,Oe,H,Me)}function Da(_,P,H){_._associatedReadableByteStreamController=P,_._view=H}function vo(_){return new TypeError(`ReadableStreamBYOBRequest.prototype.${_} can only be used on a ReadableStreamBYOBRequest`)}function br(_){return new TypeError(`ReadableByteStreamController.prototype.${_} can only be used on a ReadableByteStreamController`)}function ja(_){return new G(_)}function qa(_,P){_._reader._readIntoRequests.push(P)}function Bs(_,P,H){let re=_._reader._readIntoRequests.shift();H?re._closeSteps(P):re._chunkSteps(P)}function Wo(_){return _._reader._readIntoRequests.length}function z(_){let P=_._reader;return!(P===void 0||!Z(P))}class G{constructor(P){if(X(P,1,"ReadableStreamBYOBReader"),Ee(P,"First parameter"),Ue(P))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Dt(P._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");q(this,P),this._readIntoRequests=new p}get closed(){return Z(this)?this._closedPromise:v(be("closed"))}cancel(P=void 0){return Z(this)?this._ownerReadableStream===void 0?v(E("cancel")):V(this,P):v(be("cancel"))}read(P){if(!Z(this))return v(be("read"));if(!ArrayBuffer.isView(P))return v(new TypeError("view must be an array buffer view"));if(P.byteLength===0)return v(new TypeError("view must have non-zero byteLength"));if(P.buffer.byteLength===0)return v(new TypeError("view's buffer must have non-zero byteLength"));if(gr(P.buffer),this._ownerReadableStream===void 0)return v(E("read from"));let H,re,de=I((ve,Oe)=>{H=ve,re=Oe});return ce(this,P,{_chunkSteps:ve=>H({value:ve,done:!1}),_closeSteps:ve=>H({value:ve,done:!0}),_errorSteps:ve=>re(ve)}),de}releaseLock(){if(!Z(this))throw be("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");$(this)}}}Object.defineProperties(G.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(G.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Z(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_readIntoRequests")?!1:_ instanceof G}function ce(_,P,H){let re=_._ownerReadableStream;re._disturbed=!0,re._state==="errored"?H._errorSteps(re._storedError):cr(re._readableStreamController,P,H)}function be(_){return new TypeError(`ReadableStreamBYOBReader.prototype.${_} can only be used on a ReadableStreamBYOBReader`)}function Te(_,P){let{highWaterMark:H}=_;if(H===void 0)return P;if(Ht(H)||H<0)throw new RangeError("Invalid highWaterMark");return H}function Ne(_){let{size:P}=_;return P||(()=>1)}function Be(_,P){Ie(_,P);let H=_?.highWaterMark,re=_?.size;return{highWaterMark:H===void 0?void 0:A(H),size:re===void 0?void 0:bt(re,`${P} has member 'size' that`)}}function bt(_,P){return et(_,P),H=>A(_(H))}function ar(_,P){Ie(_,P);let H=_?.abort,re=_?.close,de=_?.start,ve=_?.type,Oe=_?.write;return{abort:H===void 0?void 0:Rr(H,_,`${P} has member 'abort' that`),close:re===void 0?void 0:Pr(re,_,`${P} has member 'close' that`),start:de===void 0?void 0:ln(de,_,`${P} has member 'start' that`),write:Oe===void 0?void 0:ci(Oe,_,`${P} has member 'write' that`),type:ve}}function Rr(_,P,H){return et(_,H),re=>S(_,P,[re])}function Pr(_,P,H){return et(_,H),()=>S(_,P,[])}function ln(_,P,H){return et(_,H),re=>D(_,P,[re])}function ci(_,P,H){return et(_,H),(re,de)=>S(_,P,[re,de])}function Ir(_,P){if(!Li(_))throw new TypeError(`${P} is not a WritableStream.`)}function mr(_){if(typeof _!="object"||_===null)return!1;try{return typeof _.aborted=="boolean"}catch{return!1}}let Bi=typeof AbortController=="function";function En(){if(Bi)return new AbortController}class Gn{constructor(P={},H={}){P===void 0?P=null:x(P,"First parameter");let re=Be(H,"Second parameter"),de=ar(P,"First parameter");if(Ns(this),de.type!==void 0)throw new RangeError("Invalid type is specified");let ve=Ne(re),Oe=Te(re,1);nl(this,de,Oe,ve)}get locked(){if(!Li(this))throw _o("locked");return bo(this)}abort(P=void 0){return Li(this)?bo(this)?v(new TypeError("Cannot abort a stream that already has a writer")):Ma(this,P):v(_o("abort"))}close(){return Li(this)?bo(this)?v(new TypeError("Cannot close a stream that already has a writer")):xn(this)?v(new TypeError("Cannot close an already-closing stream")):Ju(this):v(_o("close"))}getWriter(){if(!Li(this))throw _o("getWriter");return Ls(this)}}Object.defineProperties(Gn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Gn.prototype,r.toStringTag,{value:"WritableStream",configurable:!0});function Ls(_){return new Go(_)}function Xu(_,P,H,re,de=1,ve=()=>1){let Oe=Object.create(Gn.prototype);Ns(Oe);let Me=Object.create(fi.prototype);return Vs(Oe,Me,_,P,H,re,de,ve),Oe}function Ns(_){_._state="writable",_._storedError=void 0,_._writer=void 0,_._writableStreamController=void 0,_._writeRequests=new p,_._inFlightWriteRequest=void 0,_._closeRequest=void 0,_._inFlightCloseRequest=void 0,_._pendingAbortRequest=void 0,_._backpressure=!1}function Li(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_writableStreamController")?!1:_ instanceof Gn}function bo(_){return _._writer!==void 0}function Ma(_,P){var H;if(_._state==="closed"||_._state==="errored")return C(void 0);_._writableStreamController._abortReason=P,(H=_._writableStreamController._abortController)===null||H===void 0||H.abort();let re=_._state;if(re==="closed"||re==="errored")return C(void 0);if(_._pendingAbortRequest!==void 0)return _._pendingAbortRequest._promise;let de=!1;re==="erroring"&&(de=!0,P=void 0);let ve=I((Oe,Me)=>{_._pendingAbortRequest={_promise:void 0,_resolve:Oe,_reject:Me,_reason:P,_wasAlreadyErroring:de}});return _._pendingAbortRequest._promise=ve,de||Us(_,P),ve}function Ju(_){let P=_._state;if(P==="closed"||P==="errored")return v(new TypeError(`The stream (in ${P} state) is not in the writable state and cannot be closed`));let H=I((de,ve)=>{let Oe={_resolve:de,_reject:ve};_._closeRequest=Oe}),re=_._writer;return re!==void 0&&_._backpressure&&P==="writable"&&Xo(re),il(_._writableStreamController),H}function Zu(_){return I((P,H)=>{let re={_resolve:P,_reject:H};_._writeRequests.push(re)})}function xs(_,P){if(_._state==="writable"){Us(_,P);return}Ds(_)}function Us(_,P){let H=_._writableStreamController;_._state="erroring",_._storedError=P;let re=_._writer;re!==void 0&&rl(re,P),!vh(_)&&H._started&&Ds(_)}function Ds(_){_._state="errored",_._writableStreamController[pe]();let P=_._storedError;if(_._writeRequests.forEach(de=>{de._reject(P)}),_._writeRequests=new p,_._pendingAbortRequest===void 0){Tt(_);return}let H=_._pendingAbortRequest;if(_._pendingAbortRequest=void 0,H._wasAlreadyErroring){H._reject(P),Tt(_);return}let re=_._writableStreamController[ae](H._reason);O(re,()=>{H._resolve(),Tt(_)},de=>{H._reject(de),Tt(_)})}function yh(_){_._inFlightWriteRequest._resolve(void 0),_._inFlightWriteRequest=void 0}function js(_,P){_._inFlightWriteRequest._reject(P),_._inFlightWriteRequest=void 0,xs(_,P)}function gh(_){_._inFlightCloseRequest._resolve(void 0),_._inFlightCloseRequest=void 0,_._state==="erroring"&&(_._storedError=void 0,_._pendingAbortRequest!==void 0&&(_._pendingAbortRequest._resolve(),_._pendingAbortRequest=void 0)),_._state="closed";let P=_._writer;P!==void 0&&zs(P)}function mh(_,P){_._inFlightCloseRequest._reject(P),_._inFlightCloseRequest=void 0,_._pendingAbortRequest!==void 0&&(_._pendingAbortRequest._reject(P),_._pendingAbortRequest=void 0),xs(_,P)}function xn(_){return!(_._closeRequest===void 0&&_._inFlightCloseRequest===void 0)}function vh(_){return!(_._inFlightWriteRequest===void 0&&_._inFlightCloseRequest===void 0)}function bh(_){_._inFlightCloseRequest=_._closeRequest,_._closeRequest=void 0}function Vt(_){_._inFlightWriteRequest=_._writeRequests.shift()}function Tt(_){_._closeRequest!==void 0&&(_._closeRequest._reject(_._storedError),_._closeRequest=void 0);let P=_._writer;P!==void 0&&$s(P,_._storedError)}function qs(_,P){let H=_._writer;H!==void 0&&P!==_._backpressure&&(P?ul(H):Xo(H)),_._backpressure=P}class Go{constructor(P){if(X(P,1,"WritableStreamDefaultWriter"),Ir(P,"First parameter"),bo(P))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=P,P._writer=this;let H=P._state;if(H==="writable")!xn(P)&&P._backpressure?Ui(this):sl(this),$a(this);else if(H==="erroring")di(this,P._storedError),$a(this);else if(H==="closed")sl(this),Sh(this);else{let re=P._storedError;di(this,re),za(this,re)}}get closed(){return Ni(this)?this._closedPromise:v($r("closed"))}get desiredSize(){if(!Ni(this))throw $r("desiredSize");if(this._ownerWritableStream===void 0)throw xi("desiredSize");return vr(this)}get ready(){return Ni(this)?this._readyPromise:v($r("ready"))}abort(P=void 0){return Ni(this)?this._ownerWritableStream===void 0?v(xi("abort")):_h(this,P):v($r("abort"))}close(){if(!Ni(this))return v($r("close"));let P=this._ownerWritableStream;return P===void 0?v(xi("close")):xn(P)?v(new TypeError("Cannot close an already-closing stream")):el(this)}releaseLock(){if(!Ni(this))throw $r("releaseLock");this._ownerWritableStream!==void 0&&Va(this)}write(P=void 0){return Ni(this)?this._ownerWritableStream===void 0?v(xi("write to")):hi(this,P):v($r("write"))}}Object.defineProperties(Go.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Go.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Ni(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_ownerWritableStream")?!1:_ instanceof Go}function _h(_,P){let H=_._ownerWritableStream;return Ma(H,P)}function el(_){let P=_._ownerWritableStream;return Ju(P)}function wh(_){let P=_._ownerWritableStream,H=P._state;return xn(P)||H==="closed"?C(void 0):H==="errored"?v(P._storedError):el(_)}function tl(_,P){_._closedPromiseState==="pending"?$s(_,P):Ch(_,P)}function rl(_,P){_._readyPromiseState==="pending"?Hs(_,P):Ks(_,P)}function vr(_){let P=_._ownerWritableStream,H=P._state;return H==="errored"||H==="erroring"?null:H==="closed"?0:Fs(P._writableStreamController)}function Va(_){let P=_._ownerWritableStream,H=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");rl(_,H),tl(_,H),P._writer=void 0,_._ownerWritableStream=void 0}function hi(_,P){let H=_._ownerWritableStream,re=H._writableStreamController,de=ol(re,P);if(H!==_._ownerWritableStream)return v(xi("write to"));let ve=H._state;if(ve==="errored")return v(H._storedError);if(xn(H)||ve==="closed")return v(new TypeError("The stream is closing or closed and cannot be written to"));if(ve==="erroring")return v(H._storedError);let Oe=Zu(H);return Xr(re,P,de),Oe}let Ms={};class fi{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Vr(this))throw qt("abortReason");return this._abortReason}get signal(){if(!Vr(this))throw qt("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(P=void 0){if(!Vr(this))throw qt("error");this._controlledWritableStream._state==="writable"&&Yo(this,P)}[ae](P){let H=this._abortAlgorithm(P);return Qo(this),H}[pe](){Mr(this)}}Object.defineProperties(fi.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(fi.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Vr(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledWritableStream")?!1:_ instanceof fi}function Vs(_,P,H,re,de,ve,Oe,Me){P._controlledWritableStream=_,_._writableStreamController=P,P._queue=void 0,P._queueTotalSize=void 0,Mr(P),P._abortReason=void 0,P._abortController=En(),P._started=!1,P._strategySizeAlgorithm=Me,P._strategyHWM=Oe,P._writeAlgorithm=re,P._closeAlgorithm=de,P._abortAlgorithm=ve;let nt=Un(P);qs(_,nt);let at=H(),ct=C(at);O(ct,()=>{P._started=!0,Fa(P)},dt=>{P._started=!0,xs(_,dt)})}function nl(_,P,H,re){let de=Object.create(fi.prototype),ve=()=>{},Oe=()=>C(void 0),Me=()=>C(void 0),nt=()=>C(void 0);P.start!==void 0&&(ve=()=>P.start(de)),P.write!==void 0&&(Oe=at=>P.write(at,de)),P.close!==void 0&&(Me=()=>P.close()),P.abort!==void 0&&(nt=at=>P.abort(at)),Vs(_,de,ve,Oe,Me,nt,H,re)}function Qo(_){_._writeAlgorithm=void 0,_._closeAlgorithm=void 0,_._abortAlgorithm=void 0,_._strategySizeAlgorithm=void 0}function il(_){_n(_,Ms,0),Fa(_)}function ol(_,P){try{return _._strategySizeAlgorithm(P)}catch(H){return Fr(_,H),1}}function Fs(_){return _._strategyHWM-_._queueTotalSize}function Xr(_,P,H){try{_n(_,P,H)}catch(de){Fr(_,de);return}let re=_._controlledWritableStream;if(!xn(re)&&re._state==="writable"){let de=Un(_);qs(re,de)}Fa(_)}function Fa(_){let P=_._controlledWritableStream;if(!_._started||P._inFlightWriteRequest!==void 0)return;if(P._state==="erroring"){Ds(P);return}if(_._queue.length===0)return;let H=li(_);H===Ms?Eh(_):al(_,H)}function Fr(_,P){_._controlledWritableStream._state==="writable"&&Yo(_,P)}function Eh(_){let P=_._controlledWritableStream;bh(P),Yr(_);let H=_._closeAlgorithm();Qo(_),O(H,()=>{gh(P)},re=>{mh(P,re)})}function al(_,P){let H=_._controlledWritableStream;Vt(H);let re=_._writeAlgorithm(P);O(re,()=>{yh(H);let de=H._state;if(Yr(_),!xn(H)&&de==="writable"){let ve=Un(_);qs(H,ve)}Fa(_)},de=>{H._state==="writable"&&Qo(_),js(H,de)})}function Un(_){return Fs(_)<=0}function Yo(_,P){let H=_._controlledWritableStream;Qo(_),Us(H,P)}function _o(_){return new TypeError(`WritableStream.prototype.${_} can only be used on a WritableStream`)}function qt(_){return new TypeError(`WritableStreamDefaultController.prototype.${_} can only be used on a WritableStreamDefaultController`)}function $r(_){return new TypeError(`WritableStreamDefaultWriter.prototype.${_} can only be used on a WritableStreamDefaultWriter`)}function xi(_){return new TypeError("Cannot "+_+" a stream using a released writer")}function $a(_){_._closedPromise=I((P,H)=>{_._closedPromise_resolve=P,_._closedPromise_reject=H,_._closedPromiseState="pending"})}function za(_,P){$a(_),$s(_,P)}function Sh(_){$a(_),zs(_)}function $s(_,P){_._closedPromise_reject!==void 0&&(w(_._closedPromise),_._closedPromise_reject(P),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0,_._closedPromiseState="rejected")}function Ch(_,P){za(_,P)}function zs(_){_._closedPromise_resolve!==void 0&&(_._closedPromise_resolve(void 0),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0,_._closedPromiseState="resolved")}function Ui(_){_._readyPromise=I((P,H)=>{_._readyPromise_resolve=P,_._readyPromise_reject=H}),_._readyPromiseState="pending"}function di(_,P){Ui(_),Hs(_,P)}function sl(_){Ui(_),Xo(_)}function Hs(_,P){_._readyPromise_reject!==void 0&&(w(_._readyPromise),_._readyPromise_reject(P),_._readyPromise_resolve=void 0,_._readyPromise_reject=void 0,_._readyPromiseState="rejected")}function ul(_){Ui(_)}function Ks(_,P){di(_,P)}function Xo(_){_._readyPromise_resolve!==void 0&&(_._readyPromise_resolve(void 0),_._readyPromise_resolve=void 0,_._readyPromise_reject=void 0,_._readyPromiseState="fulfilled")}let Ws=typeof DOMException<"u"?DOMException:void 0;function Th(_){if(!(typeof _=="function"||typeof _=="object"))return!1;try{return new _,!0}catch{return!1}}function Gs(){let _=function(P,H){this.message=P||"",this.name=H||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return _.prototype=Object.create(Error.prototype),Object.defineProperty(_.prototype,"constructor",{value:_,writable:!0,configurable:!0}),_}let Qs=Th(Ws)?Ws:Gs();function ll(_,P,H,re,de,ve){let Oe=xe(_),Me=Ls(P);_._disturbed=!0;let nt=!1,at=C(void 0);return I((ct,dt)=>{let Ft;if(ve!==void 0){if(Ft=()=>{let ze=new Qs("Aborted","AbortError"),st=[];re||st.push(()=>P._state==="writable"?Ma(P,ze):C(void 0)),de||st.push(()=>_._state==="readable"?Ke(_,ze):C(void 0)),Jr(()=>Promise.all(st.map(vt=>vt())),!0,ze)},ve.aborted){Ft();return}ve.addEventListener("abort",Ft)}function Lr(){return I((ze,st)=>{function vt(Nr){Nr?ze():T(jn(),vt,st)}vt(!1)})}function jn(){return nt?C(!0):T(Me._readyPromise,()=>I((ze,st)=>{kt(Oe,{_chunkSteps:vt=>{at=T(hi(Me,vt),void 0,i),ze(!1)},_closeSteps:()=>ze(!0),_errorSteps:st})}))}if(zr(_,Oe._closedPromise,ze=>{re?cn(!0,ze):Jr(()=>Ma(P,ze),!0,ze)}),zr(P,Me._closedPromise,ze=>{de?cn(!0,ze):Jr(()=>Ke(_,ze),!0,ze)}),_r(_,Oe._closedPromise,()=>{H?cn():Jr(()=>wh(Me))}),xn(P)||P._state==="closed"){let ze=new TypeError("the destination writable stream closed before all data could be piped to it");de?cn(!0,ze):Jr(()=>Ke(_,ze),!0,ze)}w(Lr());function Tn(){let ze=at;return T(at,()=>ze!==at?Tn():void 0)}function zr(ze,st,vt){ze._state==="errored"?vt(ze._storedError):y(st,vt)}function _r(ze,st,vt){ze._state==="closed"?vt():k(st,vt)}function Jr(ze,st,vt){if(nt)return;nt=!0,P._state==="writable"&&!xn(P)?k(Tn(),Nr):Nr();function Nr(){O(ze(),()=>zi(st,vt),Y=>zi(!0,Y))}}function cn(ze,st){nt||(nt=!0,P._state==="writable"&&!xn(P)?k(Tn(),()=>zi(ze,st)):zi(ze,st))}function zi(ze,st){Va(Me),$(Oe),ve!==void 0&&ve.removeEventListener("abort",Ft),ze?dt(st):ct(void 0)}})}class Di{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ar(this))throw Ka("desiredSize");return Ys(this)}close(){if(!Ar(this))throw Ka("close");if(!So(this))throw new TypeError("The stream is not in a state that permits close");Eo(this)}enqueue(P=void 0){if(!Ar(this))throw Ka("enqueue");if(!So(this))throw new TypeError("The stream is not in a state that permits enqueue");return Ha(this,P)}error(P=void 0){if(!Ar(this))throw Ka("error");pi(this,P)}[_e](P){Mr(this);let H=this._cancelAlgorithm(P);return Jo(this),H}[Re](P){let H=this._controlledReadableStream;if(this._queue.length>0){let re=Yr(this);this._closeRequested&&this._queue.length===0?(Jo(this),ht(H)):ji(this),P._chunkSteps(re)}else je(H,P),ji(this)}}Object.defineProperties(Di.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Ar(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledReadableStream")?!1:_ instanceof Di}function ji(_){if(!wo(_))return;if(_._pulling){_._pullAgain=!0;return}_._pulling=!0;let P=_._pullAlgorithm();O(P,()=>{_._pulling=!1,_._pullAgain&&(_._pullAgain=!1,ji(_))},H=>{pi(_,H)})}function wo(_){let P=_._controlledReadableStream;return!So(_)||!_._started?!1:!!(Ue(P)&&Le(P)>0||Ys(_)>0)}function Jo(_){_._pullAlgorithm=void 0,_._cancelAlgorithm=void 0,_._strategySizeAlgorithm=void 0}function Eo(_){if(!So(_))return;let P=_._controlledReadableStream;_._closeRequested=!0,_._queue.length===0&&(Jo(_),ht(P))}function Ha(_,P){if(!So(_))return;let H=_._controlledReadableStream;if(Ue(H)&&Le(H)>0)ge(H,P,!1);else{let re;try{re=_._strategySizeAlgorithm(P)}catch(de){throw pi(_,de),de}try{_n(_,P,re)}catch(de){throw pi(_,de),de}}ji(_)}function pi(_,P){let H=_._controlledReadableStream;H._state==="readable"&&(Mr(_),Jo(_),hr(H,P))}function Ys(_){let P=_._controlledReadableStream._state;return P==="errored"?null:P==="closed"?0:_._strategyHWM-_._queueTotalSize}function Rh(_){return!wo(_)}function So(_){let P=_._controlledReadableStream._state;return!_._closeRequested&&P==="readable"}function qi(_,P,H,re,de,ve,Oe){P._controlledReadableStream=_,P._queue=void 0,P._queueTotalSize=void 0,Mr(P),P._started=!1,P._closeRequested=!1,P._pullAgain=!1,P._pulling=!1,P._strategySizeAlgorithm=Oe,P._strategyHWM=ve,P._pullAlgorithm=re,P._cancelAlgorithm=de,_._readableStreamController=P;let Me=H();O(C(Me),()=>{P._started=!0,ji(P)},nt=>{pi(P,nt)})}function Ih(_,P,H,re){let de=Object.create(Di.prototype),ve=()=>{},Oe=()=>C(void 0),Me=()=>C(void 0);P.start!==void 0&&(ve=()=>P.start(de)),P.pull!==void 0&&(Oe=()=>P.pull(de)),P.cancel!==void 0&&(Me=nt=>P.cancel(nt)),qi(_,de,ve,Oe,Me,H,re)}function Ka(_){return new TypeError(`ReadableStreamDefaultController.prototype.${_} can only be used on a ReadableStreamDefaultController`)}function Xs(_,P){return Dt(_._readableStreamController)?yi(_):cl(_)}function cl(_,P){let H=xe(_),re=!1,de=!1,ve=!1,Oe=!1,Me,nt,at,ct,dt,Ft=I(_r=>{dt=_r});function Lr(){return re?(de=!0,C(void 0)):(re=!0,kt(H,{_chunkSteps:_r=>{L(()=>{de=!1;let Jr=_r,cn=_r;ve||Ha(at._readableStreamController,Jr),Oe||Ha(ct._readableStreamController,cn),re=!1,de&&Lr()})},_closeSteps:()=>{re=!1,ve||Eo(at._readableStreamController),Oe||Eo(ct._readableStreamController),(!ve||!Oe)&&dt(void 0)},_errorSteps:()=>{re=!1}}),C(void 0))}function jn(_r){if(ve=!0,Me=_r,Oe){let Jr=Kt([Me,nt]),cn=Ke(_,Jr);dt(cn)}return Ft}function Tn(_r){if(Oe=!0,nt=_r,ve){let Jr=Kt([Me,nt]),cn=Ke(_,Jr);dt(cn)}return Ft}function zr(){}return at=Dn(zr,Lr,jn),ct=Dn(zr,Lr,Tn),y(H._closedPromise,_r=>{pi(at._readableStreamController,_r),pi(ct._readableStreamController,_r),(!ve||!Oe)&&dt(void 0)}),[at,ct]}function yi(_){let P=xe(_),H=!1,re=!1,de=!1,ve=!1,Oe=!1,Me,nt,at,ct,dt,Ft=I(ze=>{dt=ze});function Lr(ze){y(ze._closedPromise,st=>{ze===P&&(Tr(at._readableStreamController,st),Tr(ct._readableStreamController,st),(!ve||!Oe)&&dt(void 0))})}function jn(){Z(P)&&($(P),P=xe(_),Lr(P)),kt(P,{_chunkSteps:ze=>{L(()=>{re=!1,de=!1;let st=ze,vt=ze;if(!ve&&!Oe)try{vt=Qr(ze)}catch(Nr){Tr(at._readableStreamController,Nr),Tr(ct._readableStreamController,Nr),dt(Ke(_,Nr));return}ve||wn(at._readableStreamController,st),Oe||wn(ct._readableStreamController,vt),H=!1,re?zr():de&&_r()})},_closeSteps:()=>{H=!1,ve||Oi(at._readableStreamController),Oe||Oi(ct._readableStreamController),at._readableStreamController._pendingPullIntos.length>0&&go(at._readableStreamController,0),ct._readableStreamController._pendingPullIntos.length>0&&go(ct._readableStreamController,0),(!ve||!Oe)&&dt(void 0)},_errorSteps:()=>{H=!1}})}function Tn(ze,st){He(P)&&($(P),P=ja(_),Lr(P));let vt=st?ct:at,Nr=st?at:ct;ce(P,ze,{_chunkSteps:Y=>{L(()=>{re=!1,de=!1;let Rn=st?Oe:ve;if(st?ve:Oe)Rn||mo(vt._readableStreamController,Y);else{let Qn;try{Qn=Qr(Y)}catch(Hr){Tr(vt._readableStreamController,Hr),Tr(Nr._readableStreamController,Hr),dt(Ke(_,Hr));return}Rn||mo(vt._readableStreamController,Y),wn(Nr._readableStreamController,Qn)}H=!1,re?zr():de&&_r()})},_closeSteps:Y=>{H=!1;let Rn=st?Oe:ve,Qn=st?ve:Oe;Rn||Oi(vt._readableStreamController),Qn||Oi(Nr._readableStreamController),Y!==void 0&&(Rn||mo(vt._readableStreamController,Y),!Qn&&Nr._readableStreamController._pendingPullIntos.length>0&&go(Nr._readableStreamController,0)),(!Rn||!Qn)&&dt(void 0)},_errorSteps:()=>{H=!1}})}function zr(){if(H)return re=!0,C(void 0);H=!0;let ze=Ko(at._readableStreamController);return ze===null?jn():Tn(ze._view,!1),C(void 0)}function _r(){if(H)return de=!0,C(void 0);H=!0;let ze=Ko(ct._readableStreamController);return ze===null?jn():Tn(ze._view,!0),C(void 0)}function Jr(ze){if(ve=!0,Me=ze,Oe){let st=Kt([Me,nt]),vt=Ke(_,st);dt(vt)}return Ft}function cn(ze){if(Oe=!0,nt=ze,ve){let st=Kt([Me,nt]),vt=Ke(_,st);dt(vt)}return Ft}function zi(){}return at=he(zi,zr,Jr),ct=he(zi,_r,cn),Lr(P),[at,ct]}function Wa(_,P){Ie(_,P);let H=_,re=H?.autoAllocateChunkSize,de=H?.cancel,ve=H?.pull,Oe=H?.start,Me=H?.type;return{autoAllocateChunkSize:re===void 0?void 0:te(re,`${P} has member 'autoAllocateChunkSize' that`),cancel:de===void 0?void 0:Ah(de,H,`${P} has member 'cancel' that`),pull:ve===void 0?void 0:kh(ve,H,`${P} has member 'pull' that`),start:Oe===void 0?void 0:Oh(Oe,H,`${P} has member 'start' that`),type:Me===void 0?void 0:Co(Me,`${P} has member 'type' that`)}}function Ah(_,P,H){return et(_,H),re=>S(_,P,[re])}function kh(_,P,H){return et(_,H),re=>S(_,P,[re])}function Oh(_,P,H){return et(_,H),re=>D(_,P,[re])}function Co(_,P){if(_=`${_}`,_!=="bytes")throw new TypeError(`${P} '${_}' is not a valid enumeration value for ReadableStreamType`);return _}function Sn(_,P){Ie(_,P);let H=_?.mode;return{mode:H===void 0?void 0:hl(H,`${P} has member 'mode' that`)}}function hl(_,P){if(_=`${_}`,_!=="byob")throw new TypeError(`${P} '${_}' is not a valid enumeration value for ReadableStreamReaderMode`);return _}function Ph(_,P){return Ie(_,P),{preventCancel:!!_?.preventCancel}}function fl(_,P){Ie(_,P);let H=_?.preventAbort,re=_?.preventCancel,de=_?.preventClose,ve=_?.signal;return ve!==void 0&&Bh(ve,`${P} has member 'signal' that`),{preventAbort:!!H,preventCancel:!!re,preventClose:!!de,signal:ve}}function Bh(_,P){if(!mr(_))throw new TypeError(`${P} is not an AbortSignal.`)}function Lh(_,P){Ie(_,P);let H=_?.readable;Q(H,"readable","ReadableWritablePair"),Ee(H,`${P} has member 'readable' that`);let re=_?.writable;return Q(re,"writable","ReadableWritablePair"),Ir(re,`${P} has member 'writable' that`),{readable:H,writable:re}}class gi{constructor(P={},H={}){P===void 0?P=null:x(P,"First parameter");let re=Be(H,"Second parameter"),de=Wa(P,"First parameter");if(me(this),de.type==="bytes"){if(re.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let ve=Te(re,0);Ua(this,de,ve)}else{let ve=Ne(re),Oe=Te(re,1);Ih(this,de,Oe,ve)}}get locked(){if(!ye(this))throw yt("locked");return Ue(this)}cancel(P=void 0){return ye(this)?Ue(this)?v(new TypeError("Cannot cancel a stream that already has a reader")):Ke(this,P):v(yt("cancel"))}getReader(P=void 0){if(!ye(this))throw yt("getReader");return Sn(P,"First parameter").mode===void 0?xe(this):ja(this)}pipeThrough(P,H={}){if(!ye(this))throw yt("pipeThrough");X(P,1,"pipeThrough");let re=Lh(P,"First parameter"),de=fl(H,"Second parameter");if(Ue(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(bo(re.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let ve=ll(this,re.writable,de.preventClose,de.preventAbort,de.preventCancel,de.signal);return w(ve),re.readable}pipeTo(P,H={}){if(!ye(this))return v(yt("pipeTo"));if(P===void 0)return v("Parameter 1 is required in 'pipeTo'.");if(!Li(P))return v(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let re;try{re=fl(H,"Second parameter")}catch(de){return v(de)}return Ue(this)?v(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):bo(P)?v(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ll(this,P,re.preventClose,re.preventAbort,re.preventCancel,re.signal)}tee(){if(!ye(this))throw yt("tee");let P=Xs(this);return Kt(P)}values(P=void 0){if(!ye(this))throw yt("values");let H=Ph(P,"First parameter");return Lt(this,H.preventCancel)}}Object.defineProperties(gi.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(gi.prototype,r.toStringTag,{value:"ReadableStream",configurable:!0}),typeof r.asyncIterator=="symbol"&&Object.defineProperty(gi.prototype,r.asyncIterator,{value:gi.prototype.values,writable:!0,configurable:!0});function Dn(_,P,H,re=1,de=()=>1){let ve=Object.create(gi.prototype);me(ve);let Oe=Object.create(Di.prototype);return qi(ve,Oe,_,P,H,re,de),ve}function he(_,P,H){let re=Object.create(gi.prototype);me(re);let de=Object.create(Ut.prototype);return xa(re,de,_,P,H,0,void 0),re}function me(_){_._state="readable",_._reader=void 0,_._storedError=void 0,_._disturbed=!1}function ye(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_readableStreamController")?!1:_ instanceof gi}function Ue(_){return _._reader!==void 0}function Ke(_,P){if(_._disturbed=!0,_._state==="closed")return C(void 0);if(_._state==="errored")return v(_._storedError);ht(_);let H=_._reader;H!==void 0&&Z(H)&&(H._readIntoRequests.forEach(de=>{de._closeSteps(void 0)}),H._readIntoRequests=new p);let re=_._readableStreamController[_e](P);return R(re,i)}function ht(_){_._state="closed";let P=_._reader;P!==void 0&&(oe(P),He(P)&&(P._readRequests.forEach(H=>{H._closeSteps()}),P._readRequests=new p))}function hr(_,P){_._state="errored",_._storedError=P;let H=_._reader;H!==void 0&&(M(H,P),He(H)?(H._readRequests.forEach(re=>{re._errorSteps(P)}),H._readRequests=new p):(H._readIntoRequests.forEach(re=>{re._errorSteps(P)}),H._readIntoRequests=new p))}function yt(_){return new TypeError(`ReadableStream.prototype.${_} can only be used on a ReadableStream`)}function Ga(_,P){Ie(_,P);let H=_?.highWaterMark;return Q(H,"highWaterMark","QueuingStrategyInit"),{highWaterMark:A(H)}}let dl=_=>_.byteLength;try{Object.defineProperty(dl,"name",{value:"size",configurable:!0})}catch{}class Br{constructor(P){X(P,1,"ByteLengthQueuingStrategy"),P=Ga(P,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=P.highWaterMark}get highWaterMark(){if(!pl(this))throw Zo("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!pl(this))throw Zo("size");return dl}}Object.defineProperties(Br.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Br.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Zo(_){return new TypeError(`ByteLengthQueuingStrategy.prototype.${_} can only be used on a ByteLengthQueuingStrategy`)}function pl(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_byteLengthQueuingStrategyHighWaterMark")?!1:_ instanceof Br}let Mi=()=>1;try{Object.defineProperty(Mi,"name",{value:"size",configurable:!0})}catch{}class Vi{constructor(P){X(P,1,"CountQueuingStrategy"),P=Ga(P,"First parameter"),this._countQueuingStrategyHighWaterMark=P.highWaterMark}get highWaterMark(){if(!_t(this))throw ea("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!_t(this))throw ea("size");return Mi}}Object.defineProperties(Vi.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Vi.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ea(_){return new TypeError(`CountQueuingStrategy.prototype.${_} can only be used on a CountQueuingStrategy`)}function _t(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_countQueuingStrategyHighWaterMark")?!1:_ instanceof Vi}function Nh(_,P){Ie(_,P);let H=_?.flush,re=_?.readableType,de=_?.start,ve=_?.transform,Oe=_?.writableType;return{flush:H===void 0?void 0:yl(H,_,`${P} has member 'flush' that`),readableType:re,start:de===void 0?void 0:Qa(de,_,`${P} has member 'start' that`),transform:ve===void 0?void 0:xh(ve,_,`${P} has member 'transform' that`),writableType:Oe}}function yl(_,P,H){return et(_,H),re=>S(_,P,[re])}function Qa(_,P,H){return et(_,H),re=>D(_,P,[re])}function xh(_,P,H){return et(_,H),(re,de)=>S(_,P,[re,de])}class Ya{constructor(P={},H={},re={}){P===void 0&&(P=null);let de=Be(H,"Second parameter"),ve=Be(re,"Third parameter"),Oe=Nh(P,"First parameter");if(Oe.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(Oe.writableType!==void 0)throw new RangeError("Invalid writableType specified");let Me=Te(ve,0),nt=Ne(ve),at=Te(de,1),ct=Ne(de),dt,Ft=I(Lr=>{dt=Lr});Uh(this,Ft,at,ct,Me,nt),Xa(this,Oe),Oe.start!==void 0?dt(Oe.start(this._transformStreamController)):dt(void 0)}get readable(){if(!ta(this))throw ml("readable");return this._readable}get writable(){if(!ta(this))throw ml("writable");return this._writable}}Object.defineProperties(Ya.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Ya.prototype,r.toStringTag,{value:"TransformStream",configurable:!0});function Uh(_,P,H,re,de,ve){function Oe(){return P}function Me(Ft){return jh(_,Ft)}function nt(Ft){return qh(_,Ft)}function at(){return Ja(_)}_._writable=Xu(Oe,Me,at,nt,H,re);function ct(){return Za(_)}function dt(Ft){return Fi(_,Ft),C(void 0)}_._readable=Dn(Oe,ct,dt,de,ve),_._backpressure=void 0,_._backpressureChangePromise=void 0,_._backpressureChangePromise_resolve=void 0,ra(_,!0),_._transformStreamController=void 0}function ta(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_transformStreamController")?!1:_ instanceof Ya}function Cn(_,P){pi(_._readable._readableStreamController,P),Fi(_,P)}function Fi(_,P){Js(_._transformStreamController),Fr(_._writable._writableStreamController,P),_._backpressure&&ra(_,!1)}function ra(_,P){_._backpressureChangePromise!==void 0&&_._backpressureChangePromise_resolve(),_._backpressureChangePromise=I(H=>{_._backpressureChangePromise_resolve=H}),_._backpressure=P}class mi{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!na(this))throw Ro("desiredSize");let P=this._controlledTransformStream._readable._readableStreamController;return Ys(P)}enqueue(P=void 0){if(!na(this))throw Ro("enqueue");To(this,P)}error(P=void 0){if(!na(this))throw Ro("error");$i(this,P)}terminate(){if(!na(this))throw Ro("terminate");Dh(this)}}Object.defineProperties(mi.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(mi.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function na(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledTransformStream")?!1:_ instanceof mi}function gl(_,P,H,re){P._controlledTransformStream=_,_._transformStreamController=P,P._transformAlgorithm=H,P._flushAlgorithm=re}function Xa(_,P){let H=Object.create(mi.prototype),re=ve=>{try{return To(H,ve),C(void 0)}catch(Oe){return v(Oe)}},de=()=>C(void 0);P.transform!==void 0&&(re=ve=>P.transform(ve,H)),P.flush!==void 0&&(de=()=>P.flush(H)),gl(_,H,re,de)}function Js(_){_._transformAlgorithm=void 0,_._flushAlgorithm=void 0}function To(_,P){let H=_._controlledTransformStream,re=H._readable._readableStreamController;if(!So(re))throw new TypeError("Readable side is not in a state that permits enqueue");try{Ha(re,P)}catch(de){throw Fi(H,de),H._readable._storedError}Rh(re)!==H._backpressure&&ra(H,!0)}function $i(_,P){Cn(_._controlledTransformStream,P)}function ia(_,P){let H=_._transformAlgorithm(P);return R(H,void 0,re=>{throw Cn(_._controlledTransformStream,re),re})}function Dh(_){let P=_._controlledTransformStream,H=P._readable._readableStreamController;Eo(H);let re=new TypeError("TransformStream terminated");Fi(P,re)}function jh(_,P){let H=_._transformStreamController;if(_._backpressure){let re=_._backpressureChangePromise;return R(re,()=>{let de=_._writable;if(de._state==="erroring")throw de._storedError;return ia(H,P)})}return ia(H,P)}function qh(_,P){return Cn(_,P),C(void 0)}function Ja(_){let P=_._readable,H=_._transformStreamController,re=H._flushAlgorithm();return Js(H),R(re,()=>{if(P._state==="errored")throw P._storedError;Eo(P._readableStreamController)},de=>{throw Cn(_,de),P._storedError})}function Za(_){return ra(_,!1),_._backpressureChangePromise}function Ro(_){return new TypeError(`TransformStreamDefaultController.prototype.${_} can only be used on a TransformStreamDefaultController`)}function ml(_){return new TypeError(`TransformStream.prototype.${_} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=Br,t.CountQueuingStrategy=Vi,t.ReadableByteStreamController=Ut,t.ReadableStream=gi,t.ReadableStreamBYOBReader=G,t.ReadableStreamBYOBRequest=Nn,t.ReadableStreamDefaultController=Di,t.ReadableStreamDefaultReader=rt,t.TransformStream=Ya,t.TransformStreamDefaultController=mi,t.WritableStream=Gn,t.WritableStreamDefaultController=fi,t.WritableStreamDefaultWriter=Go,Object.defineProperty(t,"__esModule",{value:!0})})}),V5=Qe(()=>{if(!globalThis.ReadableStream)try{let e=_s("process"),{emitWarning:n}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,_s("stream/web")),e.emitWarning=n}catch(t){throw e.emitWarning=n,t}}catch{Object.assign(globalThis,M5())}try{let{Blob:e}=_s("buffer");e&&!e.prototype.stream&&(e.prototype.stream=function(n){let t=0,r=this;return new ReadableStream({type:"bytes",async pull(i){let s=await r.slice(t,Math.min(r.size,t+65536)).arrayBuffer();t+=s.byteLength,i.enqueue(new Uint8Array(s)),t===r.size&&i.close()}})})}catch{}}),F5=Qe(e=>{e.read=function(n,t,r,i,s){var u,h,c=s*8-i-1,a=(1<>1,f=-7,g=r?s-1:0,I=r?-1:1,C=n[t+g];for(g+=I,u=C&(1<<-f)-1,C>>=-f,f+=c;f>0;u=u*256+n[t+g],g+=I,f-=8);for(h=u&(1<<-f)-1,u>>=-f,f+=i;f>0;h=h*256+n[t+g],g+=I,f-=8);if(u===0)u=1-d;else{if(u===a)return h?NaN:(C?-1:1)*(1/0);h=h+Math.pow(2,i),u=u-d}return(C?-1:1)*h*Math.pow(2,u-i)},e.write=function(n,t,r,i,s,u){var h,c,a,d=u*8-s-1,f=(1<>1,I=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:u-1,v=i?1:-1,T=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,h=f):(h=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-h))<1&&(h--,a*=2),h+g>=1?t+=I/a:t+=I*Math.pow(2,1-g),t*a>=2&&(h++,a/=2),h+g>=f?(c=0,h=f):h+g>=1?(c=(t*a-1)*Math.pow(2,s),h=h+g):(c=t*Math.pow(2,g-1)*Math.pow(2,s),h=0));s>=8;n[r+C]=c&255,C+=v,c/=256,s-=8);for(h=h<0;n[r+C]=h&255,C+=v,h/=256,d-=8);n[r+C-v]|=T*128}}),$5=Qe((e,n)=>{"use strict";n.exports=r;var t=F5();function r(E){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(E)?E:new Uint8Array(E||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var i=65536*65536,s=1/i,u=12,h=typeof TextDecoder>"u"?null:new TextDecoder("utf8");r.prototype={destroy:function(){this.buf=null},readFields:function(E,B,j){for(j=j||this.length;this.pos>3,ee=this.pos;this.type=N&7,E(M,B,this),this.pos===ee&&this.skip(N)}return B},readMessage:function(E,B){return this.readFields(E,B,this.readVarint()+this.pos)},readFixed32:function(){var E=S(this.buf,this.pos);return this.pos+=4,E},readSFixed32:function(){var E=p(this.buf,this.pos);return this.pos+=4,E},readFixed64:function(){var E=S(this.buf,this.pos)+S(this.buf,this.pos+4)*i;return this.pos+=8,E},readSFixed64:function(){var E=S(this.buf,this.pos)+p(this.buf,this.pos+4)*i;return this.pos+=8,E},readFloat:function(){var E=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,E},readDouble:function(){var E=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,E},readVarint:function(E){var B=this.buf,j,N;return N=B[this.pos++],j=N&127,N<128||(N=B[this.pos++],j|=(N&127)<<7,N<128)||(N=B[this.pos++],j|=(N&127)<<14,N<128)||(N=B[this.pos++],j|=(N&127)<<21,N<128)?j:(N=B[this.pos],j|=(N&15)<<28,c(j,E,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var E=this.readVarint();return E%2===1?(E+1)/-2:E/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var E=this.readVarint()+this.pos,B=this.pos;return this.pos=E,E-B>=u&&h?V(this.buf,B,E):q(this.buf,B,E)},readBytes:function(){var E=this.readVarint()+this.pos,B=this.buf.subarray(this.pos,E);return this.pos=E,B},readPackedVarint:function(E,B){if(this.type!==r.Bytes)return E.push(this.readVarint(B));var j=a(this);for(E=E||[];this.pos127;);else if(B===r.Bytes)this.pos=this.readVarint()+this.pos;else if(B===r.Fixed32)this.pos+=4;else if(B===r.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+B)},writeTag:function(E,B){this.writeVarint(E<<3|B)},realloc:function(E){for(var B=this.length||16;B268435455||E<0){f(E,this);return}this.realloc(4),this.buf[this.pos++]=E&127|(E>127?128:0),!(E<=127)&&(this.buf[this.pos++]=(E>>>=7)&127|(E>127?128:0),!(E<=127)&&(this.buf[this.pos++]=(E>>>=7)&127|(E>127?128:0),!(E<=127)&&(this.buf[this.pos++]=E>>>7&127)))},writeSVarint:function(E){this.writeVarint(E<0?-E*2-1:E*2)},writeBoolean:function(E){this.writeVarint(!!E)},writeString:function(E){E=String(E),this.realloc(E.length*4),this.pos++;var B=this.pos;this.pos=$(this.buf,E,this.pos);var j=this.pos-B;j>=128&&C(B,j,this),this.pos=B-1,this.writeVarint(j),this.pos+=j},writeFloat:function(E){this.realloc(4),t.write(this.buf,E,this.pos,!0,23,4),this.pos+=4},writeDouble:function(E){this.realloc(8),t.write(this.buf,E,this.pos,!0,52,8),this.pos+=8},writeBytes:function(E){var B=E.length;this.writeVarint(B),this.realloc(B);for(var j=0;j=128&&C(j,N,this),this.pos=j-1,this.writeVarint(N),this.pos+=N},writeMessage:function(E,B,j){this.writeTag(E,r.Bytes),this.writeRawMessage(B,j)},writePackedVarint:function(E,B){B.length&&this.writeMessage(E,v,B)},writePackedSVarint:function(E,B){B.length&&this.writeMessage(E,T,B)},writePackedBoolean:function(E,B){B.length&&this.writeMessage(E,y,B)},writePackedFloat:function(E,B){B.length&&this.writeMessage(E,O,B)},writePackedDouble:function(E,B){B.length&&this.writeMessage(E,k,B)},writePackedFixed32:function(E,B){B.length&&this.writeMessage(E,R,B)},writePackedSFixed32:function(E,B){B.length&&this.writeMessage(E,w,B)},writePackedFixed64:function(E,B){B.length&&this.writeMessage(E,L,B)},writePackedSFixed64:function(E,B){B.length&&this.writeMessage(E,D,B)},writeBytesField:function(E,B){this.writeTag(E,r.Bytes),this.writeBytes(B)},writeFixed32Field:function(E,B){this.writeTag(E,r.Fixed32),this.writeFixed32(B)},writeSFixed32Field:function(E,B){this.writeTag(E,r.Fixed32),this.writeSFixed32(B)},writeFixed64Field:function(E,B){this.writeTag(E,r.Fixed64),this.writeFixed64(B)},writeSFixed64Field:function(E,B){this.writeTag(E,r.Fixed64),this.writeSFixed64(B)},writeVarintField:function(E,B){this.writeTag(E,r.Varint),this.writeVarint(B)},writeSVarintField:function(E,B){this.writeTag(E,r.Varint),this.writeSVarint(B)},writeStringField:function(E,B){this.writeTag(E,r.Bytes),this.writeString(B)},writeFloatField:function(E,B){this.writeTag(E,r.Fixed32),this.writeFloat(B)},writeDoubleField:function(E,B){this.writeTag(E,r.Fixed64),this.writeDouble(B)},writeBooleanField:function(E,B){this.writeVarintField(E,!!B)}};function c(E,B,j){var N=j.buf,M,ee;if(ee=N[j.pos++],M=(ee&112)>>4,ee<128||(ee=N[j.pos++],M|=(ee&127)<<3,ee<128)||(ee=N[j.pos++],M|=(ee&127)<<10,ee<128)||(ee=N[j.pos++],M|=(ee&127)<<17,ee<128)||(ee=N[j.pos++],M|=(ee&127)<<24,ee<128)||(ee=N[j.pos++],M|=(ee&1)<<31,ee<128))return d(E,M,B);throw new Error("Expected varint not more than 10 bytes")}function a(E){return E.type===r.Bytes?E.readVarint()+E.pos:E.pos+1}function d(E,B,j){return j?B*4294967296+(E>>>0):(B>>>0)*4294967296+(E>>>0)}function f(E,B){var j,N;if(E>=0?(j=E%4294967296|0,N=E/4294967296|0):(j=~(-E%4294967296),N=~(-E/4294967296),j^4294967295?j=j+1|0:(j=0,N=N+1|0)),E>=18446744073709552e3||E<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");B.realloc(10),g(j,N,B),I(N,B)}function g(E,B,j){j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos]=E&127}function I(E,B){var j=(E&7)<<4;B.buf[B.pos++]|=j|((E>>>=3)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127)))))}function C(E,B,j){var N=B<=16383?1:B<=2097151?2:B<=268435455?3:Math.floor(Math.log(B)/(Math.LN2*7));j.realloc(N);for(var M=j.pos-1;M>=E;M--)j.buf[M+N]=j.buf[M]}function v(E,B){for(var j=0;j>>8,E[j+2]=B>>>16,E[j+3]=B>>>24}function p(E,B){return(E[B]|E[B+1]<<8|E[B+2]<<16)+(E[B+3]<<24)}function q(E,B,j){for(var N="",M=B;M239?4:ee>223?3:ee>191?2:1;if(M+ae>j)break;var pe,_e,Re;ae===1?ee<128&&(oe=ee):ae===2?(pe=E[M+1],(pe&192)===128&&(oe=(ee&31)<<6|pe&63,oe<=127&&(oe=null))):ae===3?(pe=E[M+1],_e=E[M+2],(pe&192)===128&&(_e&192)===128&&(oe=(ee&15)<<12|(pe&63)<<6|_e&63,(oe<=2047||oe>=55296&&oe<=57343)&&(oe=null))):ae===4&&(pe=E[M+1],_e=E[M+2],Re=E[M+3],(pe&192)===128&&(_e&192)===128&&(Re&192)===128&&(oe=(ee&15)<<18|(pe&63)<<12|(_e&63)<<6|Re&63,(oe<=65535||oe>=1114112)&&(oe=null))),oe===null?(oe=65533,ae=1):oe>65535&&(oe-=65536,N+=String.fromCharCode(oe>>>10&1023|55296),oe=56320|oe&1023),N+=String.fromCharCode(oe),M+=ae}return N}function V(E,B,j){return h.decode(E.subarray(B,j))}function $(E,B,j){for(var N=0,M,ee;N55295&&M<57344)if(ee)if(M<56320){E[j++]=239,E[j++]=191,E[j++]=189,ee=M;continue}else M=ee-55296<<10|M-56320|65536,ee=null;else{M>56319||N+1===B.length?(E[j++]=239,E[j++]=191,E[j++]=189):ee=M;continue}else ee&&(E[j++]=239,E[j++]=191,E[j++]=189,ee=null);M<128?E[j++]=M:(M<2048?E[j++]=M>>6|192:(M<65536?E[j++]=M>>12|224:(E[j++]=M>>18|240,E[j++]=M>>12&63|128),E[j++]=M>>6&63|128),E[j++]=M&63|128)}return j}}),z5=Qe(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(h){var c=h+48;return c+=9-h>>>8&-48+65-10,String.fromCharCode(c)}function t(h){var c=h+48;return c+=9-h>>>8&-48+97-10,String.fromCharCode(c)}var r=256;function i(h){var c=r;return c+=(47-h&h-58)>>8&-r+h-48,c+=(64-h&h-71)>>8&-r+h-65+10,c+=(96-h&h-103)>>8&-r+h-97+10,c}function s(h,c){c===void 0&&(c=!1);for(var a=c?t:n,d="",f=0;f>>4),d+=a(h[f]&15);return d}e.encode=s;function u(h){if(h.length===0)return new Uint8Array(0);if(h.length%2!==0)throw new Error("hex: input string must be divisible by two");for(var c=new Uint8Array(h.length/2),a=0,d=0;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(h,c){var a=h>>>16&65535,d=h&65535,f=c>>>16&65535,g=c&65535;return d*g+(a*g+d*f<<16>>>0)|0}e.mul=Math.imul||n;function t(h,c){return h+c|0}e.add=t;function r(h,c){return h-c|0}e.sub=r;function i(h,c){return h<>>32-c}e.rotl=i;function s(h,c){return h<<32-c|h>>>c}e.rotr=s;function u(h){return typeof h=="number"&&isFinite(h)&&Math.floor(h)===h}e.isInteger=Number.isInteger||u,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(h){return e.isInteger(h)&&h>=-e.MAX_SAFE_INTEGER&&h<=e.MAX_SAFE_INTEGER}}),K5=Qe(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=H5();function t(j,N){return N===void 0&&(N=0),(j[N+0]<<8|j[N+1])<<16>>16}e.readInt16BE=t;function r(j,N){return N===void 0&&(N=0),(j[N+0]<<8|j[N+1])>>>0}e.readUint16BE=r;function i(j,N){return N===void 0&&(N=0),(j[N+1]<<8|j[N])<<16>>16}e.readInt16LE=i;function s(j,N){return N===void 0&&(N=0),(j[N+1]<<8|j[N])>>>0}e.readUint16LE=s;function u(j,N,M){return N===void 0&&(N=new Uint8Array(2)),M===void 0&&(M=0),N[M+0]=j>>>8,N[M+1]=j>>>0,N}e.writeUint16BE=u,e.writeInt16BE=u;function h(j,N,M){return N===void 0&&(N=new Uint8Array(2)),M===void 0&&(M=0),N[M+0]=j>>>0,N[M+1]=j>>>8,N}e.writeUint16LE=h,e.writeInt16LE=h;function c(j,N){return N===void 0&&(N=0),j[N]<<24|j[N+1]<<16|j[N+2]<<8|j[N+3]}e.readInt32BE=c;function a(j,N){return N===void 0&&(N=0),(j[N]<<24|j[N+1]<<16|j[N+2]<<8|j[N+3])>>>0}e.readUint32BE=a;function d(j,N){return N===void 0&&(N=0),j[N+3]<<24|j[N+2]<<16|j[N+1]<<8|j[N]}e.readInt32LE=d;function f(j,N){return N===void 0&&(N=0),(j[N+3]<<24|j[N+2]<<16|j[N+1]<<8|j[N])>>>0}e.readUint32LE=f;function g(j,N,M){return N===void 0&&(N=new Uint8Array(4)),M===void 0&&(M=0),N[M+0]=j>>>24,N[M+1]=j>>>16,N[M+2]=j>>>8,N[M+3]=j>>>0,N}e.writeUint32BE=g,e.writeInt32BE=g;function I(j,N,M){return N===void 0&&(N=new Uint8Array(4)),M===void 0&&(M=0),N[M+0]=j>>>0,N[M+1]=j>>>8,N[M+2]=j>>>16,N[M+3]=j>>>24,N}e.writeUint32LE=I,e.writeInt32LE=I;function C(j,N){N===void 0&&(N=0);var M=c(j,N),ee=c(j,N+4);return M*4294967296+ee-(ee>>31)*4294967296}e.readInt64BE=C;function v(j,N){N===void 0&&(N=0);var M=a(j,N),ee=a(j,N+4);return M*4294967296+ee}e.readUint64BE=v;function T(j,N){N===void 0&&(N=0);var M=d(j,N),ee=d(j,N+4);return ee*4294967296+M-(M>>31)*4294967296}e.readInt64LE=T;function O(j,N){N===void 0&&(N=0);var M=f(j,N),ee=f(j,N+4);return ee*4294967296+M}e.readUint64LE=O;function k(j,N,M){return N===void 0&&(N=new Uint8Array(8)),M===void 0&&(M=0),g(j/4294967296>>>0,N,M),g(j>>>0,N,M+4),N}e.writeUint64BE=k,e.writeInt64BE=k;function y(j,N,M){return N===void 0&&(N=new Uint8Array(8)),M===void 0&&(M=0),I(j>>>0,N,M),I(j/4294967296>>>0,N,M+4),N}e.writeUint64LE=y,e.writeInt64LE=y;function R(j,N,M){if(M===void 0&&(M=0),j%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(j/8>N.length-M)throw new Error("readUintBE: array is too short for the given bitLength");for(var ee=0,oe=1,ae=j/8+M-1;ae>=M;ae--)ee+=N[ae]*oe,oe*=256;return ee}e.readUintBE=R;function w(j,N,M){if(M===void 0&&(M=0),j%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(j/8>N.length-M)throw new Error("readUintLE: array is too short for the given bitLength");for(var ee=0,oe=1,ae=M;ae=ee;ae--)M[ae]=N/oe&255,oe*=256;return M}e.writeUintBE=L;function D(j,N,M,ee){if(M===void 0&&(M=new Uint8Array(j/8)),ee===void 0&&(ee=0),j%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(N))throw new Error("writeUintLE value must be an integer");for(var oe=1,ae=ee;ae{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(t){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=K5(),t=W5();e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var r=function(){function h(){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 h.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},h.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},h.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},h.prototype.update=function(c,a){if(a===void 0&&(a=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var d=0;if(this._bytesHashed+=a,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[d++],a--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(a>=this.blockSize&&(d=s(this._temp,this._state,c,d,a),a%=this.blockSize);a>0;)this._buffer[this._bufferLength++]=c[d++],a--;return this},h.prototype.finish=function(c){if(!this._finished){var a=this._bytesHashed,d=this._bufferLength,f=a/536870912|0,g=a<<3,I=a%64<56?64:128;this._buffer[d]=128;for(var C=d+1;C0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},h.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},h.prototype.cleanSavedState=function(c){t.wipe(c.state),c.buffer&&t.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},h}();e.SHA256=r;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 s(h,c,a,d,f){for(;f>=64;){for(var g=c[0],I=c[1],C=c[2],v=c[3],T=c[4],O=c[5],k=c[6],y=c[7],R=0;R<16;R++){var w=d+R*4;h[R]=n.readUint32BE(a,w)}for(var R=16;R<64;R++){var L=h[R-2],D=(L>>>17|L<<32-17)^(L>>>19|L<<32-19)^L>>>10;L=h[R-15];var S=(L>>>7|L<<32-7)^(L>>>18|L<<32-18)^L>>>3;h[R]=(D+h[R-7]|0)+(S+h[R-16]|0)}for(var R=0;R<64;R++){var D=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&O^~T&k)|0)+(y+(i[R]+h[R]|0)|0)|0,S=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&I^g&C^I&C)|0;y=k,k=O,O=T,T=v+D|0,v=C,C=I,I=g,g=D+S|0}c[0]+=g,c[1]+=I,c[2]+=C,c[3]+=v,c[4]+=T,c[5]+=O,c[6]+=k,c[7]+=y,d+=64,f-=64}return d}function u(h){var c=new r;c.update(h);var a=c.digest();return c.clean(),a}e.hash=u}),lt=Qe((e,n)=>{n.exports={options:{usePureJavaScript:!1}}}),Q5=Qe((e,n)=>{var t={};n.exports=t;var r={};t.encode=function(s,u,h){if(typeof u!="string")throw new TypeError('"alphabet" must be a string.');if(h!==void 0&&typeof h!="number")throw new TypeError('"maxline" must be a number.');var c="";if(!(s instanceof Uint8Array))c=i(s,u);else{var a=0,d=u.length,f=u.charAt(0),g=[0];for(a=0;a0;)g.push(C%d),C=C/d|0}for(a=0;s[a]===0&&a=0;--a)c+=u[g[a]]}if(h){var v=new RegExp(".{1,"+h+"}","g");c=c.match(v).join(`\r -`)}return c},t.decode=function(s,u){if(typeof s!="string")throw new TypeError('"input" must be a string.');if(typeof u!="string")throw new TypeError('"alphabet" must be a string.');var h=r[u];if(!h){h=r[u]=[];for(var c=0;c>=8;for(;C>0;)f.push(C&255),C>>=8}for(var v=0;s[v]===d&&v0;)d.push(g%c),g=g/c|0}var I="";for(h=0;s.at(h)===0&&h=0;--h)I+=u[d[h]];return I}}),Et=Qe((e,n)=>{var t=lt(),r=Q5(),i=n.exports=t.util=t.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(p){return setImmediate(p)};return}if(i.setImmediate=function(p){setTimeout(p,0)},typeof window<"u"&&typeof window.postMessage=="function"){let p=function(q){if(q.source===window&&q.data===R){q.stopPropagation();var V=w.slice();w.length=0,V.forEach(function($){$()})}};var y=p,R="forge.setImmediate",w=[];i.setImmediate=function(q){w.push(q),w.length===1&&window.postMessage(R,"*")},window.addEventListener("message",p,!0)}if(typeof MutationObserver<"u"){var L=Date.now(),D=!0,S=document.createElement("div"),w=[];new MutationObserver(function(){var q=w.slice();w.length=0,q.forEach(function(V){V()})}).observe(S,{attributes:!0});var m=i.setImmediate;i.setImmediate=function(q){Date.now()-L>15?(L=Date.now(),m(q)):(w.push(q),w.length===1&&S.setAttribute("a",D=!D))}}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(y){return Object.prototype.toString.call(y)==="[object Array]"},i.isArrayBuffer=function(y){return typeof ArrayBuffer<"u"&&y instanceof ArrayBuffer},i.isArrayBufferView=function(y){return y&&i.isArrayBuffer(y.buffer)&&y.byteLength!==void 0};function s(y){if(!(y===8||y===16||y===24||y===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+y)}i.ByteBuffer=u;function u(y){if(this.data="",this.read=0,typeof y=="string")this.data=y;else if(i.isArrayBuffer(y)||i.isArrayBufferView(y))if(typeof Buffer<"u"&&y instanceof Buffer)this.data=y.toString("binary");else{var R=new Uint8Array(y);try{this.data=String.fromCharCode.apply(null,R)}catch{for(var w=0;wh&&(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(y){return this.putBytes(String.fromCharCode(y))},i.ByteStringBuffer.prototype.fillWithByte=function(y,R){y=String.fromCharCode(y);for(var w=this.data;R>0;)R&1&&(w+=y),R>>>=1,R>0&&(y+=y);return this.data=w,this._optimizeConstructedString(R),this},i.ByteStringBuffer.prototype.putBytes=function(y){return this.data+=y,this._optimizeConstructedString(y.length),this},i.ByteStringBuffer.prototype.putString=function(y){return this.putBytes(i.encodeUtf8(y))},i.ByteStringBuffer.prototype.putInt16=function(y){return this.putBytes(String.fromCharCode(y>>8&255)+String.fromCharCode(y&255))},i.ByteStringBuffer.prototype.putInt24=function(y){return this.putBytes(String.fromCharCode(y>>16&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y&255))},i.ByteStringBuffer.prototype.putInt32=function(y){return this.putBytes(String.fromCharCode(y>>24&255)+String.fromCharCode(y>>16&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y&255))},i.ByteStringBuffer.prototype.putInt16Le=function(y){return this.putBytes(String.fromCharCode(y&255)+String.fromCharCode(y>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(y){return this.putBytes(String.fromCharCode(y&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(y){return this.putBytes(String.fromCharCode(y&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y>>16&255)+String.fromCharCode(y>>24&255))},i.ByteStringBuffer.prototype.putInt=function(y,R){s(R);var w="";do R-=8,w+=String.fromCharCode(y>>R&255);while(R>0);return this.putBytes(w)},i.ByteStringBuffer.prototype.putSignedInt=function(y,R){return y<0&&(y+=2<0);return R},i.ByteStringBuffer.prototype.getSignedInt=function(y){var R=this.getInt(y),w=2<=w&&(R-=w<<1),R},i.ByteStringBuffer.prototype.getBytes=function(y){var R;return y?(y=Math.min(this.length(),y),R=this.data.slice(this.read,this.read+y),this.read+=y):y===0?R="":(R=this.read===0?this.data:this.data.slice(this.read),this.clear()),R},i.ByteStringBuffer.prototype.bytes=function(y){return typeof y>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+y)},i.ByteStringBuffer.prototype.at=function(y){return this.data.charCodeAt(this.read+y)},i.ByteStringBuffer.prototype.setAt=function(y,R){return this.data=this.data.substr(0,this.read+y)+String.fromCharCode(R)+this.data.substr(this.read+y+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var y=i.createBuffer(this.data);return y.read=this.read,y},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(y){var R=Math.max(0,this.length()-y);return this.data=this.data.substr(this.read,R),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var y="",R=this.read;R=y)return this;R=Math.max(R||this.growSize,y);var w=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),L=new Uint8Array(this.length()+R);return L.set(w),this.data=new DataView(L.buffer),this},i.DataBuffer.prototype.putByte=function(y){return this.accommodate(1),this.data.setUint8(this.write++,y),this},i.DataBuffer.prototype.fillWithByte=function(y,R){this.accommodate(R);for(var w=0;w>8&65535),this.data.setInt8(this.write,y>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(y){return this.accommodate(4),this.data.setInt32(this.write,y),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(y){return this.accommodate(2),this.data.setInt16(this.write,y,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(y){return this.accommodate(3),this.data.setInt8(this.write,y>>16&255),this.data.setInt16(this.write,y>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(y){return this.accommodate(4),this.data.setInt32(this.write,y,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(y,R){s(R),this.accommodate(R/8);do R-=8,this.data.setInt8(this.write++,y>>R&255);while(R>0);return this},i.DataBuffer.prototype.putSignedInt=function(y,R){return s(R),this.accommodate(R/8),y<0&&(y+=2<0);return R},i.DataBuffer.prototype.getSignedInt=function(y){var R=this.getInt(y),w=2<=w&&(R-=w<<1),R},i.DataBuffer.prototype.getBytes=function(y){var R;return y?(y=Math.min(this.length(),y),R=this.data.slice(this.read,this.read+y),this.read+=y):y===0?R="":(R=this.read===0?this.data:this.data.slice(this.read),this.clear()),R},i.DataBuffer.prototype.bytes=function(y){return typeof y>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+y)},i.DataBuffer.prototype.at=function(y){return this.data.getUint8(this.read+y)},i.DataBuffer.prototype.setAt=function(y,R){return this.data.setUint8(y,R),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 y=new Uint8Array(this.data.buffer,this.read),R=new Uint8Array(y.byteLength);R.set(y),this.data=new DataView(R),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(y){return this.write=Math.max(0,this.length()-y),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var y="",R=this.read;R0;)R&1&&(w+=y),R>>>=1,R>0&&(y+=y);return w},i.xorBytes=function(y,R,w){for(var L="",D="",S="",m=0,p=0;w>0;--w,++m)D=y.charCodeAt(m)^R.charCodeAt(m),p>=10&&(L+=S,S="",p=0),S+=String.fromCharCode(D),++p;return L+=S,L},i.hexToBytes=function(y){var R="",w=0;for(y.length&!0&&(w=1,R+=String.fromCharCode(parseInt(y[0],16)));w>24&255)+String.fromCharCode(y>>16&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y&255)};var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[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],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(y,R){for(var w="",L="",D,S,m,p=0;p>2),w+=a.charAt((D&3)<<4|S>>4),isNaN(S)?w+="==":(w+=a.charAt((S&15)<<2|m>>6),w+=isNaN(m)?"=":a.charAt(m&63)),R&&w.length>R&&(L+=w.substr(0,R)+`\r +`)}`}}},LI=class extends Sr{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Dc=class extends Sr{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},NI=class extends Sr{constructor(e,n){super(e.message,e,n),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},Bm=class extends Sr{constructor(e,n){super(e.message,e,n),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},xI=class extends Sr{constructor(e,n,t){super(e.message,e,t),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}},Lm=class extends Sr{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}},UI=class extends Sr{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},DI=class extends Sr{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},G1=xt(require("node:process"),1),vd=require("node:buffer"),jI=require("node:stream"),Nm=require("node:url"),bd=xt(require("node:http"),1),qI=xt(Jm(),1),MI=xt(op(),1),VI=require("node:buffer"),FI=require("node:util");function Q1(e){return W.nodeStream(e)&&W.function_(e.getBoundary)}async function $I(e,n){if(n&&"content-length"in n)return Number(n["content-length"]);if(!e)return 0;if(W.string(e))return VI.Buffer.byteLength(e);if(W.buffer(e))return e.length;if(Q1(e))return(0,FI.promisify)(e.getLength.bind(e))()}function Y1(e,n,t){let r={};for(let i of t){let s=(...u)=>{n.emit(i,...u)};r[i]=s,e.on(i,s)}return()=>{for(let[i,s]of Object.entries(r))e.off(i,s)}}var zI=xt(require("node:net"),1);function HI(){let e=[];return{once(n,t,r){n.once(t,r),e.push({origin:n,event:t,fn:r})},unhandleAll(){for(let n of e){let{origin:t,event:r,fn:i}=n;t.removeListener(r,i)}e.length=0}}}var xm=Symbol("reentry"),KI=()=>{},X1=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 WI(e,n,t){if(xm in e)return KI;e[xm]=!0;let r=[],{once:i,unhandleAll:s}=HI(),u=(v,T,O)=>{let k=setTimeout(T,v,v,O);k.unref?.();let y=()=>{clearTimeout(k)};return r.push(y),y},{host:h,hostname:c}=t,a=(v,T)=>{e.destroy(new X1(v,T))},d=()=>{for(let v of r)v();s()};if(e.once("error",v=>{if(d(),e.listenerCount("error")===0)throw v}),typeof n.request<"u"){let v=u(n.request,a,"request");i(e,"response",T=>{i(T,"end",v)})}if(typeof n.socket<"u"){let{socket:v}=n,T=()=>{a(v,"socket")};e.setTimeout(v,T),r.push(()=>{e.removeListener("timeout",T)})}let f=typeof n.lookup<"u",g=typeof n.connect<"u",I=typeof n.secureConnect<"u",C=typeof n.send<"u";return(f||g||I||C)&&i(e,"socket",v=>{let{socketPath:T}=e;if(v.connecting){let O=!!(T??zI.default.isIP(c??h??"")!==0);if(f&&!O&&typeof v.address().address>"u"){let k=u(n.lookup,a,"lookup");i(v,"lookup",k)}if(g){let k=()=>u(n.connect,a,"connect");O?i(v,"connect",k()):i(v,"lookup",y=>{y===null&&i(v,"connect",k())})}I&&t.protocol==="https:"&&i(v,"connect",()=>{let k=u(n.secureConnect,a,"secureConnect");i(v,"secureConnect",k)})}if(C){let O=()=>u(n.send,a,"send");v.connecting?i(v,"connect",()=>{i(e,"upload-complete",O())}):i(e,"upload-complete",O())}}),typeof n.response<"u"&&i(e,"upload-complete",()=>{let v=u(n.response,a,"response");i(e,"response",v)}),typeof n.read<"u"&&i(e,"response",v=>{let T=u(n.read,a,"read");i(v,"end",T)}),d}function GI(e){e=e;let n={protocol:e.protocol,hostname:W.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 W.string(e.port)&&e.port.length>0&&(n.port=Number(e.port)),(e.username||e.password)&&(n.auth=`${e.username||""}:${e.password||""}`),n}var QI=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)}},YI=({attemptCount:e,retryOptions:n,error:t,retryAfter:r,computedValue:i})=>{if(t.name==="RetryError")return 1;if(e>n.limit)return 0;let s=n.methods.includes(t.options.method),u=n.errorCodes.includes(t.code),h=t.response&&n.statusCodes.includes(t.response.statusCode);if(!s||!u&&!h)return 0;if(t.response){if(r)return r>i?0:r;if(t.response.statusCode===413)return 0}let c=Math.random()*n.noise;return Math.min(2**(e-1)*1e3,n.backoffLimit)+c},XI=YI,JI=xt(require("node:process"),1),_d=require("node:util"),Ra=require("node:url"),ZI=require("node:tls"),e5=xt(require("node:http"),1),t5=xt(require("node:https"),1),r5=xt(lv(),1);function n5(e){let n=[],t=e.split(",");for(let r of t){let[i,...s]=r.split(";"),u=i.trim();if(u[0]!=="<"||u[u.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${u}`);let h=u.slice(1,-1),c={};if(s.length===0)throw new Error(`Unexpected end of Link header parameters: ${s.join(";")}`);for(let a of s){let d=a.trim(),f=d.indexOf("=");if(f===-1)throw new Error(`Failed to parse Link header: ${e}`);let g=d.slice(0,f).trim(),I=d.slice(f+1).trim();c[g]=I}n.push({reference:h,parameters:c})}return n}var[Um,i5]=JI.default.versions.node.split(".").map(Number);function o5(e){for(let n in e){let t=e[n];le.any([W.string,W.number,W.boolean,W.null_,W.undefined],t)}}var a5=new Map,wd,s5=()=>wd||(wd=new Dv,wd),u5={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 t=n5(n).find(r=>r.parameters.rel==="next"||r.parameters.rel==='"next"');return t?{url:new Ra.URL(t.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},l5=e=>{let{hooks:n,retry:t}=e,r={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...t,errorCodes:[...t.errorCodes],methods:[...t.methods],statusCodes:[...t.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 Ra.URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return r.url!==void 0&&(r.prefixUrl=""),r},c5=e=>{let{hooks:n,retry:t}=e,r={...e};return W.object(e.context)&&(r.context={...e.context}),W.object(e.cacheOptions)&&(r.cacheOptions={...e.cacheOptions}),W.object(e.https)&&(r.https={...e.https}),W.object(e.cacheOptions)&&(r.cacheOptions={...r.cacheOptions}),W.object(e.agent)&&(r.agent={...e.agent}),W.object(e.headers)&&(r.headers={...e.headers}),W.object(t)&&(r.retry={...t},W.array(t.errorCodes)&&(r.retry.errorCodes=[...t.errorCodes]),W.array(t.methods)&&(r.retry.methods=[...t.methods]),W.array(t.statusCodes)&&(r.retry.statusCodes=[...t.statusCodes])),W.object(e.timeout)&&(r.timeout={...e.timeout}),W.object(n)&&(r.hooks={...n},W.array(n.init)&&(r.hooks.init=[...n.init]),W.array(n.beforeRequest)&&(r.hooks.beforeRequest=[...n.beforeRequest]),W.array(n.beforeError)&&(r.hooks.beforeError=[...n.beforeError]),W.array(n.beforeRedirect)&&(r.hooks.beforeRedirect=[...n.beforeRedirect]),W.array(n.beforeRetry)&&(r.hooks.beforeRetry=[...n.beforeRetry]),W.array(n.afterResponse)&&(r.hooks.afterResponse=[...n.afterResponse])),W.object(e.pagination)&&(r.pagination={...e.pagination}),r},h5=e=>{let n=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(t=>typeof t=="number");if(n.length>0)return Math.min(...n)},Dm=(e,n,t)=>{let r=e.hooks?.init;if(r)for(let i of r)i(n,t)},uo=class{constructor(e,n,t){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}),le.any([W.string,W.urlInstance,W.object,W.undefined],e),le.any([W.object,W.undefined],n),le.any([W.object,W.undefined],t),e instanceof uo||n instanceof uo)throw new TypeError("The defaults must be passed as the third argument");this._internals=l5(t?._internals??t??u5),this._init=[...t?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(W.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(r){throw r.options=this,r}}merge(e){if(e){if(e instanceof uo){for(let n of e._init)this.merge(n);return}e=c5(e),Dm(this,e,this),Dm(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let n=!1;for(let t in e)if(!(t==="mutableDefaults"||t==="handlers")&&t!=="url"){if(!(t in this))throw new Error(`Unexpected option: ${t}`);this[t]=e[t],n=!0}n&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){le.any([W.function_,W.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.agent))throw new TypeError(`Unexpected agent option: ${n}`);le.any([W.object,W.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){le.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){le.plainObject(e);for(let n in e){if(!(n in this._internals.timeout))throw new Error(`Unexpected timeout option: ${n}`);le.any([W.number,W.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(le.any([W.string,W.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){le.any([W.string,W.buffer,W.nodeStream,W.generator,W.asyncGenerator,Mu,W.undefined],e),W.nodeStream(e)&&le.truthy(e.readable),e!==void 0&&(le.undefined(this._internals.form),le.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){le.any([W.plainObject,W.undefined],e),e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(le.undefined(this._internals.body),le.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(le.any([W.string,W.urlInstance,W.undefined],e),e===void 0){this._internals.url=void 0;return}if(W.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let n=`${this.prefixUrl}${e.toString()}`,t=new Ra.URL(n);if(this._internals.url=t,t.protocol==="unix:"&&(t.href=`http://unix${t.pathname}${t.search}`),t.protocol!=="http:"&&t.protocol!=="https:"){let r=new Error(`Unsupported protocol: ${t.protocol}`);throw r.code="ERR_UNSUPPORTED_PROTOCOL",r}if(this._internals.username&&(t.username=this._internals.username,this._internals.username=""),this._internals.password&&(t.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(t.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),t.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let r=/(?.+?):(?.+)/.exec(`${t.pathname}${t.search}`);if(r?.groups){let{socketPath:i,path:s}=r.groups;this._unixOptions={socketPath:i,path:s,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(le.any([W.object,W.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:n,getCookieString:t}=e;le.function_(n),le.function_(t),n.length===4&&t.length===0?(n=(0,_d.promisify)(n.bind(e)),t=(0,_d.promisify)(t.bind(e)),this._internals.cookieJar={setCookie:n,getCookieString:t}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){le.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){le.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 Ra.URLSearchParams),this._internals.searchParams)}set searchParams(e){le.any([W.string,W.object,W.undefined],e);let n=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,n&&(n.search="");return}let t=this.searchParams,r;if(W.string(e))r=new Ra.URLSearchParams(e);else if(e instanceof Ra.URLSearchParams)r=e;else{o5(e),r=new Ra.URLSearchParams;for(let i in e){let s=e[i];s===null?r.append(i,""):s===void 0?t.delete(i):r.append(i,s)}}if(this._merging){for(let i of r.keys())t.delete(i);for(let[i,s]of r)t.append(i,s)}else n?n.search=t.toString():this._internals.searchParams=t}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){le.any([W.function_,W.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){le.any([W.object,W.boolean,W.undefined],e),e===!0?this._internals.dnsCache=s5():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){le.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){le.object(e);for(let n in e){if(!(n in this._internals.hooks))throw new Error(`Unexpected hook event: ${n}`);let t=n,r=e[t];if(le.any([W.array,W.undefined],r),r)for(let i of r)le.function_(i);if(this._merging)r&&this._internals.hooks[t].push(...r);else{if(!r)throw new Error(`Missing hook event: ${n}`);this._internals.hooks[n]=[...r]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){le.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){le.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){le.any([W.object,W.string,W.boolean,W.undefined],e),e===!0?this._internals.cache=a5:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){le.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){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.username=t:this._internals.username=t}get password(){let e=this._internals.url,n=e?e.password:this._internals.password;return decodeURIComponent(n)}set password(e){le.string(e);let n=this._internals.url,t=encodeURIComponent(e);n?n.password=t:this._internals.password=t}get http2(){return this._internals.http2}set http2(e){le.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){le.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){le.plainObject(e),this._merging?Object.assign(this._internals.headers,Au(e)):this._internals.headers=Au(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){le.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){le.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){le.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(le.plainObject(e),le.any([W.function_,W.undefined],e.calculateDelay),le.any([W.number,W.undefined],e.maxRetryAfter),le.any([W.number,W.undefined],e.limit),le.any([W.array,W.undefined],e.methods),le.any([W.array,W.undefined],e.statusCodes),le.any([W.array,W.undefined],e.errorCodes),le.any([W.number,W.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 t in e)if(!(t in this._internals.retry))throw new Error(`Unexpected retry option: ${t}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:n}=this._internals;n.methods=[...new Set(n.methods.map(t=>t.toUpperCase()))],n.statusCodes=[...new Set(n.statusCodes)],n.errorCodes=[...new Set(n.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){le.any([W.string,W.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){le.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){le.any([W.function_,W.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){le.plainObject(e),le.any([W.boolean,W.undefined],e.shared),le.any([W.number,W.undefined],e.cacheHeuristic),le.any([W.number,W.undefined],e.immutableMinTimeToLive),le.any([W.boolean,W.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){le.plainObject(e),le.any([W.boolean,W.undefined],e.rejectUnauthorized),le.any([W.function_,W.undefined],e.checkServerIdentity),le.any([W.string,W.object,W.array,W.undefined],e.certificateAuthority),le.any([W.string,W.object,W.array,W.undefined],e.key),le.any([W.string,W.object,W.array,W.undefined],e.certificate),le.any([W.string,W.undefined],e.passphrase),le.any([W.string,W.buffer,W.array,W.undefined],e.pfx),le.any([W.array,W.undefined],e.alpnProtocols),le.any([W.string,W.undefined],e.ciphers),le.any([W.string,W.buffer,W.undefined],e.dhparam),le.any([W.string,W.undefined],e.signatureAlgorithms),le.any([W.string,W.undefined],e.minVersion),le.any([W.string,W.undefined],e.maxVersion),le.any([W.boolean,W.undefined],e.honorCipherOrder),le.any([W.number,W.undefined],e.tlsSessionLifetime),le.any([W.string,W.undefined],e.ecdhCurve),le.any([W.string,W.buffer,W.array,W.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");le.any([W.string,W.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){le.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){le.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){le.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){le.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){le.any([W.number,W.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){le.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,n){return(0,_d.inspect)(this._internals,n)}createNativeRequestOptions(){let e=this._internals,n=e.url,t;n.protocol==="https:"?t=e.http2?e.agent:e.agent.https:t=e.agent.http;let{https:r}=e,{pfx:i}=r;return W.array(i)&&W.plainObject(i[0])&&(i=i.map(s=>({buf:s.buffer,passphrase:s.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:r.alpnProtocols,ca:r.certificateAuthority,cert:r.certificate,key:r.key,passphrase:r.passphrase,pfx:r.pfx,rejectUnauthorized:r.rejectUnauthorized,checkServerIdentity:r.checkServerIdentity??ZI.checkServerIdentity,ciphers:r.ciphers,honorCipherOrder:r.honorCipherOrder,minVersion:r.minVersion,maxVersion:r.maxVersion,sigalgs:r.signatureAlgorithms,sessionTimeout:r.tlsSessionLifetime,dhparam:r.dhparam,ecdhCurve:r.ecdhCurve,crl:r.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:t,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?h5(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(Um<15||Um===15&&i5<10){let n=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw n.code="EUNSUPPORTED",n}return r5.default.auto}return t5.default.request}return e5.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)}},jc=e=>{let{statusCode:n}=e,t=e.request.options.followRedirect?299:399;return n>=200&&n<=t||n===304},jm=class extends Sr{constructor(e,n){let{options:t}=n.request;super(`${e.message} in "${t.url.toString()}"`,e,n.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},qm=(e,n,t,r)=>{let{rawBody:i}=e;try{if(n==="text")return i.toString(r);if(n==="json")return i.length===0?"":t(i.toString(r));if(n==="buffer")return i}catch(s){throw new jm(s,e)}throw new jm({message:`Unknown body type '${n}'`,name:"Error"},e)};function f5(e){return e.writable&&!e.writableEnded}var d5=f5;function Mm(e){return e.protocol==="unix:"||e.hostname==="unix"}var p5=W.string(G1.default.versions.brotli),y5=new Set(["GET","HEAD"]),Ed=new QI,g5=new Set([300,301,302,303,304,307,308]),m5=["socket","connect","continue","information","upgrade"],yc=()=>{},qp=class extends jI.Duplex{constructor(e,n,t){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,"_removeListeners",{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=yc,this._triggerRead=!1,this._cancelTimeouts=yc,this._removeListeners=yc,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=yc,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 uo(e,n,t),!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:s}=i;s&&(this.options=s),this.flush=async()=>{this.flush=async()=>{},this.destroy(i)};return}let{body:r}=this.options;if(W.nodeStream(r)&&r.once("error",i=>{this._flushed?this._beforeError(new Bm(i,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new Bm(i,this))}}),this.options.signal){let i=()=>{this.destroy(new DI(this))};this.options.signal.aborted?i():(this.options.signal.addEventListener("abort",i),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",i)})}}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:t}=this,r=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Sr||(e=new Sr(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 s;try{let u;n&&"retry-after"in n.headers&&(u=Number(n.headers["retry-after"]),Number.isNaN(u)?(u=Date.parse(n.headers["retry-after"])-Date.now(),u<=0&&(u=1)):u*=1e3);let h=t.retry;s=await h.calculateDelay({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:XI({attemptCount:r,retryOptions:h,error:i,retryAfter:u,computedValue:h.maxRetryAfter??t.timeout.request??Number.POSITIVE_INFINITY})})}catch(u){this._error(new Sr(u.message,u,this));return}if(s){if(await new Promise(u=>{let h=setTimeout(u,s);this._stopRetry=()=>{clearTimeout(h),u()}}),this.destroyed)return;try{for(let u of this.options.hooks.beforeRetry)await u(i,this.retryCount+1)}catch(u){this._error(new Sr(u.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,u=>{let h=new qp(t.url,u,t);return h.retryCount=this.retryCount+1,G1.default.nextTick(()=>{h.flush()}),h});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 t=this.downloadProgress;t.percent<1&&this.emit("downloadProgress",t),this.push(n)}}}_write(e,n,t){let r=()=>{this._writeRequest(e,n,t)};this._requestInitialized?r():this._jobs.push(r)}_final(e){let n=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(t=>{this._request._writableState?.errored||(t||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(t))})};this._requestInitialized?n():this._jobs.push(n)}_destroy(e,n){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:t}=this.options;W.nodeStream(t)&&t.destroy()}this._request&&this._request.destroy(),e!==null&&!W.undefined(e)&&!(e instanceof Sr)&&(e=new Sr(e.message,e,this)),n(e)}pipe(e,n){return e instanceof bd.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,n)}unpipe(e){return e instanceof bd.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:n}=e,t=!W.undefined(e.form),r=!W.undefined(e.json),i=!W.undefined(e.body),s=y5.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=s,t||r||i){if(s)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let u=!W.string(n["content-type"]);if(i){if(Mu(e.body)){let c=new Lv(e.body);u&&(n["content-type"]=c.headers["Content-Type"]),"Content-Length"in c.headers&&(n["content-length"]=c.headers["Content-Length"]),e.body=c.encode()}Q1(e.body)&&u&&(n["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(t){u&&(n["content-type"]="application/x-www-form-urlencoded");let{form:c}=e;e.form=void 0,e.body=new Nm.URLSearchParams(c).toString()}else{u&&(n["content-type"]="application/json");let{json:c}=e;e.json=void 0,e.body=e.stringifyJson(c)}let h=await $I(e.body,e.headers);W.undefined(n["content-length"])&&W.undefined(n["transfer-encoding"])&&!s&&!W.undefined(h)&&(n["content-length"]=String(h))}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:t}=n;this._nativeResponse=e,n.decompress&&(e=(0,qI.default)(e));let r=e.statusCode,i=e;i.statusMessage=i.statusMessage??bd.default.STATUS_CODES[r],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=jc(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",u=>{this._aborted=!0,e.destroy(),this._beforeError(new Lm(u,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new Lm({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let s=e.headers["set-cookie"];if(W.object(n.cookieJar)&&s){let u=s.map(async h=>n.cookieJar.setCookie(h,t.toString()));n.ignoreInvalidCookies&&(u=u.map(async h=>{try{await h}catch{}}));try{await Promise.all(u)}catch(h){this._beforeError(h);return}}if(!this.isAborted){if(n.followRedirect&&e.headers.location&&g5.has(r)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=n.maxRedirects){this._beforeError(new LI(this));return}this._request=void 0;let u=new uo(void 0,void 0,this.options),h=r===303&&u.method!=="GET"&&u.method!=="HEAD",c=r!==307&&r!==308,a=u.methodRewriting&&c;(h||a)&&(u.method="GET",u.body=void 0,u.json=void 0,u.form=void 0,delete u.headers["content-length"]);try{let d=vd.Buffer.from(e.headers.location,"binary").toString(),f=new Nm.URL(d,t);if(!Mm(t)&&Mm(f)){this._beforeError(new Sr("Cannot redirect to UNIX socket",{},this));return}f.hostname!==t.hostname||f.port!==t.port?("host"in u.headers&&delete u.headers.host,"cookie"in u.headers&&delete u.headers.cookie,"authorization"in u.headers&&delete u.headers.authorization,(u.username||u.password)&&(u.username="",u.password="")):(f.username=u.username,f.password=u.password),this.redirectUrls.push(f),u.prefixUrl="",u.url=f;for(let g of u.hooks.beforeRedirect)await g(u,i);this.emit("redirect",u,i),this.options=u,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(n.isStream&&n.throwHttpErrors&&!jc(i)){this._beforeError(new Dc(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 u of this._pipedServerResponses)if(!u.headersSent){for(let h in e.headers){let c=n.decompress?h!=="content-encoding":!0,a=e.headers[h];c&&u.setHeader(h,a)}u.statusCode=r}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let n=await(0,MI.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:t,url:r}=n;Ov(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=WI(e,t,r);let i=n.cache?"cacheableResponse":"response";e.once(i,s=>{this._onResponse(s)}),e.once("error",s=>{this._aborted=!0,e.destroy(),s=s instanceof X1?new xI(s,this.timings,this):new Sr(s.message,s,this),this._beforeError(s)}),this._unproxyEvents=Y1(e,this,m5),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((n,t)=>{super.write(e,r=>{if(r){t(r);return}n()})})}_sendBody(){let{body:e}=this.options,n=this.redirectUrls.length===0?this:this._request??this;W.nodeStream(e)?e.pipe(n):W.generator(e)||W.asyncGenerator(e)?(async()=>{try{for await(let t of e)await this._asyncWrite(t);super.end()}catch(t){this._beforeError(t)}})():W.undefined(e)?(this._cannotHaveBody||this._noPipe)&&n.end():(this._writeRequest(e,void 0,()=>{}),n.end())}_prepareCache(e){if(!Ed.has(e)){let n=new Bv((t,r)=>{let i=t._request(t,r);return W.promise(i)&&(i.once=(s,u)=>{if(s==="error")(async()=>{try{await i}catch(h){u(h)}})();else if(s==="abort")(async()=>{try{(await i).once("abort",u)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${s}`);return i}),i},e);Ed.set(e,n.request())}}async _createCacheableRequest(e,n){return new Promise((t,r)=>{Object.assign(n,GI(e));let i,s=Ed.get(n.cache)(n,async u=>{if(u._readableState.autoDestroy=!1,i){let h=()=>{u.req&&(u.complete=u.req.res.complete)};u.prependOnceListener("end",h),h(),(await i).emit("cacheableResponse",u)}t(u)});s.once("error",r),s.once("request",async u=>{i=u,t(i)})})}async _makeRequest(){let{options:e}=this,{headers:n,username:t,password:r}=e,i=e.cookieJar;for(let c in n)if(W.undefined(n[c]))delete n[c];else if(W.null_(n[c]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${c}\` header`);if(e.decompress&&W.undefined(n["accept-encoding"])&&(n["accept-encoding"]=p5?"gzip, deflate, br":"gzip, deflate"),t||r){let c=vd.Buffer.from(`${t}:${r}`).toString("base64");n.authorization=`Basic ${c}`}if(i){let c=await i.getCookieString(e.url.toString());W.nonEmptyString(c)&&(n.cookie=c)}e.prefixUrl="";let s;for(let c of e.hooks.beforeRequest){let a=await c(e);if(!W.undefined(a)){s=()=>a;break}}s||(s=e.getRequestFunction());let u=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=s,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let h=e.cache?this._createCacheableRequest:s;try{let c=h(u,this._requestOptions);W.promise(c)&&(c=await c),W.undefined(c)&&(c=e.getFallbackRequestFunction()(u,this._requestOptions),W.promise(c)&&(c=await c)),d5(c)?this._onRequest(c):this.writable?(this.once("finish",()=>{this._onResponse(c)}),this._sendBody()):this._onResponse(c)}catch(c){throw c instanceof ds?new NI(c,this):c}}async _error(e){try{if(!(e instanceof Dc&&!this.options.throwHttpErrors))for(let n of this.options.hooks.beforeError)e=await n(e)}catch(n){e=new Sr(n.message,n,this)}this.destroy(e)}_writeRequest(e,n,t){!this._request||this._request.destroyed||this._request.write(e,n,r=>{if(!r&&!this._request.destroyed){this._uploadedSize+=vd.Buffer.byteLength(e,n);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}t(r)})}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}},v5=class extends Sr{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},b5=["request","response","redirect","uploadProgress","downloadProgress"];function Vm(e){let n,t,r,i=new PI.EventEmitter,s=new Gc((h,c,a)=>{a(()=>{n.destroy()}),a.shouldReject=!1,a(()=>{c(new v5(n))});let d=f=>{a(()=>{});let g=e??new qp(void 0,void 0,r);g.retryCount=f,g._noPipe=!0,n=g,g.once("response",async v=>{let T=(v.headers["content-encoding"]??"").toLowerCase(),O=T==="gzip"||T==="deflate"||T==="br",{options:k}=g;if(O&&!k.decompress)v.body=v.rawBody;else try{v.body=qm(v,k.responseType,k.parseJson,k.encoding)}catch(y){if(v.body=v.rawBody.toString(),jc(v)){g._beforeError(y);return}}try{let y=k.hooks.afterResponse;for(let[R,w]of y.entries())if(v=await w(v,async L=>{throw k.merge(L),k.prefixUrl="",L.url&&(k.url=L.url),k.hooks.afterResponse=k.hooks.afterResponse.slice(0,R),new UI(g)}),!(W.object(v)&&W.number(v.statusCode)&&!W.nullOrUndefined(v.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(y){g._beforeError(y);return}if(t=v,!jc(v)){g._beforeError(new Dc(v));return}g.destroy(),h(g.options.resolveBodyOnly?v.body:v)});let I=v=>{if(s.isCanceled)return;let{options:T}=g;if(v instanceof Dc&&!T.throwHttpErrors){let{response:O}=v;g.destroy(),h(g.options.resolveBodyOnly?O.body:O);return}c(v)};g.once("error",I);let C=g.options?.body;g.once("retry",(v,T)=>{e=void 0;let O=g.options.body;if(C===O&&W.nodeStream(O)){T.message="Cannot retry with consumed body stream",I(T);return}r=g.options,d(v)}),Y1(g,i,b5),W.undefined(e)&&g.flush()};d(0)});s.on=(h,c)=>(i.on(h,c),s),s.off=(h,c)=>(i.off(h,c),s);let u=h=>{let c=(async()=>{await s;let{options:a}=t.request;return qm(t,h,a.parseJson,a.encoding)})();return Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)),c};return s.json=()=>{if(n.options){let{headers:h}=n.options;!n.writableFinished&&!("accept"in h)&&(h.accept="application/json")}return u("json")},s.buffer=()=>u("buffer"),s.text=()=>u("text"),s}var _5=async e=>new Promise(n=>{setTimeout(n,e)}),w5=e=>W.function_(e),E5=["get","post","put","patch","head","delete"],J1=e=>{e={options:new uo(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let n=(r,i,s=e.options)=>{let u=new qp(r,i,s),h,c=f=>(u.options=f,u._noPipe=!f.isStream,u.flush(),f.isStream?u:(h||(h=Vm(u)),h)),a=0,d=f=>{let g=(e.handlers[a++]??c)(f,d);if(W.promise(g)&&!u.options.isStream&&(h||(h=Vm(u)),g!==h)){let I=Object.getOwnPropertyDescriptors(h);for(let C in I)C in g&&delete I[C];Object.defineProperties(g,I),g.cancel=h.cancel}return g};return d(u.options)};n.extend=(...r)=>{let i=new uo(void 0,void 0,e.options),s=[...e.handlers],u;for(let h of r)w5(h)?(i.merge(h.defaults.options),s.push(...h.defaults.handlers),u=h.defaults.mutableDefaults):(i.merge(h),h.handlers&&s.push(...h.handlers),u=h.mutableDefaults);return J1({options:i,handlers:s,mutableDefaults:!!u})};let t=async function*(r,i){let s=new uo(r,i,e.options);s.resolveBodyOnly=!1;let{pagination:u}=s;le.function_(u.transform),le.function_(u.shouldContinue),le.function_(u.filter),le.function_(u.paginate),le.number(u.countLimit),le.number(u.requestLimit),le.number(u.backoff);let h=[],{countLimit:c}=u,a=0;for(;a{let s=[];for await(let u of t(r,i))s.push(u);return s},n.paginate.each=t,n.stream=(r,i)=>n(r,{...i,isStream:!0});for(let r of E5)n[r]=(i,s)=>n(i,{...s,method:r}),n.stream[r]=(i,s)=>n(i,{...s,method:r,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},S5=J1,C5={options:new uo,handlers:[],mutableDefaults:!1},T5=S5(C5),zd=T5,R5=require("module"),qc=require("path"),Z1=require("crypto"),I5=Object.create,eb=Object.defineProperty,A5=Object.getOwnPropertyDescriptor,k5=Object.getOwnPropertyNames,O5=Object.getPrototypeOf,P5=Object.prototype.hasOwnProperty,bs=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Qe=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),B5=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of k5(n))!P5.call(e,i)&&i!==t&&eb(e,i,{get:()=>n[i],enumerable:!(r=A5(n,i))||r.enumerable});return e},As=(e,n,t)=>(t=e!=null?I5(O5(e)):{},B5(n||!e||!e.__esModule?eb(t,"default",{value:e,enumerable:!0}):t,e)),L5=Qe((e,n)=>{(function(t,r){typeof e=="object"&&typeof n<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.WebStreamsPolyfill={}))})(e,function(t){"use strict";let r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:_=>`Symbol(${_})`;function i(){}function s(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}let u=s();function h(_){return typeof _=="object"&&_!==null||typeof _=="function"}let c=i,a=Promise,d=Promise.prototype.then,f=Promise.resolve.bind(a),g=Promise.reject.bind(a);function I(_){return new a(_)}function C(_){return f(_)}function v(_){return g(_)}function T(_,P,H){return d.call(_,P,H)}function O(_,P,H){T(T(_,P,H),void 0,c)}function k(_,P){O(_,P)}function y(_,P){O(_,void 0,P)}function R(_,P,H){return T(_,P,H)}function w(_){T(_,void 0,c)}let L=(()=>{let _=u&&u.queueMicrotask;if(typeof _=="function")return _;let P=C(void 0);return H=>T(P,H)})();function D(_,P,H){if(typeof _!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(_,P,H)}function S(_,P,H){try{return C(D(_,P,H))}catch(re){return v(re)}}let m=16384;class p{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(P){let H=this._back,re=H;H._elements.length===m-1&&(re={_elements:[],_next:void 0}),H._elements.push(P),re!==H&&(this._back=re,H._next=re),++this._size}shift(){let P=this._front,H=P,re=this._cursor,de=re+1,ve=P._elements,Oe=ve[re];return de===m&&(H=P._next,de=0),--this._size,this._cursor=de,P!==H&&(this._front=H),ve[re]=void 0,Oe}forEach(P){let H=this._cursor,re=this._front,de=re._elements;for(;(H!==de.length||re._next!==void 0)&&!(H===de.length&&(re=re._next,de=re._elements,H=0,de.length===0));)P(de[H]),++H}peek(){let P=this._front,H=this._cursor;return P._elements[H]}}function q(_,P){_._ownerReadableStream=P,P._reader=_,P._state==="readable"?B(_):P._state==="closed"?N(_):j(_,P._storedError)}function V(_,P){let H=_._ownerReadableStream;return Ke(H,P)}function $(_){_._ownerReadableStream._state==="readable"?M(_,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ee(_,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),_._ownerReadableStream._reader=void 0,_._ownerReadableStream=void 0}function E(_){return new TypeError("Cannot "+_+" a stream using a released reader")}function B(_){_._closedPromise=I((P,H)=>{_._closedPromise_resolve=P,_._closedPromise_reject=H})}function j(_,P){B(_),M(_,P)}function N(_){B(_),oe(_)}function M(_,P){_._closedPromise_reject!==void 0&&(w(_._closedPromise),_._closedPromise_reject(P),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0)}function ee(_,P){j(_,P)}function oe(_){_._closedPromise_resolve!==void 0&&(_._closedPromise_resolve(void 0),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0)}let ae=r("[[AbortSteps]]"),pe=r("[[ErrorSteps]]"),_e=r("[[CancelSteps]]"),Re=r("[[PullSteps]]"),qe=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},Ce=Math.trunc||function(_){return _<0?Math.ceil(_):Math.floor(_)};function $e(_){return typeof _=="object"||typeof _=="function"}function Ie(_,P){if(_!==void 0&&!$e(_))throw new TypeError(`${P} is not an object.`)}function et(_,P){if(typeof _!="function")throw new TypeError(`${P} is not a function.`)}function Je(_){return typeof _=="object"&&_!==null||typeof _=="function"}function x(_,P){if(!Je(_))throw new TypeError(`${P} is not an object.`)}function X(_,P,H){if(_===void 0)throw new TypeError(`Parameter ${P} is required in '${H}'.`)}function Q(_,P,H){if(_===void 0)throw new TypeError(`${P} is required in '${H}'.`)}function A(_){return Number(_)}function K(_){return _===0?0:_}function se(_){return K(Ce(_))}function te(_,P){let H=Number.MAX_SAFE_INTEGER,re=Number(_);if(re=K(re),!qe(re))throw new TypeError(`${P} is not a finite number`);if(re=se(re),re<0||re>H)throw new TypeError(`${P} is outside the accepted range of 0 to ${H}, inclusive`);return!qe(re)||re===0?0:re}function Ee(_,P){if(!ye(_))throw new TypeError(`${P} is not a ReadableStream.`)}function xe(_){return new rt(_)}function je(_,P){_._reader._readRequests.push(P)}function ge(_,P,H){let re=_._reader._readRequests.shift();H?re._closeSteps():re._chunkSteps(P)}function Le(_){return _._reader._readRequests.length}function We(_){let P=_._reader;return!(P===void 0||!He(P))}class rt{constructor(P){if(X(P,1,"ReadableStreamDefaultReader"),Ee(P,"First parameter"),Ue(P))throw new TypeError("This stream has already been locked for exclusive reading by another reader");q(this,P),this._readRequests=new p}get closed(){return He(this)?this._closedPromise:v(St("closed"))}cancel(P=void 0){return He(this)?this._ownerReadableStream===void 0?v(E("cancel")):V(this,P):v(St("cancel"))}read(){if(!He(this))return v(St("read"));if(this._ownerReadableStream===void 0)return v(E("read from"));let P,H,re=I((de,ve)=>{P=de,H=ve});return kt(this,{_chunkSteps:de=>P({value:de,done:!1}),_closeSteps:()=>P({value:void 0,done:!0}),_errorSteps:de=>H(de)}),re}releaseLock(){if(!He(this))throw St("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");$(this)}}}Object.defineProperties(rt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(rt.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function He(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_readRequests")?!1:_ instanceof rt}function kt(_,P){let H=_._ownerReadableStream;H._disturbed=!0,H._state==="closed"?P._closeSteps():H._state==="errored"?P._errorSteps(H._storedError):H._readableStreamController[Re](P)}function St(_){return new TypeError(`ReadableStreamDefaultReader.prototype.${_} can only be used on a ReadableStreamDefaultReader`)}let Ct=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Bt{constructor(P,H){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=P,this._preventCancel=H}next(){let P=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?R(this._ongoingPromise,P,P):P(),this._ongoingPromise}return(P){let H=()=>this._returnSteps(P);return this._ongoingPromise?R(this._ongoingPromise,H,H):H()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let P=this._reader;if(P._ownerReadableStream===void 0)return v(E("iterate"));let H,re,de=I((ve,Oe)=>{H=ve,re=Oe});return kt(P,{_chunkSteps:ve=>{this._ongoingPromise=void 0,L(()=>H({value:ve,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,$(P),H({value:void 0,done:!0})},_errorSteps:ve=>{this._ongoingPromise=void 0,this._isFinished=!0,$(P),re(ve)}}),de}_returnSteps(P){if(this._isFinished)return Promise.resolve({value:P,done:!0});this._isFinished=!0;let H=this._reader;if(H._ownerReadableStream===void 0)return v(E("finish iterating"));if(!this._preventCancel){let re=V(H,P);return $(H),R(re,()=>({value:P,done:!0}))}return $(H),C({value:P,done:!0})}}let Ot={next(){return zt(this)?this._asyncIteratorImpl.next():v(Xt("next"))},return(_){return zt(this)?this._asyncIteratorImpl.return(_):v(Xt("return"))}};Ct!==void 0&&Object.setPrototypeOf(Ot,Ct);function Lt(_,P){let H=xe(_),re=new Bt(H,P),de=Object.create(Ot);return de._asyncIteratorImpl=re,de}function zt(_){if(!h(_)||!Object.prototype.hasOwnProperty.call(_,"_asyncIteratorImpl"))return!1;try{return _._asyncIteratorImpl instanceof Bt}catch{return!1}}function Xt(_){return new TypeError(`ReadableStreamAsyncIterator.${_} can only be used on a ReadableSteamAsyncIterator`)}let Ht=Number.isNaN||function(_){return _!==_};function Kt(_){return _.slice()}function lr(_,P,H,re,de){new Uint8Array(_).set(new Uint8Array(H,re,de),P)}function Cr(_){return _}function gr(_){return!1}function qr(_,P,H){if(_.slice)return _.slice(P,H);let re=H-P,de=new ArrayBuffer(re);return lr(de,0,_,P,re),de}function un(_){return!(typeof _!="number"||Ht(_)||_<0)}function Qr(_){let P=qr(_.buffer,_.byteOffset,_.byteOffset+_.byteLength);return new Uint8Array(P)}function Yr(_){let P=_._queue.shift();return _._queueTotalSize-=P.size,_._queueTotalSize<0&&(_._queueTotalSize=0),P.value}function _n(_,P,H){if(!un(H)||H===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");_._queue.push({value:P,size:H}),_._queueTotalSize+=H}function li(_){return _._queue.peek().value}function Mr(_){_._queue=new p,_._queueTotalSize=0}class Nn{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Jt(this))throw mo("view");return this._view}respond(P){if(!Jt(this))throw mo("respond");if(X(P,1,"respond"),P=te(P,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");gr(this._view.buffer),yo(this._associatedReadableByteStreamController,P)}respondWithNewView(P){if(!Jt(this))throw mo("respondWithNewView");if(X(P,1,"respondWithNewView"),!ArrayBuffer.isView(P))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");gr(P.buffer),go(this._associatedReadableByteStreamController,P)}}Object.defineProperties(Nn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Nn.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Ut{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Dt(this))throw br("byobRequest");return Ho(this)}get desiredSize(){if(!Dt(this))throw br("desiredSize");return Pi(this)}close(){if(!Dt(this))throw br("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let P=this._controlledReadableByteStream._state;if(P!=="readable")throw new TypeError(`The stream (in ${P} state) is not in the readable state and cannot be closed`);Oi(this)}enqueue(P){if(!Dt(this))throw br("enqueue");if(X(P,1,"enqueue"),!ArrayBuffer.isView(P))throw new TypeError("chunk must be an array buffer view");if(P.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(P.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 H=this._controlledReadableByteStream._state;if(H!=="readable")throw new TypeError(`The stream (in ${H} state) is not in the readable state and cannot be enqueued to`);wn(this,P)}error(P=void 0){if(!Dt(this))throw br("error");Tr(this,P)}[_e](P){Wt(this),Mr(this);let H=this._cancelAlgorithm(P);return po(this),H}[Re](P){let H=this._controlledReadableByteStream;if(this._queueTotalSize>0){let de=this._queue.shift();this._queueTotalSize-=de.byteLength,ir(this);let ve=new Uint8Array(de.buffer,de.byteOffset,de.byteLength);P._chunkSteps(ve);return}let re=this._autoAllocateChunkSize;if(re!==void 0){let de;try{de=new ArrayBuffer(re)}catch(Oe){P._errorSteps(Oe);return}let ve={buffer:de,bufferByteLength:re,byteOffset:0,byteLength:re,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(ve)}je(H,P),jt(this)}}Object.defineProperties(Ut.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Ut.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Dt(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledReadableByteStream")?!1:_ instanceof Ut}function Jt(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_associatedReadableByteStreamController")?!1:_ instanceof Nn}function jt(_){if(!Os(_))return;if(_._pulling){_._pullAgain=!0;return}_._pulling=!0;let P=_._pullAlgorithm();O(P,()=>{_._pulling=!1,_._pullAgain&&(_._pullAgain=!1,jt(_))},H=>{Tr(_,H)})}function Wt(_){er(_),_._pendingPullIntos=new p}function Zt(_,P){let H=!1;_._state==="closed"&&(H=!0);let re=Gt(P);P.readerType==="default"?ge(_,re,H):Ps(_,re,H)}function Gt(_){let P=_.bytesFilled,H=_.elementSize;return new _.viewConstructor(_.buffer,_.byteOffset,P/H)}function Qt(_,P,H,re){_._queue.push({buffer:P,byteOffset:H,byteLength:re}),_._queueTotalSize+=re}function rr(_,P){let H=P.elementSize,re=P.bytesFilled-P.bytesFilled%H,de=Math.min(_._queueTotalSize,P.byteLength-P.bytesFilled),ve=P.bytesFilled+de,Oe=ve-ve%H,Me=de,nt=!1;Oe>re&&(Me=Oe-P.bytesFilled,nt=!0);let at=_._queue;for(;Me>0;){let ct=at.peek(),dt=Math.min(Me,ct.byteLength),Ft=P.byteOffset+P.bytesFilled;lr(P.buffer,Ft,ct.buffer,ct.byteOffset,dt),ct.byteLength===dt?at.shift():(ct.byteOffset+=dt,ct.byteLength-=dt),_._queueTotalSize-=dt,nr(_,dt,P),Me-=dt}return nt}function nr(_,P,H){H.bytesFilled+=P}function ir(_){_._queueTotalSize===0&&_._closeRequested?(po(_),ht(_._controlledReadableByteStream)):jt(_)}function er(_){_._byobRequest!==null&&(_._byobRequest._associatedReadableByteStreamController=void 0,_._byobRequest._view=null,_._byobRequest=null)}function or(_){for(;_._pendingPullIntos.length>0;){if(_._queueTotalSize===0)return;let P=_._pendingPullIntos.peek();rr(_,P)&&(fo(_),Zt(_._controlledReadableByteStream,P))}}function cr(_,P,H){let re=_._controlledReadableByteStream,de=1;P.constructor!==DataView&&(de=P.constructor.BYTES_PER_ELEMENT);let ve=P.constructor,Oe=P.buffer,Me={buffer:Oe,bufferByteLength:Oe.byteLength,byteOffset:P.byteOffset,byteLength:P.byteLength,bytesFilled:0,elementSize:de,viewConstructor:ve,readerType:"byob"};if(_._pendingPullIntos.length>0){_._pendingPullIntos.push(Me),ja(re,H);return}if(re._state==="closed"){let nt=new ve(Me.buffer,Me.byteOffset,0);H._closeSteps(nt);return}if(_._queueTotalSize>0){if(rr(_,Me)){let nt=Gt(Me);ir(_),H._chunkSteps(nt);return}if(_._closeRequested){let nt=new TypeError("Insufficient bytes to fill elements in the given buffer");Tr(_,nt),H._errorSteps(nt);return}}_._pendingPullIntos.push(Me),ja(re,H),jt(_)}function $t(_,P){let H=_._controlledReadableByteStream;if(z(H))for(;Ko(H)>0;){let re=fo(_);Zt(H,re)}}function tr(_,P,H){if(nr(_,P,H),H.bytesFilled0){let de=H.byteOffset+H.bytesFilled,ve=qr(H.buffer,de-re,de);Qt(_,ve,0,ve.byteLength)}H.bytesFilled-=re,Zt(_._controlledReadableByteStream,H),or(_)}function La(_,P){let H=_._pendingPullIntos.peek();er(_),_._controlledReadableByteStream._state==="closed"?$t(_):tr(_,P,H),jt(_)}function fo(_){return _._pendingPullIntos.shift()}function Os(_){let P=_._controlledReadableByteStream;return P._state!=="readable"||_._closeRequested||!_._started?!1:!!(We(P)&&Le(P)>0||z(P)&&Ko(P)>0||Pi(_)>0)}function po(_){_._pullAlgorithm=void 0,_._cancelAlgorithm=void 0}function Oi(_){let P=_._controlledReadableByteStream;if(!(_._closeRequested||P._state!=="readable")){if(_._queueTotalSize>0){_._closeRequested=!0;return}if(_._pendingPullIntos.length>0&&_._pendingPullIntos.peek().bytesFilled>0){let H=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Tr(_,H),H}po(_),ht(P)}}function wn(_,P){let H=_._controlledReadableByteStream;if(_._closeRequested||H._state!=="readable")return;let re=P.buffer,de=P.byteOffset,ve=P.byteLength,Oe=re;if(_._pendingPullIntos.length>0){let Me=_._pendingPullIntos.peek();gr(Me.buffer),Me.buffer=Me.buffer}if(er(_),We(H))if(Le(H)===0)Qt(_,Oe,de,ve);else{_._pendingPullIntos.length>0&&fo(_);let Me=new Uint8Array(Oe,de,ve);ge(H,Me,!1)}else z(H)?(Qt(_,Oe,de,ve),or(_)):Qt(_,Oe,de,ve);jt(_)}function Tr(_,P){let H=_._controlledReadableByteStream;H._state==="readable"&&(Wt(_),Mr(_),po(_),hr(H,P))}function Ho(_){if(_._byobRequest===null&&_._pendingPullIntos.length>0){let P=_._pendingPullIntos.peek(),H=new Uint8Array(P.buffer,P.byteOffset+P.bytesFilled,P.byteLength-P.bytesFilled),re=Object.create(Nn.prototype);Ua(re,_,H),_._byobRequest=re}return _._byobRequest}function Pi(_){let P=_._controlledReadableByteStream._state;return P==="errored"?null:P==="closed"?0:_._strategyHWM-_._queueTotalSize}function yo(_,P){let H=_._pendingPullIntos.peek();if(_._controlledReadableByteStream._state==="closed"){if(P!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(P===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(H.bytesFilled+P>H.byteLength)throw new RangeError("bytesWritten out of range")}H.buffer=H.buffer,La(_,P)}function go(_,P){let H=_._pendingPullIntos.peek();if(_._controlledReadableByteStream._state==="closed"){if(P.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(P.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(H.byteOffset+H.bytesFilled!==P.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(H.bufferByteLength!==P.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(H.bytesFilled+P.byteLength>H.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let re=P.byteLength;H.buffer=P.buffer,La(_,re)}function Na(_,P,H,re,de,ve,Oe){P._controlledReadableByteStream=_,P._pullAgain=!1,P._pulling=!1,P._byobRequest=null,P._queue=P._queueTotalSize=void 0,Mr(P),P._closeRequested=!1,P._started=!1,P._strategyHWM=ve,P._pullAlgorithm=re,P._cancelAlgorithm=de,P._autoAllocateChunkSize=Oe,P._pendingPullIntos=new p,_._readableStreamController=P;let Me=H();O(C(Me),()=>{P._started=!0,jt(P)},nt=>{Tr(P,nt)})}function xa(_,P,H){let re=Object.create(Ut.prototype),de=()=>{},ve=()=>C(void 0),Oe=()=>C(void 0);P.start!==void 0&&(de=()=>P.start(re)),P.pull!==void 0&&(ve=()=>P.pull(re)),P.cancel!==void 0&&(Oe=nt=>P.cancel(nt));let Me=P.autoAllocateChunkSize;if(Me===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Na(_,re,de,ve,Oe,H,Me)}function Ua(_,P,H){_._associatedReadableByteStreamController=P,_._view=H}function mo(_){return new TypeError(`ReadableStreamBYOBRequest.prototype.${_} can only be used on a ReadableStreamBYOBRequest`)}function br(_){return new TypeError(`ReadableByteStreamController.prototype.${_} can only be used on a ReadableByteStreamController`)}function Da(_){return new G(_)}function ja(_,P){_._reader._readIntoRequests.push(P)}function Ps(_,P,H){let re=_._reader._readIntoRequests.shift();H?re._closeSteps(P):re._chunkSteps(P)}function Ko(_){return _._reader._readIntoRequests.length}function z(_){let P=_._reader;return!(P===void 0||!Z(P))}class G{constructor(P){if(X(P,1,"ReadableStreamBYOBReader"),Ee(P,"First parameter"),Ue(P))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Dt(P._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");q(this,P),this._readIntoRequests=new p}get closed(){return Z(this)?this._closedPromise:v(be("closed"))}cancel(P=void 0){return Z(this)?this._ownerReadableStream===void 0?v(E("cancel")):V(this,P):v(be("cancel"))}read(P){if(!Z(this))return v(be("read"));if(!ArrayBuffer.isView(P))return v(new TypeError("view must be an array buffer view"));if(P.byteLength===0)return v(new TypeError("view must have non-zero byteLength"));if(P.buffer.byteLength===0)return v(new TypeError("view's buffer must have non-zero byteLength"));if(gr(P.buffer),this._ownerReadableStream===void 0)return v(E("read from"));let H,re,de=I((ve,Oe)=>{H=ve,re=Oe});return ce(this,P,{_chunkSteps:ve=>H({value:ve,done:!1}),_closeSteps:ve=>H({value:ve,done:!0}),_errorSteps:ve=>re(ve)}),de}releaseLock(){if(!Z(this))throw be("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");$(this)}}}Object.defineProperties(G.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(G.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Z(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_readIntoRequests")?!1:_ instanceof G}function ce(_,P,H){let re=_._ownerReadableStream;re._disturbed=!0,re._state==="errored"?H._errorSteps(re._storedError):cr(re._readableStreamController,P,H)}function be(_){return new TypeError(`ReadableStreamBYOBReader.prototype.${_} can only be used on a ReadableStreamBYOBReader`)}function Te(_,P){let{highWaterMark:H}=_;if(H===void 0)return P;if(Ht(H)||H<0)throw new RangeError("Invalid highWaterMark");return H}function Ne(_){let{size:P}=_;return P||(()=>1)}function Be(_,P){Ie(_,P);let H=_?.highWaterMark,re=_?.size;return{highWaterMark:H===void 0?void 0:A(H),size:re===void 0?void 0:bt(re,`${P} has member 'size' that`)}}function bt(_,P){return et(_,P),H=>A(_(H))}function ar(_,P){Ie(_,P);let H=_?.abort,re=_?.close,de=_?.start,ve=_?.type,Oe=_?.write;return{abort:H===void 0?void 0:Rr(H,_,`${P} has member 'abort' that`),close:re===void 0?void 0:Pr(re,_,`${P} has member 'close' that`),start:de===void 0?void 0:ln(de,_,`${P} has member 'start' that`),write:Oe===void 0?void 0:ci(Oe,_,`${P} has member 'write' that`),type:ve}}function Rr(_,P,H){return et(_,H),re=>S(_,P,[re])}function Pr(_,P,H){return et(_,H),()=>S(_,P,[])}function ln(_,P,H){return et(_,H),re=>D(_,P,[re])}function ci(_,P,H){return et(_,H),(re,de)=>S(_,P,[re,de])}function Ir(_,P){if(!Li(_))throw new TypeError(`${P} is not a WritableStream.`)}function mr(_){if(typeof _!="object"||_===null)return!1;try{return typeof _.aborted=="boolean"}catch{return!1}}let Bi=typeof AbortController=="function";function En(){if(Bi)return new AbortController}class Gn{constructor(P={},H={}){P===void 0?P=null:x(P,"First parameter");let re=Be(H,"Second parameter"),de=ar(P,"First parameter");if(Ls(this),de.type!==void 0)throw new RangeError("Invalid type is specified");let ve=Ne(re),Oe=Te(re,1);tl(this,de,Oe,ve)}get locked(){if(!Li(this))throw bo("locked");return vo(this)}abort(P=void 0){return Li(this)?vo(this)?v(new TypeError("Cannot abort a stream that already has a writer")):qa(this,P):v(bo("abort"))}close(){return Li(this)?vo(this)?v(new TypeError("Cannot close a stream that already has a writer")):xn(this)?v(new TypeError("Cannot close an already-closing stream")):Yu(this):v(bo("close"))}getWriter(){if(!Li(this))throw bo("getWriter");return Bs(this)}}Object.defineProperties(Gn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Gn.prototype,r.toStringTag,{value:"WritableStream",configurable:!0});function Bs(_){return new Wo(_)}function Qu(_,P,H,re,de=1,ve=()=>1){let Oe=Object.create(Gn.prototype);Ls(Oe);let Me=Object.create(fi.prototype);return Ms(Oe,Me,_,P,H,re,de,ve),Oe}function Ls(_){_._state="writable",_._storedError=void 0,_._writer=void 0,_._writableStreamController=void 0,_._writeRequests=new p,_._inFlightWriteRequest=void 0,_._closeRequest=void 0,_._inFlightCloseRequest=void 0,_._pendingAbortRequest=void 0,_._backpressure=!1}function Li(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_writableStreamController")?!1:_ instanceof Gn}function vo(_){return _._writer!==void 0}function qa(_,P){var H;if(_._state==="closed"||_._state==="errored")return C(void 0);_._writableStreamController._abortReason=P,(H=_._writableStreamController._abortController)===null||H===void 0||H.abort();let re=_._state;if(re==="closed"||re==="errored")return C(void 0);if(_._pendingAbortRequest!==void 0)return _._pendingAbortRequest._promise;let de=!1;re==="erroring"&&(de=!0,P=void 0);let ve=I((Oe,Me)=>{_._pendingAbortRequest={_promise:void 0,_resolve:Oe,_reject:Me,_reason:P,_wasAlreadyErroring:de}});return _._pendingAbortRequest._promise=ve,de||xs(_,P),ve}function Yu(_){let P=_._state;if(P==="closed"||P==="errored")return v(new TypeError(`The stream (in ${P} state) is not in the writable state and cannot be closed`));let H=I((de,ve)=>{let Oe={_resolve:de,_reject:ve};_._closeRequest=Oe}),re=_._writer;return re!==void 0&&_._backpressure&&P==="writable"&&Yo(re),rl(_._writableStreamController),H}function Xu(_){return I((P,H)=>{let re={_resolve:P,_reject:H};_._writeRequests.push(re)})}function Ns(_,P){if(_._state==="writable"){xs(_,P);return}Us(_)}function xs(_,P){let H=_._writableStreamController;_._state="erroring",_._storedError=P;let re=_._writer;re!==void 0&&el(re,P),!dh(_)&&H._started&&Us(_)}function Us(_){_._state="errored",_._writableStreamController[pe]();let P=_._storedError;if(_._writeRequests.forEach(de=>{de._reject(P)}),_._writeRequests=new p,_._pendingAbortRequest===void 0){Tt(_);return}let H=_._pendingAbortRequest;if(_._pendingAbortRequest=void 0,H._wasAlreadyErroring){H._reject(P),Tt(_);return}let re=_._writableStreamController[ae](H._reason);O(re,()=>{H._resolve(),Tt(_)},de=>{H._reject(de),Tt(_)})}function ch(_){_._inFlightWriteRequest._resolve(void 0),_._inFlightWriteRequest=void 0}function Ds(_,P){_._inFlightWriteRequest._reject(P),_._inFlightWriteRequest=void 0,Ns(_,P)}function hh(_){_._inFlightCloseRequest._resolve(void 0),_._inFlightCloseRequest=void 0,_._state==="erroring"&&(_._storedError=void 0,_._pendingAbortRequest!==void 0&&(_._pendingAbortRequest._resolve(),_._pendingAbortRequest=void 0)),_._state="closed";let P=_._writer;P!==void 0&&$s(P)}function fh(_,P){_._inFlightCloseRequest._reject(P),_._inFlightCloseRequest=void 0,_._pendingAbortRequest!==void 0&&(_._pendingAbortRequest._reject(P),_._pendingAbortRequest=void 0),Ns(_,P)}function xn(_){return!(_._closeRequest===void 0&&_._inFlightCloseRequest===void 0)}function dh(_){return!(_._inFlightWriteRequest===void 0&&_._inFlightCloseRequest===void 0)}function ph(_){_._inFlightCloseRequest=_._closeRequest,_._closeRequest=void 0}function Vt(_){_._inFlightWriteRequest=_._writeRequests.shift()}function Tt(_){_._closeRequest!==void 0&&(_._closeRequest._reject(_._storedError),_._closeRequest=void 0);let P=_._writer;P!==void 0&&Fs(P,_._storedError)}function js(_,P){let H=_._writer;H!==void 0&&P!==_._backpressure&&(P?al(H):Yo(H)),_._backpressure=P}class Wo{constructor(P){if(X(P,1,"WritableStreamDefaultWriter"),Ir(P,"First parameter"),vo(P))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=P,P._writer=this;let H=P._state;if(H==="writable")!xn(P)&&P._backpressure?Ui(this):ol(this),Fa(this);else if(H==="erroring")di(this,P._storedError),Fa(this);else if(H==="closed")ol(this),vh(this);else{let re=P._storedError;di(this,re),$a(this,re)}}get closed(){return Ni(this)?this._closedPromise:v($r("closed"))}get desiredSize(){if(!Ni(this))throw $r("desiredSize");if(this._ownerWritableStream===void 0)throw xi("desiredSize");return vr(this)}get ready(){return Ni(this)?this._readyPromise:v($r("ready"))}abort(P=void 0){return Ni(this)?this._ownerWritableStream===void 0?v(xi("abort")):yh(this,P):v($r("abort"))}close(){if(!Ni(this))return v($r("close"));let P=this._ownerWritableStream;return P===void 0?v(xi("close")):xn(P)?v(new TypeError("Cannot close an already-closing stream")):Ju(this)}releaseLock(){if(!Ni(this))throw $r("releaseLock");this._ownerWritableStream!==void 0&&Ma(this)}write(P=void 0){return Ni(this)?this._ownerWritableStream===void 0?v(xi("write to")):hi(this,P):v($r("write"))}}Object.defineProperties(Wo.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Wo.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Ni(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_ownerWritableStream")?!1:_ instanceof Wo}function yh(_,P){let H=_._ownerWritableStream;return qa(H,P)}function Ju(_){let P=_._ownerWritableStream;return Yu(P)}function gh(_){let P=_._ownerWritableStream,H=P._state;return xn(P)||H==="closed"?C(void 0):H==="errored"?v(P._storedError):Ju(_)}function Zu(_,P){_._closedPromiseState==="pending"?Fs(_,P):bh(_,P)}function el(_,P){_._readyPromiseState==="pending"?zs(_,P):Hs(_,P)}function vr(_){let P=_._ownerWritableStream,H=P._state;return H==="errored"||H==="erroring"?null:H==="closed"?0:Vs(P._writableStreamController)}function Ma(_){let P=_._ownerWritableStream,H=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");el(_,H),Zu(_,H),P._writer=void 0,_._ownerWritableStream=void 0}function hi(_,P){let H=_._ownerWritableStream,re=H._writableStreamController,de=nl(re,P);if(H!==_._ownerWritableStream)return v(xi("write to"));let ve=H._state;if(ve==="errored")return v(H._storedError);if(xn(H)||ve==="closed")return v(new TypeError("The stream is closing or closed and cannot be written to"));if(ve==="erroring")return v(H._storedError);let Oe=Xu(H);return Xr(re,P,de),Oe}let qs={};class fi{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Vr(this))throw qt("abortReason");return this._abortReason}get signal(){if(!Vr(this))throw qt("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(P=void 0){if(!Vr(this))throw qt("error");this._controlledWritableStream._state==="writable"&&Qo(this,P)}[ae](P){let H=this._abortAlgorithm(P);return Go(this),H}[pe](){Mr(this)}}Object.defineProperties(fi.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(fi.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Vr(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledWritableStream")?!1:_ instanceof fi}function Ms(_,P,H,re,de,ve,Oe,Me){P._controlledWritableStream=_,_._writableStreamController=P,P._queue=void 0,P._queueTotalSize=void 0,Mr(P),P._abortReason=void 0,P._abortController=En(),P._started=!1,P._strategySizeAlgorithm=Me,P._strategyHWM=Oe,P._writeAlgorithm=re,P._closeAlgorithm=de,P._abortAlgorithm=ve;let nt=Un(P);js(_,nt);let at=H(),ct=C(at);O(ct,()=>{P._started=!0,Va(P)},dt=>{P._started=!0,Ns(_,dt)})}function tl(_,P,H,re){let de=Object.create(fi.prototype),ve=()=>{},Oe=()=>C(void 0),Me=()=>C(void 0),nt=()=>C(void 0);P.start!==void 0&&(ve=()=>P.start(de)),P.write!==void 0&&(Oe=at=>P.write(at,de)),P.close!==void 0&&(Me=()=>P.close()),P.abort!==void 0&&(nt=at=>P.abort(at)),Ms(_,de,ve,Oe,Me,nt,H,re)}function Go(_){_._writeAlgorithm=void 0,_._closeAlgorithm=void 0,_._abortAlgorithm=void 0,_._strategySizeAlgorithm=void 0}function rl(_){_n(_,qs,0),Va(_)}function nl(_,P){try{return _._strategySizeAlgorithm(P)}catch(H){return Fr(_,H),1}}function Vs(_){return _._strategyHWM-_._queueTotalSize}function Xr(_,P,H){try{_n(_,P,H)}catch(de){Fr(_,de);return}let re=_._controlledWritableStream;if(!xn(re)&&re._state==="writable"){let de=Un(_);js(re,de)}Va(_)}function Va(_){let P=_._controlledWritableStream;if(!_._started||P._inFlightWriteRequest!==void 0)return;if(P._state==="erroring"){Us(P);return}if(_._queue.length===0)return;let H=li(_);H===qs?mh(_):il(_,H)}function Fr(_,P){_._controlledWritableStream._state==="writable"&&Qo(_,P)}function mh(_){let P=_._controlledWritableStream;ph(P),Yr(_);let H=_._closeAlgorithm();Go(_),O(H,()=>{hh(P)},re=>{fh(P,re)})}function il(_,P){let H=_._controlledWritableStream;Vt(H);let re=_._writeAlgorithm(P);O(re,()=>{ch(H);let de=H._state;if(Yr(_),!xn(H)&&de==="writable"){let ve=Un(_);js(H,ve)}Va(_)},de=>{H._state==="writable"&&Go(_),Ds(H,de)})}function Un(_){return Vs(_)<=0}function Qo(_,P){let H=_._controlledWritableStream;Go(_),xs(H,P)}function bo(_){return new TypeError(`WritableStream.prototype.${_} can only be used on a WritableStream`)}function qt(_){return new TypeError(`WritableStreamDefaultController.prototype.${_} can only be used on a WritableStreamDefaultController`)}function $r(_){return new TypeError(`WritableStreamDefaultWriter.prototype.${_} can only be used on a WritableStreamDefaultWriter`)}function xi(_){return new TypeError("Cannot "+_+" a stream using a released writer")}function Fa(_){_._closedPromise=I((P,H)=>{_._closedPromise_resolve=P,_._closedPromise_reject=H,_._closedPromiseState="pending"})}function $a(_,P){Fa(_),Fs(_,P)}function vh(_){Fa(_),$s(_)}function Fs(_,P){_._closedPromise_reject!==void 0&&(w(_._closedPromise),_._closedPromise_reject(P),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0,_._closedPromiseState="rejected")}function bh(_,P){$a(_,P)}function $s(_){_._closedPromise_resolve!==void 0&&(_._closedPromise_resolve(void 0),_._closedPromise_resolve=void 0,_._closedPromise_reject=void 0,_._closedPromiseState="resolved")}function Ui(_){_._readyPromise=I((P,H)=>{_._readyPromise_resolve=P,_._readyPromise_reject=H}),_._readyPromiseState="pending"}function di(_,P){Ui(_),zs(_,P)}function ol(_){Ui(_),Yo(_)}function zs(_,P){_._readyPromise_reject!==void 0&&(w(_._readyPromise),_._readyPromise_reject(P),_._readyPromise_resolve=void 0,_._readyPromise_reject=void 0,_._readyPromiseState="rejected")}function al(_){Ui(_)}function Hs(_,P){di(_,P)}function Yo(_){_._readyPromise_resolve!==void 0&&(_._readyPromise_resolve(void 0),_._readyPromise_resolve=void 0,_._readyPromise_reject=void 0,_._readyPromiseState="fulfilled")}let Ks=typeof DOMException<"u"?DOMException:void 0;function _h(_){if(!(typeof _=="function"||typeof _=="object"))return!1;try{return new _,!0}catch{return!1}}function Ws(){let _=function(P,H){this.message=P||"",this.name=H||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return _.prototype=Object.create(Error.prototype),Object.defineProperty(_.prototype,"constructor",{value:_,writable:!0,configurable:!0}),_}let Gs=_h(Ks)?Ks:Ws();function sl(_,P,H,re,de,ve){let Oe=xe(_),Me=Bs(P);_._disturbed=!0;let nt=!1,at=C(void 0);return I((ct,dt)=>{let Ft;if(ve!==void 0){if(Ft=()=>{let ze=new Gs("Aborted","AbortError"),st=[];re||st.push(()=>P._state==="writable"?qa(P,ze):C(void 0)),de||st.push(()=>_._state==="readable"?Ke(_,ze):C(void 0)),Jr(()=>Promise.all(st.map(vt=>vt())),!0,ze)},ve.aborted){Ft();return}ve.addEventListener("abort",Ft)}function Lr(){return I((ze,st)=>{function vt(Nr){Nr?ze():T(jn(),vt,st)}vt(!1)})}function jn(){return nt?C(!0):T(Me._readyPromise,()=>I((ze,st)=>{kt(Oe,{_chunkSteps:vt=>{at=T(hi(Me,vt),void 0,i),ze(!1)},_closeSteps:()=>ze(!0),_errorSteps:st})}))}if(zr(_,Oe._closedPromise,ze=>{re?cn(!0,ze):Jr(()=>qa(P,ze),!0,ze)}),zr(P,Me._closedPromise,ze=>{de?cn(!0,ze):Jr(()=>Ke(_,ze),!0,ze)}),_r(_,Oe._closedPromise,()=>{H?cn():Jr(()=>gh(Me))}),xn(P)||P._state==="closed"){let ze=new TypeError("the destination writable stream closed before all data could be piped to it");de?cn(!0,ze):Jr(()=>Ke(_,ze),!0,ze)}w(Lr());function Tn(){let ze=at;return T(at,()=>ze!==at?Tn():void 0)}function zr(ze,st,vt){ze._state==="errored"?vt(ze._storedError):y(st,vt)}function _r(ze,st,vt){ze._state==="closed"?vt():k(st,vt)}function Jr(ze,st,vt){if(nt)return;nt=!0,P._state==="writable"&&!xn(P)?k(Tn(),Nr):Nr();function Nr(){O(ze(),()=>zi(st,vt),Y=>zi(!0,Y))}}function cn(ze,st){nt||(nt=!0,P._state==="writable"&&!xn(P)?k(Tn(),()=>zi(ze,st)):zi(ze,st))}function zi(ze,st){Ma(Me),$(Oe),ve!==void 0&&ve.removeEventListener("abort",Ft),ze?dt(st):ct(void 0)}})}class Di{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ar(this))throw Ha("desiredSize");return Qs(this)}close(){if(!Ar(this))throw Ha("close");if(!Eo(this))throw new TypeError("The stream is not in a state that permits close");wo(this)}enqueue(P=void 0){if(!Ar(this))throw Ha("enqueue");if(!Eo(this))throw new TypeError("The stream is not in a state that permits enqueue");return za(this,P)}error(P=void 0){if(!Ar(this))throw Ha("error");pi(this,P)}[_e](P){Mr(this);let H=this._cancelAlgorithm(P);return Xo(this),H}[Re](P){let H=this._controlledReadableStream;if(this._queue.length>0){let re=Yr(this);this._closeRequested&&this._queue.length===0?(Xo(this),ht(H)):ji(this),P._chunkSteps(re)}else je(H,P),ji(this)}}Object.defineProperties(Di.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Ar(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledReadableStream")?!1:_ instanceof Di}function ji(_){if(!_o(_))return;if(_._pulling){_._pullAgain=!0;return}_._pulling=!0;let P=_._pullAlgorithm();O(P,()=>{_._pulling=!1,_._pullAgain&&(_._pullAgain=!1,ji(_))},H=>{pi(_,H)})}function _o(_){let P=_._controlledReadableStream;return!Eo(_)||!_._started?!1:!!(Ue(P)&&Le(P)>0||Qs(_)>0)}function Xo(_){_._pullAlgorithm=void 0,_._cancelAlgorithm=void 0,_._strategySizeAlgorithm=void 0}function wo(_){if(!Eo(_))return;let P=_._controlledReadableStream;_._closeRequested=!0,_._queue.length===0&&(Xo(_),ht(P))}function za(_,P){if(!Eo(_))return;let H=_._controlledReadableStream;if(Ue(H)&&Le(H)>0)ge(H,P,!1);else{let re;try{re=_._strategySizeAlgorithm(P)}catch(de){throw pi(_,de),de}try{_n(_,P,re)}catch(de){throw pi(_,de),de}}ji(_)}function pi(_,P){let H=_._controlledReadableStream;H._state==="readable"&&(Mr(_),Xo(_),hr(H,P))}function Qs(_){let P=_._controlledReadableStream._state;return P==="errored"?null:P==="closed"?0:_._strategyHWM-_._queueTotalSize}function wh(_){return!_o(_)}function Eo(_){let P=_._controlledReadableStream._state;return!_._closeRequested&&P==="readable"}function qi(_,P,H,re,de,ve,Oe){P._controlledReadableStream=_,P._queue=void 0,P._queueTotalSize=void 0,Mr(P),P._started=!1,P._closeRequested=!1,P._pullAgain=!1,P._pulling=!1,P._strategySizeAlgorithm=Oe,P._strategyHWM=ve,P._pullAlgorithm=re,P._cancelAlgorithm=de,_._readableStreamController=P;let Me=H();O(C(Me),()=>{P._started=!0,ji(P)},nt=>{pi(P,nt)})}function Eh(_,P,H,re){let de=Object.create(Di.prototype),ve=()=>{},Oe=()=>C(void 0),Me=()=>C(void 0);P.start!==void 0&&(ve=()=>P.start(de)),P.pull!==void 0&&(Oe=()=>P.pull(de)),P.cancel!==void 0&&(Me=nt=>P.cancel(nt)),qi(_,de,ve,Oe,Me,H,re)}function Ha(_){return new TypeError(`ReadableStreamDefaultController.prototype.${_} can only be used on a ReadableStreamDefaultController`)}function Ys(_,P){return Dt(_._readableStreamController)?yi(_):ul(_)}function ul(_,P){let H=xe(_),re=!1,de=!1,ve=!1,Oe=!1,Me,nt,at,ct,dt,Ft=I(_r=>{dt=_r});function Lr(){return re?(de=!0,C(void 0)):(re=!0,kt(H,{_chunkSteps:_r=>{L(()=>{de=!1;let Jr=_r,cn=_r;ve||za(at._readableStreamController,Jr),Oe||za(ct._readableStreamController,cn),re=!1,de&&Lr()})},_closeSteps:()=>{re=!1,ve||wo(at._readableStreamController),Oe||wo(ct._readableStreamController),(!ve||!Oe)&&dt(void 0)},_errorSteps:()=>{re=!1}}),C(void 0))}function jn(_r){if(ve=!0,Me=_r,Oe){let Jr=Kt([Me,nt]),cn=Ke(_,Jr);dt(cn)}return Ft}function Tn(_r){if(Oe=!0,nt=_r,ve){let Jr=Kt([Me,nt]),cn=Ke(_,Jr);dt(cn)}return Ft}function zr(){}return at=Dn(zr,Lr,jn),ct=Dn(zr,Lr,Tn),y(H._closedPromise,_r=>{pi(at._readableStreamController,_r),pi(ct._readableStreamController,_r),(!ve||!Oe)&&dt(void 0)}),[at,ct]}function yi(_){let P=xe(_),H=!1,re=!1,de=!1,ve=!1,Oe=!1,Me,nt,at,ct,dt,Ft=I(ze=>{dt=ze});function Lr(ze){y(ze._closedPromise,st=>{ze===P&&(Tr(at._readableStreamController,st),Tr(ct._readableStreamController,st),(!ve||!Oe)&&dt(void 0))})}function jn(){Z(P)&&($(P),P=xe(_),Lr(P)),kt(P,{_chunkSteps:ze=>{L(()=>{re=!1,de=!1;let st=ze,vt=ze;if(!ve&&!Oe)try{vt=Qr(ze)}catch(Nr){Tr(at._readableStreamController,Nr),Tr(ct._readableStreamController,Nr),dt(Ke(_,Nr));return}ve||wn(at._readableStreamController,st),Oe||wn(ct._readableStreamController,vt),H=!1,re?zr():de&&_r()})},_closeSteps:()=>{H=!1,ve||Oi(at._readableStreamController),Oe||Oi(ct._readableStreamController),at._readableStreamController._pendingPullIntos.length>0&&yo(at._readableStreamController,0),ct._readableStreamController._pendingPullIntos.length>0&&yo(ct._readableStreamController,0),(!ve||!Oe)&&dt(void 0)},_errorSteps:()=>{H=!1}})}function Tn(ze,st){He(P)&&($(P),P=Da(_),Lr(P));let vt=st?ct:at,Nr=st?at:ct;ce(P,ze,{_chunkSteps:Y=>{L(()=>{re=!1,de=!1;let Rn=st?Oe:ve;if(st?ve:Oe)Rn||go(vt._readableStreamController,Y);else{let Qn;try{Qn=Qr(Y)}catch(Hr){Tr(vt._readableStreamController,Hr),Tr(Nr._readableStreamController,Hr),dt(Ke(_,Hr));return}Rn||go(vt._readableStreamController,Y),wn(Nr._readableStreamController,Qn)}H=!1,re?zr():de&&_r()})},_closeSteps:Y=>{H=!1;let Rn=st?Oe:ve,Qn=st?ve:Oe;Rn||Oi(vt._readableStreamController),Qn||Oi(Nr._readableStreamController),Y!==void 0&&(Rn||go(vt._readableStreamController,Y),!Qn&&Nr._readableStreamController._pendingPullIntos.length>0&&yo(Nr._readableStreamController,0)),(!Rn||!Qn)&&dt(void 0)},_errorSteps:()=>{H=!1}})}function zr(){if(H)return re=!0,C(void 0);H=!0;let ze=Ho(at._readableStreamController);return ze===null?jn():Tn(ze._view,!1),C(void 0)}function _r(){if(H)return de=!0,C(void 0);H=!0;let ze=Ho(ct._readableStreamController);return ze===null?jn():Tn(ze._view,!0),C(void 0)}function Jr(ze){if(ve=!0,Me=ze,Oe){let st=Kt([Me,nt]),vt=Ke(_,st);dt(vt)}return Ft}function cn(ze){if(Oe=!0,nt=ze,ve){let st=Kt([Me,nt]),vt=Ke(_,st);dt(vt)}return Ft}function zi(){}return at=he(zi,zr,Jr),ct=he(zi,_r,cn),Lr(P),[at,ct]}function Ka(_,P){Ie(_,P);let H=_,re=H?.autoAllocateChunkSize,de=H?.cancel,ve=H?.pull,Oe=H?.start,Me=H?.type;return{autoAllocateChunkSize:re===void 0?void 0:te(re,`${P} has member 'autoAllocateChunkSize' that`),cancel:de===void 0?void 0:Sh(de,H,`${P} has member 'cancel' that`),pull:ve===void 0?void 0:Ch(ve,H,`${P} has member 'pull' that`),start:Oe===void 0?void 0:Th(Oe,H,`${P} has member 'start' that`),type:Me===void 0?void 0:So(Me,`${P} has member 'type' that`)}}function Sh(_,P,H){return et(_,H),re=>S(_,P,[re])}function Ch(_,P,H){return et(_,H),re=>S(_,P,[re])}function Th(_,P,H){return et(_,H),re=>D(_,P,[re])}function So(_,P){if(_=`${_}`,_!=="bytes")throw new TypeError(`${P} '${_}' is not a valid enumeration value for ReadableStreamType`);return _}function Sn(_,P){Ie(_,P);let H=_?.mode;return{mode:H===void 0?void 0:ll(H,`${P} has member 'mode' that`)}}function ll(_,P){if(_=`${_}`,_!=="byob")throw new TypeError(`${P} '${_}' is not a valid enumeration value for ReadableStreamReaderMode`);return _}function Rh(_,P){return Ie(_,P),{preventCancel:!!_?.preventCancel}}function cl(_,P){Ie(_,P);let H=_?.preventAbort,re=_?.preventCancel,de=_?.preventClose,ve=_?.signal;return ve!==void 0&&Ih(ve,`${P} has member 'signal' that`),{preventAbort:!!H,preventCancel:!!re,preventClose:!!de,signal:ve}}function Ih(_,P){if(!mr(_))throw new TypeError(`${P} is not an AbortSignal.`)}function Ah(_,P){Ie(_,P);let H=_?.readable;Q(H,"readable","ReadableWritablePair"),Ee(H,`${P} has member 'readable' that`);let re=_?.writable;return Q(re,"writable","ReadableWritablePair"),Ir(re,`${P} has member 'writable' that`),{readable:H,writable:re}}class gi{constructor(P={},H={}){P===void 0?P=null:x(P,"First parameter");let re=Be(H,"Second parameter"),de=Ka(P,"First parameter");if(me(this),de.type==="bytes"){if(re.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let ve=Te(re,0);xa(this,de,ve)}else{let ve=Ne(re),Oe=Te(re,1);Eh(this,de,Oe,ve)}}get locked(){if(!ye(this))throw yt("locked");return Ue(this)}cancel(P=void 0){return ye(this)?Ue(this)?v(new TypeError("Cannot cancel a stream that already has a reader")):Ke(this,P):v(yt("cancel"))}getReader(P=void 0){if(!ye(this))throw yt("getReader");return Sn(P,"First parameter").mode===void 0?xe(this):Da(this)}pipeThrough(P,H={}){if(!ye(this))throw yt("pipeThrough");X(P,1,"pipeThrough");let re=Ah(P,"First parameter"),de=cl(H,"Second parameter");if(Ue(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(vo(re.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let ve=sl(this,re.writable,de.preventClose,de.preventAbort,de.preventCancel,de.signal);return w(ve),re.readable}pipeTo(P,H={}){if(!ye(this))return v(yt("pipeTo"));if(P===void 0)return v("Parameter 1 is required in 'pipeTo'.");if(!Li(P))return v(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let re;try{re=cl(H,"Second parameter")}catch(de){return v(de)}return Ue(this)?v(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):vo(P)?v(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):sl(this,P,re.preventClose,re.preventAbort,re.preventCancel,re.signal)}tee(){if(!ye(this))throw yt("tee");let P=Ys(this);return Kt(P)}values(P=void 0){if(!ye(this))throw yt("values");let H=Rh(P,"First parameter");return Lt(this,H.preventCancel)}}Object.defineProperties(gi.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(gi.prototype,r.toStringTag,{value:"ReadableStream",configurable:!0}),typeof r.asyncIterator=="symbol"&&Object.defineProperty(gi.prototype,r.asyncIterator,{value:gi.prototype.values,writable:!0,configurable:!0});function Dn(_,P,H,re=1,de=()=>1){let ve=Object.create(gi.prototype);me(ve);let Oe=Object.create(Di.prototype);return qi(ve,Oe,_,P,H,re,de),ve}function he(_,P,H){let re=Object.create(gi.prototype);me(re);let de=Object.create(Ut.prototype);return Na(re,de,_,P,H,0,void 0),re}function me(_){_._state="readable",_._reader=void 0,_._storedError=void 0,_._disturbed=!1}function ye(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_readableStreamController")?!1:_ instanceof gi}function Ue(_){return _._reader!==void 0}function Ke(_,P){if(_._disturbed=!0,_._state==="closed")return C(void 0);if(_._state==="errored")return v(_._storedError);ht(_);let H=_._reader;H!==void 0&&Z(H)&&(H._readIntoRequests.forEach(de=>{de._closeSteps(void 0)}),H._readIntoRequests=new p);let re=_._readableStreamController[_e](P);return R(re,i)}function ht(_){_._state="closed";let P=_._reader;P!==void 0&&(oe(P),He(P)&&(P._readRequests.forEach(H=>{H._closeSteps()}),P._readRequests=new p))}function hr(_,P){_._state="errored",_._storedError=P;let H=_._reader;H!==void 0&&(M(H,P),He(H)?(H._readRequests.forEach(re=>{re._errorSteps(P)}),H._readRequests=new p):(H._readIntoRequests.forEach(re=>{re._errorSteps(P)}),H._readIntoRequests=new p))}function yt(_){return new TypeError(`ReadableStream.prototype.${_} can only be used on a ReadableStream`)}function Wa(_,P){Ie(_,P);let H=_?.highWaterMark;return Q(H,"highWaterMark","QueuingStrategyInit"),{highWaterMark:A(H)}}let hl=_=>_.byteLength;try{Object.defineProperty(hl,"name",{value:"size",configurable:!0})}catch{}class Br{constructor(P){X(P,1,"ByteLengthQueuingStrategy"),P=Wa(P,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=P.highWaterMark}get highWaterMark(){if(!fl(this))throw Jo("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!fl(this))throw Jo("size");return hl}}Object.defineProperties(Br.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Br.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Jo(_){return new TypeError(`ByteLengthQueuingStrategy.prototype.${_} can only be used on a ByteLengthQueuingStrategy`)}function fl(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_byteLengthQueuingStrategyHighWaterMark")?!1:_ instanceof Br}let Mi=()=>1;try{Object.defineProperty(Mi,"name",{value:"size",configurable:!0})}catch{}class Vi{constructor(P){X(P,1,"CountQueuingStrategy"),P=Wa(P,"First parameter"),this._countQueuingStrategyHighWaterMark=P.highWaterMark}get highWaterMark(){if(!_t(this))throw Zo("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!_t(this))throw Zo("size");return Mi}}Object.defineProperties(Vi.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Vi.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Zo(_){return new TypeError(`CountQueuingStrategy.prototype.${_} can only be used on a CountQueuingStrategy`)}function _t(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_countQueuingStrategyHighWaterMark")?!1:_ instanceof Vi}function kh(_,P){Ie(_,P);let H=_?.flush,re=_?.readableType,de=_?.start,ve=_?.transform,Oe=_?.writableType;return{flush:H===void 0?void 0:dl(H,_,`${P} has member 'flush' that`),readableType:re,start:de===void 0?void 0:Ga(de,_,`${P} has member 'start' that`),transform:ve===void 0?void 0:Oh(ve,_,`${P} has member 'transform' that`),writableType:Oe}}function dl(_,P,H){return et(_,H),re=>S(_,P,[re])}function Ga(_,P,H){return et(_,H),re=>D(_,P,[re])}function Oh(_,P,H){return et(_,H),(re,de)=>S(_,P,[re,de])}class Qa{constructor(P={},H={},re={}){P===void 0&&(P=null);let de=Be(H,"Second parameter"),ve=Be(re,"Third parameter"),Oe=kh(P,"First parameter");if(Oe.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(Oe.writableType!==void 0)throw new RangeError("Invalid writableType specified");let Me=Te(ve,0),nt=Ne(ve),at=Te(de,1),ct=Ne(de),dt,Ft=I(Lr=>{dt=Lr});Ph(this,Ft,at,ct,Me,nt),Ya(this,Oe),Oe.start!==void 0?dt(Oe.start(this._transformStreamController)):dt(void 0)}get readable(){if(!ea(this))throw yl("readable");return this._readable}get writable(){if(!ea(this))throw yl("writable");return this._writable}}Object.defineProperties(Qa.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Qa.prototype,r.toStringTag,{value:"TransformStream",configurable:!0});function Ph(_,P,H,re,de,ve){function Oe(){return P}function Me(Ft){return Lh(_,Ft)}function nt(Ft){return Nh(_,Ft)}function at(){return Xa(_)}_._writable=Qu(Oe,Me,at,nt,H,re);function ct(){return Ja(_)}function dt(Ft){return Fi(_,Ft),C(void 0)}_._readable=Dn(Oe,ct,dt,de,ve),_._backpressure=void 0,_._backpressureChangePromise=void 0,_._backpressureChangePromise_resolve=void 0,ta(_,!0),_._transformStreamController=void 0}function ea(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_transformStreamController")?!1:_ instanceof Qa}function Cn(_,P){pi(_._readable._readableStreamController,P),Fi(_,P)}function Fi(_,P){Xs(_._transformStreamController),Fr(_._writable._writableStreamController,P),_._backpressure&&ta(_,!1)}function ta(_,P){_._backpressureChangePromise!==void 0&&_._backpressureChangePromise_resolve(),_._backpressureChangePromise=I(H=>{_._backpressureChangePromise_resolve=H}),_._backpressure=P}class mi{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ra(this))throw To("desiredSize");let P=this._controlledTransformStream._readable._readableStreamController;return Qs(P)}enqueue(P=void 0){if(!ra(this))throw To("enqueue");Co(this,P)}error(P=void 0){if(!ra(this))throw To("error");$i(this,P)}terminate(){if(!ra(this))throw To("terminate");Bh(this)}}Object.defineProperties(mi.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(mi.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ra(_){return!h(_)||!Object.prototype.hasOwnProperty.call(_,"_controlledTransformStream")?!1:_ instanceof mi}function pl(_,P,H,re){P._controlledTransformStream=_,_._transformStreamController=P,P._transformAlgorithm=H,P._flushAlgorithm=re}function Ya(_,P){let H=Object.create(mi.prototype),re=ve=>{try{return Co(H,ve),C(void 0)}catch(Oe){return v(Oe)}},de=()=>C(void 0);P.transform!==void 0&&(re=ve=>P.transform(ve,H)),P.flush!==void 0&&(de=()=>P.flush(H)),pl(_,H,re,de)}function Xs(_){_._transformAlgorithm=void 0,_._flushAlgorithm=void 0}function Co(_,P){let H=_._controlledTransformStream,re=H._readable._readableStreamController;if(!Eo(re))throw new TypeError("Readable side is not in a state that permits enqueue");try{za(re,P)}catch(de){throw Fi(H,de),H._readable._storedError}wh(re)!==H._backpressure&&ta(H,!0)}function $i(_,P){Cn(_._controlledTransformStream,P)}function na(_,P){let H=_._transformAlgorithm(P);return R(H,void 0,re=>{throw Cn(_._controlledTransformStream,re),re})}function Bh(_){let P=_._controlledTransformStream,H=P._readable._readableStreamController;wo(H);let re=new TypeError("TransformStream terminated");Fi(P,re)}function Lh(_,P){let H=_._transformStreamController;if(_._backpressure){let re=_._backpressureChangePromise;return R(re,()=>{let de=_._writable;if(de._state==="erroring")throw de._storedError;return na(H,P)})}return na(H,P)}function Nh(_,P){return Cn(_,P),C(void 0)}function Xa(_){let P=_._readable,H=_._transformStreamController,re=H._flushAlgorithm();return Xs(H),R(re,()=>{if(P._state==="errored")throw P._storedError;wo(P._readableStreamController)},de=>{throw Cn(_,de),P._storedError})}function Ja(_){return ta(_,!1),_._backpressureChangePromise}function To(_){return new TypeError(`TransformStreamDefaultController.prototype.${_} can only be used on a TransformStreamDefaultController`)}function yl(_){return new TypeError(`TransformStream.prototype.${_} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=Br,t.CountQueuingStrategy=Vi,t.ReadableByteStreamController=Ut,t.ReadableStream=gi,t.ReadableStreamBYOBReader=G,t.ReadableStreamBYOBRequest=Nn,t.ReadableStreamDefaultController=Di,t.ReadableStreamDefaultReader=rt,t.TransformStream=Qa,t.TransformStreamDefaultController=mi,t.WritableStream=Gn,t.WritableStreamDefaultController=fi,t.WritableStreamDefaultWriter=Wo,Object.defineProperty(t,"__esModule",{value:!0})})}),N5=Qe(()=>{if(!globalThis.ReadableStream)try{let e=bs("process"),{emitWarning:n}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,bs("stream/web")),e.emitWarning=n}catch(t){throw e.emitWarning=n,t}}catch{Object.assign(globalThis,L5())}try{let{Blob:e}=bs("buffer");e&&!e.prototype.stream&&(e.prototype.stream=function(n){let t=0,r=this;return new ReadableStream({type:"bytes",async pull(i){let s=await r.slice(t,Math.min(r.size,t+65536)).arrayBuffer();t+=s.byteLength,i.enqueue(new Uint8Array(s)),t===r.size&&i.close()}})})}catch{}}),x5=Qe(e=>{e.read=function(n,t,r,i,s){var u,h,c=s*8-i-1,a=(1<>1,f=-7,g=r?s-1:0,I=r?-1:1,C=n[t+g];for(g+=I,u=C&(1<<-f)-1,C>>=-f,f+=c;f>0;u=u*256+n[t+g],g+=I,f-=8);for(h=u&(1<<-f)-1,u>>=-f,f+=i;f>0;h=h*256+n[t+g],g+=I,f-=8);if(u===0)u=1-d;else{if(u===a)return h?NaN:(C?-1:1)*(1/0);h=h+Math.pow(2,i),u=u-d}return(C?-1:1)*h*Math.pow(2,u-i)},e.write=function(n,t,r,i,s,u){var h,c,a,d=u*8-s-1,f=(1<>1,I=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:u-1,v=i?1:-1,T=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,h=f):(h=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-h))<1&&(h--,a*=2),h+g>=1?t+=I/a:t+=I*Math.pow(2,1-g),t*a>=2&&(h++,a/=2),h+g>=f?(c=0,h=f):h+g>=1?(c=(t*a-1)*Math.pow(2,s),h=h+g):(c=t*Math.pow(2,g-1)*Math.pow(2,s),h=0));s>=8;n[r+C]=c&255,C+=v,c/=256,s-=8);for(h=h<0;n[r+C]=h&255,C+=v,h/=256,d-=8);n[r+C-v]|=T*128}}),U5=Qe((e,n)=>{"use strict";n.exports=r;var t=x5();function r(E){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(E)?E:new Uint8Array(E||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var i=65536*65536,s=1/i,u=12,h=typeof TextDecoder>"u"?null:new TextDecoder("utf8");r.prototype={destroy:function(){this.buf=null},readFields:function(E,B,j){for(j=j||this.length;this.pos>3,ee=this.pos;this.type=N&7,E(M,B,this),this.pos===ee&&this.skip(N)}return B},readMessage:function(E,B){return this.readFields(E,B,this.readVarint()+this.pos)},readFixed32:function(){var E=S(this.buf,this.pos);return this.pos+=4,E},readSFixed32:function(){var E=p(this.buf,this.pos);return this.pos+=4,E},readFixed64:function(){var E=S(this.buf,this.pos)+S(this.buf,this.pos+4)*i;return this.pos+=8,E},readSFixed64:function(){var E=S(this.buf,this.pos)+p(this.buf,this.pos+4)*i;return this.pos+=8,E},readFloat:function(){var E=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,E},readDouble:function(){var E=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,E},readVarint:function(E){var B=this.buf,j,N;return N=B[this.pos++],j=N&127,N<128||(N=B[this.pos++],j|=(N&127)<<7,N<128)||(N=B[this.pos++],j|=(N&127)<<14,N<128)||(N=B[this.pos++],j|=(N&127)<<21,N<128)?j:(N=B[this.pos],j|=(N&15)<<28,c(j,E,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var E=this.readVarint();return E%2===1?(E+1)/-2:E/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var E=this.readVarint()+this.pos,B=this.pos;return this.pos=E,E-B>=u&&h?V(this.buf,B,E):q(this.buf,B,E)},readBytes:function(){var E=this.readVarint()+this.pos,B=this.buf.subarray(this.pos,E);return this.pos=E,B},readPackedVarint:function(E,B){if(this.type!==r.Bytes)return E.push(this.readVarint(B));var j=a(this);for(E=E||[];this.pos127;);else if(B===r.Bytes)this.pos=this.readVarint()+this.pos;else if(B===r.Fixed32)this.pos+=4;else if(B===r.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+B)},writeTag:function(E,B){this.writeVarint(E<<3|B)},realloc:function(E){for(var B=this.length||16;B268435455||E<0){f(E,this);return}this.realloc(4),this.buf[this.pos++]=E&127|(E>127?128:0),!(E<=127)&&(this.buf[this.pos++]=(E>>>=7)&127|(E>127?128:0),!(E<=127)&&(this.buf[this.pos++]=(E>>>=7)&127|(E>127?128:0),!(E<=127)&&(this.buf[this.pos++]=E>>>7&127)))},writeSVarint:function(E){this.writeVarint(E<0?-E*2-1:E*2)},writeBoolean:function(E){this.writeVarint(!!E)},writeString:function(E){E=String(E),this.realloc(E.length*4),this.pos++;var B=this.pos;this.pos=$(this.buf,E,this.pos);var j=this.pos-B;j>=128&&C(B,j,this),this.pos=B-1,this.writeVarint(j),this.pos+=j},writeFloat:function(E){this.realloc(4),t.write(this.buf,E,this.pos,!0,23,4),this.pos+=4},writeDouble:function(E){this.realloc(8),t.write(this.buf,E,this.pos,!0,52,8),this.pos+=8},writeBytes:function(E){var B=E.length;this.writeVarint(B),this.realloc(B);for(var j=0;j=128&&C(j,N,this),this.pos=j-1,this.writeVarint(N),this.pos+=N},writeMessage:function(E,B,j){this.writeTag(E,r.Bytes),this.writeRawMessage(B,j)},writePackedVarint:function(E,B){B.length&&this.writeMessage(E,v,B)},writePackedSVarint:function(E,B){B.length&&this.writeMessage(E,T,B)},writePackedBoolean:function(E,B){B.length&&this.writeMessage(E,y,B)},writePackedFloat:function(E,B){B.length&&this.writeMessage(E,O,B)},writePackedDouble:function(E,B){B.length&&this.writeMessage(E,k,B)},writePackedFixed32:function(E,B){B.length&&this.writeMessage(E,R,B)},writePackedSFixed32:function(E,B){B.length&&this.writeMessage(E,w,B)},writePackedFixed64:function(E,B){B.length&&this.writeMessage(E,L,B)},writePackedSFixed64:function(E,B){B.length&&this.writeMessage(E,D,B)},writeBytesField:function(E,B){this.writeTag(E,r.Bytes),this.writeBytes(B)},writeFixed32Field:function(E,B){this.writeTag(E,r.Fixed32),this.writeFixed32(B)},writeSFixed32Field:function(E,B){this.writeTag(E,r.Fixed32),this.writeSFixed32(B)},writeFixed64Field:function(E,B){this.writeTag(E,r.Fixed64),this.writeFixed64(B)},writeSFixed64Field:function(E,B){this.writeTag(E,r.Fixed64),this.writeSFixed64(B)},writeVarintField:function(E,B){this.writeTag(E,r.Varint),this.writeVarint(B)},writeSVarintField:function(E,B){this.writeTag(E,r.Varint),this.writeSVarint(B)},writeStringField:function(E,B){this.writeTag(E,r.Bytes),this.writeString(B)},writeFloatField:function(E,B){this.writeTag(E,r.Fixed32),this.writeFloat(B)},writeDoubleField:function(E,B){this.writeTag(E,r.Fixed64),this.writeDouble(B)},writeBooleanField:function(E,B){this.writeVarintField(E,!!B)}};function c(E,B,j){var N=j.buf,M,ee;if(ee=N[j.pos++],M=(ee&112)>>4,ee<128||(ee=N[j.pos++],M|=(ee&127)<<3,ee<128)||(ee=N[j.pos++],M|=(ee&127)<<10,ee<128)||(ee=N[j.pos++],M|=(ee&127)<<17,ee<128)||(ee=N[j.pos++],M|=(ee&127)<<24,ee<128)||(ee=N[j.pos++],M|=(ee&1)<<31,ee<128))return d(E,M,B);throw new Error("Expected varint not more than 10 bytes")}function a(E){return E.type===r.Bytes?E.readVarint()+E.pos:E.pos+1}function d(E,B,j){return j?B*4294967296+(E>>>0):(B>>>0)*4294967296+(E>>>0)}function f(E,B){var j,N;if(E>=0?(j=E%4294967296|0,N=E/4294967296|0):(j=~(-E%4294967296),N=~(-E/4294967296),j^4294967295?j=j+1|0:(j=0,N=N+1|0)),E>=18446744073709552e3||E<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");B.realloc(10),g(j,N,B),I(N,B)}function g(E,B,j){j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos++]=E&127|128,E>>>=7,j.buf[j.pos]=E&127}function I(E,B){var j=(E&7)<<4;B.buf[B.pos++]|=j|((E>>>=3)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127|((E>>>=7)?128:0),E&&(B.buf[B.pos++]=E&127)))))}function C(E,B,j){var N=B<=16383?1:B<=2097151?2:B<=268435455?3:Math.floor(Math.log(B)/(Math.LN2*7));j.realloc(N);for(var M=j.pos-1;M>=E;M--)j.buf[M+N]=j.buf[M]}function v(E,B){for(var j=0;j>>8,E[j+2]=B>>>16,E[j+3]=B>>>24}function p(E,B){return(E[B]|E[B+1]<<8|E[B+2]<<16)+(E[B+3]<<24)}function q(E,B,j){for(var N="",M=B;M239?4:ee>223?3:ee>191?2:1;if(M+ae>j)break;var pe,_e,Re;ae===1?ee<128&&(oe=ee):ae===2?(pe=E[M+1],(pe&192)===128&&(oe=(ee&31)<<6|pe&63,oe<=127&&(oe=null))):ae===3?(pe=E[M+1],_e=E[M+2],(pe&192)===128&&(_e&192)===128&&(oe=(ee&15)<<12|(pe&63)<<6|_e&63,(oe<=2047||oe>=55296&&oe<=57343)&&(oe=null))):ae===4&&(pe=E[M+1],_e=E[M+2],Re=E[M+3],(pe&192)===128&&(_e&192)===128&&(Re&192)===128&&(oe=(ee&15)<<18|(pe&63)<<12|(_e&63)<<6|Re&63,(oe<=65535||oe>=1114112)&&(oe=null))),oe===null?(oe=65533,ae=1):oe>65535&&(oe-=65536,N+=String.fromCharCode(oe>>>10&1023|55296),oe=56320|oe&1023),N+=String.fromCharCode(oe),M+=ae}return N}function V(E,B,j){return h.decode(E.subarray(B,j))}function $(E,B,j){for(var N=0,M,ee;N55295&&M<57344)if(ee)if(M<56320){E[j++]=239,E[j++]=191,E[j++]=189,ee=M;continue}else M=ee-55296<<10|M-56320|65536,ee=null;else{M>56319||N+1===B.length?(E[j++]=239,E[j++]=191,E[j++]=189):ee=M;continue}else ee&&(E[j++]=239,E[j++]=191,E[j++]=189,ee=null);M<128?E[j++]=M:(M<2048?E[j++]=M>>6|192:(M<65536?E[j++]=M>>12|224:(E[j++]=M>>18|240,E[j++]=M>>12&63|128),E[j++]=M>>6&63|128),E[j++]=M&63|128)}return j}}),D5=Qe(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(h){var c=h+48;return c+=9-h>>>8&-48+65-10,String.fromCharCode(c)}function t(h){var c=h+48;return c+=9-h>>>8&-48+97-10,String.fromCharCode(c)}var r=256;function i(h){var c=r;return c+=(47-h&h-58)>>8&-r+h-48,c+=(64-h&h-71)>>8&-r+h-65+10,c+=(96-h&h-103)>>8&-r+h-97+10,c}function s(h,c){c===void 0&&(c=!1);for(var a=c?t:n,d="",f=0;f>>4),d+=a(h[f]&15);return d}e.encode=s;function u(h){if(h.length===0)return new Uint8Array(0);if(h.length%2!==0)throw new Error("hex: input string must be divisible by two");for(var c=new Uint8Array(h.length/2),a=0,d=0;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(h,c){var a=h>>>16&65535,d=h&65535,f=c>>>16&65535,g=c&65535;return d*g+(a*g+d*f<<16>>>0)|0}e.mul=Math.imul||n;function t(h,c){return h+c|0}e.add=t;function r(h,c){return h-c|0}e.sub=r;function i(h,c){return h<>>32-c}e.rotl=i;function s(h,c){return h<<32-c|h>>>c}e.rotr=s;function u(h){return typeof h=="number"&&isFinite(h)&&Math.floor(h)===h}e.isInteger=Number.isInteger||u,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(h){return e.isInteger(h)&&h>=-e.MAX_SAFE_INTEGER&&h<=e.MAX_SAFE_INTEGER}}),q5=Qe(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=j5();function t(j,N){return N===void 0&&(N=0),(j[N+0]<<8|j[N+1])<<16>>16}e.readInt16BE=t;function r(j,N){return N===void 0&&(N=0),(j[N+0]<<8|j[N+1])>>>0}e.readUint16BE=r;function i(j,N){return N===void 0&&(N=0),(j[N+1]<<8|j[N])<<16>>16}e.readInt16LE=i;function s(j,N){return N===void 0&&(N=0),(j[N+1]<<8|j[N])>>>0}e.readUint16LE=s;function u(j,N,M){return N===void 0&&(N=new Uint8Array(2)),M===void 0&&(M=0),N[M+0]=j>>>8,N[M+1]=j>>>0,N}e.writeUint16BE=u,e.writeInt16BE=u;function h(j,N,M){return N===void 0&&(N=new Uint8Array(2)),M===void 0&&(M=0),N[M+0]=j>>>0,N[M+1]=j>>>8,N}e.writeUint16LE=h,e.writeInt16LE=h;function c(j,N){return N===void 0&&(N=0),j[N]<<24|j[N+1]<<16|j[N+2]<<8|j[N+3]}e.readInt32BE=c;function a(j,N){return N===void 0&&(N=0),(j[N]<<24|j[N+1]<<16|j[N+2]<<8|j[N+3])>>>0}e.readUint32BE=a;function d(j,N){return N===void 0&&(N=0),j[N+3]<<24|j[N+2]<<16|j[N+1]<<8|j[N]}e.readInt32LE=d;function f(j,N){return N===void 0&&(N=0),(j[N+3]<<24|j[N+2]<<16|j[N+1]<<8|j[N])>>>0}e.readUint32LE=f;function g(j,N,M){return N===void 0&&(N=new Uint8Array(4)),M===void 0&&(M=0),N[M+0]=j>>>24,N[M+1]=j>>>16,N[M+2]=j>>>8,N[M+3]=j>>>0,N}e.writeUint32BE=g,e.writeInt32BE=g;function I(j,N,M){return N===void 0&&(N=new Uint8Array(4)),M===void 0&&(M=0),N[M+0]=j>>>0,N[M+1]=j>>>8,N[M+2]=j>>>16,N[M+3]=j>>>24,N}e.writeUint32LE=I,e.writeInt32LE=I;function C(j,N){N===void 0&&(N=0);var M=c(j,N),ee=c(j,N+4);return M*4294967296+ee-(ee>>31)*4294967296}e.readInt64BE=C;function v(j,N){N===void 0&&(N=0);var M=a(j,N),ee=a(j,N+4);return M*4294967296+ee}e.readUint64BE=v;function T(j,N){N===void 0&&(N=0);var M=d(j,N),ee=d(j,N+4);return ee*4294967296+M-(M>>31)*4294967296}e.readInt64LE=T;function O(j,N){N===void 0&&(N=0);var M=f(j,N),ee=f(j,N+4);return ee*4294967296+M}e.readUint64LE=O;function k(j,N,M){return N===void 0&&(N=new Uint8Array(8)),M===void 0&&(M=0),g(j/4294967296>>>0,N,M),g(j>>>0,N,M+4),N}e.writeUint64BE=k,e.writeInt64BE=k;function y(j,N,M){return N===void 0&&(N=new Uint8Array(8)),M===void 0&&(M=0),I(j>>>0,N,M),I(j/4294967296>>>0,N,M+4),N}e.writeUint64LE=y,e.writeInt64LE=y;function R(j,N,M){if(M===void 0&&(M=0),j%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(j/8>N.length-M)throw new Error("readUintBE: array is too short for the given bitLength");for(var ee=0,oe=1,ae=j/8+M-1;ae>=M;ae--)ee+=N[ae]*oe,oe*=256;return ee}e.readUintBE=R;function w(j,N,M){if(M===void 0&&(M=0),j%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(j/8>N.length-M)throw new Error("readUintLE: array is too short for the given bitLength");for(var ee=0,oe=1,ae=M;ae=ee;ae--)M[ae]=N/oe&255,oe*=256;return M}e.writeUintBE=L;function D(j,N,M,ee){if(M===void 0&&(M=new Uint8Array(j/8)),ee===void 0&&(ee=0),j%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(N))throw new Error("writeUintLE value must be an integer");for(var oe=1,ae=ee;ae{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(t){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=q5(),t=M5();e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var r=function(){function h(){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 h.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},h.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},h.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},h.prototype.update=function(c,a){if(a===void 0&&(a=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var d=0;if(this._bytesHashed+=a,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[d++],a--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(a>=this.blockSize&&(d=s(this._temp,this._state,c,d,a),a%=this.blockSize);a>0;)this._buffer[this._bufferLength++]=c[d++],a--;return this},h.prototype.finish=function(c){if(!this._finished){var a=this._bytesHashed,d=this._bufferLength,f=a/536870912|0,g=a<<3,I=a%64<56?64:128;this._buffer[d]=128;for(var C=d+1;C0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},h.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},h.prototype.cleanSavedState=function(c){t.wipe(c.state),c.buffer&&t.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},h}();e.SHA256=r;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 s(h,c,a,d,f){for(;f>=64;){for(var g=c[0],I=c[1],C=c[2],v=c[3],T=c[4],O=c[5],k=c[6],y=c[7],R=0;R<16;R++){var w=d+R*4;h[R]=n.readUint32BE(a,w)}for(var R=16;R<64;R++){var L=h[R-2],D=(L>>>17|L<<32-17)^(L>>>19|L<<32-19)^L>>>10;L=h[R-15];var S=(L>>>7|L<<32-7)^(L>>>18|L<<32-18)^L>>>3;h[R]=(D+h[R-7]|0)+(S+h[R-16]|0)}for(var R=0;R<64;R++){var D=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&O^~T&k)|0)+(y+(i[R]+h[R]|0)|0)|0,S=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&I^g&C^I&C)|0;y=k,k=O,O=T,T=v+D|0,v=C,C=I,I=g,g=D+S|0}c[0]+=g,c[1]+=I,c[2]+=C,c[3]+=v,c[4]+=T,c[5]+=O,c[6]+=k,c[7]+=y,d+=64,f-=64}return d}function u(h){var c=new r;c.update(h);var a=c.digest();return c.clean(),a}e.hash=u}),lt=Qe((e,n)=>{n.exports={options:{usePureJavaScript:!1}}}),F5=Qe((e,n)=>{var t={};n.exports=t;var r={};t.encode=function(s,u,h){if(typeof u!="string")throw new TypeError('"alphabet" must be a string.');if(h!==void 0&&typeof h!="number")throw new TypeError('"maxline" must be a number.');var c="";if(!(s instanceof Uint8Array))c=i(s,u);else{var a=0,d=u.length,f=u.charAt(0),g=[0];for(a=0;a0;)g.push(C%d),C=C/d|0}for(a=0;s[a]===0&&a=0;--a)c+=u[g[a]]}if(h){var v=new RegExp(".{1,"+h+"}","g");c=c.match(v).join(`\r +`)}return c},t.decode=function(s,u){if(typeof s!="string")throw new TypeError('"input" must be a string.');if(typeof u!="string")throw new TypeError('"alphabet" must be a string.');var h=r[u];if(!h){h=r[u]=[];for(var c=0;c>=8;for(;C>0;)f.push(C&255),C>>=8}for(var v=0;s[v]===d&&v0;)d.push(g%c),g=g/c|0}var I="";for(h=0;s.at(h)===0&&h=0;--h)I+=u[d[h]];return I}}),Et=Qe((e,n)=>{var t=lt(),r=F5(),i=n.exports=t.util=t.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(p){return setImmediate(p)};return}if(i.setImmediate=function(p){setTimeout(p,0)},typeof window<"u"&&typeof window.postMessage=="function"){let p=function(q){if(q.source===window&&q.data===R){q.stopPropagation();var V=w.slice();w.length=0,V.forEach(function($){$()})}};var y=p,R="forge.setImmediate",w=[];i.setImmediate=function(q){w.push(q),w.length===1&&window.postMessage(R,"*")},window.addEventListener("message",p,!0)}if(typeof MutationObserver<"u"){var L=Date.now(),D=!0,S=document.createElement("div"),w=[];new MutationObserver(function(){var q=w.slice();w.length=0,q.forEach(function(V){V()})}).observe(S,{attributes:!0});var m=i.setImmediate;i.setImmediate=function(q){Date.now()-L>15?(L=Date.now(),m(q)):(w.push(q),w.length===1&&S.setAttribute("a",D=!D))}}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(y){return Object.prototype.toString.call(y)==="[object Array]"},i.isArrayBuffer=function(y){return typeof ArrayBuffer<"u"&&y instanceof ArrayBuffer},i.isArrayBufferView=function(y){return y&&i.isArrayBuffer(y.buffer)&&y.byteLength!==void 0};function s(y){if(!(y===8||y===16||y===24||y===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+y)}i.ByteBuffer=u;function u(y){if(this.data="",this.read=0,typeof y=="string")this.data=y;else if(i.isArrayBuffer(y)||i.isArrayBufferView(y))if(typeof Buffer<"u"&&y instanceof Buffer)this.data=y.toString("binary");else{var R=new Uint8Array(y);try{this.data=String.fromCharCode.apply(null,R)}catch{for(var w=0;wh&&(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(y){return this.putBytes(String.fromCharCode(y))},i.ByteStringBuffer.prototype.fillWithByte=function(y,R){y=String.fromCharCode(y);for(var w=this.data;R>0;)R&1&&(w+=y),R>>>=1,R>0&&(y+=y);return this.data=w,this._optimizeConstructedString(R),this},i.ByteStringBuffer.prototype.putBytes=function(y){return this.data+=y,this._optimizeConstructedString(y.length),this},i.ByteStringBuffer.prototype.putString=function(y){return this.putBytes(i.encodeUtf8(y))},i.ByteStringBuffer.prototype.putInt16=function(y){return this.putBytes(String.fromCharCode(y>>8&255)+String.fromCharCode(y&255))},i.ByteStringBuffer.prototype.putInt24=function(y){return this.putBytes(String.fromCharCode(y>>16&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y&255))},i.ByteStringBuffer.prototype.putInt32=function(y){return this.putBytes(String.fromCharCode(y>>24&255)+String.fromCharCode(y>>16&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y&255))},i.ByteStringBuffer.prototype.putInt16Le=function(y){return this.putBytes(String.fromCharCode(y&255)+String.fromCharCode(y>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(y){return this.putBytes(String.fromCharCode(y&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(y){return this.putBytes(String.fromCharCode(y&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y>>16&255)+String.fromCharCode(y>>24&255))},i.ByteStringBuffer.prototype.putInt=function(y,R){s(R);var w="";do R-=8,w+=String.fromCharCode(y>>R&255);while(R>0);return this.putBytes(w)},i.ByteStringBuffer.prototype.putSignedInt=function(y,R){return y<0&&(y+=2<0);return R},i.ByteStringBuffer.prototype.getSignedInt=function(y){var R=this.getInt(y),w=2<=w&&(R-=w<<1),R},i.ByteStringBuffer.prototype.getBytes=function(y){var R;return y?(y=Math.min(this.length(),y),R=this.data.slice(this.read,this.read+y),this.read+=y):y===0?R="":(R=this.read===0?this.data:this.data.slice(this.read),this.clear()),R},i.ByteStringBuffer.prototype.bytes=function(y){return typeof y>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+y)},i.ByteStringBuffer.prototype.at=function(y){return this.data.charCodeAt(this.read+y)},i.ByteStringBuffer.prototype.setAt=function(y,R){return this.data=this.data.substr(0,this.read+y)+String.fromCharCode(R)+this.data.substr(this.read+y+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var y=i.createBuffer(this.data);return y.read=this.read,y},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(y){var R=Math.max(0,this.length()-y);return this.data=this.data.substr(this.read,R),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var y="",R=this.read;R=y)return this;R=Math.max(R||this.growSize,y);var w=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),L=new Uint8Array(this.length()+R);return L.set(w),this.data=new DataView(L.buffer),this},i.DataBuffer.prototype.putByte=function(y){return this.accommodate(1),this.data.setUint8(this.write++,y),this},i.DataBuffer.prototype.fillWithByte=function(y,R){this.accommodate(R);for(var w=0;w>8&65535),this.data.setInt8(this.write,y>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(y){return this.accommodate(4),this.data.setInt32(this.write,y),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(y){return this.accommodate(2),this.data.setInt16(this.write,y,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(y){return this.accommodate(3),this.data.setInt8(this.write,y>>16&255),this.data.setInt16(this.write,y>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(y){return this.accommodate(4),this.data.setInt32(this.write,y,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(y,R){s(R),this.accommodate(R/8);do R-=8,this.data.setInt8(this.write++,y>>R&255);while(R>0);return this},i.DataBuffer.prototype.putSignedInt=function(y,R){return s(R),this.accommodate(R/8),y<0&&(y+=2<0);return R},i.DataBuffer.prototype.getSignedInt=function(y){var R=this.getInt(y),w=2<=w&&(R-=w<<1),R},i.DataBuffer.prototype.getBytes=function(y){var R;return y?(y=Math.min(this.length(),y),R=this.data.slice(this.read,this.read+y),this.read+=y):y===0?R="":(R=this.read===0?this.data:this.data.slice(this.read),this.clear()),R},i.DataBuffer.prototype.bytes=function(y){return typeof y>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+y)},i.DataBuffer.prototype.at=function(y){return this.data.getUint8(this.read+y)},i.DataBuffer.prototype.setAt=function(y,R){return this.data.setUint8(y,R),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 y=new Uint8Array(this.data.buffer,this.read),R=new Uint8Array(y.byteLength);R.set(y),this.data=new DataView(R),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(y){return this.write=Math.max(0,this.length()-y),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var y="",R=this.read;R0;)R&1&&(w+=y),R>>>=1,R>0&&(y+=y);return w},i.xorBytes=function(y,R,w){for(var L="",D="",S="",m=0,p=0;w>0;--w,++m)D=y.charCodeAt(m)^R.charCodeAt(m),p>=10&&(L+=S,S="",p=0),S+=String.fromCharCode(D),++p;return L+=S,L},i.hexToBytes=function(y){var R="",w=0;for(y.length&!0&&(w=1,R+=String.fromCharCode(parseInt(y[0],16)));w>24&255)+String.fromCharCode(y>>16&255)+String.fromCharCode(y>>8&255)+String.fromCharCode(y&255)};var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[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],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(y,R){for(var w="",L="",D,S,m,p=0;p>2),w+=a.charAt((D&3)<<4|S>>4),isNaN(S)?w+="==":(w+=a.charAt((S&15)<<2|m>>6),w+=isNaN(m)?"=":a.charAt(m&63)),R&&w.length>R&&(L+=w.substr(0,R)+`\r `,w=w.substr(R));return L+=w,L},i.decode64=function(y){y=y.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var R="",w,L,D,S,m=0;m>4),D!==64&&(R+=String.fromCharCode((L&15)<<4|D>>2),S!==64&&(R+=String.fromCharCode((D&3)<<6|S)));return R},i.encodeUtf8=function(y){return unescape(encodeURIComponent(y))},i.decodeUtf8=function(y){return decodeURIComponent(escape(y))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:r.encode,decode:r.decode}},i.binary.raw.encode=function(y){return String.fromCharCode.apply(null,y)},i.binary.raw.decode=function(y,R,w){var L=R;L||(L=new Uint8Array(y.length)),w=w||0;for(var D=w,S=0;S>2),w+=a.charAt((D&3)<<4|S>>4),isNaN(S)?w+="==":(w+=a.charAt((S&15)<<2|m>>6),w+=isNaN(m)?"=":a.charAt(m&63)),R&&w.length>R&&(L+=w.substr(0,R)+`\r -`,w=w.substr(R));return L+=w,L},i.binary.base64.decode=function(y,R,w){var L=R;L||(L=new Uint8Array(Math.ceil(y.length/4)*3)),y=y.replace(/[^A-Za-z0-9\+\/\=]/g,""),w=w||0;for(var D,S,m,p,q=0,V=w;q>4,m!==64&&(L[V++]=(S&15)<<4|m>>2,p!==64&&(L[V++]=(m&3)<<6|p));return R?V-w:L.subarray(0,V)},i.binary.base58.encode=function(y,R){return i.binary.baseN.encode(y,f,R)},i.binary.base58.decode=function(y,R){return i.binary.baseN.decode(y,f,R)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(y,R,w){y=i.encodeUtf8(y);var L=R;L||(L=new Uint8Array(y.length)),w=w||0;for(var D=w,S=0;S"u"&&(w=["web","flash"]);var D,S=!1,m=null;for(var p in w){D=w[p];try{if(D==="flash"||D==="both"){if(R[0]===null)throw new Error("Flash local storage not available.");L=y.apply(this,R),S=D==="flash"}(D==="web"||D==="both")&&(R[0]=localStorage,L=y.apply(this,R),S=!0)}catch(q){m=q}if(S)break}if(!S)throw m;return L};i.setItem=function(y,R,w,L,D){k(C,arguments,D)},i.getItem=function(y,R,w,L){return k(v,arguments,L)},i.removeItem=function(y,R,w,L){k(T,arguments,L)},i.clearItems=function(y,R,w){k(O,arguments,w)},i.isEmpty=function(y){for(var R in y)if(y.hasOwnProperty(R))return!1;return!0},i.format=function(y){for(var R=/%./g,w,L,D=0,S=[],m=0;w=R.exec(y);){L=y.substring(m,R.lastIndex-2),L.length>0&&S.push(L),m=R.lastIndex;var p=w[0][1];switch(p){case"s":case"o":D");break;case"%":S.push("%");break;default:S.push("<%"+p+"?>")}}return S.push(y.substring(m)),S.join("")},i.formatNumber=function(y,R,w,L){var D=y,S=isNaN(R=Math.abs(R))?2:R,m=w===void 0?",":w,p=L===void 0?".":L,q=D<0?"-":"",V=parseInt(D=Math.abs(+D||0).toFixed(S),10)+"",$=V.length>3?V.length%3:0;return q+($?V.substr(0,$)+p:"")+V.substr($).replace(/(\d{3})(?=\d)/g,"$1"+p)+(S?m+Math.abs(D-V).toFixed(S).slice(2):"")},i.formatSize=function(y){return y>=1073741824?y=i.formatNumber(y/1073741824,2,".","")+" GiB":y>=1048576?y=i.formatNumber(y/1048576,2,".","")+" MiB":y>=1024?y=i.formatNumber(y/1024,0)+" KiB":y=i.formatNumber(y,0)+" bytes",y},i.bytesFromIP=function(y){return y.indexOf(".")!==-1?i.bytesFromIPv4(y):y.indexOf(":")!==-1?i.bytesFromIPv6(y):null},i.bytesFromIPv4=function(y){if(y=y.split("."),y.length!==4)return null;for(var R=i.createBuffer(),w=0;ww[L].end-w[L].start&&(L=w.length-1))}R.push(S)}if(w.length>0){var q=w[L];q.end-q.start>0&&(R.splice(q.start,q.end-q.start+1,""),q.start===0&&R.unshift(""),q.end===7&&R.push(""))}return R.join(":")},i.estimateCores=function(y,R){if(typeof y=="function"&&(R=y,y={}),y=y||{},"cores"in i&&!y.update)return R(null,i.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,R(null,i.cores);if(typeof Worker>"u")return i.cores=1,R(null,i.cores);if(typeof Blob>"u")return i.cores=2,R(null,i.cores);var w=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(m){for(var p=Date.now(),q=p+4;Date.now()j.st&&$.st$.st&&j.st<$.et)&&E.push(B)}return q.reduce(function(N,M){return Math.max(N,M.length)},0)}}}),Hp=Qe((e,n)=>{var t=lt();Et(),n.exports=t.cipher=t.cipher||{},t.cipher.algorithms=t.cipher.algorithms||{},t.cipher.createCipher=function(i,s){var u=i;if(typeof u=="string"&&(u=t.cipher.getAlgorithm(u),u&&(u=u())),!u)throw new Error("Unsupported algorithm: "+i);return new t.cipher.BlockCipher({algorithm:u,key:s,decrypt:!1})},t.cipher.createDecipher=function(i,s){var u=i;if(typeof u=="string"&&(u=t.cipher.getAlgorithm(u),u&&(u=u())),!u)throw new Error("Unsupported algorithm: "+i);return new t.cipher.BlockCipher({algorithm:u,key:s,decrypt:!0})},t.cipher.registerAlgorithm=function(i,s){i=i.toUpperCase(),t.cipher.algorithms[i]=s},t.cipher.getAlgorithm=function(i){return i=i.toUpperCase(),i in t.cipher.algorithms?t.cipher.algorithms[i]:null};var r=t.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)};r.prototype.start=function(i){i=i||{};var s={};for(var u in i)s[u]=i[u];s.decrypt=this._decrypt,this._finish=!1,this._input=t.util.createBuffer(),this.output=i.output||t.util.createBuffer(),this.mode.start(s)},r.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()},r.prototype.finish=function(i){i&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(u){return i(this.blockSize,u,!1)},this.mode.unpad=function(u){return i(this.blockSize,u,!0)});var s={};return s.decrypt=this._decrypt,s.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,s)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,s))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,s))}}),lb=Qe((e,n)=>{var t=lt();Et(),t.cipher=t.cipher||{};var r=n.exports=t.cipher.modes=t.cipher.modes||{};r.ecb=function(h){h=h||{},this.name="ECB",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},r.ecb.prototype.start=function(h){},r.ecb.prototype.encrypt=function(h,c,a){if(h.length()0))return!0;for(var d=0;d0))return!0;for(var d=0;d0)return!1;var a=h.length(),d=h.at(a-1);return d>this.blockSize<<2?!1:(h.truncate(d),!0)},r.cbc=function(h){h=h||{},this.name="CBC",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},r.cbc.prototype.start=function(h){if(h.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in h)this._iv=i(h.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},r.cbc.prototype.encrypt=function(h,c,a){if(h.length()0))return!0;for(var d=0;d0))return!0;for(var d=0;d0)return!1;var a=h.length(),d=h.at(a-1);return d>this.blockSize<<2?!1:(h.truncate(d),!0)},r.cfb=function(h){h=h||{},this.name="CFB",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0},r.cfb.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");this._iv=i(h.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.cfb.prototype.encrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0)h.read-=this.blockSize;else for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},r.cfb.prototype.decrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0)h.read-=this.blockSize;else for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},r.ofb=function(h){h=h||{},this.name="OFB",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0},r.ofb.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");this._iv=i(h.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.ofb.prototype.encrypt=function(h,c,a){var d=h.length();if(h.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0)h.read-=this.blockSize;else for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},r.ofb.prototype.decrypt=r.ofb.prototype.encrypt,r.ctr=function(h){h=h||{},this.name="CTR",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0},r.ctr.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");this._iv=i(h.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.ctr.prototype.encrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize)for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0&&(h.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},r.ctr.prototype.decrypt=r.ctr.prototype.encrypt,r.gcm=function(h){h=h||{},this.name="GCM",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0,this._R=3774873600},r.gcm.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");var c=t.util.createBuffer(h.iv);this._cipherLength=0;var a;if("additionalData"in h?a=t.util.createBuffer(h.additionalData):a=t.util.createBuffer(),"tagLength"in h?this._tagLength=h.tagLength:this._tagLength=128,this._tag=null,h.decrypt&&(this._tag=t.util.createBuffer(h.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 d=c.length();if(d===12)this._j0=[c.getInt32(),c.getInt32(),c.getInt32(),1];else{for(this._j0=[0,0,0,0];c.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[c.getInt32(),c.getInt32(),c.getInt32(),c.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(u(d*8)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,a=t.util.createBuffer(a),this._aDataLength=u(a.length()*8);var f=a.length()%this.blockSize;for(f&&a.fillWithByte(0,this.blockSize-f),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()])},r.gcm.prototype.encrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return h.read-=this.blockSize,c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},r.gcm.prototype.decrypt=function(h,c,a){var d=h.length();if(d0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=h.getInt32(),this._hashBlock[1]=h.getInt32(),this._hashBlock[2]=h.getInt32(),this._hashBlock[3]=h.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var f=0;f0;--d)c[d]=h[d]>>>1|(h[d-1]&1)<<31;c[0]=h[0]>>>1,a&&(c[0]^=this._R)},r.gcm.prototype.tableMultiply=function(h){for(var c=[0,0,0,0],a=0;a<32;++a){var d=a/8|0,f=h[d]>>>(7-a%8)*4&15,g=this._m[a][f];c[0]^=g[0],c[1]^=g[1],c[2]^=g[2],c[3]^=g[3]}return c},r.gcm.prototype.ghash=function(h,c,a){return c[0]^=a[0],c[1]^=a[1],c[2]^=a[2],c[3]^=a[3],this.tableMultiply(c)},r.gcm.prototype.generateHashTable=function(h,c){for(var a=8/c,d=4*a,f=16*a,g=new Array(f),I=0;I>>1,f=new Array(a);f[d]=h.slice(0);for(var g=d>>>1;g>0;)this.pow(f[2*g],f[g]=[]),g>>=1;for(g=2;g4){var a=h;h=t.util.createBuffer();for(var d=0;d{var t=lt();Hp(),lb(),Et(),n.exports=t.aes=t.aes||{},t.aes.startEncrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!1,mode:k});return y.start(T),y},t.aes.createEncryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!1,mode:T})},t.aes.startDecrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!0,mode:k});return y.start(T),y},t.aes.createDecryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!0,mode:T})},t.aes.Algorithm=function(v,T){i||f();var O=this;O.name=v,O.mode=new T({blockSize:16,cipher:{encrypt:function(k,y){return I(O._w,k,y,!1)},decrypt:function(k,y){return I(O._w,k,y,!0)}}}),O._init=!1},t.aes.Algorithm.prototype.initialize=function(v){if(!this._init){var T=v.key,O;if(typeof T=="string"&&(T.length===16||T.length===24||T.length===32))T=t.util.createBuffer(T);else if(t.util.isArray(T)&&(T.length===16||T.length===24||T.length===32)){O=T,T=t.util.createBuffer();for(var k=0;k>>2;for(var k=0;k>8^L&255^99,u[O]=L,h[L]=O,D=v[L],y=v[O],R=v[y],w=v[R],S=D<<24^L<<16^L<<8^(L^D),m=(y^R^w)<<24^(O^w)<<16^(O^R^w)<<8^(O^y^w);for(var p=0;p<4;++p)a[p][O]=S,d[p][L]=m,S=S<<24|S>>>8,m=m<<24|m>>>8;O===0?O=k=1:(O=y^v[v[v[y^w]]],k^=v[v[k]])}}function g(v,T){for(var O=v.slice(0),k,y=1,R=O.length,w=R+6+1,L=s*w,D=R;D>>16&255]<<24^u[k>>>8&255]<<16^u[k&255]<<8^u[k>>>24]^c[y]<<24,y++):R>6&&D%R===4&&(k=u[k>>>24]<<24^u[k>>>16&255]<<16^u[k>>>8&255]<<8^u[k&255]),O[D]=O[D-R]^k;if(T){var S,m=d[0],p=d[1],q=d[2],V=d[3],$=O.slice(0);L=O.length;for(var D=0,E=L-s;D>>24]]^p[u[S>>>16&255]]^q[u[S>>>8&255]]^V[u[S&255]];O=$}return O}function I(v,T,O,k){var y=v.length/4-1,R,w,L,D,S;k?(R=d[0],w=d[1],L=d[2],D=d[3],S=h):(R=a[0],w=a[1],L=a[2],D=a[3],S=u);var m,p,q,V,$,E,B;m=T[0]^v[0],p=T[k?3:1]^v[1],q=T[2]^v[2],V=T[k?1:3]^v[3];for(var j=3,N=1;N>>24]^w[p>>>16&255]^L[q>>>8&255]^D[V&255]^v[++j],E=R[p>>>24]^w[q>>>16&255]^L[V>>>8&255]^D[m&255]^v[++j],B=R[q>>>24]^w[V>>>16&255]^L[m>>>8&255]^D[p&255]^v[++j],V=R[V>>>24]^w[m>>>16&255]^L[p>>>8&255]^D[q&255]^v[++j],m=$,p=E,q=B;O[0]=S[m>>>24]<<24^S[p>>>16&255]<<16^S[q>>>8&255]<<8^S[V&255]^v[++j],O[k?3:1]=S[p>>>24]<<24^S[q>>>16&255]<<16^S[V>>>8&255]<<8^S[m&255]^v[++j],O[2]=S[q>>>24]<<24^S[V>>>16&255]<<16^S[m>>>8&255]<<8^S[p&255]^v[++j],O[k?1:3]=S[V>>>24]<<24^S[m>>>16&255]<<16^S[p>>>8&255]<<8^S[q&255]^v[++j]}function C(v){v=v||{};var T=(v.mode||"CBC").toUpperCase(),O="AES-"+T,k;v.decrypt?k=t.cipher.createDecipher(O,v.key):k=t.cipher.createCipher(O,v.key);var y=k.start;return k.start=function(R,w){var L=null;w instanceof t.util.ByteBuffer&&(L=w,w={}),w=w||{},w.output=L,w.iv=R,y.call(k,w)},k}}),La=Qe((e,n)=>{var t=lt();t.pki=t.pki||{};var r=n.exports=t.pki.oids=t.oids=t.oids||{};function i(u,h){r[u]=h,r[h]=u}function s(u,h){r[u]=h}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"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("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")}),ki=Qe((e,n)=>{var t=lt();Et(),La();var r=n.exports=t.asn1=t.asn1||{};r.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},r.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},r.create=function(c,a,d,f,g){if(t.util.isArray(f)){for(var I=[],C=0;Ca){var f=new Error("Too few bytes to parse DER.");throw f.available=c.length(),f.remaining=a,f.requested=d,f}}var s=function(c,a){var d=c.getByte();if(a--,d!==128){var f,g=d&128;if(!g)f=d;else{var I=d&127;i(c,a,I),f=c.getInt(I<<3)}if(f<0)throw new Error("Negative length: "+f);return f}};r.fromDer=function(c,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 c=="string"&&(c=t.util.createBuffer(c));var d=c.length(),f=u(c,c.length(),0,a);if(a.parseAllBytes&&c.length()!==0){var g=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw g.byteCount=d,g.remaining=c.length(),g}return f};function u(c,a,d,f){var g;i(c,a,2);var I=c.getByte();a--;var C=I&192,v=I&31;g=c.length();var T=s(c,a);if(a-=g-c.length(),T!==void 0&&T>a){if(f.strict){var O=new Error("Too few bytes to read ASN.1 value.");throw O.available=c.length(),O.remaining=a,O.requested=T,O}T=a}var k,y,R=(I&32)===32;if(R)if(k=[],T===void 0)for(;;){if(i(c,a,2),c.bytes(2)===String.fromCharCode(0,0)){c.getBytes(2),a-=2;break}g=c.length(),k.push(u(c,a,d+1,f)),a-=g-c.length()}else for(;T>0;)g=c.length(),k.push(u(c,T,d+1,f)),a-=g-c.length(),T-=g-c.length();if(k===void 0&&C===r.Class.UNIVERSAL&&v===r.Type.BITSTRING&&(y=c.bytes(T)),k===void 0&&f.decodeBitStrings&&C===r.Class.UNIVERSAL&&v===r.Type.BITSTRING&&T>1){var w=c.read,L=a,D=0;if(v===r.Type.BITSTRING&&(i(c,a,1),D=c.getByte(),a--),D===0)try{g=c.length();var S={strict:!0,decodeBitStrings:!0},m=u(c,a,d+1,S),p=g-c.length();a-=p,v==r.Type.BITSTRING&&p++;var q=m.tagClass;p===T&&(q===r.Class.UNIVERSAL||q===r.Class.CONTEXT_SPECIFIC)&&(k=[m])}catch{}k===void 0&&(c.read=w,a=L)}if(k===void 0){if(T===void 0){if(f.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");T=a}if(v===r.Type.BMPSTRING)for(k="";T>0;T-=2)i(c,a,2),k+=String.fromCharCode(c.getInt16()),a-=2;else k=c.getBytes(T),a-=T}var V=y===void 0?null:{bitStringContents:y};return r.create(C,v,R,k,V)}r.toDer=function(c){var a=t.util.createBuffer(),d=c.tagClass|c.type,f=t.util.createBuffer(),g=!1;if("bitStringContents"in c&&(g=!0,c.original&&(g=r.equals(c,c.original))),g)f.putBytes(c.bitStringContents);else if(c.composed){c.constructed?d|=32:f.putByte(0);for(var I=0;I1&&(c.value.charCodeAt(0)===0&&!(c.value.charCodeAt(1)&128)||c.value.charCodeAt(0)===255&&(c.value.charCodeAt(1)&128)===128)?f.putBytes(c.value.substr(1)):f.putBytes(c.value);if(a.putByte(d),f.length()<=127)a.putByte(f.length()&127);else{var C=f.length(),v="";do v+=String.fromCharCode(C&255),C=C>>>8;while(C>0);a.putByte(v.length|128);for(var I=v.length-1;I>=0;--I)a.putByte(v.charCodeAt(I))}return a.putBuffer(f),a},r.oidToDer=function(c){var a=c.split("."),d=t.util.createBuffer();d.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var f,g,I,C,v=2;v>>7,f||(C|=128),g.push(C),f=!1;while(I>0);for(var T=g.length-1;T>=0;--T)d.putByte(g[T])}return d},r.derToOid=function(c){var a;typeof c=="string"&&(c=t.util.createBuffer(c));var d=c.getByte();a=Math.floor(d/40)+"."+d%40;for(var f=0;c.length()>0;)d=c.getByte(),f=f<<7,d&128?f+=d&127:(a+="."+(f+d),f=0);return a},r.utcTimeToDate=function(c){var a=new Date,d=parseInt(c.substr(0,2),10);d=d>=50?1900+d:2e3+d;var f=parseInt(c.substr(2,2),10)-1,g=parseInt(c.substr(4,2),10),I=parseInt(c.substr(6,2),10),C=parseInt(c.substr(8,2),10),v=0;if(c.length>11){var T=c.charAt(10),O=10;T!=="+"&&T!=="-"&&(v=parseInt(c.substr(10,2),10),O+=2)}if(a.setUTCFullYear(d,f,g),a.setUTCHours(I,C,v,0),O&&(T=c.charAt(O),T==="+"||T==="-")){var k=parseInt(c.substr(O+1,2),10),y=parseInt(c.substr(O+4,2),10),R=k*60+y;R*=6e4,T==="+"?a.setTime(+a-R):a.setTime(+a+R)}return a},r.generalizedTimeToDate=function(c){var a=new Date,d=parseInt(c.substr(0,4),10),f=parseInt(c.substr(4,2),10)-1,g=parseInt(c.substr(6,2),10),I=parseInt(c.substr(8,2),10),C=parseInt(c.substr(10,2),10),v=parseInt(c.substr(12,2),10),T=0,O=0,k=!1;c.charAt(c.length-1)==="Z"&&(k=!0);var y=c.length-5,R=c.charAt(y);if(R==="+"||R==="-"){var w=parseInt(c.substr(y+1,2),10),L=parseInt(c.substr(y+4,2),10);O=w*60+L,O*=6e4,R==="+"&&(O*=-1),k=!0}return c.charAt(14)==="."&&(T=parseFloat(c.substr(14),10)*1e3),k?(a.setUTCFullYear(d,f,g),a.setUTCHours(I,C,v,T),a.setTime(+a+O)):(a.setFullYear(d,f,g),a.setHours(I,C,v,T)),a},r.dateToUtcTime=function(c){if(typeof c=="string")return c;var a="",d=[];d.push((""+c.getUTCFullYear()).substr(2)),d.push(""+(c.getUTCMonth()+1)),d.push(""+c.getUTCDate()),d.push(""+c.getUTCHours()),d.push(""+c.getUTCMinutes()),d.push(""+c.getUTCSeconds());for(var f=0;f=-128&&c<128)return a.putSignedInt(c,8);if(c>=-32768&&c<32768)return a.putSignedInt(c,16);if(c>=-8388608&&c<8388608)return a.putSignedInt(c,24);if(c>=-2147483648&&c<2147483648)return a.putSignedInt(c,32);var d=new Error("Integer too large; max is 32-bits.");throw d.integer=c,d},r.derToInteger=function(c){typeof c=="string"&&(c=t.util.createBuffer(c));var a=c.length()*8;if(a>32)throw new Error("Integer too large; max is 32-bits.");return c.getSignedInt(a)},r.validate=function(c,a,d,f){var g=!1;if((c.tagClass===a.tagClass||typeof a.tagClass>"u")&&(c.type===a.type||typeof a.type>"u"))if(c.constructed===a.constructed||typeof a.constructed>"u"){if(g=!0,a.value&&t.util.isArray(a.value))for(var I=0,C=0;g&&C0&&(f+=` +`,w=w.substr(R));return L+=w,L},i.binary.base64.decode=function(y,R,w){var L=R;L||(L=new Uint8Array(Math.ceil(y.length/4)*3)),y=y.replace(/[^A-Za-z0-9\+\/\=]/g,""),w=w||0;for(var D,S,m,p,q=0,V=w;q>4,m!==64&&(L[V++]=(S&15)<<4|m>>2,p!==64&&(L[V++]=(m&3)<<6|p));return R?V-w:L.subarray(0,V)},i.binary.base58.encode=function(y,R){return i.binary.baseN.encode(y,f,R)},i.binary.base58.decode=function(y,R){return i.binary.baseN.decode(y,f,R)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(y,R,w){y=i.encodeUtf8(y);var L=R;L||(L=new Uint8Array(y.length)),w=w||0;for(var D=w,S=0;S"u"&&(w=["web","flash"]);var D,S=!1,m=null;for(var p in w){D=w[p];try{if(D==="flash"||D==="both"){if(R[0]===null)throw new Error("Flash local storage not available.");L=y.apply(this,R),S=D==="flash"}(D==="web"||D==="both")&&(R[0]=localStorage,L=y.apply(this,R),S=!0)}catch(q){m=q}if(S)break}if(!S)throw m;return L};i.setItem=function(y,R,w,L,D){k(C,arguments,D)},i.getItem=function(y,R,w,L){return k(v,arguments,L)},i.removeItem=function(y,R,w,L){k(T,arguments,L)},i.clearItems=function(y,R,w){k(O,arguments,w)},i.isEmpty=function(y){for(var R in y)if(y.hasOwnProperty(R))return!1;return!0},i.format=function(y){for(var R=/%./g,w,L,D=0,S=[],m=0;w=R.exec(y);){L=y.substring(m,R.lastIndex-2),L.length>0&&S.push(L),m=R.lastIndex;var p=w[0][1];switch(p){case"s":case"o":D");break;case"%":S.push("%");break;default:S.push("<%"+p+"?>")}}return S.push(y.substring(m)),S.join("")},i.formatNumber=function(y,R,w,L){var D=y,S=isNaN(R=Math.abs(R))?2:R,m=w===void 0?",":w,p=L===void 0?".":L,q=D<0?"-":"",V=parseInt(D=Math.abs(+D||0).toFixed(S),10)+"",$=V.length>3?V.length%3:0;return q+($?V.substr(0,$)+p:"")+V.substr($).replace(/(\d{3})(?=\d)/g,"$1"+p)+(S?m+Math.abs(D-V).toFixed(S).slice(2):"")},i.formatSize=function(y){return y>=1073741824?y=i.formatNumber(y/1073741824,2,".","")+" GiB":y>=1048576?y=i.formatNumber(y/1048576,2,".","")+" MiB":y>=1024?y=i.formatNumber(y/1024,0)+" KiB":y=i.formatNumber(y,0)+" bytes",y},i.bytesFromIP=function(y){return y.indexOf(".")!==-1?i.bytesFromIPv4(y):y.indexOf(":")!==-1?i.bytesFromIPv6(y):null},i.bytesFromIPv4=function(y){if(y=y.split("."),y.length!==4)return null;for(var R=i.createBuffer(),w=0;ww[L].end-w[L].start&&(L=w.length-1))}R.push(S)}if(w.length>0){var q=w[L];q.end-q.start>0&&(R.splice(q.start,q.end-q.start+1,""),q.start===0&&R.unshift(""),q.end===7&&R.push(""))}return R.join(":")},i.estimateCores=function(y,R){if(typeof y=="function"&&(R=y,y={}),y=y||{},"cores"in i&&!y.update)return R(null,i.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,R(null,i.cores);if(typeof Worker>"u")return i.cores=1,R(null,i.cores);if(typeof Blob>"u")return i.cores=2,R(null,i.cores);var w=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(m){for(var p=Date.now(),q=p+4;Date.now()j.st&&$.st$.st&&j.st<$.et)&&E.push(B)}return q.reduce(function(N,M){return Math.max(N,M.length)},0)}}}),Mp=Qe((e,n)=>{var t=lt();Et(),n.exports=t.cipher=t.cipher||{},t.cipher.algorithms=t.cipher.algorithms||{},t.cipher.createCipher=function(i,s){var u=i;if(typeof u=="string"&&(u=t.cipher.getAlgorithm(u),u&&(u=u())),!u)throw new Error("Unsupported algorithm: "+i);return new t.cipher.BlockCipher({algorithm:u,key:s,decrypt:!1})},t.cipher.createDecipher=function(i,s){var u=i;if(typeof u=="string"&&(u=t.cipher.getAlgorithm(u),u&&(u=u())),!u)throw new Error("Unsupported algorithm: "+i);return new t.cipher.BlockCipher({algorithm:u,key:s,decrypt:!0})},t.cipher.registerAlgorithm=function(i,s){i=i.toUpperCase(),t.cipher.algorithms[i]=s},t.cipher.getAlgorithm=function(i){return i=i.toUpperCase(),i in t.cipher.algorithms?t.cipher.algorithms[i]:null};var r=t.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)};r.prototype.start=function(i){i=i||{};var s={};for(var u in i)s[u]=i[u];s.decrypt=this._decrypt,this._finish=!1,this._input=t.util.createBuffer(),this.output=i.output||t.util.createBuffer(),this.mode.start(s)},r.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()},r.prototype.finish=function(i){i&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(u){return i(this.blockSize,u,!1)},this.mode.unpad=function(u){return i(this.blockSize,u,!0)});var s={};return s.decrypt=this._decrypt,s.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,s)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,s))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,s))}}),tb=Qe((e,n)=>{var t=lt();Et(),t.cipher=t.cipher||{};var r=n.exports=t.cipher.modes=t.cipher.modes||{};r.ecb=function(h){h=h||{},this.name="ECB",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},r.ecb.prototype.start=function(h){},r.ecb.prototype.encrypt=function(h,c,a){if(h.length()0))return!0;for(var d=0;d0))return!0;for(var d=0;d0)return!1;var a=h.length(),d=h.at(a-1);return d>this.blockSize<<2?!1:(h.truncate(d),!0)},r.cbc=function(h){h=h||{},this.name="CBC",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},r.cbc.prototype.start=function(h){if(h.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in h)this._iv=i(h.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},r.cbc.prototype.encrypt=function(h,c,a){if(h.length()0))return!0;for(var d=0;d0))return!0;for(var d=0;d0)return!1;var a=h.length(),d=h.at(a-1);return d>this.blockSize<<2?!1:(h.truncate(d),!0)},r.cfb=function(h){h=h||{},this.name="CFB",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0},r.cfb.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");this._iv=i(h.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.cfb.prototype.encrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0)h.read-=this.blockSize;else for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},r.cfb.prototype.decrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0)h.read-=this.blockSize;else for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},r.ofb=function(h){h=h||{},this.name="OFB",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0},r.ofb.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");this._iv=i(h.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.ofb.prototype.encrypt=function(h,c,a){var d=h.length();if(h.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0)h.read-=this.blockSize;else for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},r.ofb.prototype.decrypt=r.ofb.prototype.encrypt,r.ctr=function(h){h=h||{},this.name="CTR",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0},r.ctr.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");this._iv=i(h.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.ctr.prototype.encrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize)for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0&&(h.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},r.ctr.prototype.decrypt=r.ctr.prototype.encrypt,r.gcm=function(h){h=h||{},this.name="GCM",this.cipher=h.cipher,this.blockSize=h.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=t.util.createBuffer(),this._partialBytes=0,this._R=3774873600},r.gcm.prototype.start=function(h){if(!("iv"in h))throw new Error("Invalid IV parameter.");var c=t.util.createBuffer(h.iv);this._cipherLength=0;var a;if("additionalData"in h?a=t.util.createBuffer(h.additionalData):a=t.util.createBuffer(),"tagLength"in h?this._tagLength=h.tagLength:this._tagLength=128,this._tag=null,h.decrypt&&(this._tag=t.util.createBuffer(h.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 d=c.length();if(d===12)this._j0=[c.getInt32(),c.getInt32(),c.getInt32(),1];else{for(this._j0=[0,0,0,0];c.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[c.getInt32(),c.getInt32(),c.getInt32(),c.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(u(d*8)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,a=t.util.createBuffer(a),this._aDataLength=u(a.length()*8);var f=a.length()%this.blockSize;for(f&&a.fillWithByte(0,this.blockSize-f),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()])},r.gcm.prototype.encrypt=function(h,c,a){var d=h.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var f=0;f0&&(g=this.blockSize-g),this._partialOutput.clear();for(var f=0;f0&&this._partialOutput.getBytes(this._partialBytes),g>0&&!a)return h.read-=this.blockSize,c.putBytes(this._partialOutput.getBytes(g-this._partialBytes)),this._partialBytes=g,!0;c.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},r.gcm.prototype.decrypt=function(h,c,a){var d=h.length();if(d0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=h.getInt32(),this._hashBlock[1]=h.getInt32(),this._hashBlock[2]=h.getInt32(),this._hashBlock[3]=h.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var f=0;f0;--d)c[d]=h[d]>>>1|(h[d-1]&1)<<31;c[0]=h[0]>>>1,a&&(c[0]^=this._R)},r.gcm.prototype.tableMultiply=function(h){for(var c=[0,0,0,0],a=0;a<32;++a){var d=a/8|0,f=h[d]>>>(7-a%8)*4&15,g=this._m[a][f];c[0]^=g[0],c[1]^=g[1],c[2]^=g[2],c[3]^=g[3]}return c},r.gcm.prototype.ghash=function(h,c,a){return c[0]^=a[0],c[1]^=a[1],c[2]^=a[2],c[3]^=a[3],this.tableMultiply(c)},r.gcm.prototype.generateHashTable=function(h,c){for(var a=8/c,d=4*a,f=16*a,g=new Array(f),I=0;I>>1,f=new Array(a);f[d]=h.slice(0);for(var g=d>>>1;g>0;)this.pow(f[2*g],f[g]=[]),g>>=1;for(g=2;g4){var a=h;h=t.util.createBuffer();for(var d=0;d{var t=lt();Mp(),tb(),Et(),n.exports=t.aes=t.aes||{},t.aes.startEncrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!1,mode:k});return y.start(T),y},t.aes.createEncryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!1,mode:T})},t.aes.startDecrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!0,mode:k});return y.start(T),y},t.aes.createDecryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!0,mode:T})},t.aes.Algorithm=function(v,T){i||f();var O=this;O.name=v,O.mode=new T({blockSize:16,cipher:{encrypt:function(k,y){return I(O._w,k,y,!1)},decrypt:function(k,y){return I(O._w,k,y,!0)}}}),O._init=!1},t.aes.Algorithm.prototype.initialize=function(v){if(!this._init){var T=v.key,O;if(typeof T=="string"&&(T.length===16||T.length===24||T.length===32))T=t.util.createBuffer(T);else if(t.util.isArray(T)&&(T.length===16||T.length===24||T.length===32)){O=T,T=t.util.createBuffer();for(var k=0;k>>2;for(var k=0;k>8^L&255^99,u[O]=L,h[L]=O,D=v[L],y=v[O],R=v[y],w=v[R],S=D<<24^L<<16^L<<8^(L^D),m=(y^R^w)<<24^(O^w)<<16^(O^R^w)<<8^(O^y^w);for(var p=0;p<4;++p)a[p][O]=S,d[p][L]=m,S=S<<24|S>>>8,m=m<<24|m>>>8;O===0?O=k=1:(O=y^v[v[v[y^w]]],k^=v[v[k]])}}function g(v,T){for(var O=v.slice(0),k,y=1,R=O.length,w=R+6+1,L=s*w,D=R;D>>16&255]<<24^u[k>>>8&255]<<16^u[k&255]<<8^u[k>>>24]^c[y]<<24,y++):R>6&&D%R===4&&(k=u[k>>>24]<<24^u[k>>>16&255]<<16^u[k>>>8&255]<<8^u[k&255]),O[D]=O[D-R]^k;if(T){var S,m=d[0],p=d[1],q=d[2],V=d[3],$=O.slice(0);L=O.length;for(var D=0,E=L-s;D>>24]]^p[u[S>>>16&255]]^q[u[S>>>8&255]]^V[u[S&255]];O=$}return O}function I(v,T,O,k){var y=v.length/4-1,R,w,L,D,S;k?(R=d[0],w=d[1],L=d[2],D=d[3],S=h):(R=a[0],w=a[1],L=a[2],D=a[3],S=u);var m,p,q,V,$,E,B;m=T[0]^v[0],p=T[k?3:1]^v[1],q=T[2]^v[2],V=T[k?1:3]^v[3];for(var j=3,N=1;N>>24]^w[p>>>16&255]^L[q>>>8&255]^D[V&255]^v[++j],E=R[p>>>24]^w[q>>>16&255]^L[V>>>8&255]^D[m&255]^v[++j],B=R[q>>>24]^w[V>>>16&255]^L[m>>>8&255]^D[p&255]^v[++j],V=R[V>>>24]^w[m>>>16&255]^L[p>>>8&255]^D[q&255]^v[++j],m=$,p=E,q=B;O[0]=S[m>>>24]<<24^S[p>>>16&255]<<16^S[q>>>8&255]<<8^S[V&255]^v[++j],O[k?3:1]=S[p>>>24]<<24^S[q>>>16&255]<<16^S[V>>>8&255]<<8^S[m&255]^v[++j],O[2]=S[q>>>24]<<24^S[V>>>16&255]<<16^S[m>>>8&255]<<8^S[p&255]^v[++j],O[k?1:3]=S[V>>>24]<<24^S[m>>>16&255]<<16^S[p>>>8&255]<<8^S[q&255]^v[++j]}function C(v){v=v||{};var T=(v.mode||"CBC").toUpperCase(),O="AES-"+T,k;v.decrypt?k=t.cipher.createDecipher(O,v.key):k=t.cipher.createCipher(O,v.key);var y=k.start;return k.start=function(R,w){var L=null;w instanceof t.util.ByteBuffer&&(L=w,w={}),w=w||{},w.output=L,w.iv=R,y.call(k,w)},k}}),Ba=Qe((e,n)=>{var t=lt();t.pki=t.pki||{};var r=n.exports=t.pki.oids=t.oids=t.oids||{};function i(u,h){r[u]=h,r[h]=u}function s(u,h){r[u]=h}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"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("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")}),ki=Qe((e,n)=>{var t=lt();Et(),Ba();var r=n.exports=t.asn1=t.asn1||{};r.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},r.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},r.create=function(c,a,d,f,g){if(t.util.isArray(f)){for(var I=[],C=0;Ca){var f=new Error("Too few bytes to parse DER.");throw f.available=c.length(),f.remaining=a,f.requested=d,f}}var s=function(c,a){var d=c.getByte();if(a--,d!==128){var f,g=d&128;if(!g)f=d;else{var I=d&127;i(c,a,I),f=c.getInt(I<<3)}if(f<0)throw new Error("Negative length: "+f);return f}};r.fromDer=function(c,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 c=="string"&&(c=t.util.createBuffer(c));var d=c.length(),f=u(c,c.length(),0,a);if(a.parseAllBytes&&c.length()!==0){var g=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw g.byteCount=d,g.remaining=c.length(),g}return f};function u(c,a,d,f){var g;i(c,a,2);var I=c.getByte();a--;var C=I&192,v=I&31;g=c.length();var T=s(c,a);if(a-=g-c.length(),T!==void 0&&T>a){if(f.strict){var O=new Error("Too few bytes to read ASN.1 value.");throw O.available=c.length(),O.remaining=a,O.requested=T,O}T=a}var k,y,R=(I&32)===32;if(R)if(k=[],T===void 0)for(;;){if(i(c,a,2),c.bytes(2)===String.fromCharCode(0,0)){c.getBytes(2),a-=2;break}g=c.length(),k.push(u(c,a,d+1,f)),a-=g-c.length()}else for(;T>0;)g=c.length(),k.push(u(c,T,d+1,f)),a-=g-c.length(),T-=g-c.length();if(k===void 0&&C===r.Class.UNIVERSAL&&v===r.Type.BITSTRING&&(y=c.bytes(T)),k===void 0&&f.decodeBitStrings&&C===r.Class.UNIVERSAL&&v===r.Type.BITSTRING&&T>1){var w=c.read,L=a,D=0;if(v===r.Type.BITSTRING&&(i(c,a,1),D=c.getByte(),a--),D===0)try{g=c.length();var S={strict:!0,decodeBitStrings:!0},m=u(c,a,d+1,S),p=g-c.length();a-=p,v==r.Type.BITSTRING&&p++;var q=m.tagClass;p===T&&(q===r.Class.UNIVERSAL||q===r.Class.CONTEXT_SPECIFIC)&&(k=[m])}catch{}k===void 0&&(c.read=w,a=L)}if(k===void 0){if(T===void 0){if(f.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");T=a}if(v===r.Type.BMPSTRING)for(k="";T>0;T-=2)i(c,a,2),k+=String.fromCharCode(c.getInt16()),a-=2;else k=c.getBytes(T),a-=T}var V=y===void 0?null:{bitStringContents:y};return r.create(C,v,R,k,V)}r.toDer=function(c){var a=t.util.createBuffer(),d=c.tagClass|c.type,f=t.util.createBuffer(),g=!1;if("bitStringContents"in c&&(g=!0,c.original&&(g=r.equals(c,c.original))),g)f.putBytes(c.bitStringContents);else if(c.composed){c.constructed?d|=32:f.putByte(0);for(var I=0;I1&&(c.value.charCodeAt(0)===0&&!(c.value.charCodeAt(1)&128)||c.value.charCodeAt(0)===255&&(c.value.charCodeAt(1)&128)===128)?f.putBytes(c.value.substr(1)):f.putBytes(c.value);if(a.putByte(d),f.length()<=127)a.putByte(f.length()&127);else{var C=f.length(),v="";do v+=String.fromCharCode(C&255),C=C>>>8;while(C>0);a.putByte(v.length|128);for(var I=v.length-1;I>=0;--I)a.putByte(v.charCodeAt(I))}return a.putBuffer(f),a},r.oidToDer=function(c){var a=c.split("."),d=t.util.createBuffer();d.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var f,g,I,C,v=2;v>>7,f||(C|=128),g.push(C),f=!1;while(I>0);for(var T=g.length-1;T>=0;--T)d.putByte(g[T])}return d},r.derToOid=function(c){var a;typeof c=="string"&&(c=t.util.createBuffer(c));var d=c.getByte();a=Math.floor(d/40)+"."+d%40;for(var f=0;c.length()>0;)d=c.getByte(),f=f<<7,d&128?f+=d&127:(a+="."+(f+d),f=0);return a},r.utcTimeToDate=function(c){var a=new Date,d=parseInt(c.substr(0,2),10);d=d>=50?1900+d:2e3+d;var f=parseInt(c.substr(2,2),10)-1,g=parseInt(c.substr(4,2),10),I=parseInt(c.substr(6,2),10),C=parseInt(c.substr(8,2),10),v=0;if(c.length>11){var T=c.charAt(10),O=10;T!=="+"&&T!=="-"&&(v=parseInt(c.substr(10,2),10),O+=2)}if(a.setUTCFullYear(d,f,g),a.setUTCHours(I,C,v,0),O&&(T=c.charAt(O),T==="+"||T==="-")){var k=parseInt(c.substr(O+1,2),10),y=parseInt(c.substr(O+4,2),10),R=k*60+y;R*=6e4,T==="+"?a.setTime(+a-R):a.setTime(+a+R)}return a},r.generalizedTimeToDate=function(c){var a=new Date,d=parseInt(c.substr(0,4),10),f=parseInt(c.substr(4,2),10)-1,g=parseInt(c.substr(6,2),10),I=parseInt(c.substr(8,2),10),C=parseInt(c.substr(10,2),10),v=parseInt(c.substr(12,2),10),T=0,O=0,k=!1;c.charAt(c.length-1)==="Z"&&(k=!0);var y=c.length-5,R=c.charAt(y);if(R==="+"||R==="-"){var w=parseInt(c.substr(y+1,2),10),L=parseInt(c.substr(y+4,2),10);O=w*60+L,O*=6e4,R==="+"&&(O*=-1),k=!0}return c.charAt(14)==="."&&(T=parseFloat(c.substr(14),10)*1e3),k?(a.setUTCFullYear(d,f,g),a.setUTCHours(I,C,v,T),a.setTime(+a+O)):(a.setFullYear(d,f,g),a.setHours(I,C,v,T)),a},r.dateToUtcTime=function(c){if(typeof c=="string")return c;var a="",d=[];d.push((""+c.getUTCFullYear()).substr(2)),d.push(""+(c.getUTCMonth()+1)),d.push(""+c.getUTCDate()),d.push(""+c.getUTCHours()),d.push(""+c.getUTCMinutes()),d.push(""+c.getUTCSeconds());for(var f=0;f=-128&&c<128)return a.putSignedInt(c,8);if(c>=-32768&&c<32768)return a.putSignedInt(c,16);if(c>=-8388608&&c<8388608)return a.putSignedInt(c,24);if(c>=-2147483648&&c<2147483648)return a.putSignedInt(c,32);var d=new Error("Integer too large; max is 32-bits.");throw d.integer=c,d},r.derToInteger=function(c){typeof c=="string"&&(c=t.util.createBuffer(c));var a=c.length()*8;if(a>32)throw new Error("Integer too large; max is 32-bits.");return c.getSignedInt(a)},r.validate=function(c,a,d,f){var g=!1;if((c.tagClass===a.tagClass||typeof a.tagClass>"u")&&(c.type===a.type||typeof a.type>"u"))if(c.constructed===a.constructed||typeof a.constructed>"u"){if(g=!0,a.value&&t.util.isArray(a.value))for(var I=0,C=0;g&&C0&&(f+=` `);for(var g="",I=0;I1?f+="0x"+t.util.bytesToHex(c.value.slice(1)):f+="(none)",c.value.length>0){var O=c.value.charCodeAt(0);O==1?f+=" (1 unused bit shown)":O>1&&(f+=" ("+O+" unused bits shown)")}}else if(c.type===r.Type.OCTETSTRING)h.test(c.value)||(f+="("+c.value+") "),f+="0x"+t.util.bytesToHex(c.value);else if(c.type===r.Type.UTF8)try{f+=t.util.decodeUtf8(c.value)}catch(k){if(k.message==="URI malformed")f+="0x"+t.util.bytesToHex(c.value)+" (malformed UTF8)";else throw k}else c.type===r.Type.PRINTABLESTRING||c.type===r.Type.IA5String?f+=c.value:h.test(c.value)?f+="0x"+t.util.bytesToHex(c.value):c.value.length===0?f+="[null]":f+=c.value}return f}}),fo=Qe((e,n)=>{var t=lt();n.exports=t.md=t.md||{},t.md.algorithms=t.md.algorithms||{}}),Wu=Qe((e,n)=>{var t=lt();fo(),Et();var r=n.exports=t.hmac=t.hmac||{};r.create=function(){var i=null,s=null,u=null,h=null,c={};return c.start=function(a,d){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in t.md.algorithms)s=t.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else s=a;if(d===null)d=i;else{if(typeof d=="string")d=t.util.createBuffer(d);else if(t.util.isArray(d)){var f=d;d=t.util.createBuffer();for(var g=0;gs.blockLength&&(s.start(),s.update(d.bytes()),d=s.digest()),u=t.util.createBuffer(),h=t.util.createBuffer(),I=d.length();for(var g=0;g{var t=lt();fo(),Et();var r=n.exports=t.md5=t.md5||{};t.md.md5=t.md.algorithms.md5=r,r.create=function(){c||a();var f=null,g=t.util.createBuffer(),I=new Array(16),C={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return C.start=function(){C.messageLength=0,C.fullMessageLength=C.messageLength64=[];for(var v=C.messageLengthSize/4,T=0;T>>0,O>>>0];for(var k=C.fullMessageLength.length-1;k>=0;--k)C.fullMessageLength[k]+=O[1],O[1]=O[0]+(C.fullMessageLength[k]/4294967296>>>0),C.fullMessageLength[k]=C.fullMessageLength[k]>>>0,O[0]=O[1]/4294967296>>>0;return g.putBytes(v),d(f,I,g),(g.read>2048||g.length()===0)&&g.compact(),C},C.digest=function(){var v=t.util.createBuffer();v.putBytes(g.bytes());var T=C.fullMessageLength[C.fullMessageLength.length-1]+C.messageLengthSize,O=T&C.blockLength-1;v.putBytes(i.substr(0,C.blockLength-O));for(var k,y=0,R=C.fullMessageLength.length-1;R>=0;--R)k=C.fullMessageLength[R]*8+y,y=k/4294967296>>>0,v.putInt32Le(k>>>0);var w={h0:f.h0,h1:f.h1,h2:f.h2,h3:f.h3};d(w,I,v);var L=t.util.createBuffer();return L.putInt32Le(w.h0),L.putInt32Le(w.h1),L.putInt32Le(w.h2),L.putInt32Le(w.h3),L},C};var i=null,s=null,u=null,h=null,c=!1;function a(){i=String.fromCharCode(128),i+=t.util.fillString(String.fromCharCode(0),64),s=[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],u=[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],h=new Array(64);for(var f=0;f<64;++f)h[f]=Math.floor(Math.abs(Math.sin(f+1))*4294967296);c=!0}function d(f,g,I){for(var C,v,T,O,k,y,R,w,L=I.length();L>=64;){for(v=f.h0,T=f.h1,O=f.h2,k=f.h3,w=0;w<16;++w)g[w]=I.getInt32Le(),y=k^T&(O^k),C=v+y+h[w]+g[w],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;for(;w<32;++w)y=O^k&(T^O),C=v+y+h[w]+g[s[w]],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;for(;w<48;++w)y=T^O^k,C=v+y+h[w]+g[s[w]],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;for(;w<64;++w)y=O^(T|~k),C=v+y+h[w]+g[s[w]],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;f.h0=f.h0+v|0,f.h1=f.h1+T|0,f.h2=f.h2+O|0,f.h3=f.h3+k|0,L-=64}}}),Os=Qe((e,n)=>{var t=lt();Et();var r=n.exports=t.pem=t.pem||{};r.encode=function(u,h){h=h||{};var c="-----BEGIN "+u.type+`-----\r +`,c.composed){for(var C=0,v="",I=0;I1?f+="0x"+t.util.bytesToHex(c.value.slice(1)):f+="(none)",c.value.length>0){var O=c.value.charCodeAt(0);O==1?f+=" (1 unused bit shown)":O>1&&(f+=" ("+O+" unused bits shown)")}}else if(c.type===r.Type.OCTETSTRING)h.test(c.value)||(f+="("+c.value+") "),f+="0x"+t.util.bytesToHex(c.value);else if(c.type===r.Type.UTF8)try{f+=t.util.decodeUtf8(c.value)}catch(k){if(k.message==="URI malformed")f+="0x"+t.util.bytesToHex(c.value)+" (malformed UTF8)";else throw k}else c.type===r.Type.PRINTABLESTRING||c.type===r.Type.IA5String?f+=c.value:h.test(c.value)?f+="0x"+t.util.bytesToHex(c.value):c.value.length===0?f+="[null]":f+=c.value}return f}}),ho=Qe((e,n)=>{var t=lt();n.exports=t.md=t.md||{},t.md.algorithms=t.md.algorithms||{}}),Hu=Qe((e,n)=>{var t=lt();ho(),Et();var r=n.exports=t.hmac=t.hmac||{};r.create=function(){var i=null,s=null,u=null,h=null,c={};return c.start=function(a,d){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in t.md.algorithms)s=t.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else s=a;if(d===null)d=i;else{if(typeof d=="string")d=t.util.createBuffer(d);else if(t.util.isArray(d)){var f=d;d=t.util.createBuffer();for(var g=0;gs.blockLength&&(s.start(),s.update(d.bytes()),d=s.digest()),u=t.util.createBuffer(),h=t.util.createBuffer(),I=d.length();for(var g=0;g{var t=lt();ho(),Et();var r=n.exports=t.md5=t.md5||{};t.md.md5=t.md.algorithms.md5=r,r.create=function(){c||a();var f=null,g=t.util.createBuffer(),I=new Array(16),C={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return C.start=function(){C.messageLength=0,C.fullMessageLength=C.messageLength64=[];for(var v=C.messageLengthSize/4,T=0;T>>0,O>>>0];for(var k=C.fullMessageLength.length-1;k>=0;--k)C.fullMessageLength[k]+=O[1],O[1]=O[0]+(C.fullMessageLength[k]/4294967296>>>0),C.fullMessageLength[k]=C.fullMessageLength[k]>>>0,O[0]=O[1]/4294967296>>>0;return g.putBytes(v),d(f,I,g),(g.read>2048||g.length()===0)&&g.compact(),C},C.digest=function(){var v=t.util.createBuffer();v.putBytes(g.bytes());var T=C.fullMessageLength[C.fullMessageLength.length-1]+C.messageLengthSize,O=T&C.blockLength-1;v.putBytes(i.substr(0,C.blockLength-O));for(var k,y=0,R=C.fullMessageLength.length-1;R>=0;--R)k=C.fullMessageLength[R]*8+y,y=k/4294967296>>>0,v.putInt32Le(k>>>0);var w={h0:f.h0,h1:f.h1,h2:f.h2,h3:f.h3};d(w,I,v);var L=t.util.createBuffer();return L.putInt32Le(w.h0),L.putInt32Le(w.h1),L.putInt32Le(w.h2),L.putInt32Le(w.h3),L},C};var i=null,s=null,u=null,h=null,c=!1;function a(){i=String.fromCharCode(128),i+=t.util.fillString(String.fromCharCode(0),64),s=[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],u=[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],h=new Array(64);for(var f=0;f<64;++f)h[f]=Math.floor(Math.abs(Math.sin(f+1))*4294967296);c=!0}function d(f,g,I){for(var C,v,T,O,k,y,R,w,L=I.length();L>=64;){for(v=f.h0,T=f.h1,O=f.h2,k=f.h3,w=0;w<16;++w)g[w]=I.getInt32Le(),y=k^T&(O^k),C=v+y+h[w]+g[w],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;for(;w<32;++w)y=O^k&(T^O),C=v+y+h[w]+g[s[w]],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;for(;w<48;++w)y=T^O^k,C=v+y+h[w]+g[s[w]],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;for(;w<64;++w)y=O^(T|~k),C=v+y+h[w]+g[s[w]],R=u[w],v=k,k=O,O=T,T+=C<>>32-R;f.h0=f.h0+v|0,f.h1=f.h1+T|0,f.h2=f.h2+O|0,f.h3=f.h3+k|0,L-=64}}}),ks=Qe((e,n)=>{var t=lt();Et();var r=n.exports=t.pem=t.pem||{};r.encode=function(u,h){h=h||{};var c="-----BEGIN "+u.type+`-----\r `,a;if(u.procType&&(a={name:"Proc-Type",values:[String(u.procType.version),u.procType.type]},c+=i(a)),u.contentDomain&&(a={name:"Content-Domain",values:[u.contentDomain]},c+=i(a)),u.dekInfo&&(a={name:"DEK-Info",values:[u.dekInfo.algorithm]},u.dekInfo.parameters&&a.values.push(u.dekInfo.parameters),c+=i(a)),u.headers)for(var d=0;d65&&g!==-1){var I=h[g];I===","?(++g,h=h.substr(0,g)+`\r `+h.substr(g)):h=h.substr(0,g)+`\r -`+I+h.substr(g+1),f=d-g-1,g=-1,++d}else(h[d]===" "||h[d]===" "||h[d]===",")&&(g=d);return h}function s(u){return u.replace(/^\s+/,"")}}),lh=Qe((e,n)=>{var t=lt();Hp(),lb(),Et(),n.exports=t.des=t.des||{},t.des.startEncrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!1,mode:k||(T===null?"ECB":"CBC")});return y.start(T),y},t.des.createEncryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!1,mode:T})},t.des.startDecrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!0,mode:k||(T===null?"ECB":"CBC")});return y.start(T),y},t.des.createDecryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!0,mode:T})},t.des.Algorithm=function(v,T){var O=this;O.name=v,O.mode=new T({blockSize:8,cipher:{encrypt:function(k,y){return I(O._keys,k,y,!1)},decrypt:function(k,y){return I(O._keys,k,y,!0)}}}),O._init=!1},t.des.Algorithm.prototype.initialize=function(v){if(!this._init){var T=t.util.createBuffer(v.key);if(this.name.indexOf("3DES")===0&&T.length()!==24)throw new Error("Invalid Triple-DES key size: "+T.length()*8);this._keys=g(T),this._init=!0}},r("DES-ECB",t.cipher.modes.ecb),r("DES-CBC",t.cipher.modes.cbc),r("DES-CFB",t.cipher.modes.cfb),r("DES-OFB",t.cipher.modes.ofb),r("DES-CTR",t.cipher.modes.ctr),r("3DES-ECB",t.cipher.modes.ecb),r("3DES-CBC",t.cipher.modes.cbc),r("3DES-CFB",t.cipher.modes.cfb),r("3DES-OFB",t.cipher.modes.ofb),r("3DES-CTR",t.cipher.modes.ctr);function r(v,T){var O=function(){return new t.des.Algorithm(v,T)};t.cipher.registerAlgorithm(v,O)}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],s=[-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],u=[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],h=[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],c=[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],d=[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],f=[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(v){for(var T=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],O=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],k=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],y=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],R=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],w=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],L=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],D=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],S=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],m=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],q=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],V=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],$=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],E=v.length()>8?3:1,B=[],j=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],N=0,M,ee=0;ee>>4^ae)&252645135,ae^=M,oe^=M<<4,M=(ae>>>-16^oe)&65535,oe^=M,ae^=M<<-16,M=(oe>>>2^ae)&858993459,ae^=M,oe^=M<<2,M=(ae>>>-16^oe)&65535,oe^=M,ae^=M<<-16,M=(oe>>>1^ae)&1431655765,ae^=M,oe^=M<<1,M=(ae>>>8^oe)&16711935,oe^=M,ae^=M<<8,M=(oe>>>1^ae)&1431655765,ae^=M,oe^=M<<1,M=oe<<8|ae>>>20&240,oe=ae<<24|ae<<8&16711680|ae>>>8&65280|ae>>>24&240,ae=M;for(var pe=0;pe>>26,ae=ae<<2|ae>>>26):(oe=oe<<1|oe>>>27,ae=ae<<1|ae>>>27),oe&=-15,ae&=-15;var _e=T[oe>>>28]|O[oe>>>24&15]|k[oe>>>20&15]|y[oe>>>16&15]|R[oe>>>12&15]|w[oe>>>8&15]|L[oe>>>4&15],Re=D[ae>>>28]|S[ae>>>24&15]|m[ae>>>20&15]|p[ae>>>16&15]|q[ae>>>12&15]|V[ae>>>8&15]|$[ae>>>4&15];M=(Re>>>16^_e)&65535,B[N++]=_e^M,B[N++]=Re^M<<16}}return B}function I(v,T,O,k){var y=v.length===32?3:9,R;y===3?R=k?[30,-2,-2]:[0,32,2]:R=k?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var w,L=T[0],D=T[1];w=(L>>>4^D)&252645135,D^=w,L^=w<<4,w=(L>>>16^D)&65535,D^=w,L^=w<<16,w=(D>>>2^L)&858993459,L^=w,D^=w<<2,w=(D>>>8^L)&16711935,L^=w,D^=w<<8,w=(L>>>1^D)&1431655765,D^=w,L^=w<<1,L=L<<1|L>>>31,D=D<<1|D>>>31;for(var S=0;S>>4|D<<28)^v[q+1];w=L,L=D,D=w^(s[V>>>24&63]|h[V>>>16&63]|a[V>>>8&63]|f[V&63]|i[$>>>24&63]|u[$>>>16&63]|c[$>>>8&63]|d[$&63])}w=L,L=D,D=w}L=L>>>1|L<<31,D=D>>>1|D<<31,w=(L>>>1^D)&1431655765,D^=w,L^=w<<1,w=(D>>>8^L)&16711935,L^=w,D^=w<<8,w=(D>>>2^L)&858993459,L^=w,D^=w<<2,w=(L>>>16^D)&65535,D^=w,L^=w<<16,w=(L>>>4^D)&252645135,D^=w,L^=w<<4,O[0]=L,O[1]=D}function C(v){v=v||{};var T=(v.mode||"CBC").toUpperCase(),O="DES-"+T,k;v.decrypt?k=t.cipher.createDecipher(O,v.key):k=t.cipher.createCipher(O,v.key);var y=k.start;return k.start=function(R,w){var L=null;w instanceof t.util.ByteBuffer&&(L=w,w={}),w=w||{},w.output=L,w.iv=R,y.call(k,w)},k}}),Wp=Qe((e,n)=>{var t=lt();Wu(),fo(),Et();var r=t.pkcs5=t.pkcs5||{},i;t.util.isNodejs&&!t.options.usePureJavaScript&&(i=_s("crypto")),n.exports=t.pbkdf2=r.pbkdf2=function(s,u,h,c,a,d){if(typeof a=="function"&&(d=a,a=null),t.util.isNodejs&&!t.options.usePureJavaScript&&i.pbkdf2&&(a===null||typeof a!="object")&&(i.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!="string"&&(a="sha1"),s=Buffer.from(s,"binary"),u=Buffer.from(u,"binary"),d?i.pbkdf2Sync.length===4?i.pbkdf2(s,u,h,c,function(S,m){if(S)return d(S);d(null,m.toString("binary"))}):i.pbkdf2(s,u,h,c,a,function(S,m){if(S)return d(S);d(null,m.toString("binary"))}):i.pbkdf2Sync.length===4?i.pbkdf2Sync(s,u,h,c).toString("binary"):i.pbkdf2Sync(s,u,h,c,a).toString("binary");if((typeof a>"u"||a===null)&&(a="sha1"),typeof a=="string"){if(!(a in t.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=t.md[a].create()}var f=a.digestLength;if(c>4294967295*f){var g=new Error("Derived key is too long.");if(d)return d(g);throw g}var I=Math.ceil(c/f),C=c-(I-1)*f,v=t.hmac.create();v.start(a,s);var T="",O,k,y;if(!d){for(var R=1;R<=I;++R){v.start(null,null),v.update(u),v.update(t.util.int32ToBytes(R)),O=y=v.digest().getBytes();for(var w=2;w<=h;++w)v.start(null,null),v.update(y),k=v.digest().getBytes(),O=t.util.xorBytes(O,k,f),y=k;T+=RI)return d(null,T);v.start(null,null),v.update(u),v.update(t.util.int32ToBytes(R)),O=y=v.digest().getBytes(),w=2,D()}function D(){if(w<=h)return v.start(null,null),v.update(y),k=v.digest().getBytes(),O=t.util.xorBytes(O,k,f),y=k,++w,t.util.setImmediate(D);T+=R{var t=lt();fo(),Et();var r=n.exports=t.sha256=t.sha256||{};t.md.sha256=t.md.algorithms.sha256=r,r.create=function(){s||h();var a=null,d=t.util.createBuffer(),f=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,C=0;C>>0,v>>>0];for(var T=g.fullMessageLength.length-1;T>=0;--T)g.fullMessageLength[T]+=v[1],v[1]=v[0]+(g.fullMessageLength[T]/4294967296>>>0),g.fullMessageLength[T]=g.fullMessageLength[T]>>>0,v[0]=v[1]/4294967296>>>0;return d.putBytes(I),c(a,f,d),(d.read>2048||d.length()===0)&&d.compact(),g},g.digest=function(){var I=t.util.createBuffer();I.putBytes(d.bytes());var C=g.fullMessageLength[g.fullMessageLength.length-1]+g.messageLengthSize,v=C&g.blockLength-1;I.putBytes(i.substr(0,g.blockLength-v));for(var T,O,k=g.fullMessageLength[0]*8,y=0;y>>0,k+=O,I.putInt32(k>>>0),k=T>>>0;I.putInt32(k);var R={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,h4:a.h4,h5:a.h5,h6:a.h6,h7:a.h7};c(R,f,I);var w=t.util.createBuffer();return w.putInt32(R.h0),w.putInt32(R.h1),w.putInt32(R.h2),w.putInt32(R.h3),w.putInt32(R.h4),w.putInt32(R.h5),w.putInt32(R.h6),w.putInt32(R.h7),w},g};var i=null,s=!1,u=null;function h(){i=String.fromCharCode(128),i+=t.util.fillString(String.fromCharCode(0),64),u=[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],s=!0}function c(a,d,f){for(var g,I,C,v,T,O,k,y,R,w,L,D,S,m,p,q=f.length();q>=64;){for(k=0;k<16;++k)d[k]=f.getInt32();for(;k<64;++k)g=d[k-2],g=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,I=d[k-15],I=(I>>>7|I<<25)^(I>>>18|I<<14)^I>>>3,d[k]=g+d[k-7]+I+d[k-16]|0;for(y=a.h0,R=a.h1,w=a.h2,L=a.h3,D=a.h4,S=a.h5,m=a.h6,p=a.h7,k=0;k<64;++k)v=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),T=m^D&(S^m),C=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),O=y&R|w&(y^R),g=p+v+T+u[k]+d[k],I=C+O,p=m,m=S,S=D,D=L+g>>>0,L=w,w=R,R=y,y=g+I>>>0;a.h0=a.h0+y|0,a.h1=a.h1+R|0,a.h2=a.h2+w|0,a.h3=a.h3+L|0,a.h4=a.h4+D|0,a.h5=a.h5+S|0,a.h6=a.h6+m|0,a.h7=a.h7+p|0,q-=64}}}),hb=Qe((e,n)=>{var t=lt();Et();var r=null;t.util.isNodejs&&!t.options.usePureJavaScript&&!process.versions["node-webkit"]&&(r=_s("crypto"));var i=n.exports=t.prng=t.prng||{};i.create=function(s){for(var u={plugin:s,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},h=s.md,c=new Array(32),a=0;a<32;++a)c[a]=h.create();u.pools=c,u.pool=0,u.generate=function(C,v){if(!v)return u.generateSync(C);var T=u.plugin.cipher,O=u.plugin.increment,k=u.plugin.formatKey,y=u.plugin.formatSeed,R=t.util.createBuffer();u.key=null,w();function w(L){if(L)return v(L);if(R.length()>=C)return v(null,R.getBytes(C));if(u.generated>1048575&&(u.key=null),u.key===null)return t.util.nextTick(function(){d(w)});var D=T(u.key,u.seed);u.generated+=D.length,R.putBytes(D),u.key=k(T(u.key,O(u.seed))),u.seed=y(T(u.key,u.seed)),t.util.setImmediate(w)}},u.generateSync=function(C){var v=u.plugin.cipher,T=u.plugin.increment,O=u.plugin.formatKey,k=u.plugin.formatSeed;u.key=null;for(var y=t.util.createBuffer();y.length()1048575&&(u.key=null),u.key===null&&f();var R=v(u.key,u.seed);u.generated+=R.length,y.putBytes(R),u.key=O(v(u.key,T(u.seed))),u.seed=k(v(u.key,u.seed))}return y.getBytes(C)};function d(C){if(u.pools[0].messageLength>=32)return g(),C();var v=32-u.pools[0].messageLength<<5;u.seedFile(v,function(T,O){if(T)return C(T);u.collect(O),g(),C()})}function f(){if(u.pools[0].messageLength>=32)return g();var C=32-u.pools[0].messageLength<<5;u.collect(u.seedFileSync(C)),g()}function g(){u.reseeds=u.reseeds===4294967295?0:u.reseeds+1;var C=u.plugin.md.create();C.update(u.keyBytes);for(var v=1,T=0;T<32;++T)u.reseeds%v===0&&(C.update(u.pools[T].digest().getBytes()),u.pools[T].start()),v=v<<1;u.keyBytes=C.digest().getBytes(),C.start(),C.update(u.keyBytes);var O=C.digest().getBytes();u.key=u.plugin.formatKey(u.keyBytes),u.seed=u.plugin.formatSeed(O),u.generated=0}function I(C){var v=null,T=t.util.globalScope,O=T.crypto||T.msCrypto;O&&O.getRandomValues&&(v=function(p){return O.getRandomValues(p)});var k=t.util.createBuffer();if(v)for(;k.length()>16),D+=(L&32767)<<16,D+=L>>15,D=(D&2147483647)+(D>>31),m=D&4294967295;for(var w=0;w<3;++w)S=m>>>(w<<3),S^=Math.floor(Math.random()*256),k.putByte(S&255)}return k.getBytes(C)}return r?(u.seedFile=function(C,v){r.randomBytes(C,function(T,O){if(T)return v(T);v(null,O.toString())})},u.seedFileSync=function(C){return r.randomBytes(C).toString()}):(u.seedFile=function(C,v){try{v(null,I(C))}catch(T){v(T)}},u.seedFileSync=I),u.collect=function(C){for(var v=C.length,T=0;T>O&255);u.collect(T)},u.registerWorker=function(C){if(C===self)u.seedFile=function(T,O){function k(y){var R=y.data;R.forge&&R.forge.prng&&(self.removeEventListener("message",k),O(R.forge.prng.err,R.forge.prng.bytes))}self.addEventListener("message",k),self.postMessage({forge:{prng:{needed:T}}})};else{var v=function(T){var O=T.data;O.forge&&O.forge.prng&&u.seedFile(O.forge.prng.needed,function(k,y){C.postMessage({forge:{prng:{err:k,bytes:y}}})})};C.addEventListener("message",v)}},u}}),ui=Qe((e,n)=>{var t=lt();Ba(),cb(),hb(),Et(),function(){if(t.random&&t.random.getBytes){n.exports=t.random;return}(function(r){var i={},s=new Array(4),u=t.util.createBuffer();i.formatKey=function(C){var v=t.util.createBuffer(C);return C=new Array(4),C[0]=v.getInt32(),C[1]=v.getInt32(),C[2]=v.getInt32(),C[3]=v.getInt32(),t.aes._expandKey(C,!1)},i.formatSeed=function(C){var v=t.util.createBuffer(C);return C=new Array(4),C[0]=v.getInt32(),C[1]=v.getInt32(),C[2]=v.getInt32(),C[3]=v.getInt32(),C},i.cipher=function(C,v){return t.aes._updateBlock(C,v,s,!1),u.putInt32(s[0]),u.putInt32(s[1]),u.putInt32(s[2]),u.putInt32(s[3]),u.getBytes()},i.increment=function(C){return++C[3],C},i.md=t.md.sha256;function h(){var C=t.prng.create(i);return C.getBytes=function(v,T){return C.generate(v,T)},C.getBytesSync=function(v){return C.generate(v)},C}var c=h(),a=null,d=t.util.globalScope,f=d.crypto||d.msCrypto;if(f&&f.getRandomValues&&(a=function(C){return f.getRandomValues(C)}),t.options.usePureJavaScript||!t.util.isNodejs&&!a){if(typeof window>"u"||window.document,c.collectInt(+new Date,32),typeof navigator<"u"){var g="";for(var I in navigator)try{typeof navigator[I]=="string"&&(g+=navigator[I])}catch{}c.collect(g),g=null}r&&(r().mousemove(function(C){c.collectInt(C.clientX,16),c.collectInt(C.clientY,16)}),r().keypress(function(C){c.collectInt(C.charCode,8)}))}if(!t.random)t.random=c;else for(var I in c)t.random[I]=c[I];t.random.createInstance=h,n.exports=t.random})(typeof jQuery<"u"?jQuery:null)}()}),fb=Qe((e,n)=>{var t=lt();Et();var r=[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],s=function(c,a){return c<>16-a},u=function(c,a){return(c&65535)>>a|c<<16-a&65535};n.exports=t.rc2=t.rc2||{},t.rc2.expandKey=function(c,a){typeof c=="string"&&(c=t.util.createBuffer(c)),a=a||128;var d=c,f=c.length(),g=a,I=Math.ceil(g/8),C=255>>(g&7),v;for(v=f;v<128;v++)d.putByte(r[d.at(v-1)+d.at(v-f)&255]);for(d.setAt(128-I,r[d.at(128-I)&C]),v=127-I;v>=0;v--)d.setAt(v,r[d.at(v+1)^d.at(v+I)]);return d};var h=function(c,a,d){var f=!1,g=null,I=null,C=null,v,T,O,k,y=[];for(c=t.rc2.expandKey(c,a),O=0;O<64;O++)y.push(c.getInt16Le());d?(v=function(L){for(O=0;O<4;O++)L[O]+=y[k]+(L[(O+3)%4]&L[(O+2)%4])+(~L[(O+3)%4]&L[(O+1)%4]),L[O]=s(L[O],i[O]),k++},T=function(L){for(O=0;O<4;O++)L[O]+=y[L[(O+3)%4]&63]}):(v=function(L){for(O=3;O>=0;O--)L[O]=u(L[O],i[O]),L[O]-=y[k]+(L[(O+3)%4]&L[(O+2)%4])+(~L[(O+3)%4]&L[(O+1)%4]),k--},T=function(L){for(O=3;O>=0;O--)L[O]-=y[L[(O+3)%4]&63]});var R=function(L){var D=[];for(O=0;O<4;O++){var S=g.getInt16Le();C!==null&&(d?S^=C.getInt16Le():C.putInt16Le(S)),D.push(S&65535)}k=d?0:63;for(var m=0;m=8;)R([[5,v],[1,T],[6,v],[1,T],[5,v]])},finish:function(L){var D=!0;if(d)if(L)D=L(8,g,!d);else{var S=g.length()===8?8:8-g.length();g.fillWithByte(S,S)}if(D&&(f=!0,w.update()),!d&&(D=g.length()===0,D))if(L)D=L(8,I,!d);else{var m=I.length(),p=I.at(m-1);p>m?D=!1:I.truncate(p)}return D}},w};t.rc2.startEncrypting=function(c,a,d){var f=t.rc2.createEncryptionCipher(c,128);return f.start(a,d),f},t.rc2.createEncryptionCipher=function(c,a){return h(c,a,!0)},t.rc2.startDecrypting=function(c,a,d){var f=t.rc2.createDecryptionCipher(c,128);return f.start(a,d),f},t.rc2.createDecryptionCipher=function(c,a){return h(c,a,!1)}}),ch=Qe((e,n)=>{var t=lt();n.exports=t.jsbn=t.jsbn||{};var r,i=0xdeadbeefcafe,s=(i&16777215)==15715070;function u(z,G,Z){this.data=[],z!=null&&(typeof z=="number"?this.fromNumber(z,G,Z):G==null&&typeof z!="string"?this.fromString(z,256):this.fromString(z,G))}t.jsbn.BigInteger=u;function h(){return new u(null)}function c(z,G,Z,ce,be,Te){for(;--Te>=0;){var Ne=G*this.data[z++]+Z.data[ce]+be;be=Math.floor(Ne/67108864),Z.data[ce++]=Ne&67108863}return be}function a(z,G,Z,ce,be,Te){for(var Ne=G&32767,Be=G>>15;--Te>=0;){var bt=this.data[z]&32767,ar=this.data[z++]>>15,Rr=Be*bt+ar*Ne;bt=Ne*bt+((Rr&32767)<<15)+Z.data[ce]+(be&1073741823),be=(bt>>>30)+(Rr>>>15)+Be*ar+(be>>>30),Z.data[ce++]=bt&1073741823}return be}function d(z,G,Z,ce,be,Te){for(var Ne=G&16383,Be=G>>14;--Te>=0;){var bt=this.data[z]&16383,ar=this.data[z++]>>14,Rr=Be*bt+ar*Ne;bt=Ne*bt+((Rr&16383)<<14)+Z.data[ce]+be,be=(bt>>28)+(Rr>>14)+Be*ar,Z.data[ce++]=bt&268435455}return be}typeof navigator>"u"?(u.prototype.am=d,r=28):s&&navigator.appName=="Microsoft Internet Explorer"?(u.prototype.am=a,r=30):s&&navigator.appName!="Netscape"?(u.prototype.am=c,r=26):(u.prototype.am=d,r=28),u.prototype.DB=r,u.prototype.DM=(1<=0;--G)z.data[G]=this.data[G];z.t=this.t,z.s=this.s}function y(z){this.t=1,this.s=z<0?-1:0,z>0?this.data[0]=z:z<-1?this.data[0]=z+this.DV:this.t=0}function R(z){var G=h();return G.fromInt(z),G}function w(z,G){var Z;if(G==16)Z=4;else if(G==8)Z=3;else if(G==256)Z=8;else if(G==2)Z=1;else if(G==32)Z=5;else if(G==4)Z=2;else{this.fromRadix(z,G);return}this.t=0,this.s=0;for(var ce=z.length,be=!1,Te=0;--ce>=0;){var Ne=Z==8?z[ce]&255:O(z,ce);if(Ne<0){z.charAt(ce)=="-"&&(be=!0);continue}be=!1,Te==0?this.data[this.t++]=Ne:Te+Z>this.DB?(this.data[this.t-1]|=(Ne&(1<>this.DB-Te):this.data[this.t-1]|=Ne<=this.DB&&(Te-=this.DB)}Z==8&&z[0]&128&&(this.s=-1,Te>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==z;)--this.t}function D(z){if(this.s<0)return"-"+this.negate().toString(z);var G;if(z==16)G=4;else if(z==8)G=3;else if(z==2)G=1;else if(z==32)G=5;else if(z==4)G=2;else return this.toRadix(z);var Z=(1<0)for(Be>Be)>0&&(be=!0,Te=T(ce));Ne>=0;)Be>(Be+=this.DB-G)):(ce=this.data[Ne]>>(Be-=G)&Z,Be<=0&&(Be+=this.DB,--Ne)),ce>0&&(be=!0),be&&(Te+=T(ce));return be?Te:"0"}function S(){var z=h();return u.ZERO.subTo(this,z),z}function m(){return this.s<0?this.negate():this}function p(z){var G=this.s-z.s;if(G!=0)return G;var Z=this.t;if(G=Z-z.t,G!=0)return this.s<0?-G:G;for(;--Z>=0;)if((G=this.data[Z]-z.data[Z])!=0)return G;return 0}function q(z){var G=1,Z;return(Z=z>>>16)!=0&&(z=Z,G+=16),(Z=z>>8)!=0&&(z=Z,G+=8),(Z=z>>4)!=0&&(z=Z,G+=4),(Z=z>>2)!=0&&(z=Z,G+=2),(Z=z>>1)!=0&&(z=Z,G+=1),G}function V(){return this.t<=0?0:this.DB*(this.t-1)+q(this.data[this.t-1]^this.s&this.DM)}function $(z,G){var Z;for(Z=this.t-1;Z>=0;--Z)G.data[Z+z]=this.data[Z];for(Z=z-1;Z>=0;--Z)G.data[Z]=0;G.t=this.t+z,G.s=this.s}function E(z,G){for(var Z=z;Z=0;--Be)G.data[Be+Te+1]=this.data[Be]>>ce|Ne,Ne=(this.data[Be]&be)<=0;--Be)G.data[Be]=0;G.data[Te]=Ne,G.t=this.t+Te+1,G.s=this.s,G.clamp()}function j(z,G){G.s=this.s;var Z=Math.floor(z/this.DB);if(Z>=this.t){G.t=0;return}var ce=z%this.DB,be=this.DB-ce,Te=(1<>ce;for(var Ne=Z+1;Ne>ce;ce>0&&(G.data[this.t-Z-1]|=(this.s&Te)<>=this.DB;if(z.t>=this.DB;ce+=this.s}else{for(ce+=this.s;Z>=this.DB;ce-=z.s}G.s=ce<0?-1:0,ce<-1?G.data[Z++]=this.DV+ce:ce>0&&(G.data[Z++]=ce),G.t=Z,G.clamp()}function M(z,G){var Z=this.abs(),ce=z.abs(),be=Z.t;for(G.t=be+ce.t;--be>=0;)G.data[be]=0;for(be=0;be=0;)z.data[Z]=0;for(Z=0;Z=G.DV&&(z.data[Z+G.t]-=G.DV,z.data[Z+G.t+1]=1)}z.t>0&&(z.data[z.t-1]+=G.am(Z,G.data[Z],z,2*Z,0,1)),z.s=0,z.clamp()}function oe(z,G,Z){var ce=z.abs();if(!(ce.t<=0)){var be=this.abs();if(be.t0?(ce.lShiftTo(bt,Te),be.lShiftTo(bt,Z)):(ce.copyTo(Te),be.copyTo(Z));var ar=Te.t,Rr=Te.data[ar-1];if(Rr!=0){var Pr=Rr*(1<1?Te.data[ar-2]>>this.F2:0),ln=this.FV/Pr,ci=(1<=0&&(Z.data[Z.t++]=1,Z.subTo(En,Z)),u.ONE.dlShiftTo(ar,En),En.subTo(Te,Te);Te.t=0;){var Gn=Z.data[--mr]==Rr?this.DM:Math.floor(Z.data[mr]*ln+(Z.data[mr-1]+Ir)*ci);if((Z.data[mr]+=Te.am(0,Gn,Z,Bi,0,ar))0&&Z.rShiftTo(bt,Z),Ne<0&&u.ZERO.subTo(Z,Z)}}}function ae(z){var G=h();return this.abs().divRemTo(z,null,G),this.s<0&&G.compareTo(u.ZERO)>0&&z.subTo(G,G),G}function pe(z){this.m=z}function _e(z){return z.s<0||z.compareTo(this.m)>=0?z.mod(this.m):z}function Re(z){return z}function qe(z){z.divRemTo(this.m,null,z)}function Ce(z,G,Z){z.multiplyTo(G,Z),this.reduce(Z)}function $e(z,G){z.squareTo(G),this.reduce(G)}pe.prototype.convert=_e,pe.prototype.revert=Re,pe.prototype.reduce=qe,pe.prototype.mulTo=Ce,pe.prototype.sqrTo=$e;function Ie(){if(this.t<1)return 0;var z=this.data[0];if(!(z&1))return 0;var G=z&3;return G=G*(2-(z&15)*G)&15,G=G*(2-(z&255)*G)&255,G=G*(2-((z&65535)*G&65535))&65535,G=G*(2-z*G%this.DV)%this.DV,G>0?this.DV-G:-G}function et(z){this.m=z,this.mp=z.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(G,G),G}function x(z){var G=h();return z.copyTo(G),this.reduce(G),G}function X(z){for(;z.t<=this.mt2;)z.data[z.t++]=0;for(var G=0;G>15)*this.mpl&this.um)<<15)&z.DM;for(Z=G+this.m.t,z.data[Z]+=this.m.am(0,ce,z,G,0,this.m.t);z.data[Z]>=z.DV;)z.data[Z]-=z.DV,z.data[++Z]++}z.clamp(),z.drShiftTo(this.m.t,z),z.compareTo(this.m)>=0&&z.subTo(this.m,z)}function Q(z,G){z.squareTo(G),this.reduce(G)}function A(z,G,Z){z.multiplyTo(G,Z),this.reduce(Z)}et.prototype.convert=Je,et.prototype.revert=x,et.prototype.reduce=X,et.prototype.mulTo=A,et.prototype.sqrTo=Q;function K(){return(this.t>0?this.data[0]&1:this.s)==0}function se(z,G){if(z>4294967295||z<1)return u.ONE;var Z=h(),ce=h(),be=G.convert(this),Te=q(z)-1;for(be.copyTo(Z);--Te>=0;)if(G.sqrTo(Z,ce),(z&1<0)G.mulTo(ce,be,Z);else{var Ne=Z;Z=ce,ce=Ne}return G.revert(Z)}function te(z,G){var Z;return z<256||G.isEven()?Z=new pe(G):Z=new et(G),this.exp(z,Z)}u.prototype.copyTo=k,u.prototype.fromInt=y,u.prototype.fromString=w,u.prototype.clamp=L,u.prototype.dlShiftTo=$,u.prototype.drShiftTo=E,u.prototype.lShiftTo=B,u.prototype.rShiftTo=j,u.prototype.subTo=N,u.prototype.multiplyTo=M,u.prototype.squareTo=ee,u.prototype.divRemTo=oe,u.prototype.invDigit=Ie,u.prototype.isEven=K,u.prototype.exp=se,u.prototype.toString=D,u.prototype.negate=S,u.prototype.abs=m,u.prototype.compareTo=p,u.prototype.bitLength=V,u.prototype.mod=ae,u.prototype.modPowInt=te,u.ZERO=R(0),u.ONE=R(1);function Ee(){var z=h();return this.copyTo(z),z}function xe(){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 ge(){return this.t==0?this.s:this.data[0]<<16>>16}function Le(z){return Math.floor(Math.LN2*this.DB/Math.log(z))}function We(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function rt(z){if(z==null&&(z=10),this.signum()==0||z<2||z>36)return"0";var G=this.chunkSize(z),Z=Math.pow(z,G),ce=R(Z),be=h(),Te=h(),Ne="";for(this.divRemTo(ce,be,Te);be.signum()>0;)Ne=(Z+Te.intValue()).toString(z).substr(1)+Ne,be.divRemTo(ce,be,Te);return Te.intValue().toString(z)+Ne}function He(z,G){this.fromInt(0),G==null&&(G=10);for(var Z=this.chunkSize(G),ce=Math.pow(G,Z),be=!1,Te=0,Ne=0,Be=0;Be=Z&&(this.dMultiply(ce),this.dAddOffset(Ne,0),Te=0,Ne=0)}Te>0&&(this.dMultiply(Math.pow(G,Te)),this.dAddOffset(Ne,0)),be&&u.ZERO.subTo(this,this)}function kt(z,G,Z){if(typeof G=="number")if(z<2)this.fromInt(1);else for(this.fromNumber(z,Z),this.testBit(z-1)||this.bitwiseTo(u.ONE.shiftLeft(z-1),Ht,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(G);)this.dAddOffset(2,0),this.bitLength()>z&&this.subTo(u.ONE.shiftLeft(z-1),this);else{var ce=new Array,be=z&7;ce.length=(z>>3)+1,G.nextBytes(ce),be>0?ce[0]&=(1<0)for(Z>Z)!=(this.s&this.DM)>>Z&&(G[be++]=ce|this.s<=0;)Z<8?(ce=(this.data[z]&(1<>(Z+=this.DB-8)):(ce=this.data[z]>>(Z-=8)&255,Z<=0&&(Z+=this.DB,--z)),ce&128&&(ce|=-256),be==0&&(this.s&128)!=(ce&128)&&++be,(be>0||ce!=this.s)&&(G[be++]=ce);return G}function Ct(z){return this.compareTo(z)==0}function Bt(z){return this.compareTo(z)<0?this:z}function Ot(z){return this.compareTo(z)>0?this:z}function Lt(z,G,Z){var ce,be,Te=Math.min(z.t,this.t);for(ce=0;ce>=16,G+=16),z&255||(z>>=8,G+=8),z&15||(z>>=4,G+=4),z&3||(z>>=2,G+=2),z&1||++G,G}function li(){for(var z=0;z=this.t?this.s!=0:(this.data[G]&1<>=this.DB;if(z.t>=this.DB;ce+=this.s}else{for(ce+=this.s;Z>=this.DB;ce+=z.s}G.s=ce<0?-1:0,ce>0?G.data[Z++]=ce:ce<-1&&(G.data[Z++]=this.DV+ce),G.t=Z,G.clamp()}function Gt(z){var G=h();return this.addTo(z,G),G}function Qt(z){var G=h();return this.subTo(z,G),G}function rr(z){var G=h();return this.multiplyTo(z,G),G}function nr(z){var G=h();return this.divRemTo(z,G,null),G}function ir(z){var G=h();return this.divRemTo(z,null,G),G}function er(z){var G=h(),Z=h();return this.divRemTo(z,G,Z),new Array(G,Z)}function or(z){this.data[this.t]=this.am(0,z-1,this,0,0,this.t),++this.t,this.clamp()}function cr(z,G){if(z!=0){for(;this.t<=G;)this.data[this.t++]=0;for(this.data[G]+=z;this.data[G]>=this.DV;)this.data[G]-=this.DV,++G>=this.t&&(this.data[this.t++]=0),++this.data[G]}}function $t(){}function tr(z){return z}function Na(z,G,Z){z.multiplyTo(G,Z)}function po(z,G){z.squareTo(G)}$t.prototype.convert=tr,$t.prototype.revert=tr,$t.prototype.mulTo=Na,$t.prototype.sqrTo=po;function Ps(z){return this.exp(z,new $t)}function yo(z,G,Z){var ce=Math.min(this.t+z.t,G);for(Z.s=0,Z.t=ce;ce>0;)Z.data[--ce]=0;var be;for(be=Z.t-this.t;ce=0;)Z.data[ce]=0;for(ce=Math.max(G-this.t,0);ce2*this.m.t)return z.mod(this.m);if(z.compareTo(this.m)<0)return z;var G=h();return z.copyTo(G),this.reduce(G),G}function Ko(z){return z}function Pi(z){for(z.drShiftTo(this.m.t-1,this.r2),z.t>this.m.t+1&&(z.t=this.m.t+1,z.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);z.compareTo(this.r2)<0;)z.dAddOffset(1,this.m.t+1);for(z.subTo(this.r2,z);z.compareTo(this.m)>=0;)z.subTo(this.m,z)}function go(z,G){z.squareTo(G),this.reduce(G)}function mo(z,G,Z){z.multiplyTo(G,Z),this.reduce(Z)}wn.prototype.convert=Tr,wn.prototype.revert=Ko,wn.prototype.reduce=Pi,wn.prototype.mulTo=mo,wn.prototype.sqrTo=go;function xa(z,G){var Z=z.bitLength(),ce,be=R(1),Te;if(Z<=0)return be;Z<18?ce=1:Z<48?ce=3:Z<144?ce=4:Z<768?ce=5:ce=6,Z<8?Te=new pe(G):G.isEven()?Te=new wn(G):Te=new et(G);var Ne=new Array,Be=3,bt=ce-1,ar=(1<1){var Rr=h();for(Te.sqrTo(Ne[1],Rr);Be<=ar;)Ne[Be]=h(),Te.mulTo(Rr,Ne[Be-2],Ne[Be]),Be+=2}var Pr=z.t-1,ln,ci=!0,Ir=h(),mr;for(Z=q(z.data[Pr])-1;Pr>=0;){for(Z>=bt?ln=z.data[Pr]>>Z-bt&ar:(ln=(z.data[Pr]&(1<0&&(ln|=z.data[Pr-1]>>this.DB+Z-bt)),Be=ce;!(ln&1);)ln>>=1,--Be;if((Z-=Be)<0&&(Z+=this.DB,--Pr),ci)Ne[ln].copyTo(be),ci=!1;else{for(;Be>1;)Te.sqrTo(be,Ir),Te.sqrTo(Ir,be),Be-=2;Be>0?Te.sqrTo(be,Ir):(mr=be,be=Ir,Ir=mr),Te.mulTo(Ir,Ne[ln],be)}for(;Pr>=0&&!(z.data[Pr]&1<0&&(G.rShiftTo(Te,G),Z.rShiftTo(Te,Z));G.signum()>0;)(be=G.getLowestSetBit())>0&&G.rShiftTo(be,G),(be=Z.getLowestSetBit())>0&&Z.rShiftTo(be,Z),G.compareTo(Z)>=0?(G.subTo(Z,G),G.rShiftTo(1,G)):(Z.subTo(G,Z),Z.rShiftTo(1,Z));return Te>0&&Z.lShiftTo(Te,Z),Z}function Da(z){if(z<=0)return 0;var G=this.DV%z,Z=this.s<0?z-1:0;if(this.t>0)if(G==0)Z=this.data[0]%z;else for(var ce=this.t-1;ce>=0;--ce)Z=(G*Z+this.data[ce])%z;return Z}function vo(z){var G=z.isEven();if(this.isEven()&&G||z.signum()==0)return u.ZERO;for(var Z=z.clone(),ce=this.clone(),be=R(1),Te=R(0),Ne=R(0),Be=R(1);Z.signum()!=0;){for(;Z.isEven();)Z.rShiftTo(1,Z),G?((!be.isEven()||!Te.isEven())&&(be.addTo(this,be),Te.subTo(z,Te)),be.rShiftTo(1,be)):Te.isEven()||Te.subTo(z,Te),Te.rShiftTo(1,Te);for(;ce.isEven();)ce.rShiftTo(1,ce),G?((!Ne.isEven()||!Be.isEven())&&(Ne.addTo(this,Ne),Be.subTo(z,Be)),Ne.rShiftTo(1,Ne)):Be.isEven()||Be.subTo(z,Be),Be.rShiftTo(1,Be);Z.compareTo(ce)>=0?(Z.subTo(ce,Z),G&&be.subTo(Ne,be),Te.subTo(Be,Te)):(ce.subTo(Z,ce),G&&Ne.subTo(be,Ne),Be.subTo(Te,Be))}if(ce.compareTo(u.ONE)!=0)return u.ZERO;if(Be.compareTo(z)>=0)return Be.subtract(z);if(Be.signum()<0)Be.addTo(z,Be);else return Be;return Be.signum()<0?Be.add(z):Be}var br=[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],ja=(1<<26)/br[br.length-1];function qa(z){var G,Z=this.abs();if(Z.t==1&&Z.data[0]<=br[br.length-1]){for(G=0;G=0);var Be=Te.modPow(ce,this);if(Be.compareTo(u.ONE)!=0&&Be.compareTo(G)!=0){for(var bt=1;bt++{var t=lt();fo(),Et();var r=n.exports=t.sha1=t.sha1||{};t.md.sha1=t.md.algorithms.sha1=r,r.create=function(){s||u();var c=null,a=t.util.createBuffer(),d=new Array(80),f={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return f.start=function(){f.messageLength=0,f.fullMessageLength=f.messageLength64=[];for(var g=f.messageLengthSize/4,I=0;I>>0,C>>>0];for(var v=f.fullMessageLength.length-1;v>=0;--v)f.fullMessageLength[v]+=C[1],C[1]=C[0]+(f.fullMessageLength[v]/4294967296>>>0),f.fullMessageLength[v]=f.fullMessageLength[v]>>>0,C[0]=C[1]/4294967296>>>0;return a.putBytes(g),h(c,d,a),(a.read>2048||a.length()===0)&&a.compact(),f},f.digest=function(){var g=t.util.createBuffer();g.putBytes(a.bytes());var I=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize,C=I&f.blockLength-1;g.putBytes(i.substr(0,f.blockLength-C));for(var v,T,O=f.fullMessageLength[0]*8,k=0;k>>0,O+=T,g.putInt32(O>>>0),O=v>>>0;g.putInt32(O);var y={h0:c.h0,h1:c.h1,h2:c.h2,h3:c.h3,h4:c.h4};h(y,d,g);var R=t.util.createBuffer();return R.putInt32(y.h0),R.putInt32(y.h1),R.putInt32(y.h2),R.putInt32(y.h3),R.putInt32(y.h4),R},f};var i=null,s=!1;function u(){i=String.fromCharCode(128),i+=t.util.fillString(String.fromCharCode(0),64),s=!0}function h(c,a,d){for(var f,g,I,C,v,T,O,k,y=d.length();y>=64;){for(g=c.h0,I=c.h1,C=c.h2,v=c.h3,T=c.h4,k=0;k<16;++k)f=d.getInt32(),a[k]=f,O=v^I&(C^v),f=(g<<5|g>>>27)+O+T+1518500249+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<20;++k)f=a[k-3]^a[k-8]^a[k-14]^a[k-16],f=f<<1|f>>>31,a[k]=f,O=v^I&(C^v),f=(g<<5|g>>>27)+O+T+1518500249+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<32;++k)f=a[k-3]^a[k-8]^a[k-14]^a[k-16],f=f<<1|f>>>31,a[k]=f,O=I^C^v,f=(g<<5|g>>>27)+O+T+1859775393+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<40;++k)f=a[k-6]^a[k-16]^a[k-28]^a[k-32],f=f<<2|f>>>30,a[k]=f,O=I^C^v,f=(g<<5|g>>>27)+O+T+1859775393+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<60;++k)f=a[k-6]^a[k-16]^a[k-28]^a[k-32],f=f<<2|f>>>30,a[k]=f,O=I&C|v&(I^C),f=(g<<5|g>>>27)+O+T+2400959708+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<80;++k)f=a[k-6]^a[k-16]^a[k-28]^a[k-32],f=f<<2|f>>>30,a[k]=f,O=I^C^v,f=(g<<5|g>>>27)+O+T+3395469782+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;c.h0=c.h0+g|0,c.h1=c.h1+I|0,c.h2=c.h2+C|0,c.h3=c.h3+v|0,c.h4=c.h4+T|0,y-=64}}}),db=Qe((e,n)=>{var t=lt();Et(),ui(),Gu();var r=n.exports=t.pkcs1=t.pkcs1||{};r.encode_rsa_oaep=function(s,u,h){var c,a,d,f;typeof h=="string"?(c=h,a=arguments[3]||void 0,d=arguments[4]||void 0):h&&(c=h.label||void 0,a=h.seed||void 0,d=h.md||void 0,h.mgf1&&h.mgf1.md&&(f=h.mgf1.md)),d?d.start():d=t.md.sha1.create(),f||(f=d);var g=Math.ceil(s.n.bitLength()/8),I=g-2*d.digestLength-2;if(u.length>I){var C=new Error("RSAES-OAEP input message length is too long.");throw C.length=u.length,C.maxLength=I,C}c||(c=""),d.update(c,"raw");for(var v=d.digest(),T="",O=I-u.length,k=0;k>24&255,d>>16&255,d>>8&255,d&255);h.start(),h.update(s+f),c+=h.digest().getBytes()}return c.substring(0,u)}}),pb=Qe((e,n)=>{var t=lt();Et(),ch(),ui(),function(){if(t.prime){n.exports=t.prime;return}var r=n.exports=t.prime=t.prime||{},i=t.jsbn.BigInteger,s=[6,4,2,4,2,4,6,2],u=new i(null);u.fromInt(30);var h=function(C,v){return C|v};r.generateProbablePrime=function(C,v,T){typeof v=="function"&&(T=v,v={}),v=v||{};var O=v.algorithm||"PRIMEINC";typeof O=="string"&&(O={name:O}),O.options=O.options||{};var k=v.prng||t.random,y={nextBytes:function(R){for(var w=k.getBytesSync(R.length),L=0;Lv&&(C=g(v,T)),C.isProbablePrime(k))return R(null,C);C.dAddOffset(s[O++%8],0)}while(y<0||+new Date-w"u")return a(C,v,T,O);var k=g(C,v),y=T.workers,R=T.workLoad||100,w=R*30/8,L=T.workerScript||"forge/prime.worker.js";if(y===-1)return t.util.estimateCores(function(S,m){S&&(m=2),y=m-1,D()});D();function D(){y=Math.max(1,y);for(var S=[],m=0;mC&&(k=g(C,v));var j=k.toString(16);$.target.postMessage({hex:j,workLoad:R}),k.dAddOffset(w,0)}}}}function g(C,v){var T=new i(C,v),O=C-1;return T.testBit(O)||T.bitwiseTo(i.ONE.shiftLeft(O),h,T),T.dAddOffset(31-T.mod(u).byteValue(),0),T}function I(C){return C<=100?27:C<=150?18:C<=200?15:C<=250?12:C<=300?9:C<=350?8:C<=400?7:C<=500?6:C<=600?5:C<=800?4:C<=1250?3:2}}()}),hh=Qe((e,n)=>{var t=lt();ki(),ch(),La(),db(),pb(),ui(),Et(),typeof r>"u"&&(r=t.jsbn.BigInteger);var r,i=t.util.isNodejs?_s("crypto"):null,s=t.asn1,u=t.util;t.pki=t.pki||{},n.exports=t.pki.rsa=t.rsa=t.rsa||{};var h=t.pki,c=[6,4,2,4,2,4,6,2],a={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},d={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},g=t.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},I={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},C=function(m){var p;if(m.algorithm in h.oids)p=h.oids[m.algorithm];else{var q=new Error("Unknown message digest algorithm.");throw q.algorithm=m.algorithm,q}var V=s.oidToDer(p).getBytes(),$=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),E=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);E.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,V)),E.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var B=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,m.digest().getBytes());return $.value.push(E),$.value.push(B),s.toDer($).getBytes()},v=function(m,p,q){if(q)return m.modPow(p.e,p.n);if(!p.p||!p.q)return m.modPow(p.d,p.n);p.dP||(p.dP=p.d.mod(p.p.subtract(r.ONE))),p.dQ||(p.dQ=p.d.mod(p.q.subtract(r.ONE))),p.qInv||(p.qInv=p.q.modInverse(p.p));var V;do V=new r(t.util.bytesToHex(t.random.getBytes(p.n.bitLength()/8)),16);while(V.compareTo(p.n)>=0||!V.gcd(p.n).equals(r.ONE));m=m.multiply(V.modPow(p.e,p.n)).mod(p.n);for(var $=m.mod(p.p).modPow(p.dP,p.p),E=m.mod(p.q).modPow(p.dQ,p.q);$.compareTo(E)<0;)$=$.add(p.p);var B=$.subtract(E).multiply(p.qInv).mod(p.p).multiply(p.q).add(E);return B=B.multiply(V.modInverse(p.n)).mod(p.n),B};h.rsa.encrypt=function(m,p,q){var V=q,$,E=Math.ceil(p.n.bitLength()/8);q!==!1&&q!==!0?(V=q===2,$=T(m,p,q)):($=t.util.createBuffer(),$.putBytes(m));for(var B=new r($.toHex(),16),j=v(B,p,V),N=j.toString(16),M=t.util.createBuffer(),ee=E-Math.ceil(N.length/2);ee>0;)M.putByte(0),--ee;return M.putBytes(t.util.hexToBytes(N)),M.getBytes()},h.rsa.decrypt=function(m,p,q,V){var $=Math.ceil(p.n.bitLength()/8);if(m.length!==$){var E=new Error("Encrypted message length is invalid.");throw E.length=m.length,E.expected=$,E}var B=new r(t.util.createBuffer(m).toHex(),16);if(B.compareTo(p.n)>=0)throw new Error("Encrypted message is invalid.");for(var j=v(B,p,q),N=j.toString(16),M=t.util.createBuffer(),ee=$-Math.ceil(N.length/2);ee>0;)M.putByte(0),--ee;return M.putBytes(t.util.hexToBytes(N)),V!==!1?O(M.getBytes(),p,q):M.getBytes()},h.rsa.createKeyPairGenerationState=function(m,p,q){typeof m=="string"&&(m=parseInt(m,10)),m=m||2048,q=q||{};var V=q.prng||t.random,$={nextBytes:function(j){for(var N=V.getBytesSync(j.length),M=0;M>1,pBits:m-(m>>1),pqState:0,num:null,keys:null},B.e.fromInt(B.eInt);else throw new Error("Invalid key generation algorithm: "+E);return B},h.rsa.stepKeyPairGenerationState=function(m,p){"algorithm"in m||(m.algorithm="PRIMEINC");var q=new r(null);q.fromInt(30);for(var V=0,$=function(oe,ae){return oe|ae},E=+new Date,B,j=0;m.keys===null&&(p<=0||jN?m.pqState=0:m.num.isProbablePrime(R(m.num.bitLength()))?++m.pqState:m.num.dAddOffset(c[V++%8],0):m.pqState===2?m.pqState=m.num.subtract(r.ONE).gcd(m.e).compareTo(r.ONE)===0?3:0:m.pqState===3&&(m.pqState=0,m.p===null?m.p=m.num:m.q=m.num,m.p!==null&&m.q!==null&&++m.state,m.num=null)}else if(m.state===1)m.p.compareTo(m.q)<0&&(m.num=m.p,m.p=m.q,m.q=m.num),++m.state;else if(m.state===2)m.p1=m.p.subtract(r.ONE),m.q1=m.q.subtract(r.ONE),m.phi=m.p1.multiply(m.q1),++m.state;else if(m.state===3)m.phi.gcd(m.e).compareTo(r.ONE)===0?++m.state:(m.p=null,m.q=null,m.state=0);else if(m.state===4)m.n=m.p.multiply(m.q),m.n.bitLength()===m.bits?++m.state:(m.q=null,m.state=0);else if(m.state===5){var ee=m.e.modInverse(m.phi);m.keys={privateKey:h.rsa.setPrivateKey(m.n,m.e,ee,m.p,m.q,ee.mod(m.p1),ee.mod(m.q1),m.q.modInverse(m.p)),publicKey:h.rsa.setPublicKey(m.n,m.e)}}B=+new Date,j+=B-E,E=B}return m.keys!==null},h.rsa.generateKeyPair=function(m,p,q,V){if(arguments.length===1?typeof m=="object"?(q=m,m=void 0):typeof m=="function"&&(V=m,m=void 0):arguments.length===2?typeof m=="number"?typeof p=="function"?(V=p,p=void 0):typeof p!="number"&&(q=p,p=void 0):(q=m,V=p,m=void 0,p=void 0):arguments.length===3&&(typeof p=="number"?typeof q=="function"&&(V=q,q=void 0):(V=q,q=p,p=void 0)),q=q||{},m===void 0&&(m=q.bits||2048),p===void 0&&(p=q.e||65537),!t.options.usePureJavaScript&&!q.prng&&m>=256&&m<=16384&&(p===65537||p===3)){if(V){if(w("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:m,publicExponent:p,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(j,N,M){if(j)return V(j);V(null,{privateKey:h.privateKeyFromPem(M),publicKey:h.publicKeyFromPem(N)})});if(L("generateKey")&&L("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:m,publicExponent:S(p),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(j){return u.globalScope.crypto.subtle.exportKey("pkcs8",j.privateKey)}).then(void 0,function(j){V(j)}).then(function(j){if(j){var N=h.privateKeyFromAsn1(s.fromDer(t.util.createBuffer(j)));V(null,{privateKey:N,publicKey:h.setRsaPublicKey(N.n,N.e)})}});if(D("generateKey")&&D("exportKey")){var $=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:m,publicExponent:S(p),hash:{name:"SHA-256"}},!0,["sign","verify"]);$.oncomplete=function(j){var N=j.target.result,M=u.globalScope.msCrypto.subtle.exportKey("pkcs8",N.privateKey);M.oncomplete=function(ee){var oe=ee.target.result,ae=h.privateKeyFromAsn1(s.fromDer(t.util.createBuffer(oe)));V(null,{privateKey:ae,publicKey:h.setRsaPublicKey(ae.n,ae.e)})},M.onerror=function(ee){V(ee)}},$.onerror=function(j){V(j)};return}}else if(w("generateKeyPairSync")){var E=i.generateKeyPairSync("rsa",{modulusLength:m,publicExponent:p,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:h.privateKeyFromPem(E.privateKey),publicKey:h.publicKeyFromPem(E.publicKey)}}}var B=h.rsa.createKeyPairGenerationState(m,p,q);if(!V)return h.rsa.stepKeyPairGenerationState(B,0),B.keys;k(B,q,V)},h.setRsaPublicKey=h.rsa.setPublicKey=function(m,p){var q={n:m,e:p};return q.encrypt=function(V,$,E){if(typeof $=="string"?$=$.toUpperCase():$===void 0&&($="RSAES-PKCS1-V1_5"),$==="RSAES-PKCS1-V1_5")$={encode:function(j,N,M){return T(j,N,2).getBytes()}};else if($==="RSA-OAEP"||$==="RSAES-OAEP")$={encode:function(j,N){return t.pkcs1.encode_rsa_oaep(N,j,E)}};else if(["RAW","NONE","NULL",null].indexOf($)!==-1)$={encode:function(j){return j}};else if(typeof $=="string")throw new Error('Unsupported encryption scheme: "'+$+'".');var B=$.encode(V,q,!0);return h.rsa.encrypt(B,q,!0)},q.verify=function(V,$,E,B){typeof E=="string"?E=E.toUpperCase():E===void 0&&(E="RSASSA-PKCS1-V1_5"),B===void 0&&(B={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in B||(B._parseAllDigestBytes=!0),E==="RSASSA-PKCS1-V1_5"?E={verify:function(N,M){M=O(M,q,!0);var ee=s.fromDer(M,{parseAllBytes:B._parseAllDigestBytes}),oe={},ae=[];if(!s.validate(ee,I,oe,ae)){var pe=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw pe.errors=ae,pe}var _e=s.derToOid(oe.algorithmIdentifier);if(!(_e===t.oids.md2||_e===t.oids.md5||_e===t.oids.sha1||_e===t.oids.sha224||_e===t.oids.sha256||_e===t.oids.sha384||_e===t.oids.sha512||_e===t.oids["sha512-224"]||_e===t.oids["sha512-256"])){var pe=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw pe.oid=_e,pe}if((_e===t.oids.md2||_e===t.oids.md5)&&!("parameters"in oe))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return N===oe.digest}}:(E==="NONE"||E==="NULL"||E===null)&&(E={verify:function(N,M){return M=O(M,q,!0),N===M}});var j=h.rsa.decrypt($,q,!0,!1);return E.verify(V,j,q.n.bitLength())},q},h.setRsaPrivateKey=h.rsa.setPrivateKey=function(m,p,q,V,$,E,B,j){var N={n:m,e:p,d:q,p:V,q:$,dP:E,dQ:B,qInv:j};return N.decrypt=function(M,ee,oe){typeof ee=="string"?ee=ee.toUpperCase():ee===void 0&&(ee="RSAES-PKCS1-V1_5");var ae=h.rsa.decrypt(M,N,!1,!1);if(ee==="RSAES-PKCS1-V1_5")ee={decode:O};else if(ee==="RSA-OAEP"||ee==="RSAES-OAEP")ee={decode:function(pe,_e){return t.pkcs1.decode_rsa_oaep(_e,pe,oe)}};else if(["RAW","NONE","NULL",null].indexOf(ee)!==-1)ee={decode:function(pe){return pe}};else throw new Error('Unsupported encryption scheme: "'+ee+'".');return ee.decode(ae,N,!1)},N.sign=function(M,ee){var oe=!1;typeof ee=="string"&&(ee=ee.toUpperCase()),ee===void 0||ee==="RSASSA-PKCS1-V1_5"?(ee={encode:C},oe=1):(ee==="NONE"||ee==="NULL"||ee===null)&&(ee={encode:function(){return M}},oe=1);var ae=ee.encode(M,N.n.bitLength());return h.rsa.encrypt(ae,N,oe)},N},h.wrapRsaPrivateKey=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(h.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(m).getBytes())])},h.privateKeyFromAsn1=function(m){var p={},q=[];if(s.validate(m,a,p,q)&&(m=s.fromDer(t.util.createBuffer(p.privateKey))),p={},q=[],!s.validate(m,d,p,q)){var V=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw V.errors=q,V}var $,E,B,j,N,M,ee,oe;return $=t.util.createBuffer(p.privateKeyModulus).toHex(),E=t.util.createBuffer(p.privateKeyPublicExponent).toHex(),B=t.util.createBuffer(p.privateKeyPrivateExponent).toHex(),j=t.util.createBuffer(p.privateKeyPrime1).toHex(),N=t.util.createBuffer(p.privateKeyPrime2).toHex(),M=t.util.createBuffer(p.privateKeyExponent1).toHex(),ee=t.util.createBuffer(p.privateKeyExponent2).toHex(),oe=t.util.createBuffer(p.privateKeyCoefficient).toHex(),h.setRsaPrivateKey(new r($,16),new r(E,16),new r(B,16),new r(j,16),new r(N,16),new r(M,16),new r(ee,16),new r(oe,16))},h.privateKeyToAsn1=h.privateKeyToRSAPrivateKey=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.qInv))])},h.publicKeyFromAsn1=function(m){var p={},q=[];if(s.validate(m,g,p,q)){var V=s.derToOid(p.publicKeyOid);if(V!==h.oids.rsaEncryption){var $=new Error("Cannot read public key. Unknown OID.");throw $.oid=V,$}m=p.rsaPublicKey}if(q=[],!s.validate(m,f,p,q)){var $=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw $.errors=q,$}var E=t.util.createBuffer(p.publicKeyModulus).toHex(),B=t.util.createBuffer(p.publicKeyExponent).toHex();return h.setRsaPublicKey(new r(E,16),new r(B,16))},h.publicKeyToAsn1=h.publicKeyToSubjectPublicKeyInfo=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(h.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[h.publicKeyToRSAPublicKey(m)])])},h.publicKeyToRSAPublicKey=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.e))])};function T(m,p,q){var V=t.util.createBuffer(),$=Math.ceil(p.n.bitLength()/8);if(m.length>$-11){var E=new Error("Message is too long for PKCS#1 v1.5 padding.");throw E.length=m.length,E.max=$-11,E}V.putByte(0),V.putByte(q);var B=$-3-m.length,j;if(q===0||q===1){j=q===0?0:255;for(var N=0;N0;){for(var M=0,ee=t.random.getBytes(B),N=0;N"u")throw new Error("Encryption block is invalid.");var N=0;if(j===0){N=$-3-V;for(var M=0;M1;){if(E.getByte()!==255){--E.read;break}++N}else if(j===2)for(N=0;E.length()>1;){if(E.getByte()===0){--E.read;break}++N}var ee=E.getByte();if(ee!==0||N!==$-3-E.length())throw new Error("Encryption block is invalid.");return E.getBytes()}function k(m,p,q){typeof p=="function"&&(q=p,p={}),p=p||{};var V={algorithm:{name:p.algorithm||"PRIMEINC",options:{workers:p.workers||2,workLoad:p.workLoad||100,workerScript:p.workerScript}}};"prng"in p&&(V.prng=p.prng),$();function $(){E(m.pBits,function(j,N){if(j)return q(j);if(m.p=N,m.q!==null)return B(j,m.q);E(m.qBits,B)})}function E(j,N){t.prime.generateProbablePrime(j,V,N)}function B(j,N){if(j)return q(j);if(m.q=N,m.p.compareTo(m.q)<0){var M=m.p;m.p=m.q,m.q=M}if(m.p.subtract(r.ONE).gcd(m.e).compareTo(r.ONE)!==0){m.p=null,$();return}if(m.q.subtract(r.ONE).gcd(m.e).compareTo(r.ONE)!==0){m.q=null,E(m.qBits,B);return}if(m.p1=m.p.subtract(r.ONE),m.q1=m.q.subtract(r.ONE),m.phi=m.p1.multiply(m.q1),m.phi.gcd(m.e).compareTo(r.ONE)!==0){m.p=m.q=null,$();return}if(m.n=m.p.multiply(m.q),m.n.bitLength()!==m.bits){m.q=null,E(m.qBits,B);return}var ee=m.e.modInverse(m.phi);m.keys={privateKey:h.rsa.setPrivateKey(m.n,m.e,ee,m.p,m.q,ee.mod(m.p1),ee.mod(m.q1),m.q.modInverse(m.p)),publicKey:h.rsa.setPublicKey(m.n,m.e)},q(null,m.keys)}}function y(m){var p=m.toString(16);p[0]>="8"&&(p="00"+p);var q=t.util.hexToBytes(p);return q.length>1&&(q.charCodeAt(0)===0&&!(q.charCodeAt(1)&128)||q.charCodeAt(0)===255&&(q.charCodeAt(1)&128)===128)?q.substr(1):q}function R(m){return m<=100?27:m<=150?18:m<=200?15:m<=250?12:m<=300?9:m<=350?8:m<=400?7:m<=500?6:m<=600?5:m<=800?4:m<=1250?3:2}function w(m){return t.util.isNodejs&&typeof i[m]=="function"}function L(m){return typeof u.globalScope<"u"&&typeof u.globalScope.crypto=="object"&&typeof u.globalScope.crypto.subtle=="object"&&typeof u.globalScope.crypto.subtle[m]=="function"}function D(m){return typeof u.globalScope<"u"&&typeof u.globalScope.msCrypto=="object"&&typeof u.globalScope.msCrypto.subtle=="object"&&typeof u.globalScope.msCrypto.subtle[m]=="function"}function S(m){for(var p=t.util.hexToBytes(m.toString(16)),q=new Uint8Array(p.length),V=0;V{var t=lt();Ba(),ki(),lh(),fo(),La(),Wp(),Os(),ui(),fb(),hh(),Et(),typeof r>"u"&&(r=t.jsbn.BigInteger);var r,i=t.asn1,s=t.pki=t.pki||{};n.exports=s.pbe=t.pbe=t.pbe||{};var u=s.oids,h={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"}]},c={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"}]};s.encryptPrivateKeyInfo=function(C,v,T){T=T||{},T.saltSize=T.saltSize||8,T.count=T.count||2048,T.algorithm=T.algorithm||"aes128",T.prfAlgorithm=T.prfAlgorithm||"sha1";var O=t.random.getBytesSync(T.saltSize),k=T.count,y=i.integerToDer(k),R,w,L;if(T.algorithm.indexOf("aes")===0||T.algorithm==="des"){var D,S,m;switch(T.algorithm){case"aes128":R=16,D=16,S=u["aes128-CBC"],m=t.aes.createEncryptionCipher;break;case"aes192":R=24,D=16,S=u["aes192-CBC"],m=t.aes.createEncryptionCipher;break;case"aes256":R=32,D=16,S=u["aes256-CBC"],m=t.aes.createEncryptionCipher;break;case"des":R=8,D=8,S=u.desCBC,m=t.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=T.algorithm,p}var q="hmacWith"+T.prfAlgorithm.toUpperCase(),V=g(q),$=t.pkcs5.pbkdf2(v,O,k,R,V),E=t.random.getBytesSync(D),B=m($);B.start(E),B.update(i.toDer(C)),B.finish(),L=B.output.getBytes();var j=I(O,y,R,q);w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(u.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(u.pkcs5PBKDF2).getBytes()),j]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(S).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,E)])])])}else if(T.algorithm==="3des"){R=24;var N=new t.util.ByteBuffer(O),$=s.pbe.generatePkcs12Key(v,N,1,k,R),E=s.pbe.generatePkcs12Key(v,N,2,k,R),B=t.des.createEncryptionCipher($);B.start(E),B.update(i.toDer(C)),B.finish(),L=B.output.getBytes(),w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(u["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,y.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=T.algorithm,p}var M=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[w,i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,L)]);return M},s.decryptPrivateKeyInfo=function(C,v){var T=null,O={},k=[];if(!i.validate(C,h,O,k)){var y=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw y.errors=k,y}var R=i.derToOid(O.encryptionOid),w=s.pbe.getCipher(R,O.encryptionParams,v),L=t.util.createBuffer(O.encryptedData);return w.update(L),w.finish()&&(T=i.fromDer(w.output)),T},s.encryptedPrivateKeyToPem=function(C,v){var T={type:"ENCRYPTED PRIVATE KEY",body:i.toDer(C).getBytes()};return t.pem.encode(T,{maxline:v})},s.encryptedPrivateKeyFromPem=function(C){var v=t.pem.decode(C)[0];if(v.type!=="ENCRYPTED PRIVATE KEY"){var T=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw T.headerType=v.type,T}if(v.procType&&v.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return i.fromDer(v.body)},s.encryptRsaPrivateKey=function(C,v,T){if(T=T||{},!T.legacy){var O=s.wrapRsaPrivateKey(s.privateKeyToAsn1(C));return O=s.encryptPrivateKeyInfo(O,v,T),s.encryptedPrivateKeyToPem(O)}var k,y,R,w;switch(T.algorithm){case"aes128":k="AES-128-CBC",R=16,y=t.random.getBytesSync(16),w=t.aes.createEncryptionCipher;break;case"aes192":k="AES-192-CBC",R=24,y=t.random.getBytesSync(16),w=t.aes.createEncryptionCipher;break;case"aes256":k="AES-256-CBC",R=32,y=t.random.getBytesSync(16),w=t.aes.createEncryptionCipher;break;case"3des":k="DES-EDE3-CBC",R=24,y=t.random.getBytesSync(8),w=t.des.createEncryptionCipher;break;case"des":k="DES-CBC",R=8,y=t.random.getBytesSync(8),w=t.des.createEncryptionCipher;break;default:var L=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+T.algorithm+'".');throw L.algorithm=T.algorithm,L}var D=t.pbe.opensslDeriveBytes(v,y.substr(0,8),R),S=w(D);S.start(y),S.update(i.toDer(s.privateKeyToAsn1(C))),S.finish();var m={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:k,parameters:t.util.bytesToHex(y).toUpperCase()},body:S.output.getBytes()};return t.pem.encode(m)},s.decryptRsaPrivateKey=function(C,v){var T=null,O=t.pem.decode(C)[0];if(O.type!=="ENCRYPTED PRIVATE KEY"&&O.type!=="PRIVATE KEY"&&O.type!=="RSA PRIVATE KEY"){var k=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw k.headerType=k,k}if(O.procType&&O.procType.type==="ENCRYPTED"){var y,R;switch(O.dekInfo.algorithm){case"DES-CBC":y=8,R=t.des.createDecryptionCipher;break;case"DES-EDE3-CBC":y=24,R=t.des.createDecryptionCipher;break;case"AES-128-CBC":y=16,R=t.aes.createDecryptionCipher;break;case"AES-192-CBC":y=24,R=t.aes.createDecryptionCipher;break;case"AES-256-CBC":y=32,R=t.aes.createDecryptionCipher;break;case"RC2-40-CBC":y=5,R=function(m){return t.rc2.createDecryptionCipher(m,40)};break;case"RC2-64-CBC":y=8,R=function(m){return t.rc2.createDecryptionCipher(m,64)};break;case"RC2-128-CBC":y=16,R=function(m){return t.rc2.createDecryptionCipher(m,128)};break;default:var k=new Error('Could not decrypt private key; unsupported encryption algorithm "'+O.dekInfo.algorithm+'".');throw k.algorithm=O.dekInfo.algorithm,k}var w=t.util.hexToBytes(O.dekInfo.parameters),L=t.pbe.opensslDeriveBytes(v,w.substr(0,8),y),D=R(L);if(D.start(w),D.update(t.util.createBuffer(O.body)),D.finish())T=D.output.getBytes();else return T}else T=O.body;return O.type==="ENCRYPTED PRIVATE KEY"?T=s.decryptPrivateKeyInfo(i.fromDer(T),v):T=i.fromDer(T),T!==null&&(T=s.privateKeyFromAsn1(T)),T},s.pbe.generatePkcs12Key=function(C,v,T,O,k,y){var R,w;if(typeof y>"u"||y===null){if(!("sha1"in t.md))throw new Error('"sha1" hash algorithm unavailable.');y=t.md.sha1.create()}var L=y.digestLength,D=y.blockLength,S=new t.util.ByteBuffer,m=new t.util.ByteBuffer;if(C!=null){for(w=0;w=0;w--)Ce=Ce>>8,Ce+=pe.at(w)+qe.at(w),qe.setAt(w,Ce&255);Re.putBuffer(qe)}N=Re,S.putBuffer(oe)}return S.truncate(S.length()-k),S},s.pbe.getCipher=function(C,v,T){switch(C){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(C,v,T);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(C,v,T);default:var O=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw O.oid=C,O.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],O}},s.pbe.getCipherForPBES2=function(C,v,T){var O={},k=[];if(!i.validate(v,c,O,k)){var y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw y.errors=k,y}if(C=i.derToOid(O.kdfOid),C!==s.oids.pkcs5PBKDF2){var y=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw y.oid=C,y.supportedOids=["pkcs5PBKDF2"],y}if(C=i.derToOid(O.encOid),C!==s.oids["aes128-CBC"]&&C!==s.oids["aes192-CBC"]&&C!==s.oids["aes256-CBC"]&&C!==s.oids["des-EDE3-CBC"]&&C!==s.oids.desCBC){var y=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw y.oid=C,y.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],y}var R=O.kdfSalt,w=t.util.createBuffer(O.kdfIterationCount);w=w.getInt(w.length()<<3);var L,D;switch(s.oids[C]){case"aes128-CBC":L=16,D=t.aes.createDecryptionCipher;break;case"aes192-CBC":L=24,D=t.aes.createDecryptionCipher;break;case"aes256-CBC":L=32,D=t.aes.createDecryptionCipher;break;case"des-EDE3-CBC":L=24,D=t.des.createDecryptionCipher;break;case"desCBC":L=8,D=t.des.createDecryptionCipher;break}var S=f(O.prfOid),m=t.pkcs5.pbkdf2(T,R,w,L,S),p=O.encIv,q=D(m);return q.start(p),q},s.pbe.getCipherForPKCS12PBE=function(C,v,T){var O={},k=[];if(!i.validate(v,a,O,k)){var y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw y.errors=k,y}var R=t.util.createBuffer(O.salt),w=t.util.createBuffer(O.iterations);w=w.getInt(w.length()<<3);var L,D,S;switch(C){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:L=24,D=8,S=t.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:L=5,D=8,S=function($,E){var B=t.rc2.createDecryptionCipher($,40);return B.start(E,null),B};break;default:var y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw y.oid=C,y}var m=f(O.prfOid),p=s.pbe.generatePkcs12Key(T,R,1,w,L,m);m.start();var q=s.pbe.generatePkcs12Key(T,R,2,w,D,m);return S(p,q)},s.pbe.opensslDeriveBytes=function(C,v,T,O){if(typeof O>"u"||O===null){if(!("md5"in t.md))throw new Error('"md5" hash algorithm unavailable.');O=t.md.md5.create()}v===null&&(v="");for(var k=[d(O,C+v)],y=16,R=1;y{var t=lt();ki(),Et();var r=t.asn1,i=n.exports=t.pkcs7asn1=t.pkcs7asn1||{};t.pkcs7=t.pkcs7||{},t.pkcs7.asn1=i;var s={name:"ContentInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=s;var u={name:"EncryptedContentInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:r.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(u)},i.encryptedDataValidator={name:"EncryptedData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"}].concat(u)};var h={name:"SignerInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:r.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,capture:"signerInfos",optional:!0,value:[h]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:r.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}}),mb=Qe((e,n)=>{var t=lt();Et(),t.mgf=t.mgf||{};var r=n.exports=t.mgf.mgf1=t.mgf1=t.mgf1||{};r.create=function(i){var s={generate:function(u,h){for(var c=new t.util.ByteBuffer,a=Math.ceil(h/i.digestLength),d=0;d{var t=lt();mb(),n.exports=t.mgf=t.mgf||{},t.mgf.mgf1=t.mgf1}),Gp=Qe((e,n)=>{var t=lt();ui(),Et();var r=n.exports=t.pss=t.pss||{};r.create=function(i){arguments.length===3&&(i={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var s=i.md,u=i.mgf,h=s.digestLength,c=i.salt||null;typeof c=="string"&&(c=t.util.createBuffer(c));var a;if("saltLength"in i)a=i.saltLength;else if(c!==null)a=c.length();else throw new Error("Salt length not specified or specific salt not given.");if(c!==null&&c.length()!==a)throw new Error("Given salt length does not match length of given salt.");var d=i.prng||t.random,f={};return f.encode=function(g,I){var C,v=I-1,T=Math.ceil(v/8),O=g.digest().getBytes();if(T>8*T-v&255;return m=String.fromCharCode(m.charCodeAt(0)&~p)+m.substr(1),m+R+String.fromCharCode(188)},f.verify=function(g,I,C){var v,T=C-1,O=Math.ceil(T/8);if(I=I.substr(-O),O>8*O-T&255;if(y.charCodeAt(0)&w)throw new Error("Bits beyond keysize not zero as expected.");var L=u.generate(R,k),D="";for(v=0;v{var t=lt();Ba(),ki(),lh(),fo(),Y5(),La(),Os(),Gp(),hh(),Et();var r=t.asn1,i=n.exports=t.pki=t.pki||{},s=i.oids,u={};u.CN=s.commonName,u.commonName="CN",u.C=s.countryName,u.countryName="C",u.L=s.localityName,u.localityName="L",u.ST=s.stateOrProvinceName,u.stateOrProvinceName="ST",u.O=s.organizationName,u.organizationName="O",u.OU=s.organizationalUnitName,u.organizationalUnitName="OU",u.E=s.emailAddress,u.emailAddress="E";var h=t.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:r.Class.UNIVERSAL,type:r.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:r.Class.UNIVERSAL,type:r.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:r.Class.UNIVERSAL,type:r.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:r.Class.UNIVERSAL,type:r.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},h,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:r.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:r.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},a={name:"rsapss",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:r.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:r.Class.UNIVERSAL,type:r.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:r.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:r.Class.UNIVERSAL,type:r.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},d={name:"CertificationRequestInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},h,{name:"CertificationRequestInfo.attributes",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0}]}]}]},f={name:"CertificationRequest",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[d,{name:"CertificationRequest.signatureAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};i.RDNAttributesAsArray=function(S,m){for(var p=[],q,V,$,E=0;E2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(j.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(E.validity.notBefore=j[0],E.validity.notAfter=j[1],E.tbsCertificate=p.tbsCertificate,m){E.md=C({signatureOid:E.signatureOid,type:"certificate"});var N=r.toDer(E.tbsCertificate);E.md.update(N.getBytes())}var M=t.md.sha1.create(),ee=r.toDer(p.certIssuer);M.update(ee.getBytes()),E.issuer.getField=function(pe){return g(E.issuer,pe)},E.issuer.addField=function(pe){O([pe]),E.issuer.attributes.push(pe)},E.issuer.attributes=i.RDNAttributesAsArray(p.certIssuer),p.certIssuerUniqueId&&(E.issuer.uniqueId=p.certIssuerUniqueId),E.issuer.hash=M.digest().toHex();var oe=t.md.sha1.create(),ae=r.toDer(p.certSubject);return oe.update(ae.getBytes()),E.subject.getField=function(pe){return g(E.subject,pe)},E.subject.addField=function(pe){O([pe]),E.subject.attributes.push(pe)},E.subject.attributes=i.RDNAttributesAsArray(p.certSubject),p.certSubjectUniqueId&&(E.subject.uniqueId=p.certSubjectUniqueId),E.subject.hash=oe.digest().toHex(),p.certExtensions?E.extensions=i.certificateExtensionsFromAsn1(p.certExtensions):E.extensions=[],E.publicKey=i.publicKeyFromAsn1(p.subjectPublicKeyInfo),E},i.certificateExtensionsFromAsn1=function(S){for(var m=[],p=0;p1&&(q=p.value.charCodeAt(1),V=p.value.length>2?p.value.charCodeAt(2):0),m.digitalSignature=(q&128)===128,m.nonRepudiation=(q&64)===64,m.keyEncipherment=(q&32)===32,m.dataEncipherment=(q&16)===16,m.keyAgreement=(q&8)===8,m.keyCertSign=(q&4)===4,m.cRLSign=(q&2)===2,m.encipherOnly=(q&1)===1,m.decipherOnly=(V&128)===128}else if(m.name==="basicConstraints"){var p=r.fromDer(m.value);p.value.length>0&&p.value[0].type===r.Type.BOOLEAN?m.cA=p.value[0].value.charCodeAt(0)!==0:m.cA=!1;var $=null;p.value.length>0&&p.value[0].type===r.Type.INTEGER?$=p.value[0].value:p.value.length>1&&($=p.value[1].value),$!==null&&(m.pathLenConstraint=r.derToInteger($))}else if(m.name==="extKeyUsage")for(var p=r.fromDer(m.value),E=0;E1&&(q=p.value.charCodeAt(1)),m.client=(q&128)===128,m.server=(q&64)===64,m.email=(q&32)===32,m.objsign=(q&16)===16,m.reserved=(q&8)===8,m.sslCA=(q&4)===4,m.emailCA=(q&2)===2,m.objCA=(q&1)===1}else if(m.name==="subjectAltName"||m.name==="issuerAltName"){m.altNames=[];for(var j,p=r.fromDer(m.value),N=0;N"u"&&(m.type&&m.type in i.oids?m.name=i.oids[m.type]:m.shortName&&m.shortName in u&&(m.name=i.oids[u[m.shortName]])),typeof m.type>"u")if(m.name&&m.name in i.oids)m.type=i.oids[m.name];else{var q=new Error("Attribute type not specified.");throw q.attribute=m,q}if(typeof m.shortName>"u"&&m.name&&m.name in u&&(m.shortName=u[m.name]),m.type===s.extensionRequest&&(m.valueConstructed=!0,m.valueTagClass=r.Type.SEQUENCE,!m.value&&m.extensions)){m.value=[];for(var V=0;V"u"){var q=new Error("Attribute value not specified.");throw q.attribute=m,q}}}function k(S,m){if(m=m||{},typeof S.name>"u"&&S.id&&S.id in i.oids&&(S.name=i.oids[S.id]),typeof S.id>"u")if(S.name&&S.name in i.oids)S.id=i.oids[S.name];else{var p=new Error("Extension ID not specified.");throw p.extension=S,p}if(typeof S.value<"u")return S;if(S.name==="keyUsage"){var q=0,V=0,$=0;S.digitalSignature&&(V|=128,q=7),S.nonRepudiation&&(V|=64,q=6),S.keyEncipherment&&(V|=32,q=5),S.dataEncipherment&&(V|=16,q=4),S.keyAgreement&&(V|=8,q=3),S.keyCertSign&&(V|=4,q=2),S.cRLSign&&(V|=2,q=1),S.encipherOnly&&(V|=1,q=0),S.decipherOnly&&($|=128,q=7);var E=String.fromCharCode(q);$!==0?E+=String.fromCharCode(V)+String.fromCharCode($):V!==0&&(E+=String.fromCharCode(V)),S.value=r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,E)}else if(S.name==="basicConstraints")S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),S.cA&&S.value.value.push(r.create(r.Class.UNIVERSAL,r.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in S&&S.value.value.push(r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(S.pathLenConstraint).getBytes()));else if(S.name==="extKeyUsage"){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);var B=S.value.value;for(var j in S)S[j]===!0&&(j in s?B.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(s[j]).getBytes())):j.indexOf(".")!==-1&&B.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(j).getBytes())))}else if(S.name==="nsCertType"){var q=0,V=0;S.client&&(V|=128,q=7),S.server&&(V|=64,q=6),S.email&&(V|=32,q=5),S.objsign&&(V|=16,q=4),S.reserved&&(V|=8,q=3),S.sslCA&&(V|=4,q=2),S.emailCA&&(V|=2,q=1),S.objCA&&(V|=1,q=0);var E=String.fromCharCode(q);V!==0&&(E+=String.fromCharCode(V)),S.value=r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,E)}else if(S.name==="subjectAltName"||S.name==="issuerAltName"){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);for(var N,M=0;M128)throw new Error('Invalid "nsComment" content.');S.value=r.create(r.Class.UNIVERSAL,r.Type.IA5STRING,!1,S.comment)}else if(S.name==="subjectKeyIdentifier"&&m.cert){var ee=m.cert.generateSubjectKeyIdentifier();S.subjectKeyIdentifier=ee.toHex(),S.value=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,ee.getBytes())}else if(S.name==="authorityKeyIdentifier"&&m.cert){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);var B=S.value.value;if(S.keyIdentifier){var oe=S.keyIdentifier===!0?m.cert.generateSubjectKeyIdentifier().getBytes():S.keyIdentifier;B.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!1,oe))}if(S.authorityCertIssuer){var ae=[r.create(r.Class.CONTEXT_SPECIFIC,4,!0,[T(S.authorityCertIssuer===!0?m.cert.issuer:S.authorityCertIssuer)])];B.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,ae))}if(S.serialNumber){var pe=t.util.hexToBytes(S.serialNumber===!0?m.cert.serialNumber:S.serialNumber);B.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!1,pe))}}else if(S.name==="cRLDistributionPoints"){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);for(var B=S.value.value,_e=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),Re=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]),N,M=0;M"u"){var p=new Error("Extension value not specified.");throw p.extension=S,p}return S}function y(S,m){switch(S){case s["RSASSA-PSS"]:var p=[];return m.hash.algorithmOid!==void 0&&p.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(m.hash.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")])])),m.mgf.algorithmOid!==void 0&&p.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(m.mgf.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(m.mgf.hash.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")])])])),m.saltLength!==void 0&&p.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(m.saltLength).getBytes())])),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,p);default:return r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")}}function R(S){var m=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]);if(S.attributes.length===0)return m;for(var p=S.attributes,q=0;q=w&&S0&&q.value.push(i.certificateExtensionsToAsn1(S.extensions)),q},i.getCertificationRequestInfo=function(S){var m=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(S.version).getBytes()),T(S.subject),i.publicKeyToAsn1(S.publicKey),R(S)]);return m},i.distinguishedNameToAsn1=function(S){return T(S)},i.certificateToAsn1=function(S){var m=S.tbsCertificate||i.getTBSCertificate(S);return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[m,r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(S.signatureOid).getBytes()),y(S.signatureOid,S.signatureParameters)]),r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,String.fromCharCode(0)+S.signature)])},i.certificateExtensionsToAsn1=function(S){var m=r.create(r.Class.CONTEXT_SPECIFIC,3,!0,[]),p=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);m.value.push(p);for(var q=0;q"u"&&(V=new Date);var $=!0,E=null,B=0;do{var j=m.shift(),N=null,M=!1;if(V&&(Vj.validity.notAfter)&&(E={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:j.validity.notBefore,notAfter:j.validity.notAfter,now:V}),E===null){if(N=m[0]||S.getIssuer(j),N===null&&j.isIssuer(j)&&(M=!0,N=j),N){var ee=N;t.util.isArray(ee)||(ee=[ee]);for(var oe=!1;!oe&&ee.length>0;){N=ee.shift();try{oe=N.verify(j)}catch{}}oe||(E={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}E===null&&(!N||M)&&!S.hasCertificate(j)&&(E={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(E===null&&N&&!j.isIssuer(N)&&(E={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),E===null)for(var ae={keyUsage:!0,basicConstraints:!0},pe=0;E===null&&peRe.pathLenConstraint&&(E={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}}var $e=E===null?!0:E.error,Ie=p.verify?p.verify($e,B,q):$e;if(Ie===!0)E=null;else throw $e===!0&&(E={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(Ie||Ie===0)&&(typeof Ie=="object"&&!t.util.isArray(Ie)?(Ie.message&&(E.message=Ie.message),Ie.error&&(E.error=Ie.error)):typeof Ie=="string"&&(E.error=Ie)),E;$=!1,++B}while(m.length>0);return!0}}),vb=Qe((e,n)=>{var t=lt();ki(),Wu(),La(),gb(),yb(),ui(),hh(),Gu(),Et(),Qp();var r=t.asn1,i=t.pki,s=n.exports=t.pkcs12=t.pkcs12||{},u={name:"ContentInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},h={name:"PFX",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},u,{name:"PFX.macData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:r.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},a={name:"Attribute",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,capture:"values"}]},d={name:"CertBag",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:r.Class.UNIVERSAL,type:r.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function f(O,k,y,R){for(var w=[],L=0;L=0&&w.push(S)}}return w}s.pkcs12FromAsn1=function(O,k,y){typeof k=="string"?(y=k,k=!0):k===void 0&&(k=!0);var R={},w=[];if(!r.validate(O,h,R,w)){var L=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw L.errors=L,L}var D={version:R.version.charCodeAt(0),safeContents:[],getBags:function(N){var M={},ee;return"localKeyId"in N?ee=N.localKeyId:"localKeyIdHex"in N&&(ee=t.util.hexToBytes(N.localKeyIdHex)),ee===void 0&&!("friendlyName"in N)&&"bagType"in N&&(M[N.bagType]=f(D.safeContents,null,null,N.bagType)),ee!==void 0&&(M.localKeyId=f(D.safeContents,"localKeyId",ee,N.bagType)),"friendlyName"in N&&(M.friendlyName=f(D.safeContents,"friendlyName",N.friendlyName,N.bagType)),M},getBagsByFriendlyName:function(N,M){return f(D.safeContents,"friendlyName",N,M)},getBagsByLocalKeyId:function(N,M){return f(D.safeContents,"localKeyId",N,M)}};if(R.version.charCodeAt(0)!==3){var L=new Error("PKCS#12 PFX of version other than 3 not supported.");throw L.version=R.version.charCodeAt(0),L}if(r.derToOid(R.contentType)!==i.oids.data){var L=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw L.oid=r.derToOid(R.contentType),L}var S=R.content.value[0];if(S.tagClass!==r.Class.UNIVERSAL||S.type!==r.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(S=g(S),R.mac){var m=null,p=0,q=r.derToOid(R.macAlgorithm);switch(q){case i.oids.sha1:m=t.md.sha1.create(),p=20;break;case i.oids.sha256:m=t.md.sha256.create(),p=32;break;case i.oids.sha384:m=t.md.sha384.create(),p=48;break;case i.oids.sha512:m=t.md.sha512.create(),p=64;break;case i.oids.md5:m=t.md.md5.create(),p=16;break}if(m===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+q);var V=new t.util.ByteBuffer(R.macSalt),$="macIterations"in R?parseInt(t.util.bytesToHex(R.macIterations),16):1,E=s.generateKey(y,V,3,$,p,m),B=t.hmac.create();B.start(m,E),B.update(S.value);var j=B.getMac();if(j.getBytes()!==R.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return I(D,S.value,k,y),D};function g(O){if(O.composed||O.constructed){for(var k=t.util.createBuffer(),y=0;y0&&(L=r.create(r.Class.UNIVERSAL,r.Type.SET,!0,m));var p=[],q=[];k!==null&&(t.util.isArray(k)?q=k:q=[k]);for(var V=[],$=0;$0){var N=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,V),M=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(N).getBytes())])]);p.push(M)}var ee=null;if(O!==null){var oe=i.wrapRsaPrivateKey(i.privateKeyToAsn1(O));y===null?ee=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.keyBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[oe]),L]):ee=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(oe,y,R)]),L]);var ae=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[ee]),pe=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(ae).getBytes())])]);p.push(pe)}var _e=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,p),Re;if(R.useMac){var S=t.md.sha1.create(),qe=new t.util.ByteBuffer(t.random.getBytes(R.saltSize)),Ce=R.count,O=s.generateKey(y,qe,3,Ce,20),$e=t.hmac.create();$e.start(S,O),$e.update(r.toDer(_e).getBytes());var Ie=$e.getMac();Re=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.sha1).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,Ie.getBytes())]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,qe.getBytes()),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(Ce).getBytes())])}return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(3).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(_e).getBytes())])]),Re])},s.generateKey=t.pbe.generatePkcs12Key}),bb=Qe((e,n)=>{var t=lt();ki(),La(),yb(),Os(),Wp(),vb(),Gp(),hh(),Et(),Qp();var r=t.asn1,i=n.exports=t.pki=t.pki||{};i.pemToDer=function(s){var u=t.pem.decode(s)[0];if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return t.util.createBuffer(u.body)},i.privateKeyFromPem=function(s){var u=t.pem.decode(s)[0];if(u.type!=="PRIVATE KEY"&&u.type!=="RSA PRIVATE KEY"){var h=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw h.headerType=u.type,h}if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var c=r.fromDer(u.body);return i.privateKeyFromAsn1(c)},i.privateKeyToPem=function(s,u){var h={type:"RSA PRIVATE KEY",body:r.toDer(i.privateKeyToAsn1(s)).getBytes()};return t.pem.encode(h,{maxline:u})},i.privateKeyInfoToPem=function(s,u){var h={type:"PRIVATE KEY",body:r.toDer(s).getBytes()};return t.pem.encode(h,{maxline:u})}}),_b=Qe((e,n)=>{var t=lt();ki(),Wu(),Kp(),Os(),bb(),ui(),Gu(),Et();var r=function(x,X,Q,A){var K=t.util.createBuffer(),se=x.length>>1,te=se+(x.length&1),Ee=x.substr(0,te),xe=x.substr(se,te),je=t.util.createBuffer(),ge=t.hmac.create();Q=X+Q;var Le=Math.ceil(A/16),We=Math.ceil(A/20);ge.start("MD5",Ee);var rt=t.util.createBuffer();je.putBytes(Q);for(var He=0;He0&&(a.queue(x,a.createAlert(x,{level:a.Alert.Level.warning,description:a.Alert.Description.no_renegotiation})),a.flush(x)),x.process()},a.parseHelloMessage=function(x,X,Q){var A=null,K=x.entity===a.ConnectionEnd.client;if(Q<38)x.error(x,{message:K?"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 se=X.fragment,te=se.length();if(A={version:{major:se.getByte(),minor:se.getByte()},random:t.util.createBuffer(se.getBytes(32)),session_id:h(se,1),extensions:[]},K?(A.cipher_suite=se.getBytes(2),A.compression_method=se.getByte()):(A.cipher_suites=h(se,2),A.compression_methods=h(se,1)),te=Q-(te-se.length()),te>0){for(var Ee=h(se,2);Ee.length()>0;)A.extensions.push({type:[Ee.getByte(),Ee.getByte()],data:h(Ee,2)});if(!K)for(var xe=0;xe0;){var Le=ge.getByte();if(Le!==0)break;x.session.extensions.server_name.serverNameList.push(h(ge,2).getBytes())}}}if(x.session.version&&(A.version.major!==x.session.version.major||A.version.minor!==x.session.version.minor))return x.error(x,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});if(K)x.session.cipherSuite=a.getCipherSuite(A.cipher_suite);else for(var We=t.util.createBuffer(A.cipher_suites.bytes());We.length()>0&&(x.session.cipherSuite=a.getCipherSuite(We.getBytes(2)),x.session.cipherSuite===null););if(x.session.cipherSuite===null)return x.error(x,{message:"No cipher suites in common.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure},cipherSuite:t.util.bytesToHex(A.cipher_suite)});K?x.session.compressionMethod=A.compression_method:x.session.compressionMethod=a.CompressionMethod.none}return A},a.createSecurityParameters=function(x,X){var Q=x.entity===a.ConnectionEnd.client,A=X.random.bytes(),K=Q?x.session.sp.client_random:A,se=Q?A:a.createRandom().getBytes();x.session.sp={entity:x.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:x.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:K,server_random:se}},a.handleServerHello=function(x,X,Q){var A=a.parseHelloMessage(x,X,Q);if(!x.fail){if(A.version.minor<=x.version.minor)x.version.minor=A.version.minor;else return x.error(x,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});x.session.version=x.version;var K=A.session_id.bytes();K.length>0&&K===x.session.id?(x.expect=v,x.session.resuming=!0,x.session.sp.server_random=A.random.bytes()):(x.expect=f,x.session.resuming=!1,a.createSecurityParameters(x,A)),x.session.id=K,x.process()}},a.handleClientHello=function(x,X,Q){var A=a.parseHelloMessage(x,X,Q);if(!x.fail){var K=A.session_id.bytes(),se=null;if(x.sessionCache&&(se=x.sessionCache.getSession(K),se===null?K="":(se.version.major!==A.version.major||se.version.minor>A.version.minor)&&(se=null,K="")),K.length===0&&(K=t.random.getBytes(32)),x.session.id=K,x.session.clientHelloVersion=A.version,x.session.sp={},se)x.version=x.session.version=se.version,x.session.sp=se.sp;else{for(var te,Ee=1;Ee0;)se=h(K.certificate_list,3),te=t.asn1.fromDer(se),se=t.pki.certificateFromAsn1(te,!0),Ee.push(se)}catch(je){return x.error(x,{message:"Could not parse certificate list.",cause:je,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate}})}var xe=x.entity===a.ConnectionEnd.client;(xe||x.verifyClient===!0)&&Ee.length===0?x.error(x,{message:xe?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}}):Ee.length===0?x.expect=xe?g:w:(xe?x.session.serverCertificate=Ee[0]:x.session.clientCertificate=Ee[0],a.verifyCertificateChain(x,Ee)&&(x.expect=xe?g:w)),x.process()},a.handleServerKeyExchange=function(x,X,Q){if(Q>0)return x.error(x,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});x.expect=I,x.process()},a.handleClientKeyExchange=function(x,X,Q){if(Q<48)return x.error(x,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});var A=X.fragment,K={enc_pre_master_secret:h(A,2).getBytes()},se=null;if(x.getPrivateKey)try{se=x.getPrivateKey(x,x.session.serverCertificate),se=t.pki.privateKeyFromPem(se)}catch(xe){x.error(x,{message:"Could not get private key.",cause:xe,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}if(se===null)return x.error(x,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}});try{var te=x.session.sp;te.pre_master_secret=se.decrypt(K.enc_pre_master_secret);var Ee=x.session.clientHelloVersion;if(Ee.major!==te.pre_master_secret.charCodeAt(0)||Ee.minor!==te.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{te.pre_master_secret=t.random.getBytes(48)}x.expect=D,x.session.clientCertificate!==null&&(x.expect=L),x.process()},a.handleCertificateRequest=function(x,X,Q){if(Q<3)return x.error(x,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var A=X.fragment,K={certificate_types:h(A,1),certificate_authorities:h(A,2)};x.session.certificateRequest=K,x.expect=C,x.process()},a.handleCertificateVerify=function(x,X,Q){if(Q<2)return x.error(x,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var A=X.fragment;A.read-=4;var K=A.bytes();A.read+=4;var se={signature:h(A,2).getBytes()},te=t.util.createBuffer();te.putBuffer(x.session.md5.digest()),te.putBuffer(x.session.sha1.digest()),te=te.getBytes();try{var Ee=x.session.clientCertificate;if(!Ee.publicKey.verify(te,se.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");x.session.md5.update(K),x.session.sha1.update(K)}catch{return x.error(x,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure}})}x.expect=D,x.process()},a.handleServerHelloDone=function(x,X,Q){if(Q>0)return x.error(x,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.record_overflow}});if(x.serverCertificate===null){var A={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.insufficient_security}},K=0,se=x.verify(x,A.alert.description,K,[]);if(se!==!0)return(se||se===0)&&(typeof se=="object"&&!t.util.isArray(se)?(se.message&&(A.message=se.message),se.alert&&(A.alert.description=se.alert)):typeof se=="number"&&(A.alert.description=se)),x.error(x,A)}x.session.certificateRequest!==null&&(X=a.createRecord(x,{type:a.ContentType.handshake,data:a.createCertificate(x)}),a.queue(x,X)),X=a.createRecord(x,{type:a.ContentType.handshake,data:a.createClientKeyExchange(x)}),a.queue(x,X),x.expect=k;var te=function(Ee,xe){Ee.session.certificateRequest!==null&&Ee.session.clientCertificate!==null&&a.queue(Ee,a.createRecord(Ee,{type:a.ContentType.handshake,data:a.createCertificateVerify(Ee,xe)})),a.queue(Ee,a.createRecord(Ee,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),Ee.state.pending=a.createConnectionState(Ee),Ee.state.current.write=Ee.state.pending.write,a.queue(Ee,a.createRecord(Ee,{type:a.ContentType.handshake,data:a.createFinished(Ee)})),Ee.expect=v,a.flush(Ee),Ee.process()};if(x.session.certificateRequest===null||x.session.clientCertificate===null)return te(x,null);a.getClientSignature(x,te)},a.handleChangeCipherSpec=function(x,X){if(X.fragment.getByte()!==1)return x.error(x,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var Q=x.entity===a.ConnectionEnd.client;(x.session.resuming&&Q||!x.session.resuming&&!Q)&&(x.state.pending=a.createConnectionState(x)),x.state.current.read=x.state.pending.read,(!x.session.resuming&&Q||x.session.resuming&&!Q)&&(x.state.pending=null),x.expect=Q?T:S,x.process()},a.handleFinished=function(x,X,Q){var A=X.fragment;A.read-=4;var K=A.bytes();A.read+=4;var se=X.fragment.getBytes();A=t.util.createBuffer(),A.putBuffer(x.session.md5.digest()),A.putBuffer(x.session.sha1.digest());var te=x.entity===a.ConnectionEnd.client,Ee=te?"server finished":"client finished",xe=x.session.sp,je=12,ge=r;if(A=ge(xe.master_secret,Ee,A.getBytes(),je),A.getBytes()!==se)return x.error(x,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decrypt_error}});x.session.md5.update(K),x.session.sha1.update(K),(x.session.resuming&&te||!x.session.resuming&&!te)&&(a.queue(x,a.createRecord(x,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),x.state.current.write=x.state.pending.write,x.state.pending=null,a.queue(x,a.createRecord(x,{type:a.ContentType.handshake,data:a.createFinished(x)}))),x.expect=te?O:m,x.handshaking=!1,++x.handshakes,x.peerCertificate=te?x.session.serverCertificate:x.session.clientCertificate,a.flush(x),x.isConnected=!0,x.connected(x),x.process()},a.handleAlert=function(x,X){var Q=X.fragment,A={level:Q.getByte(),description:Q.getByte()},K;switch(A.description){case a.Alert.Description.close_notify:K="Connection closed.";break;case a.Alert.Description.unexpected_message:K="Unexpected message.";break;case a.Alert.Description.bad_record_mac:K="Bad record MAC.";break;case a.Alert.Description.decryption_failed:K="Decryption failed.";break;case a.Alert.Description.record_overflow:K="Record overflow.";break;case a.Alert.Description.decompression_failure:K="Decompression failed.";break;case a.Alert.Description.handshake_failure:K="Handshake failure.";break;case a.Alert.Description.bad_certificate:K="Bad certificate.";break;case a.Alert.Description.unsupported_certificate:K="Unsupported certificate.";break;case a.Alert.Description.certificate_revoked:K="Certificate revoked.";break;case a.Alert.Description.certificate_expired:K="Certificate expired.";break;case a.Alert.Description.certificate_unknown:K="Certificate unknown.";break;case a.Alert.Description.illegal_parameter:K="Illegal parameter.";break;case a.Alert.Description.unknown_ca:K="Unknown certificate authority.";break;case a.Alert.Description.access_denied:K="Access denied.";break;case a.Alert.Description.decode_error:K="Decode error.";break;case a.Alert.Description.decrypt_error:K="Decrypt error.";break;case a.Alert.Description.export_restriction:K="Export restriction.";break;case a.Alert.Description.protocol_version:K="Unsupported protocol version.";break;case a.Alert.Description.insufficient_security:K="Insufficient security.";break;case a.Alert.Description.internal_error:K="Internal error.";break;case a.Alert.Description.user_canceled:K="User canceled.";break;case a.Alert.Description.no_renegotiation:K="Renegotiation not supported.";break;default:K="Unknown error.";break}if(A.description===a.Alert.Description.close_notify)return x.close();x.error(x,{message:K,send:!1,origin:x.entity===a.ConnectionEnd.client?"server":"client",alert:A}),x.process()},a.handleHandshake=function(x,X){var Q=X.fragment,A=Q.getByte(),K=Q.getInt24();if(K>Q.length())return x.fragmented=X,X.fragment=t.util.createBuffer(),Q.read-=4,x.process();x.fragmented=null,Q.read-=4;var se=Q.bytes(K+4);Q.read+=4,A in Re[x.entity][x.expect]?(x.entity===a.ConnectionEnd.server&&!x.open&&!x.fail&&(x.handshaking=!0,x.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:t.md.md5.create(),sha1:t.md.sha1.create()}),A!==a.HandshakeType.hello_request&&A!==a.HandshakeType.certificate_verify&&A!==a.HandshakeType.finished&&(x.session.md5.update(se),x.session.sha1.update(se)),Re[x.entity][x.expect][A](x,X,K)):a.handleUnexpected(x,X)},a.handleApplicationData=function(x,X){x.data.putBuffer(X.fragment),x.dataReady(x),x.process()},a.handleHeartbeat=function(x,X){var Q=X.fragment,A=Q.getByte(),K=Q.getInt16(),se=Q.getBytes(K);if(A===a.HeartbeatMessageType.heartbeat_request){if(x.handshaking||K>se.length)return x.process();a.queue(x,a.createRecord(x,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_response,se)})),a.flush(x)}else if(A===a.HeartbeatMessageType.heartbeat_response){if(se!==x.expectedHeartbeatPayload)return x.process();x.heartbeatReceived&&x.heartbeatReceived(x,t.util.createBuffer(se))}x.process()};var d=0,f=1,g=2,I=3,C=4,v=5,T=6,O=7,k=8,y=0,R=1,w=2,L=3,D=4,S=5,m=6,p=a.handleUnexpected,q=a.handleChangeCipherSpec,V=a.handleAlert,$=a.handleHandshake,E=a.handleApplicationData,B=a.handleHeartbeat,j=[];j[a.ConnectionEnd.client]=[[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[q,V,p,p,B],[p,V,$,p,B],[p,V,$,E,B],[p,V,$,p,B]],j[a.ConnectionEnd.server]=[[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[q,V,p,p,B],[p,V,$,p,B],[p,V,$,E,B],[p,V,$,p,B]];var N=a.handleHelloRequest,M=a.handleServerHello,ee=a.handleCertificate,oe=a.handleServerKeyExchange,ae=a.handleCertificateRequest,pe=a.handleServerHelloDone,_e=a.handleFinished,Re=[];Re[a.ConnectionEnd.client]=[[p,p,M,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,ee,oe,ae,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,oe,ae,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,ae,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,_e],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]];var qe=a.handleClientHello,Ce=a.handleClientKeyExchange,$e=a.handleCertificateVerify;Re[a.ConnectionEnd.server]=[[p,qe,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,ee,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,Ce,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,$e,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,_e],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]],a.generateKeys=function(x,X){var Q=r,A=X.client_random+X.server_random;x.session.resuming||(X.master_secret=Q(X.pre_master_secret,"master secret",A,48).bytes(),X.pre_master_secret=null),A=X.server_random+X.client_random;var K=2*X.mac_key_length+2*X.enc_key_length,se=x.version.major===a.Versions.TLS_1_0.major&&x.version.minor===a.Versions.TLS_1_0.minor;se&&(K+=2*X.fixed_iv_length);var te=Q(X.master_secret,"key expansion",A,K),Ee={client_write_MAC_key:te.getBytes(X.mac_key_length),server_write_MAC_key:te.getBytes(X.mac_key_length),client_write_key:te.getBytes(X.enc_key_length),server_write_key:te.getBytes(X.enc_key_length)};return se&&(Ee.client_write_IV=te.getBytes(X.fixed_iv_length),Ee.server_write_IV=te.getBytes(X.fixed_iv_length)),Ee},a.createConnectionState=function(x){var X=x.entity===a.ConnectionEnd.client,Q=function(){var se={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(te){return!0},compressionState:null,compressFunction:function(te){return!0},updateSequenceNumber:function(){se.sequenceNumber[1]===4294967295?(se.sequenceNumber[1]=0,++se.sequenceNumber[0]):++se.sequenceNumber[1]}};return se},A={read:Q(),write:Q()};if(A.read.update=function(se,te){return A.read.cipherFunction(te,A.read)?A.read.compressFunction(se,te,A.read)||se.error(se,{message:"Could not decompress record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decompression_failure}}):se.error(se,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_record_mac}}),!se.fail},A.write.update=function(se,te){return A.write.compressFunction(se,te,A.write)?A.write.cipherFunction(te,A.write)||se.error(se,{message:"Could not encrypt record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):se.error(se,{message:"Could not compress record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}),!se.fail},x.session){var K=x.session.sp;switch(x.session.cipherSuite.initSecurityParameters(K),K.keys=a.generateKeys(x,K),A.read.macKey=X?K.keys.server_write_MAC_key:K.keys.client_write_MAC_key,A.write.macKey=X?K.keys.client_write_MAC_key:K.keys.server_write_MAC_key,x.session.cipherSuite.initConnectionState(A,x,K),K.compression_algorithm){case a.CompressionMethod.none:break;case a.CompressionMethod.deflate:A.read.compressFunction=u,A.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return A},a.createRandom=function(){var x=new Date,X=+x+x.getTimezoneOffset()*6e4,Q=t.util.createBuffer();return Q.putInt32(X),Q.putBytes(t.random.getBytes(28)),Q},a.createRecord=function(x,X){if(!X.data)return null;var Q={type:X.type,version:{major:x.version.major,minor:x.version.minor},length:X.data.length(),fragment:X.data};return Q},a.createAlert=function(x,X){var Q=t.util.createBuffer();return Q.putByte(X.level),Q.putByte(X.description),a.createRecord(x,{type:a.ContentType.alert,data:Q})},a.createClientHello=function(x){x.session.clientHelloVersion={major:x.version.major,minor:x.version.minor};for(var X=t.util.createBuffer(),Q=0;Q0&&(Le+=2);var We=x.session.id,rt=We.length+1+2+4+28+2+K+1+te+Le,He=t.util.createBuffer();return He.putByte(a.HandshakeType.client_hello),He.putInt24(rt),He.putByte(x.version.major),He.putByte(x.version.minor),He.putBytes(x.session.sp.client_random),c(He,1,t.util.createBuffer(We)),c(He,2,X),c(He,1,se),Le>0&&c(He,2,Ee),He},a.createServerHello=function(x){var X=x.session.id,Q=X.length+1+2+4+28+2+1,A=t.util.createBuffer();return A.putByte(a.HandshakeType.server_hello),A.putInt24(Q),A.putByte(x.version.major),A.putByte(x.version.minor),A.putBytes(x.session.sp.server_random),c(A,1,t.util.createBuffer(X)),A.putByte(x.session.cipherSuite.id[0]),A.putByte(x.session.cipherSuite.id[1]),A.putByte(x.session.compressionMethod),A},a.createCertificate=function(x){var X=x.entity===a.ConnectionEnd.client,Q=null;if(x.getCertificate){var A;X?A=x.session.certificateRequest:A=x.session.extensions.server_name.serverNameList,Q=x.getCertificate(x,A)}var K=t.util.createBuffer();if(Q!==null)try{t.util.isArray(Q)||(Q=[Q]);for(var se=null,te=0;te0&&(Q.putByte(a.HandshakeType.server_key_exchange),Q.putInt24(X)),Q},a.getClientSignature=function(x,X){var Q=t.util.createBuffer();Q.putBuffer(x.session.md5.digest()),Q.putBuffer(x.session.sha1.digest()),Q=Q.getBytes(),x.getSignature=x.getSignature||function(A,K,se){var te=null;if(A.getPrivateKey)try{te=A.getPrivateKey(A,A.session.clientCertificate),te=t.pki.privateKeyFromPem(te)}catch(Ee){A.error(A,{message:"Could not get private key.",cause:Ee,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}te===null?A.error(A,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):K=te.sign(K,null),se(A,K)},x.getSignature(x,Q,X)},a.createCertificateVerify=function(x,X){var Q=X.length+2,A=t.util.createBuffer();return A.putByte(a.HandshakeType.certificate_verify),A.putInt24(Q),A.putInt16(X.length),A.putBytes(X),A},a.createCertificateRequest=function(x){var X=t.util.createBuffer();X.putByte(1);var Q=t.util.createBuffer();for(var A in x.caStore.certs){var K=x.caStore.certs[A],se=t.pki.distinguishedNameToAsn1(K.subject),te=t.asn1.toDer(se);Q.putInt16(te.length()),Q.putBuffer(te)}var Ee=1+X.length()+2+Q.length(),xe=t.util.createBuffer();return xe.putByte(a.HandshakeType.certificate_request),xe.putInt24(Ee),c(xe,1,X),c(xe,2,Q),xe},a.createServerHelloDone=function(x){var X=t.util.createBuffer();return X.putByte(a.HandshakeType.server_hello_done),X.putInt24(0),X},a.createChangeCipherSpec=function(){var x=t.util.createBuffer();return x.putByte(1),x},a.createFinished=function(x){var X=t.util.createBuffer();X.putBuffer(x.session.md5.digest()),X.putBuffer(x.session.sha1.digest());var Q=x.entity===a.ConnectionEnd.client,A=x.session.sp,K=12,se=r,te=Q?"client finished":"server finished";X=se(A.master_secret,te,X.getBytes(),K);var Ee=t.util.createBuffer();return Ee.putByte(a.HandshakeType.finished),Ee.putInt24(X.length()),Ee.putBuffer(X),Ee},a.createHeartbeat=function(x,X,Q){typeof Q>"u"&&(Q=X.length);var A=t.util.createBuffer();A.putByte(x),A.putInt16(Q),A.putBytes(X);var K=A.length(),se=Math.max(16,K-Q-3);return A.putBytes(t.random.getBytes(se)),A},a.queue=function(x,X){if(X&&!(X.fragment.length()===0&&(X.type===a.ContentType.handshake||X.type===a.ContentType.alert||X.type===a.ContentType.change_cipher_spec))){if(X.type===a.ContentType.handshake){var Q=X.fragment.bytes();x.session.md5.update(Q),x.session.sha1.update(Q),Q=null}var A;if(X.fragment.length()<=a.MaxFragment)A=[X];else{A=[];for(var K=X.fragment.bytes();K.length>a.MaxFragment;)A.push(a.createRecord(x,{type:X.type,data:t.util.createBuffer(K.slice(0,a.MaxFragment))})),K=K.slice(a.MaxFragment);K.length>0&&A.push(a.createRecord(x,{type:X.type,data:t.util.createBuffer(K)}))}for(var se=0;se0&&(te=Q.order[0]),te!==null&&te in Q.cache){se=Q.cache[te],delete Q.cache[te];for(var Ee in Q.order)if(Q.order[Ee]===te){Q.order.splice(Ee,1);break}}return se},Q.setSession=function(K,se){if(Q.order.length===Q.capacity){var te=Q.order.shift();delete Q.cache[te]}var te=t.util.bytesToHex(K);Q.order.push(te),Q.cache[te]=se}}return Q},a.createConnection=function(x){var X=null;x.caStore?t.util.isArray(x.caStore)?X=t.pki.createCaStore(x.caStore):X=x.caStore:X=t.pki.createCaStore();var Q=x.cipherSuites||null;if(Q===null){Q=[];for(var A in a.CipherSuites)Q.push(a.CipherSuites[A])}var K=x.server?a.ConnectionEnd.server:a.ConnectionEnd.client,se=x.sessionCache?a.createSessionCache(x.sessionCache):null,te={version:{major:a.Version.major,minor:a.Version.minor},entity:K,sessionId:x.sessionId,caStore:X,sessionCache:se,cipherSuites:Q,connected:x.connected,virtualHost:x.virtualHost||null,verifyClient:x.verifyClient||!1,verify:x.verify||function(ge,Le,We,rt){return Le},verifyOptions:x.verifyOptions||{},getCertificate:x.getCertificate||null,getPrivateKey:x.getPrivateKey||null,getSignature:x.getSignature||null,input:t.util.createBuffer(),tlsData:t.util.createBuffer(),data:t.util.createBuffer(),tlsDataReady:x.tlsDataReady,dataReady:x.dataReady,heartbeatReceived:x.heartbeatReceived,closed:x.closed,error:function(ge,Le){Le.origin=Le.origin||(ge.entity===a.ConnectionEnd.client?"client":"server"),Le.send&&(a.queue(ge,a.createAlert(ge,Le.alert)),a.flush(ge));var We=Le.fatal!==!1;We&&(ge.fail=!0),x.error(ge,Le),We&&ge.close(!1)},deflate:x.deflate||null,inflate:x.inflate||null};te.reset=function(ge){te.version={major:a.Version.major,minor:a.Version.minor},te.record=null,te.session=null,te.peerCertificate=null,te.state={pending:null,current:null},te.expect=te.entity===a.ConnectionEnd.client?d:y,te.fragmented=null,te.records=[],te.open=!1,te.handshakes=0,te.handshaking=!1,te.isConnected=!1,te.fail=!(ge||typeof ge>"u"),te.input.clear(),te.tlsData.clear(),te.data.clear(),te.state.current=a.createConnectionState(te)},te.reset();var Ee=function(ge,Le){var We=Le.type-a.ContentType.change_cipher_spec,rt=j[ge.entity][ge.expect];We in rt?rt[We](ge,Le):a.handleUnexpected(ge,Le)},xe=function(ge){var Le=0,We=ge.input,rt=We.length();if(rt<5)Le=5-rt;else{ge.record={type:We.getByte(),version:{major:We.getByte(),minor:We.getByte()},length:We.getInt16(),fragment:t.util.createBuffer(),ready:!1};var He=ge.record.version.major===ge.version.major;He&&ge.session&&ge.session.version&&(He=ge.record.version.minor===ge.version.minor),He||ge.error(ge,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}})}return Le},je=function(ge){var Le=0,We=ge.input,rt=We.length();if(rt0&&(te.sessionCache&&(Le=te.sessionCache.getSession(ge)),Le===null&&(ge="")),ge.length===0&&te.sessionCache&&(Le=te.sessionCache.getSession(),Le!==null&&(ge=Le.id)),te.session={id:ge,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:t.md.md5.create(),sha1:t.md.sha1.create()},Le&&(te.version=Le.version,te.session.sp=Le.sp),te.session.sp.client_random=a.createRandom().getBytes(),te.open=!0,a.queue(te,a.createRecord(te,{type:a.ContentType.handshake,data:a.createClientHello(te)})),a.flush(te)}},te.process=function(ge){var Le=0;return ge&&te.input.putBytes(ge),te.fail||(te.record!==null&&te.record.ready&&te.record.fragment.isEmpty()&&(te.record=null),te.record===null&&(Le=xe(te)),!te.fail&&te.record!==null&&!te.record.ready&&(Le=je(te)),!te.fail&&te.record!==null&&te.record.ready&&Ee(te,te.record)),Le},te.prepare=function(ge){return a.queue(te,a.createRecord(te,{type:a.ContentType.application_data,data:t.util.createBuffer(ge)})),a.flush(te)},te.prepareHeartbeatRequest=function(ge,Le){return ge instanceof t.util.ByteBuffer&&(ge=ge.bytes()),typeof Le>"u"&&(Le=ge.length),te.expectedHeartbeatPayload=ge,a.queue(te,a.createRecord(te,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_request,ge,Le)})),a.flush(te)},te.close=function(ge){if(!te.fail&&te.sessionCache&&te.session){var Le={id:te.session.id,version:te.session.version,sp:te.session.sp};Le.sp.keys=null,te.sessionCache.setSession(Le.id,Le)}te.open&&(te.open=!1,te.input.clear(),(te.isConnected||te.handshaking)&&(te.isConnected=te.handshaking=!1,a.queue(te,a.createAlert(te,{level:a.Alert.Level.warning,description:a.Alert.Description.close_notify})),a.flush(te)),te.closed(te)),te.reset(ge)},te},n.exports=t.tls=t.tls||{};for(Je in a)typeof a[Je]!="function"&&(t.tls[Je]=a[Je]);var Je;t.tls.prf_tls1=r,t.tls.hmac_sha1=i,t.tls.createSessionCache=a.createSessionCache,t.tls.createConnection=a.createConnection}),X5=Qe((e,n)=>{var t=lt();Ba(),_b();var r=n.exports=t.tls;r.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(d){d.bulk_cipher_algorithm=r.BulkCipherAlgorithm.aes,d.cipher_type=r.CipherType.block,d.enc_key_length=16,d.block_length=16,d.fixed_iv_length=16,d.record_iv_length=16,d.mac_algorithm=r.MACAlgorithm.hmac_sha1,d.mac_length=20,d.mac_key_length=20},initConnectionState:i},r.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(d){d.bulk_cipher_algorithm=r.BulkCipherAlgorithm.aes,d.cipher_type=r.CipherType.block,d.enc_key_length=32,d.block_length=16,d.fixed_iv_length=16,d.record_iv_length=16,d.mac_algorithm=r.MACAlgorithm.hmac_sha1,d.mac_length=20,d.mac_key_length=20},initConnectionState:i};function i(d,f,g){var I=f.entity===t.tls.ConnectionEnd.client;d.read.cipherState={init:!1,cipher:t.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},d.write.cipherState={init:!1,cipher:t.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},d.read.cipherFunction=c,d.write.cipherFunction=s,d.read.macLength=d.write.macLength=g.mac_length,d.read.macFunction=d.write.macFunction=r.hmac_sha1}function s(d,f){var g=!1,I=f.macFunction(f.macKey,f.sequenceNumber,d);d.fragment.putBytes(I),f.updateSequenceNumber();var C;d.version.minor===r.Versions.TLS_1_0.minor?C=f.cipherState.init?null:f.cipherState.iv:C=t.random.getBytesSync(16),f.cipherState.init=!0;var v=f.cipherState.cipher;return v.start({iv:C}),d.version.minor>=r.Versions.TLS_1_1.minor&&v.output.putBytes(C),v.update(d.fragment),v.finish(u)&&(d.fragment=v.output,d.length=d.fragment.length(),g=!0),g}function u(d,f,g){if(!g){var I=d-f.length()%d;f.fillWithByte(I-1,I)}return!0}function h(d,f,g){var I=!0;if(g){for(var C=f.length(),v=f.last(),T=C-1-v;T=v?(d.fragment=C.output.getBytes(O-v),T=C.output.getBytes(v)):d.fragment=C.output.getBytes(),d.fragment=t.util.createBuffer(d.fragment),d.length=d.fragment.length();var k=f.macFunction(f.macKey,f.sequenceNumber,d);return f.updateSequenceNumber(),g=a(f.macKey,T,k)&&g,g}function a(d,f,g){var I=t.hmac.create();return I.start("SHA1",d),I.update(f),f=I.digest().getBytes(),I.start(null,null),I.update(g),g=I.digest().getBytes(),f===g}}),wb=Qe((e,n)=>{var t=lt();fo(),Et();var r=n.exports=t.sha512=t.sha512||{};t.md.sha512=t.md.algorithms.sha512=r;var i=t.sha384=t.sha512.sha384=t.sha512.sha384||{};i.create=function(){return r.create("SHA-384")},t.md.sha384=t.md.algorithms.sha384=i,t.sha512.sha256=t.sha512.sha256||{create:function(){return r.create("SHA-512/256")}},t.md["sha512/256"]=t.md.algorithms["sha512/256"]=t.sha512.sha256,t.sha512.sha224=t.sha512.sha224||{create:function(){return r.create("SHA-512/224")}},t.md["sha512/224"]=t.md.algorithms["sha512/224"]=t.sha512.sha224,r.create=function(f){if(u||a(),typeof f>"u"&&(f="SHA-512"),!(f in c))throw new Error("Invalid SHA-512 algorithm: "+f);for(var g=c[f],I=null,C=t.util.createBuffer(),v=new Array(80),T=0;T<80;++T)v[T]=new Array(2);var O=64;switch(f){case"SHA-384":O=48;break;case"SHA-512/256":O=32;break;case"SHA-512/224":O=28;break}var k={algorithm:f.replace("-","").toLowerCase(),blockLength:128,digestLength:O,messageLength:0,fullMessageLength:null,messageLengthSize:16};return k.start=function(){k.messageLength=0,k.fullMessageLength=k.messageLength128=[];for(var y=k.messageLengthSize/4,R=0;R>>0,w>>>0];for(var L=k.fullMessageLength.length-1;L>=0;--L)k.fullMessageLength[L]+=w[1],w[1]=w[0]+(k.fullMessageLength[L]/4294967296>>>0),k.fullMessageLength[L]=k.fullMessageLength[L]>>>0,w[0]=w[1]/4294967296>>>0;return C.putBytes(y),d(I,v,C),(C.read>2048||C.length()===0)&&C.compact(),k},k.digest=function(){var y=t.util.createBuffer();y.putBytes(C.bytes());var R=k.fullMessageLength[k.fullMessageLength.length-1]+k.messageLengthSize,w=R&k.blockLength-1;y.putBytes(s.substr(0,k.blockLength-w));for(var L,D,S=k.fullMessageLength[0]*8,m=0;m>>0,S+=D,y.putInt32(S>>>0),S=L>>>0;y.putInt32(S);for(var p=new Array(I.length),m=0;m=128;){for(Ce=0;Ce<16;++Ce)g[Ce][0]=I.getInt32()>>>0,g[Ce][1]=I.getInt32()>>>0;for(;Ce<80;++Ce)et=g[Ce-2],$e=et[0],Ie=et[1],C=(($e>>>19|Ie<<13)^(Ie>>>29|$e<<3)^$e>>>6)>>>0,v=(($e<<13|Ie>>>19)^(Ie<<3|$e>>>29)^($e<<26|Ie>>>6))>>>0,x=g[Ce-15],$e=x[0],Ie=x[1],T=(($e>>>1|Ie<<31)^($e>>>8|Ie<<24)^$e>>>7)>>>0,O=(($e<<31|Ie>>>1)^($e<<24|Ie>>>8)^($e<<25|Ie>>>7))>>>0,Je=g[Ce-7],X=g[Ce-16],Ie=v+Je[1]+O+X[1],g[Ce][0]=C+Je[0]+T+X[0]+(Ie/4294967296>>>0)>>>0,g[Ce][1]=Ie>>>0;for(p=f[0][0],q=f[0][1],V=f[1][0],$=f[1][1],E=f[2][0],B=f[2][1],j=f[3][0],N=f[3][1],M=f[4][0],ee=f[4][1],oe=f[5][0],ae=f[5][1],pe=f[6][0],_e=f[6][1],Re=f[7][0],qe=f[7][1],Ce=0;Ce<80;++Ce)R=((M>>>14|ee<<18)^(M>>>18|ee<<14)^(ee>>>9|M<<23))>>>0,w=((M<<18|ee>>>14)^(M<<14|ee>>>18)^(ee<<23|M>>>9))>>>0,L=(pe^M&(oe^pe))>>>0,D=(_e^ee&(ae^_e))>>>0,k=((p>>>28|q<<4)^(q>>>2|p<<30)^(q>>>7|p<<25))>>>0,y=((p<<4|q>>>28)^(q<<30|p>>>2)^(q<<25|p>>>7))>>>0,S=(p&V|E&(p^V))>>>0,m=(q&$|B&(q^$))>>>0,Ie=qe+w+D+h[Ce][1]+g[Ce][1],C=Re+R+L+h[Ce][0]+g[Ce][0]+(Ie/4294967296>>>0)>>>0,v=Ie>>>0,Ie=y+m,T=k+S+(Ie/4294967296>>>0)>>>0,O=Ie>>>0,Re=pe,qe=_e,pe=oe,_e=ae,oe=M,ae=ee,Ie=N+v,M=j+C+(Ie/4294967296>>>0)>>>0,ee=Ie>>>0,j=E,N=B,E=V,B=$,V=p,$=q,Ie=v+O,p=C+T+(Ie/4294967296>>>0)>>>0,q=Ie>>>0;Ie=f[0][1]+q,f[0][0]=f[0][0]+p+(Ie/4294967296>>>0)>>>0,f[0][1]=Ie>>>0,Ie=f[1][1]+$,f[1][0]=f[1][0]+V+(Ie/4294967296>>>0)>>>0,f[1][1]=Ie>>>0,Ie=f[2][1]+B,f[2][0]=f[2][0]+E+(Ie/4294967296>>>0)>>>0,f[2][1]=Ie>>>0,Ie=f[3][1]+N,f[3][0]=f[3][0]+j+(Ie/4294967296>>>0)>>>0,f[3][1]=Ie>>>0,Ie=f[4][1]+ee,f[4][0]=f[4][0]+M+(Ie/4294967296>>>0)>>>0,f[4][1]=Ie>>>0,Ie=f[5][1]+ae,f[5][0]=f[5][0]+oe+(Ie/4294967296>>>0)>>>0,f[5][1]=Ie>>>0,Ie=f[6][1]+_e,f[6][0]=f[6][0]+pe+(Ie/4294967296>>>0)>>>0,f[6][1]=Ie>>>0,Ie=f[7][1]+qe,f[7][0]=f[7][0]+Re+(Ie/4294967296>>>0)>>>0,f[7][1]=Ie>>>0,Q-=128}}}),J5=Qe(e=>{var n=lt();ki();var t=n.asn1;e.privateKeyValidator={name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},e.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}}),Z5=Qe((e,n)=>{var t=lt();ch(),ui(),wb(),Et();var r=J5(),i=r.publicKeyValidator,s=r.privateKeyValidator;typeof u>"u"&&(u=t.jsbn.BigInteger);var u,h=t.util.ByteBuffer,c=typeof Buffer>"u"?Uint8Array:Buffer;t.pki=t.pki||{},n.exports=t.pki.ed25519=t.ed25519=t.ed25519||{};var a=t.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(x){x=x||{};var X=x.seed;if(X===void 0)X=t.random.getBytesSync(a.constants.SEED_BYTE_LENGTH);else if(typeof X=="string"){if(X.length!==a.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+a.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(X instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');X=d({message:X,encoding:"binary"});for(var Q=new c(a.constants.PUBLIC_KEY_BYTE_LENGTH),A=new c(a.constants.PRIVATE_KEY_BYTE_LENGTH),K=0;K<32;++K)A[K]=X[K];return R(Q,A),{publicKey:Q,privateKey:A}},a.privateKeyFromAsn1=function(x){var X={},Q=[],A=t.asn1.validate(x,s,X,Q);if(!A){var K=new Error("Invalid Key.");throw K.errors=Q,K}var se=t.asn1.derToOid(X.privateKeyOid),te=t.oids.EdDSA25519;if(se!==te)throw new Error('Invalid OID "'+se+'"; OID must be "'+te+'".');var Ee=X.privateKey,xe=d({message:t.asn1.fromDer(Ee).value,encoding:"binary"});return{privateKeyBytes:xe}},a.publicKeyFromAsn1=function(x){var X={},Q=[],A=t.asn1.validate(x,i,X,Q);if(!A){var K=new Error("Invalid Key.");throw K.errors=Q,K}var se=t.asn1.derToOid(X.publicKeyOid),te=t.oids.EdDSA25519;if(se!==te)throw new Error('Invalid OID "'+se+'"; OID must be "'+te+'".');var Ee=X.ed25519PublicKey;if(Ee.length!==a.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return d({message:Ee,encoding:"binary"})},a.publicKeyFromPrivateKey=function(x){x=x||{};var X=d({message:x.privateKey,encoding:"binary"});if(X.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 Q=new c(a.constants.PUBLIC_KEY_BYTE_LENGTH),A=0;A=0};function d(x){var X=x.message;if(X instanceof Uint8Array||X instanceof c)return X;var Q=x.encoding;if(X===void 0)if(x.md)X=x.md.digest().getBytes(),Q="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof X=="string"&&!Q)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof X=="string"){if(typeof Buffer<"u")return Buffer.from(X,Q);X=new h(X,Q)}else if(!(X instanceof h))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 A=new c(X.length()),K=0;K=32;--A){for(Q=0,K=A-32,se=A-12;K>8,X[K]-=Q*256;X[K]+=Q,X[A]=0}for(Q=0,K=0;K<32;++K)X[K]+=Q-(X[31]>>4)*O[K],Q=X[K]>>8,X[K]&=255;for(K=0;K<32;++K)X[K]-=Q*O[K];for(A=0;A<32;++A)X[A+1]+=X[A]>>8,x[A]=X[A]&255}function S(x){for(var X=new Float64Array(64),Q=0;Q<64;++Q)X[Q]=x[Q],x[Q]=0;D(x,X)}function m(x,X){var Q=Ce(),A=Ce(),K=Ce(),se=Ce(),te=Ce(),Ee=Ce(),xe=Ce(),je=Ce(),ge=Ce();Ie(Q,x[1],x[0]),Ie(ge,X[1],X[0]),Je(Q,Q,ge),$e(A,x[0],x[1]),$e(ge,X[0],X[1]),Je(A,A,ge),Je(K,x[3],X[3]),Je(K,K,C),Je(se,x[2],X[2]),$e(se,se,se),Ie(te,A,Q),Ie(Ee,se,K),$e(xe,se,K),$e(je,A,Q),Je(x[0],te,Ee),Je(x[1],je,xe),Je(x[2],xe,Ee),Je(x[3],te,je)}function p(x,X,Q){for(var A=0;A<4;++A)qe(x[A],X[A],Q)}function q(x,X){var Q=Ce(),A=Ce(),K=Ce();_e(K,X[2]),Je(Q,X[0],K),Je(A,X[1],K),V(x,A),x[31]^=ee(Q)<<7}function V(x,X){var Q,A,K,se=Ce(),te=Ce();for(Q=0;Q<16;++Q)te[Q]=X[Q];for(Re(te),Re(te),Re(te),A=0;A<2;++A){for(se[0]=te[0]-65517,Q=1;Q<15;++Q)se[Q]=te[Q]-65535-(se[Q-1]>>16&1),se[Q-1]&=65535;se[15]=te[15]-32767-(se[14]>>16&1),K=se[15]>>16&1,se[14]&=65535,qe(te,se,1-K)}for(Q=0;Q<16;Q++)x[2*Q]=te[Q]&255,x[2*Q+1]=te[Q]>>8}function $(x,X){var Q=Ce(),A=Ce(),K=Ce(),se=Ce(),te=Ce(),Ee=Ce(),xe=Ce();return pe(x[2],g),E(x[1],X),et(K,x[1]),Je(se,K,I),Ie(K,K,x[2]),$e(se,x[2],se),et(te,se),et(Ee,te),Je(xe,Ee,te),Je(Q,xe,K),Je(Q,Q,se),B(Q,Q),Je(Q,Q,K),Je(Q,Q,se),Je(Q,Q,se),Je(x[0],Q,se),et(A,x[0]),Je(A,A,se),j(A,K)&&Je(x[0],x[0],k),et(A,x[0]),Je(A,A,se),j(A,K)?-1:(ee(x[0])===X[31]>>7&&Ie(x[0],f,x[0]),Je(x[3],x[0],x[1]),0)}function E(x,X){var Q;for(Q=0;Q<16;++Q)x[Q]=X[2*Q]+(X[2*Q+1]<<8);x[15]&=32767}function B(x,X){var Q=Ce(),A;for(A=0;A<16;++A)Q[A]=X[A];for(A=250;A>=0;--A)et(Q,Q),A!==1&&Je(Q,Q,X);for(A=0;A<16;++A)x[A]=Q[A]}function j(x,X){var Q=new c(32),A=new c(32);return V(Q,x),V(A,X),N(Q,0,A,0)}function N(x,X,Q,A){return M(x,X,Q,A,32)}function M(x,X,Q,A,K){var se,te=0;for(se=0;se>>8)-1}function ee(x){var X=new c(32);return V(X,x),X[0]&1}function oe(x,X,Q){var A,K;for(pe(x[0],f),pe(x[1],g),pe(x[2],g),pe(x[3],f),K=255;K>=0;--K)A=Q[K/8|0]>>(K&7)&1,p(x,X,A),m(X,x),m(x,x),p(x,X,A)}function ae(x,X){var Q=[Ce(),Ce(),Ce(),Ce()];pe(Q[0],v),pe(Q[1],T),pe(Q[2],g),Je(Q[3],v,T),oe(x,Q,X)}function pe(x,X){var Q;for(Q=0;Q<16;Q++)x[Q]=X[Q]|0}function _e(x,X){var Q=Ce(),A;for(A=0;A<16;++A)Q[A]=X[A];for(A=253;A>=0;--A)et(Q,Q),A!==2&&A!==4&&Je(Q,Q,X);for(A=0;A<16;++A)x[A]=Q[A]}function Re(x){var X,Q,A=1;for(X=0;X<16;++X)Q=x[X]+A+65535,A=Math.floor(Q/65536),x[X]=Q-A*65536;x[0]+=A-1+37*(A-1)}function qe(x,X,Q){for(var A,K=~(Q-1),se=0;se<16;++se)A=K&(x[se]^X[se]),x[se]^=A,X[se]^=A}function Ce(x){var X,Q=new Float64Array(16);if(x)for(X=0;X{var t=lt();Et(),ui(),ch(),n.exports=t.kem=t.kem||{};var r=t.jsbn.BigInteger;t.kem.rsa={},t.kem.rsa.create=function(s,u){u=u||{};var h=u.prng||t.random,c={};return c.encrypt=function(a,d){var f=Math.ceil(a.n.bitLength()/8),g;do g=new r(t.util.bytesToHex(h.getBytesSync(f)),16).mod(a.n);while(g.compareTo(r.ONE)<=0);g=t.util.hexToBytes(g.toString(16));var I=f-g.length;I>0&&(g=t.util.fillString(String.fromCharCode(0),I)+g);var C=a.encrypt(g,"NONE"),v=s.generate(g,d);return{encapsulation:C,key:v}},c.decrypt=function(a,d,f){var g=a.decrypt(d,"NONE");return s.generate(g,f)},c},t.kem.kdf1=function(s,u){i(this,s,0,u||s.digestLength)},t.kem.kdf2=function(s,u){i(this,s,1,u||s.digestLength)};function i(s,u,h,c){s.generate=function(a,d){for(var f=new t.util.ByteBuffer,g=Math.ceil(d/c)+h,I=new t.util.ByteBuffer,C=h;C{var t=lt();Et(),n.exports=t.log=t.log||{},t.log.levels=["none","error","warning","info","debug","verbose","max"];var r={},i=[],s=null;for(t.log.LEVEL_LOCKED=2,t.log.NO_LEVEL_CHECK=4,t.log.INTERPOLATE=8,c=0;c"u"||v?C.flags|=t.log.LEVEL_LOCKED:C.flags&=~t.log.LEVEL_LOCKED},t.log.addLogger=function(C){i.push(C)},typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(d={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},f=function(C,v){t.log.prepareStandard(v);var T=d[v.level],O=[v.standard];O=O.concat(v.arguments.slice()),T.apply(console,O)},a=t.log.makeLogger(f)):(f=function(C,v){t.log.prepareStandardFull(v),console.log(v.standardFull)},a=t.log.makeLogger(f)),t.log.setLevel(a,"debug"),t.log.addLogger(a),s=a):console={log:function(){}};var a,d,f;s!==null&&typeof window<"u"&&window.location&&(g=new URL(window.location.href).searchParams,g.has("console.level")&&t.log.setLevel(s,g.get("console.level").slice(-1)[0]),g.has("console.lock")&&(I=g.get("console.lock").slice(-1)[0],I=="true"&&t.log.lock(s)));var g,I;t.log.consoleLogger=s}),rA=Qe((e,n)=>{n.exports=fo(),Kp(),Gu(),cb(),wb()}),nA=Qe((e,n)=>{var t=lt();Ba(),ki(),lh(),La(),Os(),gb(),ui(),Et(),Qp();var r=t.asn1,i=n.exports=t.pkcs7=t.pkcs7||{};i.messageFromPem=function(v){var T=t.pem.decode(v)[0];if(T.type!=="PKCS7"){var O=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw O.headerType=T.type,O}if(T.procType&&T.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var k=r.fromDer(T.body);return i.messageFromAsn1(k)},i.messageToPem=function(v,T){var O={type:"PKCS7",body:r.toDer(v.toAsn1()).getBytes()};return t.pem.encode(O,{maxline:T})},i.messageFromAsn1=function(v){var T={},O=[];if(!r.validate(v,i.asn1.contentInfoValidator,T,O)){var k=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw k.errors=O,k}var y=r.derToOid(T.contentType),R;switch(y){case t.pki.oids.envelopedData:R=i.createEnvelopedData();break;case t.pki.oids.encryptedData:R=i.createEncryptedData();break;case t.pki.oids.signedData:R=i.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+y+" is not (yet) supported.")}return R.fromAsn1(T.content.value[0]),R},i.createSignedData=function(){var v=null;return v={type:t.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(k){if(I(v,k,i.asn1.signedDataValidator),v.certificates=[],v.crls=[],v.digestAlgorithmIdentifiers=[],v.contentInfo=null,v.signerInfos=[],v.rawCapture.certificates)for(var y=v.rawCapture.certificates.value,R=0;R0&&w.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,k)),R.length>0&&w.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,R)),w.value[0].value.push(r.create(r.Class.UNIVERSAL,r.Type.SET,!0,v.signerInfos)),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(v.type).getBytes()),w])},addSigner:function(k){var y=k.issuer,R=k.serialNumber;if(k.certificate){var w=k.certificate;typeof w=="string"&&(w=t.pki.certificateFromPem(w)),y=w.issuer.attributes,R=w.serialNumber}var L=k.key;if(!L)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof L=="string"&&(L=t.pki.privateKeyFromPem(L));var D=k.digestAlgorithm||t.pki.oids.sha1;switch(D){case t.pki.oids.sha1:case t.pki.oids.sha256:case t.pki.oids.sha384:case t.pki.oids.sha512:case t.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+D)}var S=k.authenticatedAttributes||[];if(S.length>0){for(var m=!1,p=!1,q=0;q0){for(var O=r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[]),k=0;k=O&&y{var t=lt();Ba(),Wu(),Kp(),Gu(),Et();var r=n.exports=t.ssh=t.ssh||{};r.privateKeyToPutty=function(h,c,a){a=a||"",c=c||"";var d="ssh-rsa",f=c===""?"none":"aes256-cbc",g="PuTTY-User-Key-File-2: "+d+`\r +`+I+h.substr(g+1),f=d-g-1,g=-1,++d}else(h[d]===" "||h[d]===" "||h[d]===",")&&(g=d);return h}function s(u){return u.replace(/^\s+/,"")}}),ih=Qe((e,n)=>{var t=lt();Mp(),tb(),Et(),n.exports=t.des=t.des||{},t.des.startEncrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!1,mode:k||(T===null?"ECB":"CBC")});return y.start(T),y},t.des.createEncryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!1,mode:T})},t.des.startDecrypting=function(v,T,O,k){var y=C({key:v,output:O,decrypt:!0,mode:k||(T===null?"ECB":"CBC")});return y.start(T),y},t.des.createDecryptionCipher=function(v,T){return C({key:v,output:null,decrypt:!0,mode:T})},t.des.Algorithm=function(v,T){var O=this;O.name=v,O.mode=new T({blockSize:8,cipher:{encrypt:function(k,y){return I(O._keys,k,y,!1)},decrypt:function(k,y){return I(O._keys,k,y,!0)}}}),O._init=!1},t.des.Algorithm.prototype.initialize=function(v){if(!this._init){var T=t.util.createBuffer(v.key);if(this.name.indexOf("3DES")===0&&T.length()!==24)throw new Error("Invalid Triple-DES key size: "+T.length()*8);this._keys=g(T),this._init=!0}},r("DES-ECB",t.cipher.modes.ecb),r("DES-CBC",t.cipher.modes.cbc),r("DES-CFB",t.cipher.modes.cfb),r("DES-OFB",t.cipher.modes.ofb),r("DES-CTR",t.cipher.modes.ctr),r("3DES-ECB",t.cipher.modes.ecb),r("3DES-CBC",t.cipher.modes.cbc),r("3DES-CFB",t.cipher.modes.cfb),r("3DES-OFB",t.cipher.modes.ofb),r("3DES-CTR",t.cipher.modes.ctr);function r(v,T){var O=function(){return new t.des.Algorithm(v,T)};t.cipher.registerAlgorithm(v,O)}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],s=[-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],u=[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],h=[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],c=[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],d=[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],f=[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(v){for(var T=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],O=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],k=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],y=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],R=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],w=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],L=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],D=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],S=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],m=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],q=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],V=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],$=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],E=v.length()>8?3:1,B=[],j=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],N=0,M,ee=0;ee>>4^ae)&252645135,ae^=M,oe^=M<<4,M=(ae>>>-16^oe)&65535,oe^=M,ae^=M<<-16,M=(oe>>>2^ae)&858993459,ae^=M,oe^=M<<2,M=(ae>>>-16^oe)&65535,oe^=M,ae^=M<<-16,M=(oe>>>1^ae)&1431655765,ae^=M,oe^=M<<1,M=(ae>>>8^oe)&16711935,oe^=M,ae^=M<<8,M=(oe>>>1^ae)&1431655765,ae^=M,oe^=M<<1,M=oe<<8|ae>>>20&240,oe=ae<<24|ae<<8&16711680|ae>>>8&65280|ae>>>24&240,ae=M;for(var pe=0;pe>>26,ae=ae<<2|ae>>>26):(oe=oe<<1|oe>>>27,ae=ae<<1|ae>>>27),oe&=-15,ae&=-15;var _e=T[oe>>>28]|O[oe>>>24&15]|k[oe>>>20&15]|y[oe>>>16&15]|R[oe>>>12&15]|w[oe>>>8&15]|L[oe>>>4&15],Re=D[ae>>>28]|S[ae>>>24&15]|m[ae>>>20&15]|p[ae>>>16&15]|q[ae>>>12&15]|V[ae>>>8&15]|$[ae>>>4&15];M=(Re>>>16^_e)&65535,B[N++]=_e^M,B[N++]=Re^M<<16}}return B}function I(v,T,O,k){var y=v.length===32?3:9,R;y===3?R=k?[30,-2,-2]:[0,32,2]:R=k?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var w,L=T[0],D=T[1];w=(L>>>4^D)&252645135,D^=w,L^=w<<4,w=(L>>>16^D)&65535,D^=w,L^=w<<16,w=(D>>>2^L)&858993459,L^=w,D^=w<<2,w=(D>>>8^L)&16711935,L^=w,D^=w<<8,w=(L>>>1^D)&1431655765,D^=w,L^=w<<1,L=L<<1|L>>>31,D=D<<1|D>>>31;for(var S=0;S>>4|D<<28)^v[q+1];w=L,L=D,D=w^(s[V>>>24&63]|h[V>>>16&63]|a[V>>>8&63]|f[V&63]|i[$>>>24&63]|u[$>>>16&63]|c[$>>>8&63]|d[$&63])}w=L,L=D,D=w}L=L>>>1|L<<31,D=D>>>1|D<<31,w=(L>>>1^D)&1431655765,D^=w,L^=w<<1,w=(D>>>8^L)&16711935,L^=w,D^=w<<8,w=(D>>>2^L)&858993459,L^=w,D^=w<<2,w=(L>>>16^D)&65535,D^=w,L^=w<<16,w=(L>>>4^D)&252645135,D^=w,L^=w<<4,O[0]=L,O[1]=D}function C(v){v=v||{};var T=(v.mode||"CBC").toUpperCase(),O="DES-"+T,k;v.decrypt?k=t.cipher.createDecipher(O,v.key):k=t.cipher.createCipher(O,v.key);var y=k.start;return k.start=function(R,w){var L=null;w instanceof t.util.ByteBuffer&&(L=w,w={}),w=w||{},w.output=L,w.iv=R,y.call(k,w)},k}}),Fp=Qe((e,n)=>{var t=lt();Hu(),ho(),Et();var r=t.pkcs5=t.pkcs5||{},i;t.util.isNodejs&&!t.options.usePureJavaScript&&(i=bs("crypto")),n.exports=t.pbkdf2=r.pbkdf2=function(s,u,h,c,a,d){if(typeof a=="function"&&(d=a,a=null),t.util.isNodejs&&!t.options.usePureJavaScript&&i.pbkdf2&&(a===null||typeof a!="object")&&(i.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!="string"&&(a="sha1"),s=Buffer.from(s,"binary"),u=Buffer.from(u,"binary"),d?i.pbkdf2Sync.length===4?i.pbkdf2(s,u,h,c,function(S,m){if(S)return d(S);d(null,m.toString("binary"))}):i.pbkdf2(s,u,h,c,a,function(S,m){if(S)return d(S);d(null,m.toString("binary"))}):i.pbkdf2Sync.length===4?i.pbkdf2Sync(s,u,h,c).toString("binary"):i.pbkdf2Sync(s,u,h,c,a).toString("binary");if((typeof a>"u"||a===null)&&(a="sha1"),typeof a=="string"){if(!(a in t.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=t.md[a].create()}var f=a.digestLength;if(c>4294967295*f){var g=new Error("Derived key is too long.");if(d)return d(g);throw g}var I=Math.ceil(c/f),C=c-(I-1)*f,v=t.hmac.create();v.start(a,s);var T="",O,k,y;if(!d){for(var R=1;R<=I;++R){v.start(null,null),v.update(u),v.update(t.util.int32ToBytes(R)),O=y=v.digest().getBytes();for(var w=2;w<=h;++w)v.start(null,null),v.update(y),k=v.digest().getBytes(),O=t.util.xorBytes(O,k,f),y=k;T+=RI)return d(null,T);v.start(null,null),v.update(u),v.update(t.util.int32ToBytes(R)),O=y=v.digest().getBytes(),w=2,D()}function D(){if(w<=h)return v.start(null,null),v.update(y),k=v.digest().getBytes(),O=t.util.xorBytes(O,k,f),y=k,++w,t.util.setImmediate(D);T+=R{var t=lt();ho(),Et();var r=n.exports=t.sha256=t.sha256||{};t.md.sha256=t.md.algorithms.sha256=r,r.create=function(){s||h();var a=null,d=t.util.createBuffer(),f=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,C=0;C>>0,v>>>0];for(var T=g.fullMessageLength.length-1;T>=0;--T)g.fullMessageLength[T]+=v[1],v[1]=v[0]+(g.fullMessageLength[T]/4294967296>>>0),g.fullMessageLength[T]=g.fullMessageLength[T]>>>0,v[0]=v[1]/4294967296>>>0;return d.putBytes(I),c(a,f,d),(d.read>2048||d.length()===0)&&d.compact(),g},g.digest=function(){var I=t.util.createBuffer();I.putBytes(d.bytes());var C=g.fullMessageLength[g.fullMessageLength.length-1]+g.messageLengthSize,v=C&g.blockLength-1;I.putBytes(i.substr(0,g.blockLength-v));for(var T,O,k=g.fullMessageLength[0]*8,y=0;y>>0,k+=O,I.putInt32(k>>>0),k=T>>>0;I.putInt32(k);var R={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,h4:a.h4,h5:a.h5,h6:a.h6,h7:a.h7};c(R,f,I);var w=t.util.createBuffer();return w.putInt32(R.h0),w.putInt32(R.h1),w.putInt32(R.h2),w.putInt32(R.h3),w.putInt32(R.h4),w.putInt32(R.h5),w.putInt32(R.h6),w.putInt32(R.h7),w},g};var i=null,s=!1,u=null;function h(){i=String.fromCharCode(128),i+=t.util.fillString(String.fromCharCode(0),64),u=[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],s=!0}function c(a,d,f){for(var g,I,C,v,T,O,k,y,R,w,L,D,S,m,p,q=f.length();q>=64;){for(k=0;k<16;++k)d[k]=f.getInt32();for(;k<64;++k)g=d[k-2],g=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,I=d[k-15],I=(I>>>7|I<<25)^(I>>>18|I<<14)^I>>>3,d[k]=g+d[k-7]+I+d[k-16]|0;for(y=a.h0,R=a.h1,w=a.h2,L=a.h3,D=a.h4,S=a.h5,m=a.h6,p=a.h7,k=0;k<64;++k)v=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),T=m^D&(S^m),C=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),O=y&R|w&(y^R),g=p+v+T+u[k]+d[k],I=C+O,p=m,m=S,S=D,D=L+g>>>0,L=w,w=R,R=y,y=g+I>>>0;a.h0=a.h0+y|0,a.h1=a.h1+R|0,a.h2=a.h2+w|0,a.h3=a.h3+L|0,a.h4=a.h4+D|0,a.h5=a.h5+S|0,a.h6=a.h6+m|0,a.h7=a.h7+p|0,q-=64}}}),nb=Qe((e,n)=>{var t=lt();Et();var r=null;t.util.isNodejs&&!t.options.usePureJavaScript&&!process.versions["node-webkit"]&&(r=bs("crypto"));var i=n.exports=t.prng=t.prng||{};i.create=function(s){for(var u={plugin:s,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},h=s.md,c=new Array(32),a=0;a<32;++a)c[a]=h.create();u.pools=c,u.pool=0,u.generate=function(C,v){if(!v)return u.generateSync(C);var T=u.plugin.cipher,O=u.plugin.increment,k=u.plugin.formatKey,y=u.plugin.formatSeed,R=t.util.createBuffer();u.key=null,w();function w(L){if(L)return v(L);if(R.length()>=C)return v(null,R.getBytes(C));if(u.generated>1048575&&(u.key=null),u.key===null)return t.util.nextTick(function(){d(w)});var D=T(u.key,u.seed);u.generated+=D.length,R.putBytes(D),u.key=k(T(u.key,O(u.seed))),u.seed=y(T(u.key,u.seed)),t.util.setImmediate(w)}},u.generateSync=function(C){var v=u.plugin.cipher,T=u.plugin.increment,O=u.plugin.formatKey,k=u.plugin.formatSeed;u.key=null;for(var y=t.util.createBuffer();y.length()1048575&&(u.key=null),u.key===null&&f();var R=v(u.key,u.seed);u.generated+=R.length,y.putBytes(R),u.key=O(v(u.key,T(u.seed))),u.seed=k(v(u.key,u.seed))}return y.getBytes(C)};function d(C){if(u.pools[0].messageLength>=32)return g(),C();var v=32-u.pools[0].messageLength<<5;u.seedFile(v,function(T,O){if(T)return C(T);u.collect(O),g(),C()})}function f(){if(u.pools[0].messageLength>=32)return g();var C=32-u.pools[0].messageLength<<5;u.collect(u.seedFileSync(C)),g()}function g(){u.reseeds=u.reseeds===4294967295?0:u.reseeds+1;var C=u.plugin.md.create();C.update(u.keyBytes);for(var v=1,T=0;T<32;++T)u.reseeds%v===0&&(C.update(u.pools[T].digest().getBytes()),u.pools[T].start()),v=v<<1;u.keyBytes=C.digest().getBytes(),C.start(),C.update(u.keyBytes);var O=C.digest().getBytes();u.key=u.plugin.formatKey(u.keyBytes),u.seed=u.plugin.formatSeed(O),u.generated=0}function I(C){var v=null,T=t.util.globalScope,O=T.crypto||T.msCrypto;O&&O.getRandomValues&&(v=function(p){return O.getRandomValues(p)});var k=t.util.createBuffer();if(v)for(;k.length()>16),D+=(L&32767)<<16,D+=L>>15,D=(D&2147483647)+(D>>31),m=D&4294967295;for(var w=0;w<3;++w)S=m>>>(w<<3),S^=Math.floor(Math.random()*256),k.putByte(S&255)}return k.getBytes(C)}return r?(u.seedFile=function(C,v){r.randomBytes(C,function(T,O){if(T)return v(T);v(null,O.toString())})},u.seedFileSync=function(C){return r.randomBytes(C).toString()}):(u.seedFile=function(C,v){try{v(null,I(C))}catch(T){v(T)}},u.seedFileSync=I),u.collect=function(C){for(var v=C.length,T=0;T>O&255);u.collect(T)},u.registerWorker=function(C){if(C===self)u.seedFile=function(T,O){function k(y){var R=y.data;R.forge&&R.forge.prng&&(self.removeEventListener("message",k),O(R.forge.prng.err,R.forge.prng.bytes))}self.addEventListener("message",k),self.postMessage({forge:{prng:{needed:T}}})};else{var v=function(T){var O=T.data;O.forge&&O.forge.prng&&u.seedFile(O.forge.prng.needed,function(k,y){C.postMessage({forge:{prng:{err:k,bytes:y}}})})};C.addEventListener("message",v)}},u}}),ui=Qe((e,n)=>{var t=lt();Pa(),rb(),nb(),Et(),function(){if(t.random&&t.random.getBytes){n.exports=t.random;return}(function(r){var i={},s=new Array(4),u=t.util.createBuffer();i.formatKey=function(C){var v=t.util.createBuffer(C);return C=new Array(4),C[0]=v.getInt32(),C[1]=v.getInt32(),C[2]=v.getInt32(),C[3]=v.getInt32(),t.aes._expandKey(C,!1)},i.formatSeed=function(C){var v=t.util.createBuffer(C);return C=new Array(4),C[0]=v.getInt32(),C[1]=v.getInt32(),C[2]=v.getInt32(),C[3]=v.getInt32(),C},i.cipher=function(C,v){return t.aes._updateBlock(C,v,s,!1),u.putInt32(s[0]),u.putInt32(s[1]),u.putInt32(s[2]),u.putInt32(s[3]),u.getBytes()},i.increment=function(C){return++C[3],C},i.md=t.md.sha256;function h(){var C=t.prng.create(i);return C.getBytes=function(v,T){return C.generate(v,T)},C.getBytesSync=function(v){return C.generate(v)},C}var c=h(),a=null,d=t.util.globalScope,f=d.crypto||d.msCrypto;if(f&&f.getRandomValues&&(a=function(C){return f.getRandomValues(C)}),t.options.usePureJavaScript||!t.util.isNodejs&&!a){if(typeof window>"u"||window.document,c.collectInt(+new Date,32),typeof navigator<"u"){var g="";for(var I in navigator)try{typeof navigator[I]=="string"&&(g+=navigator[I])}catch{}c.collect(g),g=null}r&&(r().mousemove(function(C){c.collectInt(C.clientX,16),c.collectInt(C.clientY,16)}),r().keypress(function(C){c.collectInt(C.charCode,8)}))}if(!t.random)t.random=c;else for(var I in c)t.random[I]=c[I];t.random.createInstance=h,n.exports=t.random})(typeof jQuery<"u"?jQuery:null)}()}),ib=Qe((e,n)=>{var t=lt();Et();var r=[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],s=function(c,a){return c<>16-a},u=function(c,a){return(c&65535)>>a|c<<16-a&65535};n.exports=t.rc2=t.rc2||{},t.rc2.expandKey=function(c,a){typeof c=="string"&&(c=t.util.createBuffer(c)),a=a||128;var d=c,f=c.length(),g=a,I=Math.ceil(g/8),C=255>>(g&7),v;for(v=f;v<128;v++)d.putByte(r[d.at(v-1)+d.at(v-f)&255]);for(d.setAt(128-I,r[d.at(128-I)&C]),v=127-I;v>=0;v--)d.setAt(v,r[d.at(v+1)^d.at(v+I)]);return d};var h=function(c,a,d){var f=!1,g=null,I=null,C=null,v,T,O,k,y=[];for(c=t.rc2.expandKey(c,a),O=0;O<64;O++)y.push(c.getInt16Le());d?(v=function(L){for(O=0;O<4;O++)L[O]+=y[k]+(L[(O+3)%4]&L[(O+2)%4])+(~L[(O+3)%4]&L[(O+1)%4]),L[O]=s(L[O],i[O]),k++},T=function(L){for(O=0;O<4;O++)L[O]+=y[L[(O+3)%4]&63]}):(v=function(L){for(O=3;O>=0;O--)L[O]=u(L[O],i[O]),L[O]-=y[k]+(L[(O+3)%4]&L[(O+2)%4])+(~L[(O+3)%4]&L[(O+1)%4]),k--},T=function(L){for(O=3;O>=0;O--)L[O]-=y[L[(O+3)%4]&63]});var R=function(L){var D=[];for(O=0;O<4;O++){var S=g.getInt16Le();C!==null&&(d?S^=C.getInt16Le():C.putInt16Le(S)),D.push(S&65535)}k=d?0:63;for(var m=0;m=8;)R([[5,v],[1,T],[6,v],[1,T],[5,v]])},finish:function(L){var D=!0;if(d)if(L)D=L(8,g,!d);else{var S=g.length()===8?8:8-g.length();g.fillWithByte(S,S)}if(D&&(f=!0,w.update()),!d&&(D=g.length()===0,D))if(L)D=L(8,I,!d);else{var m=I.length(),p=I.at(m-1);p>m?D=!1:I.truncate(p)}return D}},w};t.rc2.startEncrypting=function(c,a,d){var f=t.rc2.createEncryptionCipher(c,128);return f.start(a,d),f},t.rc2.createEncryptionCipher=function(c,a){return h(c,a,!0)},t.rc2.startDecrypting=function(c,a,d){var f=t.rc2.createDecryptionCipher(c,128);return f.start(a,d),f},t.rc2.createDecryptionCipher=function(c,a){return h(c,a,!1)}}),oh=Qe((e,n)=>{var t=lt();n.exports=t.jsbn=t.jsbn||{};var r,i=0xdeadbeefcafe,s=(i&16777215)==15715070;function u(z,G,Z){this.data=[],z!=null&&(typeof z=="number"?this.fromNumber(z,G,Z):G==null&&typeof z!="string"?this.fromString(z,256):this.fromString(z,G))}t.jsbn.BigInteger=u;function h(){return new u(null)}function c(z,G,Z,ce,be,Te){for(;--Te>=0;){var Ne=G*this.data[z++]+Z.data[ce]+be;be=Math.floor(Ne/67108864),Z.data[ce++]=Ne&67108863}return be}function a(z,G,Z,ce,be,Te){for(var Ne=G&32767,Be=G>>15;--Te>=0;){var bt=this.data[z]&32767,ar=this.data[z++]>>15,Rr=Be*bt+ar*Ne;bt=Ne*bt+((Rr&32767)<<15)+Z.data[ce]+(be&1073741823),be=(bt>>>30)+(Rr>>>15)+Be*ar+(be>>>30),Z.data[ce++]=bt&1073741823}return be}function d(z,G,Z,ce,be,Te){for(var Ne=G&16383,Be=G>>14;--Te>=0;){var bt=this.data[z]&16383,ar=this.data[z++]>>14,Rr=Be*bt+ar*Ne;bt=Ne*bt+((Rr&16383)<<14)+Z.data[ce]+be,be=(bt>>28)+(Rr>>14)+Be*ar,Z.data[ce++]=bt&268435455}return be}typeof navigator>"u"?(u.prototype.am=d,r=28):s&&navigator.appName=="Microsoft Internet Explorer"?(u.prototype.am=a,r=30):s&&navigator.appName!="Netscape"?(u.prototype.am=c,r=26):(u.prototype.am=d,r=28),u.prototype.DB=r,u.prototype.DM=(1<=0;--G)z.data[G]=this.data[G];z.t=this.t,z.s=this.s}function y(z){this.t=1,this.s=z<0?-1:0,z>0?this.data[0]=z:z<-1?this.data[0]=z+this.DV:this.t=0}function R(z){var G=h();return G.fromInt(z),G}function w(z,G){var Z;if(G==16)Z=4;else if(G==8)Z=3;else if(G==256)Z=8;else if(G==2)Z=1;else if(G==32)Z=5;else if(G==4)Z=2;else{this.fromRadix(z,G);return}this.t=0,this.s=0;for(var ce=z.length,be=!1,Te=0;--ce>=0;){var Ne=Z==8?z[ce]&255:O(z,ce);if(Ne<0){z.charAt(ce)=="-"&&(be=!0);continue}be=!1,Te==0?this.data[this.t++]=Ne:Te+Z>this.DB?(this.data[this.t-1]|=(Ne&(1<>this.DB-Te):this.data[this.t-1]|=Ne<=this.DB&&(Te-=this.DB)}Z==8&&z[0]&128&&(this.s=-1,Te>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==z;)--this.t}function D(z){if(this.s<0)return"-"+this.negate().toString(z);var G;if(z==16)G=4;else if(z==8)G=3;else if(z==2)G=1;else if(z==32)G=5;else if(z==4)G=2;else return this.toRadix(z);var Z=(1<0)for(Be>Be)>0&&(be=!0,Te=T(ce));Ne>=0;)Be>(Be+=this.DB-G)):(ce=this.data[Ne]>>(Be-=G)&Z,Be<=0&&(Be+=this.DB,--Ne)),ce>0&&(be=!0),be&&(Te+=T(ce));return be?Te:"0"}function S(){var z=h();return u.ZERO.subTo(this,z),z}function m(){return this.s<0?this.negate():this}function p(z){var G=this.s-z.s;if(G!=0)return G;var Z=this.t;if(G=Z-z.t,G!=0)return this.s<0?-G:G;for(;--Z>=0;)if((G=this.data[Z]-z.data[Z])!=0)return G;return 0}function q(z){var G=1,Z;return(Z=z>>>16)!=0&&(z=Z,G+=16),(Z=z>>8)!=0&&(z=Z,G+=8),(Z=z>>4)!=0&&(z=Z,G+=4),(Z=z>>2)!=0&&(z=Z,G+=2),(Z=z>>1)!=0&&(z=Z,G+=1),G}function V(){return this.t<=0?0:this.DB*(this.t-1)+q(this.data[this.t-1]^this.s&this.DM)}function $(z,G){var Z;for(Z=this.t-1;Z>=0;--Z)G.data[Z+z]=this.data[Z];for(Z=z-1;Z>=0;--Z)G.data[Z]=0;G.t=this.t+z,G.s=this.s}function E(z,G){for(var Z=z;Z=0;--Be)G.data[Be+Te+1]=this.data[Be]>>ce|Ne,Ne=(this.data[Be]&be)<=0;--Be)G.data[Be]=0;G.data[Te]=Ne,G.t=this.t+Te+1,G.s=this.s,G.clamp()}function j(z,G){G.s=this.s;var Z=Math.floor(z/this.DB);if(Z>=this.t){G.t=0;return}var ce=z%this.DB,be=this.DB-ce,Te=(1<>ce;for(var Ne=Z+1;Ne>ce;ce>0&&(G.data[this.t-Z-1]|=(this.s&Te)<>=this.DB;if(z.t>=this.DB;ce+=this.s}else{for(ce+=this.s;Z>=this.DB;ce-=z.s}G.s=ce<0?-1:0,ce<-1?G.data[Z++]=this.DV+ce:ce>0&&(G.data[Z++]=ce),G.t=Z,G.clamp()}function M(z,G){var Z=this.abs(),ce=z.abs(),be=Z.t;for(G.t=be+ce.t;--be>=0;)G.data[be]=0;for(be=0;be=0;)z.data[Z]=0;for(Z=0;Z=G.DV&&(z.data[Z+G.t]-=G.DV,z.data[Z+G.t+1]=1)}z.t>0&&(z.data[z.t-1]+=G.am(Z,G.data[Z],z,2*Z,0,1)),z.s=0,z.clamp()}function oe(z,G,Z){var ce=z.abs();if(!(ce.t<=0)){var be=this.abs();if(be.t0?(ce.lShiftTo(bt,Te),be.lShiftTo(bt,Z)):(ce.copyTo(Te),be.copyTo(Z));var ar=Te.t,Rr=Te.data[ar-1];if(Rr!=0){var Pr=Rr*(1<1?Te.data[ar-2]>>this.F2:0),ln=this.FV/Pr,ci=(1<=0&&(Z.data[Z.t++]=1,Z.subTo(En,Z)),u.ONE.dlShiftTo(ar,En),En.subTo(Te,Te);Te.t=0;){var Gn=Z.data[--mr]==Rr?this.DM:Math.floor(Z.data[mr]*ln+(Z.data[mr-1]+Ir)*ci);if((Z.data[mr]+=Te.am(0,Gn,Z,Bi,0,ar))0&&Z.rShiftTo(bt,Z),Ne<0&&u.ZERO.subTo(Z,Z)}}}function ae(z){var G=h();return this.abs().divRemTo(z,null,G),this.s<0&&G.compareTo(u.ZERO)>0&&z.subTo(G,G),G}function pe(z){this.m=z}function _e(z){return z.s<0||z.compareTo(this.m)>=0?z.mod(this.m):z}function Re(z){return z}function qe(z){z.divRemTo(this.m,null,z)}function Ce(z,G,Z){z.multiplyTo(G,Z),this.reduce(Z)}function $e(z,G){z.squareTo(G),this.reduce(G)}pe.prototype.convert=_e,pe.prototype.revert=Re,pe.prototype.reduce=qe,pe.prototype.mulTo=Ce,pe.prototype.sqrTo=$e;function Ie(){if(this.t<1)return 0;var z=this.data[0];if(!(z&1))return 0;var G=z&3;return G=G*(2-(z&15)*G)&15,G=G*(2-(z&255)*G)&255,G=G*(2-((z&65535)*G&65535))&65535,G=G*(2-z*G%this.DV)%this.DV,G>0?this.DV-G:-G}function et(z){this.m=z,this.mp=z.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(G,G),G}function x(z){var G=h();return z.copyTo(G),this.reduce(G),G}function X(z){for(;z.t<=this.mt2;)z.data[z.t++]=0;for(var G=0;G>15)*this.mpl&this.um)<<15)&z.DM;for(Z=G+this.m.t,z.data[Z]+=this.m.am(0,ce,z,G,0,this.m.t);z.data[Z]>=z.DV;)z.data[Z]-=z.DV,z.data[++Z]++}z.clamp(),z.drShiftTo(this.m.t,z),z.compareTo(this.m)>=0&&z.subTo(this.m,z)}function Q(z,G){z.squareTo(G),this.reduce(G)}function A(z,G,Z){z.multiplyTo(G,Z),this.reduce(Z)}et.prototype.convert=Je,et.prototype.revert=x,et.prototype.reduce=X,et.prototype.mulTo=A,et.prototype.sqrTo=Q;function K(){return(this.t>0?this.data[0]&1:this.s)==0}function se(z,G){if(z>4294967295||z<1)return u.ONE;var Z=h(),ce=h(),be=G.convert(this),Te=q(z)-1;for(be.copyTo(Z);--Te>=0;)if(G.sqrTo(Z,ce),(z&1<0)G.mulTo(ce,be,Z);else{var Ne=Z;Z=ce,ce=Ne}return G.revert(Z)}function te(z,G){var Z;return z<256||G.isEven()?Z=new pe(G):Z=new et(G),this.exp(z,Z)}u.prototype.copyTo=k,u.prototype.fromInt=y,u.prototype.fromString=w,u.prototype.clamp=L,u.prototype.dlShiftTo=$,u.prototype.drShiftTo=E,u.prototype.lShiftTo=B,u.prototype.rShiftTo=j,u.prototype.subTo=N,u.prototype.multiplyTo=M,u.prototype.squareTo=ee,u.prototype.divRemTo=oe,u.prototype.invDigit=Ie,u.prototype.isEven=K,u.prototype.exp=se,u.prototype.toString=D,u.prototype.negate=S,u.prototype.abs=m,u.prototype.compareTo=p,u.prototype.bitLength=V,u.prototype.mod=ae,u.prototype.modPowInt=te,u.ZERO=R(0),u.ONE=R(1);function Ee(){var z=h();return this.copyTo(z),z}function xe(){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 ge(){return this.t==0?this.s:this.data[0]<<16>>16}function Le(z){return Math.floor(Math.LN2*this.DB/Math.log(z))}function We(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function rt(z){if(z==null&&(z=10),this.signum()==0||z<2||z>36)return"0";var G=this.chunkSize(z),Z=Math.pow(z,G),ce=R(Z),be=h(),Te=h(),Ne="";for(this.divRemTo(ce,be,Te);be.signum()>0;)Ne=(Z+Te.intValue()).toString(z).substr(1)+Ne,be.divRemTo(ce,be,Te);return Te.intValue().toString(z)+Ne}function He(z,G){this.fromInt(0),G==null&&(G=10);for(var Z=this.chunkSize(G),ce=Math.pow(G,Z),be=!1,Te=0,Ne=0,Be=0;Be=Z&&(this.dMultiply(ce),this.dAddOffset(Ne,0),Te=0,Ne=0)}Te>0&&(this.dMultiply(Math.pow(G,Te)),this.dAddOffset(Ne,0)),be&&u.ZERO.subTo(this,this)}function kt(z,G,Z){if(typeof G=="number")if(z<2)this.fromInt(1);else for(this.fromNumber(z,Z),this.testBit(z-1)||this.bitwiseTo(u.ONE.shiftLeft(z-1),Ht,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(G);)this.dAddOffset(2,0),this.bitLength()>z&&this.subTo(u.ONE.shiftLeft(z-1),this);else{var ce=new Array,be=z&7;ce.length=(z>>3)+1,G.nextBytes(ce),be>0?ce[0]&=(1<0)for(Z>Z)!=(this.s&this.DM)>>Z&&(G[be++]=ce|this.s<=0;)Z<8?(ce=(this.data[z]&(1<>(Z+=this.DB-8)):(ce=this.data[z]>>(Z-=8)&255,Z<=0&&(Z+=this.DB,--z)),ce&128&&(ce|=-256),be==0&&(this.s&128)!=(ce&128)&&++be,(be>0||ce!=this.s)&&(G[be++]=ce);return G}function Ct(z){return this.compareTo(z)==0}function Bt(z){return this.compareTo(z)<0?this:z}function Ot(z){return this.compareTo(z)>0?this:z}function Lt(z,G,Z){var ce,be,Te=Math.min(z.t,this.t);for(ce=0;ce>=16,G+=16),z&255||(z>>=8,G+=8),z&15||(z>>=4,G+=4),z&3||(z>>=2,G+=2),z&1||++G,G}function li(){for(var z=0;z=this.t?this.s!=0:(this.data[G]&1<>=this.DB;if(z.t>=this.DB;ce+=this.s}else{for(ce+=this.s;Z>=this.DB;ce+=z.s}G.s=ce<0?-1:0,ce>0?G.data[Z++]=ce:ce<-1&&(G.data[Z++]=this.DV+ce),G.t=Z,G.clamp()}function Gt(z){var G=h();return this.addTo(z,G),G}function Qt(z){var G=h();return this.subTo(z,G),G}function rr(z){var G=h();return this.multiplyTo(z,G),G}function nr(z){var G=h();return this.divRemTo(z,G,null),G}function ir(z){var G=h();return this.divRemTo(z,null,G),G}function er(z){var G=h(),Z=h();return this.divRemTo(z,G,Z),new Array(G,Z)}function or(z){this.data[this.t]=this.am(0,z-1,this,0,0,this.t),++this.t,this.clamp()}function cr(z,G){if(z!=0){for(;this.t<=G;)this.data[this.t++]=0;for(this.data[G]+=z;this.data[G]>=this.DV;)this.data[G]-=this.DV,++G>=this.t&&(this.data[this.t++]=0),++this.data[G]}}function $t(){}function tr(z){return z}function La(z,G,Z){z.multiplyTo(G,Z)}function fo(z,G){z.squareTo(G)}$t.prototype.convert=tr,$t.prototype.revert=tr,$t.prototype.mulTo=La,$t.prototype.sqrTo=fo;function Os(z){return this.exp(z,new $t)}function po(z,G,Z){var ce=Math.min(this.t+z.t,G);for(Z.s=0,Z.t=ce;ce>0;)Z.data[--ce]=0;var be;for(be=Z.t-this.t;ce=0;)Z.data[ce]=0;for(ce=Math.max(G-this.t,0);ce2*this.m.t)return z.mod(this.m);if(z.compareTo(this.m)<0)return z;var G=h();return z.copyTo(G),this.reduce(G),G}function Ho(z){return z}function Pi(z){for(z.drShiftTo(this.m.t-1,this.r2),z.t>this.m.t+1&&(z.t=this.m.t+1,z.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);z.compareTo(this.r2)<0;)z.dAddOffset(1,this.m.t+1);for(z.subTo(this.r2,z);z.compareTo(this.m)>=0;)z.subTo(this.m,z)}function yo(z,G){z.squareTo(G),this.reduce(G)}function go(z,G,Z){z.multiplyTo(G,Z),this.reduce(Z)}wn.prototype.convert=Tr,wn.prototype.revert=Ho,wn.prototype.reduce=Pi,wn.prototype.mulTo=go,wn.prototype.sqrTo=yo;function Na(z,G){var Z=z.bitLength(),ce,be=R(1),Te;if(Z<=0)return be;Z<18?ce=1:Z<48?ce=3:Z<144?ce=4:Z<768?ce=5:ce=6,Z<8?Te=new pe(G):G.isEven()?Te=new wn(G):Te=new et(G);var Ne=new Array,Be=3,bt=ce-1,ar=(1<1){var Rr=h();for(Te.sqrTo(Ne[1],Rr);Be<=ar;)Ne[Be]=h(),Te.mulTo(Rr,Ne[Be-2],Ne[Be]),Be+=2}var Pr=z.t-1,ln,ci=!0,Ir=h(),mr;for(Z=q(z.data[Pr])-1;Pr>=0;){for(Z>=bt?ln=z.data[Pr]>>Z-bt&ar:(ln=(z.data[Pr]&(1<0&&(ln|=z.data[Pr-1]>>this.DB+Z-bt)),Be=ce;!(ln&1);)ln>>=1,--Be;if((Z-=Be)<0&&(Z+=this.DB,--Pr),ci)Ne[ln].copyTo(be),ci=!1;else{for(;Be>1;)Te.sqrTo(be,Ir),Te.sqrTo(Ir,be),Be-=2;Be>0?Te.sqrTo(be,Ir):(mr=be,be=Ir,Ir=mr),Te.mulTo(Ir,Ne[ln],be)}for(;Pr>=0&&!(z.data[Pr]&1<0&&(G.rShiftTo(Te,G),Z.rShiftTo(Te,Z));G.signum()>0;)(be=G.getLowestSetBit())>0&&G.rShiftTo(be,G),(be=Z.getLowestSetBit())>0&&Z.rShiftTo(be,Z),G.compareTo(Z)>=0?(G.subTo(Z,G),G.rShiftTo(1,G)):(Z.subTo(G,Z),Z.rShiftTo(1,Z));return Te>0&&Z.lShiftTo(Te,Z),Z}function Ua(z){if(z<=0)return 0;var G=this.DV%z,Z=this.s<0?z-1:0;if(this.t>0)if(G==0)Z=this.data[0]%z;else for(var ce=this.t-1;ce>=0;--ce)Z=(G*Z+this.data[ce])%z;return Z}function mo(z){var G=z.isEven();if(this.isEven()&&G||z.signum()==0)return u.ZERO;for(var Z=z.clone(),ce=this.clone(),be=R(1),Te=R(0),Ne=R(0),Be=R(1);Z.signum()!=0;){for(;Z.isEven();)Z.rShiftTo(1,Z),G?((!be.isEven()||!Te.isEven())&&(be.addTo(this,be),Te.subTo(z,Te)),be.rShiftTo(1,be)):Te.isEven()||Te.subTo(z,Te),Te.rShiftTo(1,Te);for(;ce.isEven();)ce.rShiftTo(1,ce),G?((!Ne.isEven()||!Be.isEven())&&(Ne.addTo(this,Ne),Be.subTo(z,Be)),Ne.rShiftTo(1,Ne)):Be.isEven()||Be.subTo(z,Be),Be.rShiftTo(1,Be);Z.compareTo(ce)>=0?(Z.subTo(ce,Z),G&&be.subTo(Ne,be),Te.subTo(Be,Te)):(ce.subTo(Z,ce),G&&Ne.subTo(be,Ne),Be.subTo(Te,Be))}if(ce.compareTo(u.ONE)!=0)return u.ZERO;if(Be.compareTo(z)>=0)return Be.subtract(z);if(Be.signum()<0)Be.addTo(z,Be);else return Be;return Be.signum()<0?Be.add(z):Be}var br=[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],Da=(1<<26)/br[br.length-1];function ja(z){var G,Z=this.abs();if(Z.t==1&&Z.data[0]<=br[br.length-1]){for(G=0;G=0);var Be=Te.modPow(ce,this);if(Be.compareTo(u.ONE)!=0&&Be.compareTo(G)!=0){for(var bt=1;bt++{var t=lt();ho(),Et();var r=n.exports=t.sha1=t.sha1||{};t.md.sha1=t.md.algorithms.sha1=r,r.create=function(){s||u();var c=null,a=t.util.createBuffer(),d=new Array(80),f={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return f.start=function(){f.messageLength=0,f.fullMessageLength=f.messageLength64=[];for(var g=f.messageLengthSize/4,I=0;I>>0,C>>>0];for(var v=f.fullMessageLength.length-1;v>=0;--v)f.fullMessageLength[v]+=C[1],C[1]=C[0]+(f.fullMessageLength[v]/4294967296>>>0),f.fullMessageLength[v]=f.fullMessageLength[v]>>>0,C[0]=C[1]/4294967296>>>0;return a.putBytes(g),h(c,d,a),(a.read>2048||a.length()===0)&&a.compact(),f},f.digest=function(){var g=t.util.createBuffer();g.putBytes(a.bytes());var I=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize,C=I&f.blockLength-1;g.putBytes(i.substr(0,f.blockLength-C));for(var v,T,O=f.fullMessageLength[0]*8,k=0;k>>0,O+=T,g.putInt32(O>>>0),O=v>>>0;g.putInt32(O);var y={h0:c.h0,h1:c.h1,h2:c.h2,h3:c.h3,h4:c.h4};h(y,d,g);var R=t.util.createBuffer();return R.putInt32(y.h0),R.putInt32(y.h1),R.putInt32(y.h2),R.putInt32(y.h3),R.putInt32(y.h4),R},f};var i=null,s=!1;function u(){i=String.fromCharCode(128),i+=t.util.fillString(String.fromCharCode(0),64),s=!0}function h(c,a,d){for(var f,g,I,C,v,T,O,k,y=d.length();y>=64;){for(g=c.h0,I=c.h1,C=c.h2,v=c.h3,T=c.h4,k=0;k<16;++k)f=d.getInt32(),a[k]=f,O=v^I&(C^v),f=(g<<5|g>>>27)+O+T+1518500249+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<20;++k)f=a[k-3]^a[k-8]^a[k-14]^a[k-16],f=f<<1|f>>>31,a[k]=f,O=v^I&(C^v),f=(g<<5|g>>>27)+O+T+1518500249+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<32;++k)f=a[k-3]^a[k-8]^a[k-14]^a[k-16],f=f<<1|f>>>31,a[k]=f,O=I^C^v,f=(g<<5|g>>>27)+O+T+1859775393+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<40;++k)f=a[k-6]^a[k-16]^a[k-28]^a[k-32],f=f<<2|f>>>30,a[k]=f,O=I^C^v,f=(g<<5|g>>>27)+O+T+1859775393+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<60;++k)f=a[k-6]^a[k-16]^a[k-28]^a[k-32],f=f<<2|f>>>30,a[k]=f,O=I&C|v&(I^C),f=(g<<5|g>>>27)+O+T+2400959708+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;for(;k<80;++k)f=a[k-6]^a[k-16]^a[k-28]^a[k-32],f=f<<2|f>>>30,a[k]=f,O=I^C^v,f=(g<<5|g>>>27)+O+T+3395469782+f,T=v,v=C,C=(I<<30|I>>>2)>>>0,I=g,g=f;c.h0=c.h0+g|0,c.h1=c.h1+I|0,c.h2=c.h2+C|0,c.h3=c.h3+v|0,c.h4=c.h4+T|0,y-=64}}}),ob=Qe((e,n)=>{var t=lt();Et(),ui(),Ku();var r=n.exports=t.pkcs1=t.pkcs1||{};r.encode_rsa_oaep=function(s,u,h){var c,a,d,f;typeof h=="string"?(c=h,a=arguments[3]||void 0,d=arguments[4]||void 0):h&&(c=h.label||void 0,a=h.seed||void 0,d=h.md||void 0,h.mgf1&&h.mgf1.md&&(f=h.mgf1.md)),d?d.start():d=t.md.sha1.create(),f||(f=d);var g=Math.ceil(s.n.bitLength()/8),I=g-2*d.digestLength-2;if(u.length>I){var C=new Error("RSAES-OAEP input message length is too long.");throw C.length=u.length,C.maxLength=I,C}c||(c=""),d.update(c,"raw");for(var v=d.digest(),T="",O=I-u.length,k=0;k>24&255,d>>16&255,d>>8&255,d&255);h.start(),h.update(s+f),c+=h.digest().getBytes()}return c.substring(0,u)}}),ab=Qe((e,n)=>{var t=lt();Et(),oh(),ui(),function(){if(t.prime){n.exports=t.prime;return}var r=n.exports=t.prime=t.prime||{},i=t.jsbn.BigInteger,s=[6,4,2,4,2,4,6,2],u=new i(null);u.fromInt(30);var h=function(C,v){return C|v};r.generateProbablePrime=function(C,v,T){typeof v=="function"&&(T=v,v={}),v=v||{};var O=v.algorithm||"PRIMEINC";typeof O=="string"&&(O={name:O}),O.options=O.options||{};var k=v.prng||t.random,y={nextBytes:function(R){for(var w=k.getBytesSync(R.length),L=0;Lv&&(C=g(v,T)),C.isProbablePrime(k))return R(null,C);C.dAddOffset(s[O++%8],0)}while(y<0||+new Date-w"u")return a(C,v,T,O);var k=g(C,v),y=T.workers,R=T.workLoad||100,w=R*30/8,L=T.workerScript||"forge/prime.worker.js";if(y===-1)return t.util.estimateCores(function(S,m){S&&(m=2),y=m-1,D()});D();function D(){y=Math.max(1,y);for(var S=[],m=0;mC&&(k=g(C,v));var j=k.toString(16);$.target.postMessage({hex:j,workLoad:R}),k.dAddOffset(w,0)}}}}function g(C,v){var T=new i(C,v),O=C-1;return T.testBit(O)||T.bitwiseTo(i.ONE.shiftLeft(O),h,T),T.dAddOffset(31-T.mod(u).byteValue(),0),T}function I(C){return C<=100?27:C<=150?18:C<=200?15:C<=250?12:C<=300?9:C<=350?8:C<=400?7:C<=500?6:C<=600?5:C<=800?4:C<=1250?3:2}}()}),ah=Qe((e,n)=>{var t=lt();ki(),oh(),Ba(),ob(),ab(),ui(),Et(),typeof r>"u"&&(r=t.jsbn.BigInteger);var r,i=t.util.isNodejs?bs("crypto"):null,s=t.asn1,u=t.util;t.pki=t.pki||{},n.exports=t.pki.rsa=t.rsa=t.rsa||{};var h=t.pki,c=[6,4,2,4,2,4,6,2],a={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},d={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},g=t.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},I={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},C=function(m){var p;if(m.algorithm in h.oids)p=h.oids[m.algorithm];else{var q=new Error("Unknown message digest algorithm.");throw q.algorithm=m.algorithm,q}var V=s.oidToDer(p).getBytes(),$=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),E=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);E.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,V)),E.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var B=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,m.digest().getBytes());return $.value.push(E),$.value.push(B),s.toDer($).getBytes()},v=function(m,p,q){if(q)return m.modPow(p.e,p.n);if(!p.p||!p.q)return m.modPow(p.d,p.n);p.dP||(p.dP=p.d.mod(p.p.subtract(r.ONE))),p.dQ||(p.dQ=p.d.mod(p.q.subtract(r.ONE))),p.qInv||(p.qInv=p.q.modInverse(p.p));var V;do V=new r(t.util.bytesToHex(t.random.getBytes(p.n.bitLength()/8)),16);while(V.compareTo(p.n)>=0||!V.gcd(p.n).equals(r.ONE));m=m.multiply(V.modPow(p.e,p.n)).mod(p.n);for(var $=m.mod(p.p).modPow(p.dP,p.p),E=m.mod(p.q).modPow(p.dQ,p.q);$.compareTo(E)<0;)$=$.add(p.p);var B=$.subtract(E).multiply(p.qInv).mod(p.p).multiply(p.q).add(E);return B=B.multiply(V.modInverse(p.n)).mod(p.n),B};h.rsa.encrypt=function(m,p,q){var V=q,$,E=Math.ceil(p.n.bitLength()/8);q!==!1&&q!==!0?(V=q===2,$=T(m,p,q)):($=t.util.createBuffer(),$.putBytes(m));for(var B=new r($.toHex(),16),j=v(B,p,V),N=j.toString(16),M=t.util.createBuffer(),ee=E-Math.ceil(N.length/2);ee>0;)M.putByte(0),--ee;return M.putBytes(t.util.hexToBytes(N)),M.getBytes()},h.rsa.decrypt=function(m,p,q,V){var $=Math.ceil(p.n.bitLength()/8);if(m.length!==$){var E=new Error("Encrypted message length is invalid.");throw E.length=m.length,E.expected=$,E}var B=new r(t.util.createBuffer(m).toHex(),16);if(B.compareTo(p.n)>=0)throw new Error("Encrypted message is invalid.");for(var j=v(B,p,q),N=j.toString(16),M=t.util.createBuffer(),ee=$-Math.ceil(N.length/2);ee>0;)M.putByte(0),--ee;return M.putBytes(t.util.hexToBytes(N)),V!==!1?O(M.getBytes(),p,q):M.getBytes()},h.rsa.createKeyPairGenerationState=function(m,p,q){typeof m=="string"&&(m=parseInt(m,10)),m=m||2048,q=q||{};var V=q.prng||t.random,$={nextBytes:function(j){for(var N=V.getBytesSync(j.length),M=0;M>1,pBits:m-(m>>1),pqState:0,num:null,keys:null},B.e.fromInt(B.eInt);else throw new Error("Invalid key generation algorithm: "+E);return B},h.rsa.stepKeyPairGenerationState=function(m,p){"algorithm"in m||(m.algorithm="PRIMEINC");var q=new r(null);q.fromInt(30);for(var V=0,$=function(oe,ae){return oe|ae},E=+new Date,B,j=0;m.keys===null&&(p<=0||jN?m.pqState=0:m.num.isProbablePrime(R(m.num.bitLength()))?++m.pqState:m.num.dAddOffset(c[V++%8],0):m.pqState===2?m.pqState=m.num.subtract(r.ONE).gcd(m.e).compareTo(r.ONE)===0?3:0:m.pqState===3&&(m.pqState=0,m.p===null?m.p=m.num:m.q=m.num,m.p!==null&&m.q!==null&&++m.state,m.num=null)}else if(m.state===1)m.p.compareTo(m.q)<0&&(m.num=m.p,m.p=m.q,m.q=m.num),++m.state;else if(m.state===2)m.p1=m.p.subtract(r.ONE),m.q1=m.q.subtract(r.ONE),m.phi=m.p1.multiply(m.q1),++m.state;else if(m.state===3)m.phi.gcd(m.e).compareTo(r.ONE)===0?++m.state:(m.p=null,m.q=null,m.state=0);else if(m.state===4)m.n=m.p.multiply(m.q),m.n.bitLength()===m.bits?++m.state:(m.q=null,m.state=0);else if(m.state===5){var ee=m.e.modInverse(m.phi);m.keys={privateKey:h.rsa.setPrivateKey(m.n,m.e,ee,m.p,m.q,ee.mod(m.p1),ee.mod(m.q1),m.q.modInverse(m.p)),publicKey:h.rsa.setPublicKey(m.n,m.e)}}B=+new Date,j+=B-E,E=B}return m.keys!==null},h.rsa.generateKeyPair=function(m,p,q,V){if(arguments.length===1?typeof m=="object"?(q=m,m=void 0):typeof m=="function"&&(V=m,m=void 0):arguments.length===2?typeof m=="number"?typeof p=="function"?(V=p,p=void 0):typeof p!="number"&&(q=p,p=void 0):(q=m,V=p,m=void 0,p=void 0):arguments.length===3&&(typeof p=="number"?typeof q=="function"&&(V=q,q=void 0):(V=q,q=p,p=void 0)),q=q||{},m===void 0&&(m=q.bits||2048),p===void 0&&(p=q.e||65537),!t.options.usePureJavaScript&&!q.prng&&m>=256&&m<=16384&&(p===65537||p===3)){if(V){if(w("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:m,publicExponent:p,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(j,N,M){if(j)return V(j);V(null,{privateKey:h.privateKeyFromPem(M),publicKey:h.publicKeyFromPem(N)})});if(L("generateKey")&&L("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:m,publicExponent:S(p),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(j){return u.globalScope.crypto.subtle.exportKey("pkcs8",j.privateKey)}).then(void 0,function(j){V(j)}).then(function(j){if(j){var N=h.privateKeyFromAsn1(s.fromDer(t.util.createBuffer(j)));V(null,{privateKey:N,publicKey:h.setRsaPublicKey(N.n,N.e)})}});if(D("generateKey")&&D("exportKey")){var $=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:m,publicExponent:S(p),hash:{name:"SHA-256"}},!0,["sign","verify"]);$.oncomplete=function(j){var N=j.target.result,M=u.globalScope.msCrypto.subtle.exportKey("pkcs8",N.privateKey);M.oncomplete=function(ee){var oe=ee.target.result,ae=h.privateKeyFromAsn1(s.fromDer(t.util.createBuffer(oe)));V(null,{privateKey:ae,publicKey:h.setRsaPublicKey(ae.n,ae.e)})},M.onerror=function(ee){V(ee)}},$.onerror=function(j){V(j)};return}}else if(w("generateKeyPairSync")){var E=i.generateKeyPairSync("rsa",{modulusLength:m,publicExponent:p,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:h.privateKeyFromPem(E.privateKey),publicKey:h.publicKeyFromPem(E.publicKey)}}}var B=h.rsa.createKeyPairGenerationState(m,p,q);if(!V)return h.rsa.stepKeyPairGenerationState(B,0),B.keys;k(B,q,V)},h.setRsaPublicKey=h.rsa.setPublicKey=function(m,p){var q={n:m,e:p};return q.encrypt=function(V,$,E){if(typeof $=="string"?$=$.toUpperCase():$===void 0&&($="RSAES-PKCS1-V1_5"),$==="RSAES-PKCS1-V1_5")$={encode:function(j,N,M){return T(j,N,2).getBytes()}};else if($==="RSA-OAEP"||$==="RSAES-OAEP")$={encode:function(j,N){return t.pkcs1.encode_rsa_oaep(N,j,E)}};else if(["RAW","NONE","NULL",null].indexOf($)!==-1)$={encode:function(j){return j}};else if(typeof $=="string")throw new Error('Unsupported encryption scheme: "'+$+'".');var B=$.encode(V,q,!0);return h.rsa.encrypt(B,q,!0)},q.verify=function(V,$,E,B){typeof E=="string"?E=E.toUpperCase():E===void 0&&(E="RSASSA-PKCS1-V1_5"),B===void 0&&(B={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in B||(B._parseAllDigestBytes=!0),E==="RSASSA-PKCS1-V1_5"?E={verify:function(N,M){M=O(M,q,!0);var ee=s.fromDer(M,{parseAllBytes:B._parseAllDigestBytes}),oe={},ae=[];if(!s.validate(ee,I,oe,ae)){var pe=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw pe.errors=ae,pe}var _e=s.derToOid(oe.algorithmIdentifier);if(!(_e===t.oids.md2||_e===t.oids.md5||_e===t.oids.sha1||_e===t.oids.sha224||_e===t.oids.sha256||_e===t.oids.sha384||_e===t.oids.sha512||_e===t.oids["sha512-224"]||_e===t.oids["sha512-256"])){var pe=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw pe.oid=_e,pe}if((_e===t.oids.md2||_e===t.oids.md5)&&!("parameters"in oe))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return N===oe.digest}}:(E==="NONE"||E==="NULL"||E===null)&&(E={verify:function(N,M){return M=O(M,q,!0),N===M}});var j=h.rsa.decrypt($,q,!0,!1);return E.verify(V,j,q.n.bitLength())},q},h.setRsaPrivateKey=h.rsa.setPrivateKey=function(m,p,q,V,$,E,B,j){var N={n:m,e:p,d:q,p:V,q:$,dP:E,dQ:B,qInv:j};return N.decrypt=function(M,ee,oe){typeof ee=="string"?ee=ee.toUpperCase():ee===void 0&&(ee="RSAES-PKCS1-V1_5");var ae=h.rsa.decrypt(M,N,!1,!1);if(ee==="RSAES-PKCS1-V1_5")ee={decode:O};else if(ee==="RSA-OAEP"||ee==="RSAES-OAEP")ee={decode:function(pe,_e){return t.pkcs1.decode_rsa_oaep(_e,pe,oe)}};else if(["RAW","NONE","NULL",null].indexOf(ee)!==-1)ee={decode:function(pe){return pe}};else throw new Error('Unsupported encryption scheme: "'+ee+'".');return ee.decode(ae,N,!1)},N.sign=function(M,ee){var oe=!1;typeof ee=="string"&&(ee=ee.toUpperCase()),ee===void 0||ee==="RSASSA-PKCS1-V1_5"?(ee={encode:C},oe=1):(ee==="NONE"||ee==="NULL"||ee===null)&&(ee={encode:function(){return M}},oe=1);var ae=ee.encode(M,N.n.bitLength());return h.rsa.encrypt(ae,N,oe)},N},h.wrapRsaPrivateKey=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(h.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(m).getBytes())])},h.privateKeyFromAsn1=function(m){var p={},q=[];if(s.validate(m,a,p,q)&&(m=s.fromDer(t.util.createBuffer(p.privateKey))),p={},q=[],!s.validate(m,d,p,q)){var V=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw V.errors=q,V}var $,E,B,j,N,M,ee,oe;return $=t.util.createBuffer(p.privateKeyModulus).toHex(),E=t.util.createBuffer(p.privateKeyPublicExponent).toHex(),B=t.util.createBuffer(p.privateKeyPrivateExponent).toHex(),j=t.util.createBuffer(p.privateKeyPrime1).toHex(),N=t.util.createBuffer(p.privateKeyPrime2).toHex(),M=t.util.createBuffer(p.privateKeyExponent1).toHex(),ee=t.util.createBuffer(p.privateKeyExponent2).toHex(),oe=t.util.createBuffer(p.privateKeyCoefficient).toHex(),h.setRsaPrivateKey(new r($,16),new r(E,16),new r(B,16),new r(j,16),new r(N,16),new r(M,16),new r(ee,16),new r(oe,16))},h.privateKeyToAsn1=h.privateKeyToRSAPrivateKey=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.qInv))])},h.publicKeyFromAsn1=function(m){var p={},q=[];if(s.validate(m,g,p,q)){var V=s.derToOid(p.publicKeyOid);if(V!==h.oids.rsaEncryption){var $=new Error("Cannot read public key. Unknown OID.");throw $.oid=V,$}m=p.rsaPublicKey}if(q=[],!s.validate(m,f,p,q)){var $=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw $.errors=q,$}var E=t.util.createBuffer(p.publicKeyModulus).toHex(),B=t.util.createBuffer(p.publicKeyExponent).toHex();return h.setRsaPublicKey(new r(E,16),new r(B,16))},h.publicKeyToAsn1=h.publicKeyToSubjectPublicKeyInfo=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(h.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[h.publicKeyToRSAPublicKey(m)])])},h.publicKeyToRSAPublicKey=function(m){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,y(m.e))])};function T(m,p,q){var V=t.util.createBuffer(),$=Math.ceil(p.n.bitLength()/8);if(m.length>$-11){var E=new Error("Message is too long for PKCS#1 v1.5 padding.");throw E.length=m.length,E.max=$-11,E}V.putByte(0),V.putByte(q);var B=$-3-m.length,j;if(q===0||q===1){j=q===0?0:255;for(var N=0;N0;){for(var M=0,ee=t.random.getBytes(B),N=0;N"u")throw new Error("Encryption block is invalid.");var N=0;if(j===0){N=$-3-V;for(var M=0;M1;){if(E.getByte()!==255){--E.read;break}++N}else if(j===2)for(N=0;E.length()>1;){if(E.getByte()===0){--E.read;break}++N}var ee=E.getByte();if(ee!==0||N!==$-3-E.length())throw new Error("Encryption block is invalid.");return E.getBytes()}function k(m,p,q){typeof p=="function"&&(q=p,p={}),p=p||{};var V={algorithm:{name:p.algorithm||"PRIMEINC",options:{workers:p.workers||2,workLoad:p.workLoad||100,workerScript:p.workerScript}}};"prng"in p&&(V.prng=p.prng),$();function $(){E(m.pBits,function(j,N){if(j)return q(j);if(m.p=N,m.q!==null)return B(j,m.q);E(m.qBits,B)})}function E(j,N){t.prime.generateProbablePrime(j,V,N)}function B(j,N){if(j)return q(j);if(m.q=N,m.p.compareTo(m.q)<0){var M=m.p;m.p=m.q,m.q=M}if(m.p.subtract(r.ONE).gcd(m.e).compareTo(r.ONE)!==0){m.p=null,$();return}if(m.q.subtract(r.ONE).gcd(m.e).compareTo(r.ONE)!==0){m.q=null,E(m.qBits,B);return}if(m.p1=m.p.subtract(r.ONE),m.q1=m.q.subtract(r.ONE),m.phi=m.p1.multiply(m.q1),m.phi.gcd(m.e).compareTo(r.ONE)!==0){m.p=m.q=null,$();return}if(m.n=m.p.multiply(m.q),m.n.bitLength()!==m.bits){m.q=null,E(m.qBits,B);return}var ee=m.e.modInverse(m.phi);m.keys={privateKey:h.rsa.setPrivateKey(m.n,m.e,ee,m.p,m.q,ee.mod(m.p1),ee.mod(m.q1),m.q.modInverse(m.p)),publicKey:h.rsa.setPublicKey(m.n,m.e)},q(null,m.keys)}}function y(m){var p=m.toString(16);p[0]>="8"&&(p="00"+p);var q=t.util.hexToBytes(p);return q.length>1&&(q.charCodeAt(0)===0&&!(q.charCodeAt(1)&128)||q.charCodeAt(0)===255&&(q.charCodeAt(1)&128)===128)?q.substr(1):q}function R(m){return m<=100?27:m<=150?18:m<=200?15:m<=250?12:m<=300?9:m<=350?8:m<=400?7:m<=500?6:m<=600?5:m<=800?4:m<=1250?3:2}function w(m){return t.util.isNodejs&&typeof i[m]=="function"}function L(m){return typeof u.globalScope<"u"&&typeof u.globalScope.crypto=="object"&&typeof u.globalScope.crypto.subtle=="object"&&typeof u.globalScope.crypto.subtle[m]=="function"}function D(m){return typeof u.globalScope<"u"&&typeof u.globalScope.msCrypto=="object"&&typeof u.globalScope.msCrypto.subtle=="object"&&typeof u.globalScope.msCrypto.subtle[m]=="function"}function S(m){for(var p=t.util.hexToBytes(m.toString(16)),q=new Uint8Array(p.length),V=0;V{var t=lt();Pa(),ki(),ih(),ho(),Ba(),Fp(),ks(),ui(),ib(),ah(),Et(),typeof r>"u"&&(r=t.jsbn.BigInteger);var r,i=t.asn1,s=t.pki=t.pki||{};n.exports=s.pbe=t.pbe=t.pbe||{};var u=s.oids,h={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"}]},c={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"}]};s.encryptPrivateKeyInfo=function(C,v,T){T=T||{},T.saltSize=T.saltSize||8,T.count=T.count||2048,T.algorithm=T.algorithm||"aes128",T.prfAlgorithm=T.prfAlgorithm||"sha1";var O=t.random.getBytesSync(T.saltSize),k=T.count,y=i.integerToDer(k),R,w,L;if(T.algorithm.indexOf("aes")===0||T.algorithm==="des"){var D,S,m;switch(T.algorithm){case"aes128":R=16,D=16,S=u["aes128-CBC"],m=t.aes.createEncryptionCipher;break;case"aes192":R=24,D=16,S=u["aes192-CBC"],m=t.aes.createEncryptionCipher;break;case"aes256":R=32,D=16,S=u["aes256-CBC"],m=t.aes.createEncryptionCipher;break;case"des":R=8,D=8,S=u.desCBC,m=t.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=T.algorithm,p}var q="hmacWith"+T.prfAlgorithm.toUpperCase(),V=g(q),$=t.pkcs5.pbkdf2(v,O,k,R,V),E=t.random.getBytesSync(D),B=m($);B.start(E),B.update(i.toDer(C)),B.finish(),L=B.output.getBytes();var j=I(O,y,R,q);w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(u.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(u.pkcs5PBKDF2).getBytes()),j]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(S).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,E)])])])}else if(T.algorithm==="3des"){R=24;var N=new t.util.ByteBuffer(O),$=s.pbe.generatePkcs12Key(v,N,1,k,R),E=s.pbe.generatePkcs12Key(v,N,2,k,R),B=t.des.createEncryptionCipher($);B.start(E),B.update(i.toDer(C)),B.finish(),L=B.output.getBytes(),w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(u["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,y.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=T.algorithm,p}var M=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[w,i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,L)]);return M},s.decryptPrivateKeyInfo=function(C,v){var T=null,O={},k=[];if(!i.validate(C,h,O,k)){var y=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw y.errors=k,y}var R=i.derToOid(O.encryptionOid),w=s.pbe.getCipher(R,O.encryptionParams,v),L=t.util.createBuffer(O.encryptedData);return w.update(L),w.finish()&&(T=i.fromDer(w.output)),T},s.encryptedPrivateKeyToPem=function(C,v){var T={type:"ENCRYPTED PRIVATE KEY",body:i.toDer(C).getBytes()};return t.pem.encode(T,{maxline:v})},s.encryptedPrivateKeyFromPem=function(C){var v=t.pem.decode(C)[0];if(v.type!=="ENCRYPTED PRIVATE KEY"){var T=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw T.headerType=v.type,T}if(v.procType&&v.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return i.fromDer(v.body)},s.encryptRsaPrivateKey=function(C,v,T){if(T=T||{},!T.legacy){var O=s.wrapRsaPrivateKey(s.privateKeyToAsn1(C));return O=s.encryptPrivateKeyInfo(O,v,T),s.encryptedPrivateKeyToPem(O)}var k,y,R,w;switch(T.algorithm){case"aes128":k="AES-128-CBC",R=16,y=t.random.getBytesSync(16),w=t.aes.createEncryptionCipher;break;case"aes192":k="AES-192-CBC",R=24,y=t.random.getBytesSync(16),w=t.aes.createEncryptionCipher;break;case"aes256":k="AES-256-CBC",R=32,y=t.random.getBytesSync(16),w=t.aes.createEncryptionCipher;break;case"3des":k="DES-EDE3-CBC",R=24,y=t.random.getBytesSync(8),w=t.des.createEncryptionCipher;break;case"des":k="DES-CBC",R=8,y=t.random.getBytesSync(8),w=t.des.createEncryptionCipher;break;default:var L=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+T.algorithm+'".');throw L.algorithm=T.algorithm,L}var D=t.pbe.opensslDeriveBytes(v,y.substr(0,8),R),S=w(D);S.start(y),S.update(i.toDer(s.privateKeyToAsn1(C))),S.finish();var m={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:k,parameters:t.util.bytesToHex(y).toUpperCase()},body:S.output.getBytes()};return t.pem.encode(m)},s.decryptRsaPrivateKey=function(C,v){var T=null,O=t.pem.decode(C)[0];if(O.type!=="ENCRYPTED PRIVATE KEY"&&O.type!=="PRIVATE KEY"&&O.type!=="RSA PRIVATE KEY"){var k=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw k.headerType=k,k}if(O.procType&&O.procType.type==="ENCRYPTED"){var y,R;switch(O.dekInfo.algorithm){case"DES-CBC":y=8,R=t.des.createDecryptionCipher;break;case"DES-EDE3-CBC":y=24,R=t.des.createDecryptionCipher;break;case"AES-128-CBC":y=16,R=t.aes.createDecryptionCipher;break;case"AES-192-CBC":y=24,R=t.aes.createDecryptionCipher;break;case"AES-256-CBC":y=32,R=t.aes.createDecryptionCipher;break;case"RC2-40-CBC":y=5,R=function(m){return t.rc2.createDecryptionCipher(m,40)};break;case"RC2-64-CBC":y=8,R=function(m){return t.rc2.createDecryptionCipher(m,64)};break;case"RC2-128-CBC":y=16,R=function(m){return t.rc2.createDecryptionCipher(m,128)};break;default:var k=new Error('Could not decrypt private key; unsupported encryption algorithm "'+O.dekInfo.algorithm+'".');throw k.algorithm=O.dekInfo.algorithm,k}var w=t.util.hexToBytes(O.dekInfo.parameters),L=t.pbe.opensslDeriveBytes(v,w.substr(0,8),y),D=R(L);if(D.start(w),D.update(t.util.createBuffer(O.body)),D.finish())T=D.output.getBytes();else return T}else T=O.body;return O.type==="ENCRYPTED PRIVATE KEY"?T=s.decryptPrivateKeyInfo(i.fromDer(T),v):T=i.fromDer(T),T!==null&&(T=s.privateKeyFromAsn1(T)),T},s.pbe.generatePkcs12Key=function(C,v,T,O,k,y){var R,w;if(typeof y>"u"||y===null){if(!("sha1"in t.md))throw new Error('"sha1" hash algorithm unavailable.');y=t.md.sha1.create()}var L=y.digestLength,D=y.blockLength,S=new t.util.ByteBuffer,m=new t.util.ByteBuffer;if(C!=null){for(w=0;w=0;w--)Ce=Ce>>8,Ce+=pe.at(w)+qe.at(w),qe.setAt(w,Ce&255);Re.putBuffer(qe)}N=Re,S.putBuffer(oe)}return S.truncate(S.length()-k),S},s.pbe.getCipher=function(C,v,T){switch(C){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(C,v,T);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(C,v,T);default:var O=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw O.oid=C,O.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],O}},s.pbe.getCipherForPBES2=function(C,v,T){var O={},k=[];if(!i.validate(v,c,O,k)){var y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw y.errors=k,y}if(C=i.derToOid(O.kdfOid),C!==s.oids.pkcs5PBKDF2){var y=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw y.oid=C,y.supportedOids=["pkcs5PBKDF2"],y}if(C=i.derToOid(O.encOid),C!==s.oids["aes128-CBC"]&&C!==s.oids["aes192-CBC"]&&C!==s.oids["aes256-CBC"]&&C!==s.oids["des-EDE3-CBC"]&&C!==s.oids.desCBC){var y=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw y.oid=C,y.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],y}var R=O.kdfSalt,w=t.util.createBuffer(O.kdfIterationCount);w=w.getInt(w.length()<<3);var L,D;switch(s.oids[C]){case"aes128-CBC":L=16,D=t.aes.createDecryptionCipher;break;case"aes192-CBC":L=24,D=t.aes.createDecryptionCipher;break;case"aes256-CBC":L=32,D=t.aes.createDecryptionCipher;break;case"des-EDE3-CBC":L=24,D=t.des.createDecryptionCipher;break;case"desCBC":L=8,D=t.des.createDecryptionCipher;break}var S=f(O.prfOid),m=t.pkcs5.pbkdf2(T,R,w,L,S),p=O.encIv,q=D(m);return q.start(p),q},s.pbe.getCipherForPKCS12PBE=function(C,v,T){var O={},k=[];if(!i.validate(v,a,O,k)){var y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw y.errors=k,y}var R=t.util.createBuffer(O.salt),w=t.util.createBuffer(O.iterations);w=w.getInt(w.length()<<3);var L,D,S;switch(C){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:L=24,D=8,S=t.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:L=5,D=8,S=function($,E){var B=t.rc2.createDecryptionCipher($,40);return B.start(E,null),B};break;default:var y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw y.oid=C,y}var m=f(O.prfOid),p=s.pbe.generatePkcs12Key(T,R,1,w,L,m);m.start();var q=s.pbe.generatePkcs12Key(T,R,2,w,D,m);return S(p,q)},s.pbe.opensslDeriveBytes=function(C,v,T,O){if(typeof O>"u"||O===null){if(!("md5"in t.md))throw new Error('"md5" hash algorithm unavailable.');O=t.md.md5.create()}v===null&&(v="");for(var k=[d(O,C+v)],y=16,R=1;y{var t=lt();ki(),Et();var r=t.asn1,i=n.exports=t.pkcs7asn1=t.pkcs7asn1||{};t.pkcs7=t.pkcs7||{},t.pkcs7.asn1=i;var s={name:"ContentInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=s;var u={name:"EncryptedContentInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:r.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(u)},i.encryptedDataValidator={name:"EncryptedData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"}].concat(u)};var h={name:"SignerInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:r.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,capture:"signerInfos",optional:!0,value:[h]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:r.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}}),lb=Qe((e,n)=>{var t=lt();Et(),t.mgf=t.mgf||{};var r=n.exports=t.mgf.mgf1=t.mgf1=t.mgf1||{};r.create=function(i){var s={generate:function(u,h){for(var c=new t.util.ByteBuffer,a=Math.ceil(h/i.digestLength),d=0;d{var t=lt();lb(),n.exports=t.mgf=t.mgf||{},t.mgf.mgf1=t.mgf1}),$p=Qe((e,n)=>{var t=lt();ui(),Et();var r=n.exports=t.pss=t.pss||{};r.create=function(i){arguments.length===3&&(i={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var s=i.md,u=i.mgf,h=s.digestLength,c=i.salt||null;typeof c=="string"&&(c=t.util.createBuffer(c));var a;if("saltLength"in i)a=i.saltLength;else if(c!==null)a=c.length();else throw new Error("Salt length not specified or specific salt not given.");if(c!==null&&c.length()!==a)throw new Error("Given salt length does not match length of given salt.");var d=i.prng||t.random,f={};return f.encode=function(g,I){var C,v=I-1,T=Math.ceil(v/8),O=g.digest().getBytes();if(T>8*T-v&255;return m=String.fromCharCode(m.charCodeAt(0)&~p)+m.substr(1),m+R+String.fromCharCode(188)},f.verify=function(g,I,C){var v,T=C-1,O=Math.ceil(T/8);if(I=I.substr(-O),O>8*O-T&255;if(y.charCodeAt(0)&w)throw new Error("Bits beyond keysize not zero as expected.");var L=u.generate(R,k),D="";for(v=0;v{var t=lt();Pa(),ki(),ih(),ho(),$5(),Ba(),ks(),$p(),ah(),Et();var r=t.asn1,i=n.exports=t.pki=t.pki||{},s=i.oids,u={};u.CN=s.commonName,u.commonName="CN",u.C=s.countryName,u.countryName="C",u.L=s.localityName,u.localityName="L",u.ST=s.stateOrProvinceName,u.stateOrProvinceName="ST",u.O=s.organizationName,u.organizationName="O",u.OU=s.organizationalUnitName,u.organizationalUnitName="OU",u.E=s.emailAddress,u.emailAddress="E";var h=t.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:r.Class.UNIVERSAL,type:r.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:r.Class.UNIVERSAL,type:r.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:r.Class.UNIVERSAL,type:r.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:r.Class.UNIVERSAL,type:r.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},h,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:r.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:r.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},a={name:"rsapss",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:r.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:r.Class.UNIVERSAL,type:r.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:r.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:r.Class.UNIVERSAL,type:r.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},d={name:"CertificationRequestInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},h,{name:"CertificationRequestInfo.attributes",tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0}]}]}]},f={name:"CertificationRequest",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[d,{name:"CertificationRequest.signatureAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};i.RDNAttributesAsArray=function(S,m){for(var p=[],q,V,$,E=0;E2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(j.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(E.validity.notBefore=j[0],E.validity.notAfter=j[1],E.tbsCertificate=p.tbsCertificate,m){E.md=C({signatureOid:E.signatureOid,type:"certificate"});var N=r.toDer(E.tbsCertificate);E.md.update(N.getBytes())}var M=t.md.sha1.create(),ee=r.toDer(p.certIssuer);M.update(ee.getBytes()),E.issuer.getField=function(pe){return g(E.issuer,pe)},E.issuer.addField=function(pe){O([pe]),E.issuer.attributes.push(pe)},E.issuer.attributes=i.RDNAttributesAsArray(p.certIssuer),p.certIssuerUniqueId&&(E.issuer.uniqueId=p.certIssuerUniqueId),E.issuer.hash=M.digest().toHex();var oe=t.md.sha1.create(),ae=r.toDer(p.certSubject);return oe.update(ae.getBytes()),E.subject.getField=function(pe){return g(E.subject,pe)},E.subject.addField=function(pe){O([pe]),E.subject.attributes.push(pe)},E.subject.attributes=i.RDNAttributesAsArray(p.certSubject),p.certSubjectUniqueId&&(E.subject.uniqueId=p.certSubjectUniqueId),E.subject.hash=oe.digest().toHex(),p.certExtensions?E.extensions=i.certificateExtensionsFromAsn1(p.certExtensions):E.extensions=[],E.publicKey=i.publicKeyFromAsn1(p.subjectPublicKeyInfo),E},i.certificateExtensionsFromAsn1=function(S){for(var m=[],p=0;p1&&(q=p.value.charCodeAt(1),V=p.value.length>2?p.value.charCodeAt(2):0),m.digitalSignature=(q&128)===128,m.nonRepudiation=(q&64)===64,m.keyEncipherment=(q&32)===32,m.dataEncipherment=(q&16)===16,m.keyAgreement=(q&8)===8,m.keyCertSign=(q&4)===4,m.cRLSign=(q&2)===2,m.encipherOnly=(q&1)===1,m.decipherOnly=(V&128)===128}else if(m.name==="basicConstraints"){var p=r.fromDer(m.value);p.value.length>0&&p.value[0].type===r.Type.BOOLEAN?m.cA=p.value[0].value.charCodeAt(0)!==0:m.cA=!1;var $=null;p.value.length>0&&p.value[0].type===r.Type.INTEGER?$=p.value[0].value:p.value.length>1&&($=p.value[1].value),$!==null&&(m.pathLenConstraint=r.derToInteger($))}else if(m.name==="extKeyUsage")for(var p=r.fromDer(m.value),E=0;E1&&(q=p.value.charCodeAt(1)),m.client=(q&128)===128,m.server=(q&64)===64,m.email=(q&32)===32,m.objsign=(q&16)===16,m.reserved=(q&8)===8,m.sslCA=(q&4)===4,m.emailCA=(q&2)===2,m.objCA=(q&1)===1}else if(m.name==="subjectAltName"||m.name==="issuerAltName"){m.altNames=[];for(var j,p=r.fromDer(m.value),N=0;N"u"&&(m.type&&m.type in i.oids?m.name=i.oids[m.type]:m.shortName&&m.shortName in u&&(m.name=i.oids[u[m.shortName]])),typeof m.type>"u")if(m.name&&m.name in i.oids)m.type=i.oids[m.name];else{var q=new Error("Attribute type not specified.");throw q.attribute=m,q}if(typeof m.shortName>"u"&&m.name&&m.name in u&&(m.shortName=u[m.name]),m.type===s.extensionRequest&&(m.valueConstructed=!0,m.valueTagClass=r.Type.SEQUENCE,!m.value&&m.extensions)){m.value=[];for(var V=0;V"u"){var q=new Error("Attribute value not specified.");throw q.attribute=m,q}}}function k(S,m){if(m=m||{},typeof S.name>"u"&&S.id&&S.id in i.oids&&(S.name=i.oids[S.id]),typeof S.id>"u")if(S.name&&S.name in i.oids)S.id=i.oids[S.name];else{var p=new Error("Extension ID not specified.");throw p.extension=S,p}if(typeof S.value<"u")return S;if(S.name==="keyUsage"){var q=0,V=0,$=0;S.digitalSignature&&(V|=128,q=7),S.nonRepudiation&&(V|=64,q=6),S.keyEncipherment&&(V|=32,q=5),S.dataEncipherment&&(V|=16,q=4),S.keyAgreement&&(V|=8,q=3),S.keyCertSign&&(V|=4,q=2),S.cRLSign&&(V|=2,q=1),S.encipherOnly&&(V|=1,q=0),S.decipherOnly&&($|=128,q=7);var E=String.fromCharCode(q);$!==0?E+=String.fromCharCode(V)+String.fromCharCode($):V!==0&&(E+=String.fromCharCode(V)),S.value=r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,E)}else if(S.name==="basicConstraints")S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),S.cA&&S.value.value.push(r.create(r.Class.UNIVERSAL,r.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in S&&S.value.value.push(r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(S.pathLenConstraint).getBytes()));else if(S.name==="extKeyUsage"){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);var B=S.value.value;for(var j in S)S[j]===!0&&(j in s?B.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(s[j]).getBytes())):j.indexOf(".")!==-1&&B.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(j).getBytes())))}else if(S.name==="nsCertType"){var q=0,V=0;S.client&&(V|=128,q=7),S.server&&(V|=64,q=6),S.email&&(V|=32,q=5),S.objsign&&(V|=16,q=4),S.reserved&&(V|=8,q=3),S.sslCA&&(V|=4,q=2),S.emailCA&&(V|=2,q=1),S.objCA&&(V|=1,q=0);var E=String.fromCharCode(q);V!==0&&(E+=String.fromCharCode(V)),S.value=r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,E)}else if(S.name==="subjectAltName"||S.name==="issuerAltName"){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);for(var N,M=0;M128)throw new Error('Invalid "nsComment" content.');S.value=r.create(r.Class.UNIVERSAL,r.Type.IA5STRING,!1,S.comment)}else if(S.name==="subjectKeyIdentifier"&&m.cert){var ee=m.cert.generateSubjectKeyIdentifier();S.subjectKeyIdentifier=ee.toHex(),S.value=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,ee.getBytes())}else if(S.name==="authorityKeyIdentifier"&&m.cert){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);var B=S.value.value;if(S.keyIdentifier){var oe=S.keyIdentifier===!0?m.cert.generateSubjectKeyIdentifier().getBytes():S.keyIdentifier;B.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!1,oe))}if(S.authorityCertIssuer){var ae=[r.create(r.Class.CONTEXT_SPECIFIC,4,!0,[T(S.authorityCertIssuer===!0?m.cert.issuer:S.authorityCertIssuer)])];B.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,ae))}if(S.serialNumber){var pe=t.util.hexToBytes(S.serialNumber===!0?m.cert.serialNumber:S.serialNumber);B.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!1,pe))}}else if(S.name==="cRLDistributionPoints"){S.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);for(var B=S.value.value,_e=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),Re=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]),N,M=0;M"u"){var p=new Error("Extension value not specified.");throw p.extension=S,p}return S}function y(S,m){switch(S){case s["RSASSA-PSS"]:var p=[];return m.hash.algorithmOid!==void 0&&p.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(m.hash.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")])])),m.mgf.algorithmOid!==void 0&&p.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(m.mgf.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(m.mgf.hash.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")])])])),m.saltLength!==void 0&&p.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(m.saltLength).getBytes())])),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,p);default:return r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")}}function R(S){var m=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]);if(S.attributes.length===0)return m;for(var p=S.attributes,q=0;q=w&&S0&&q.value.push(i.certificateExtensionsToAsn1(S.extensions)),q},i.getCertificationRequestInfo=function(S){var m=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(S.version).getBytes()),T(S.subject),i.publicKeyToAsn1(S.publicKey),R(S)]);return m},i.distinguishedNameToAsn1=function(S){return T(S)},i.certificateToAsn1=function(S){var m=S.tbsCertificate||i.getTBSCertificate(S);return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[m,r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(S.signatureOid).getBytes()),y(S.signatureOid,S.signatureParameters)]),r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,String.fromCharCode(0)+S.signature)])},i.certificateExtensionsToAsn1=function(S){var m=r.create(r.Class.CONTEXT_SPECIFIC,3,!0,[]),p=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);m.value.push(p);for(var q=0;q"u"&&(V=new Date);var $=!0,E=null,B=0;do{var j=m.shift(),N=null,M=!1;if(V&&(Vj.validity.notAfter)&&(E={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:j.validity.notBefore,notAfter:j.validity.notAfter,now:V}),E===null){if(N=m[0]||S.getIssuer(j),N===null&&j.isIssuer(j)&&(M=!0,N=j),N){var ee=N;t.util.isArray(ee)||(ee=[ee]);for(var oe=!1;!oe&&ee.length>0;){N=ee.shift();try{oe=N.verify(j)}catch{}}oe||(E={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}E===null&&(!N||M)&&!S.hasCertificate(j)&&(E={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(E===null&&N&&!j.isIssuer(N)&&(E={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),E===null)for(var ae={keyUsage:!0,basicConstraints:!0},pe=0;E===null&&peRe.pathLenConstraint&&(E={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}}var $e=E===null?!0:E.error,Ie=p.verify?p.verify($e,B,q):$e;if(Ie===!0)E=null;else throw $e===!0&&(E={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(Ie||Ie===0)&&(typeof Ie=="object"&&!t.util.isArray(Ie)?(Ie.message&&(E.message=Ie.message),Ie.error&&(E.error=Ie.error)):typeof Ie=="string"&&(E.error=Ie)),E;$=!1,++B}while(m.length>0);return!0}}),cb=Qe((e,n)=>{var t=lt();ki(),Hu(),Ba(),ub(),sb(),ui(),ah(),Ku(),Et(),zp();var r=t.asn1,i=t.pki,s=n.exports=t.pkcs12=t.pkcs12||{},u={name:"ContentInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},h={name:"PFX",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"version"},u,{name:"PFX.macData",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:r.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},a={name:"Attribute",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,capture:"values"}]},d={name:"CertBag",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:r.Class.UNIVERSAL,type:r.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function f(O,k,y,R){for(var w=[],L=0;L=0&&w.push(S)}}return w}s.pkcs12FromAsn1=function(O,k,y){typeof k=="string"?(y=k,k=!0):k===void 0&&(k=!0);var R={},w=[];if(!r.validate(O,h,R,w)){var L=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw L.errors=L,L}var D={version:R.version.charCodeAt(0),safeContents:[],getBags:function(N){var M={},ee;return"localKeyId"in N?ee=N.localKeyId:"localKeyIdHex"in N&&(ee=t.util.hexToBytes(N.localKeyIdHex)),ee===void 0&&!("friendlyName"in N)&&"bagType"in N&&(M[N.bagType]=f(D.safeContents,null,null,N.bagType)),ee!==void 0&&(M.localKeyId=f(D.safeContents,"localKeyId",ee,N.bagType)),"friendlyName"in N&&(M.friendlyName=f(D.safeContents,"friendlyName",N.friendlyName,N.bagType)),M},getBagsByFriendlyName:function(N,M){return f(D.safeContents,"friendlyName",N,M)},getBagsByLocalKeyId:function(N,M){return f(D.safeContents,"localKeyId",N,M)}};if(R.version.charCodeAt(0)!==3){var L=new Error("PKCS#12 PFX of version other than 3 not supported.");throw L.version=R.version.charCodeAt(0),L}if(r.derToOid(R.contentType)!==i.oids.data){var L=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw L.oid=r.derToOid(R.contentType),L}var S=R.content.value[0];if(S.tagClass!==r.Class.UNIVERSAL||S.type!==r.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(S=g(S),R.mac){var m=null,p=0,q=r.derToOid(R.macAlgorithm);switch(q){case i.oids.sha1:m=t.md.sha1.create(),p=20;break;case i.oids.sha256:m=t.md.sha256.create(),p=32;break;case i.oids.sha384:m=t.md.sha384.create(),p=48;break;case i.oids.sha512:m=t.md.sha512.create(),p=64;break;case i.oids.md5:m=t.md.md5.create(),p=16;break}if(m===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+q);var V=new t.util.ByteBuffer(R.macSalt),$="macIterations"in R?parseInt(t.util.bytesToHex(R.macIterations),16):1,E=s.generateKey(y,V,3,$,p,m),B=t.hmac.create();B.start(m,E),B.update(S.value);var j=B.getMac();if(j.getBytes()!==R.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return I(D,S.value,k,y),D};function g(O){if(O.composed||O.constructed){for(var k=t.util.createBuffer(),y=0;y0&&(L=r.create(r.Class.UNIVERSAL,r.Type.SET,!0,m));var p=[],q=[];k!==null&&(t.util.isArray(k)?q=k:q=[k]);for(var V=[],$=0;$0){var N=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,V),M=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(N).getBytes())])]);p.push(M)}var ee=null;if(O!==null){var oe=i.wrapRsaPrivateKey(i.privateKeyToAsn1(O));y===null?ee=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.keyBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[oe]),L]):ee=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(oe,y,R)]),L]);var ae=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[ee]),pe=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(ae).getBytes())])]);p.push(pe)}var _e=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,p),Re;if(R.useMac){var S=t.md.sha1.create(),qe=new t.util.ByteBuffer(t.random.getBytes(R.saltSize)),Ce=R.count,O=s.generateKey(y,qe,3,Ce,20),$e=t.hmac.create();$e.start(S,O),$e.update(r.toDer(_e).getBytes());var Ie=$e.getMac();Re=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.sha1).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,Ie.getBytes())]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,qe.getBytes()),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(Ce).getBytes())])}return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(3).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(_e).getBytes())])]),Re])},s.generateKey=t.pbe.generatePkcs12Key}),hb=Qe((e,n)=>{var t=lt();ki(),Ba(),sb(),ks(),Fp(),cb(),$p(),ah(),Et(),zp();var r=t.asn1,i=n.exports=t.pki=t.pki||{};i.pemToDer=function(s){var u=t.pem.decode(s)[0];if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return t.util.createBuffer(u.body)},i.privateKeyFromPem=function(s){var u=t.pem.decode(s)[0];if(u.type!=="PRIVATE KEY"&&u.type!=="RSA PRIVATE KEY"){var h=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw h.headerType=u.type,h}if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var c=r.fromDer(u.body);return i.privateKeyFromAsn1(c)},i.privateKeyToPem=function(s,u){var h={type:"RSA PRIVATE KEY",body:r.toDer(i.privateKeyToAsn1(s)).getBytes()};return t.pem.encode(h,{maxline:u})},i.privateKeyInfoToPem=function(s,u){var h={type:"PRIVATE KEY",body:r.toDer(s).getBytes()};return t.pem.encode(h,{maxline:u})}}),fb=Qe((e,n)=>{var t=lt();ki(),Hu(),Vp(),ks(),hb(),ui(),Ku(),Et();var r=function(x,X,Q,A){var K=t.util.createBuffer(),se=x.length>>1,te=se+(x.length&1),Ee=x.substr(0,te),xe=x.substr(se,te),je=t.util.createBuffer(),ge=t.hmac.create();Q=X+Q;var Le=Math.ceil(A/16),We=Math.ceil(A/20);ge.start("MD5",Ee);var rt=t.util.createBuffer();je.putBytes(Q);for(var He=0;He0&&(a.queue(x,a.createAlert(x,{level:a.Alert.Level.warning,description:a.Alert.Description.no_renegotiation})),a.flush(x)),x.process()},a.parseHelloMessage=function(x,X,Q){var A=null,K=x.entity===a.ConnectionEnd.client;if(Q<38)x.error(x,{message:K?"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 se=X.fragment,te=se.length();if(A={version:{major:se.getByte(),minor:se.getByte()},random:t.util.createBuffer(se.getBytes(32)),session_id:h(se,1),extensions:[]},K?(A.cipher_suite=se.getBytes(2),A.compression_method=se.getByte()):(A.cipher_suites=h(se,2),A.compression_methods=h(se,1)),te=Q-(te-se.length()),te>0){for(var Ee=h(se,2);Ee.length()>0;)A.extensions.push({type:[Ee.getByte(),Ee.getByte()],data:h(Ee,2)});if(!K)for(var xe=0;xe0;){var Le=ge.getByte();if(Le!==0)break;x.session.extensions.server_name.serverNameList.push(h(ge,2).getBytes())}}}if(x.session.version&&(A.version.major!==x.session.version.major||A.version.minor!==x.session.version.minor))return x.error(x,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});if(K)x.session.cipherSuite=a.getCipherSuite(A.cipher_suite);else for(var We=t.util.createBuffer(A.cipher_suites.bytes());We.length()>0&&(x.session.cipherSuite=a.getCipherSuite(We.getBytes(2)),x.session.cipherSuite===null););if(x.session.cipherSuite===null)return x.error(x,{message:"No cipher suites in common.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure},cipherSuite:t.util.bytesToHex(A.cipher_suite)});K?x.session.compressionMethod=A.compression_method:x.session.compressionMethod=a.CompressionMethod.none}return A},a.createSecurityParameters=function(x,X){var Q=x.entity===a.ConnectionEnd.client,A=X.random.bytes(),K=Q?x.session.sp.client_random:A,se=Q?A:a.createRandom().getBytes();x.session.sp={entity:x.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:x.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:K,server_random:se}},a.handleServerHello=function(x,X,Q){var A=a.parseHelloMessage(x,X,Q);if(!x.fail){if(A.version.minor<=x.version.minor)x.version.minor=A.version.minor;else return x.error(x,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});x.session.version=x.version;var K=A.session_id.bytes();K.length>0&&K===x.session.id?(x.expect=v,x.session.resuming=!0,x.session.sp.server_random=A.random.bytes()):(x.expect=f,x.session.resuming=!1,a.createSecurityParameters(x,A)),x.session.id=K,x.process()}},a.handleClientHello=function(x,X,Q){var A=a.parseHelloMessage(x,X,Q);if(!x.fail){var K=A.session_id.bytes(),se=null;if(x.sessionCache&&(se=x.sessionCache.getSession(K),se===null?K="":(se.version.major!==A.version.major||se.version.minor>A.version.minor)&&(se=null,K="")),K.length===0&&(K=t.random.getBytes(32)),x.session.id=K,x.session.clientHelloVersion=A.version,x.session.sp={},se)x.version=x.session.version=se.version,x.session.sp=se.sp;else{for(var te,Ee=1;Ee0;)se=h(K.certificate_list,3),te=t.asn1.fromDer(se),se=t.pki.certificateFromAsn1(te,!0),Ee.push(se)}catch(je){return x.error(x,{message:"Could not parse certificate list.",cause:je,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate}})}var xe=x.entity===a.ConnectionEnd.client;(xe||x.verifyClient===!0)&&Ee.length===0?x.error(x,{message:xe?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}}):Ee.length===0?x.expect=xe?g:w:(xe?x.session.serverCertificate=Ee[0]:x.session.clientCertificate=Ee[0],a.verifyCertificateChain(x,Ee)&&(x.expect=xe?g:w)),x.process()},a.handleServerKeyExchange=function(x,X,Q){if(Q>0)return x.error(x,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});x.expect=I,x.process()},a.handleClientKeyExchange=function(x,X,Q){if(Q<48)return x.error(x,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});var A=X.fragment,K={enc_pre_master_secret:h(A,2).getBytes()},se=null;if(x.getPrivateKey)try{se=x.getPrivateKey(x,x.session.serverCertificate),se=t.pki.privateKeyFromPem(se)}catch(xe){x.error(x,{message:"Could not get private key.",cause:xe,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}if(se===null)return x.error(x,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}});try{var te=x.session.sp;te.pre_master_secret=se.decrypt(K.enc_pre_master_secret);var Ee=x.session.clientHelloVersion;if(Ee.major!==te.pre_master_secret.charCodeAt(0)||Ee.minor!==te.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{te.pre_master_secret=t.random.getBytes(48)}x.expect=D,x.session.clientCertificate!==null&&(x.expect=L),x.process()},a.handleCertificateRequest=function(x,X,Q){if(Q<3)return x.error(x,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var A=X.fragment,K={certificate_types:h(A,1),certificate_authorities:h(A,2)};x.session.certificateRequest=K,x.expect=C,x.process()},a.handleCertificateVerify=function(x,X,Q){if(Q<2)return x.error(x,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var A=X.fragment;A.read-=4;var K=A.bytes();A.read+=4;var se={signature:h(A,2).getBytes()},te=t.util.createBuffer();te.putBuffer(x.session.md5.digest()),te.putBuffer(x.session.sha1.digest()),te=te.getBytes();try{var Ee=x.session.clientCertificate;if(!Ee.publicKey.verify(te,se.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");x.session.md5.update(K),x.session.sha1.update(K)}catch{return x.error(x,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure}})}x.expect=D,x.process()},a.handleServerHelloDone=function(x,X,Q){if(Q>0)return x.error(x,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.record_overflow}});if(x.serverCertificate===null){var A={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.insufficient_security}},K=0,se=x.verify(x,A.alert.description,K,[]);if(se!==!0)return(se||se===0)&&(typeof se=="object"&&!t.util.isArray(se)?(se.message&&(A.message=se.message),se.alert&&(A.alert.description=se.alert)):typeof se=="number"&&(A.alert.description=se)),x.error(x,A)}x.session.certificateRequest!==null&&(X=a.createRecord(x,{type:a.ContentType.handshake,data:a.createCertificate(x)}),a.queue(x,X)),X=a.createRecord(x,{type:a.ContentType.handshake,data:a.createClientKeyExchange(x)}),a.queue(x,X),x.expect=k;var te=function(Ee,xe){Ee.session.certificateRequest!==null&&Ee.session.clientCertificate!==null&&a.queue(Ee,a.createRecord(Ee,{type:a.ContentType.handshake,data:a.createCertificateVerify(Ee,xe)})),a.queue(Ee,a.createRecord(Ee,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),Ee.state.pending=a.createConnectionState(Ee),Ee.state.current.write=Ee.state.pending.write,a.queue(Ee,a.createRecord(Ee,{type:a.ContentType.handshake,data:a.createFinished(Ee)})),Ee.expect=v,a.flush(Ee),Ee.process()};if(x.session.certificateRequest===null||x.session.clientCertificate===null)return te(x,null);a.getClientSignature(x,te)},a.handleChangeCipherSpec=function(x,X){if(X.fragment.getByte()!==1)return x.error(x,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});var Q=x.entity===a.ConnectionEnd.client;(x.session.resuming&&Q||!x.session.resuming&&!Q)&&(x.state.pending=a.createConnectionState(x)),x.state.current.read=x.state.pending.read,(!x.session.resuming&&Q||x.session.resuming&&!Q)&&(x.state.pending=null),x.expect=Q?T:S,x.process()},a.handleFinished=function(x,X,Q){var A=X.fragment;A.read-=4;var K=A.bytes();A.read+=4;var se=X.fragment.getBytes();A=t.util.createBuffer(),A.putBuffer(x.session.md5.digest()),A.putBuffer(x.session.sha1.digest());var te=x.entity===a.ConnectionEnd.client,Ee=te?"server finished":"client finished",xe=x.session.sp,je=12,ge=r;if(A=ge(xe.master_secret,Ee,A.getBytes(),je),A.getBytes()!==se)return x.error(x,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decrypt_error}});x.session.md5.update(K),x.session.sha1.update(K),(x.session.resuming&&te||!x.session.resuming&&!te)&&(a.queue(x,a.createRecord(x,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),x.state.current.write=x.state.pending.write,x.state.pending=null,a.queue(x,a.createRecord(x,{type:a.ContentType.handshake,data:a.createFinished(x)}))),x.expect=te?O:m,x.handshaking=!1,++x.handshakes,x.peerCertificate=te?x.session.serverCertificate:x.session.clientCertificate,a.flush(x),x.isConnected=!0,x.connected(x),x.process()},a.handleAlert=function(x,X){var Q=X.fragment,A={level:Q.getByte(),description:Q.getByte()},K;switch(A.description){case a.Alert.Description.close_notify:K="Connection closed.";break;case a.Alert.Description.unexpected_message:K="Unexpected message.";break;case a.Alert.Description.bad_record_mac:K="Bad record MAC.";break;case a.Alert.Description.decryption_failed:K="Decryption failed.";break;case a.Alert.Description.record_overflow:K="Record overflow.";break;case a.Alert.Description.decompression_failure:K="Decompression failed.";break;case a.Alert.Description.handshake_failure:K="Handshake failure.";break;case a.Alert.Description.bad_certificate:K="Bad certificate.";break;case a.Alert.Description.unsupported_certificate:K="Unsupported certificate.";break;case a.Alert.Description.certificate_revoked:K="Certificate revoked.";break;case a.Alert.Description.certificate_expired:K="Certificate expired.";break;case a.Alert.Description.certificate_unknown:K="Certificate unknown.";break;case a.Alert.Description.illegal_parameter:K="Illegal parameter.";break;case a.Alert.Description.unknown_ca:K="Unknown certificate authority.";break;case a.Alert.Description.access_denied:K="Access denied.";break;case a.Alert.Description.decode_error:K="Decode error.";break;case a.Alert.Description.decrypt_error:K="Decrypt error.";break;case a.Alert.Description.export_restriction:K="Export restriction.";break;case a.Alert.Description.protocol_version:K="Unsupported protocol version.";break;case a.Alert.Description.insufficient_security:K="Insufficient security.";break;case a.Alert.Description.internal_error:K="Internal error.";break;case a.Alert.Description.user_canceled:K="User canceled.";break;case a.Alert.Description.no_renegotiation:K="Renegotiation not supported.";break;default:K="Unknown error.";break}if(A.description===a.Alert.Description.close_notify)return x.close();x.error(x,{message:K,send:!1,origin:x.entity===a.ConnectionEnd.client?"server":"client",alert:A}),x.process()},a.handleHandshake=function(x,X){var Q=X.fragment,A=Q.getByte(),K=Q.getInt24();if(K>Q.length())return x.fragmented=X,X.fragment=t.util.createBuffer(),Q.read-=4,x.process();x.fragmented=null,Q.read-=4;var se=Q.bytes(K+4);Q.read+=4,A in Re[x.entity][x.expect]?(x.entity===a.ConnectionEnd.server&&!x.open&&!x.fail&&(x.handshaking=!0,x.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:t.md.md5.create(),sha1:t.md.sha1.create()}),A!==a.HandshakeType.hello_request&&A!==a.HandshakeType.certificate_verify&&A!==a.HandshakeType.finished&&(x.session.md5.update(se),x.session.sha1.update(se)),Re[x.entity][x.expect][A](x,X,K)):a.handleUnexpected(x,X)},a.handleApplicationData=function(x,X){x.data.putBuffer(X.fragment),x.dataReady(x),x.process()},a.handleHeartbeat=function(x,X){var Q=X.fragment,A=Q.getByte(),K=Q.getInt16(),se=Q.getBytes(K);if(A===a.HeartbeatMessageType.heartbeat_request){if(x.handshaking||K>se.length)return x.process();a.queue(x,a.createRecord(x,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_response,se)})),a.flush(x)}else if(A===a.HeartbeatMessageType.heartbeat_response){if(se!==x.expectedHeartbeatPayload)return x.process();x.heartbeatReceived&&x.heartbeatReceived(x,t.util.createBuffer(se))}x.process()};var d=0,f=1,g=2,I=3,C=4,v=5,T=6,O=7,k=8,y=0,R=1,w=2,L=3,D=4,S=5,m=6,p=a.handleUnexpected,q=a.handleChangeCipherSpec,V=a.handleAlert,$=a.handleHandshake,E=a.handleApplicationData,B=a.handleHeartbeat,j=[];j[a.ConnectionEnd.client]=[[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[q,V,p,p,B],[p,V,$,p,B],[p,V,$,E,B],[p,V,$,p,B]],j[a.ConnectionEnd.server]=[[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[p,V,$,p,B],[q,V,p,p,B],[p,V,$,p,B],[p,V,$,E,B],[p,V,$,p,B]];var N=a.handleHelloRequest,M=a.handleServerHello,ee=a.handleCertificate,oe=a.handleServerKeyExchange,ae=a.handleCertificateRequest,pe=a.handleServerHelloDone,_e=a.handleFinished,Re=[];Re[a.ConnectionEnd.client]=[[p,p,M,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,ee,oe,ae,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,oe,ae,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,ae,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,pe,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,_e],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[N,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]];var qe=a.handleClientHello,Ce=a.handleClientKeyExchange,$e=a.handleCertificateVerify;Re[a.ConnectionEnd.server]=[[p,qe,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,ee,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,Ce,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,$e,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,_e],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]],a.generateKeys=function(x,X){var Q=r,A=X.client_random+X.server_random;x.session.resuming||(X.master_secret=Q(X.pre_master_secret,"master secret",A,48).bytes(),X.pre_master_secret=null),A=X.server_random+X.client_random;var K=2*X.mac_key_length+2*X.enc_key_length,se=x.version.major===a.Versions.TLS_1_0.major&&x.version.minor===a.Versions.TLS_1_0.minor;se&&(K+=2*X.fixed_iv_length);var te=Q(X.master_secret,"key expansion",A,K),Ee={client_write_MAC_key:te.getBytes(X.mac_key_length),server_write_MAC_key:te.getBytes(X.mac_key_length),client_write_key:te.getBytes(X.enc_key_length),server_write_key:te.getBytes(X.enc_key_length)};return se&&(Ee.client_write_IV=te.getBytes(X.fixed_iv_length),Ee.server_write_IV=te.getBytes(X.fixed_iv_length)),Ee},a.createConnectionState=function(x){var X=x.entity===a.ConnectionEnd.client,Q=function(){var se={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(te){return!0},compressionState:null,compressFunction:function(te){return!0},updateSequenceNumber:function(){se.sequenceNumber[1]===4294967295?(se.sequenceNumber[1]=0,++se.sequenceNumber[0]):++se.sequenceNumber[1]}};return se},A={read:Q(),write:Q()};if(A.read.update=function(se,te){return A.read.cipherFunction(te,A.read)?A.read.compressFunction(se,te,A.read)||se.error(se,{message:"Could not decompress record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decompression_failure}}):se.error(se,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_record_mac}}),!se.fail},A.write.update=function(se,te){return A.write.compressFunction(se,te,A.write)?A.write.cipherFunction(te,A.write)||se.error(se,{message:"Could not encrypt record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):se.error(se,{message:"Could not compress record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}),!se.fail},x.session){var K=x.session.sp;switch(x.session.cipherSuite.initSecurityParameters(K),K.keys=a.generateKeys(x,K),A.read.macKey=X?K.keys.server_write_MAC_key:K.keys.client_write_MAC_key,A.write.macKey=X?K.keys.client_write_MAC_key:K.keys.server_write_MAC_key,x.session.cipherSuite.initConnectionState(A,x,K),K.compression_algorithm){case a.CompressionMethod.none:break;case a.CompressionMethod.deflate:A.read.compressFunction=u,A.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return A},a.createRandom=function(){var x=new Date,X=+x+x.getTimezoneOffset()*6e4,Q=t.util.createBuffer();return Q.putInt32(X),Q.putBytes(t.random.getBytes(28)),Q},a.createRecord=function(x,X){if(!X.data)return null;var Q={type:X.type,version:{major:x.version.major,minor:x.version.minor},length:X.data.length(),fragment:X.data};return Q},a.createAlert=function(x,X){var Q=t.util.createBuffer();return Q.putByte(X.level),Q.putByte(X.description),a.createRecord(x,{type:a.ContentType.alert,data:Q})},a.createClientHello=function(x){x.session.clientHelloVersion={major:x.version.major,minor:x.version.minor};for(var X=t.util.createBuffer(),Q=0;Q0&&(Le+=2);var We=x.session.id,rt=We.length+1+2+4+28+2+K+1+te+Le,He=t.util.createBuffer();return He.putByte(a.HandshakeType.client_hello),He.putInt24(rt),He.putByte(x.version.major),He.putByte(x.version.minor),He.putBytes(x.session.sp.client_random),c(He,1,t.util.createBuffer(We)),c(He,2,X),c(He,1,se),Le>0&&c(He,2,Ee),He},a.createServerHello=function(x){var X=x.session.id,Q=X.length+1+2+4+28+2+1,A=t.util.createBuffer();return A.putByte(a.HandshakeType.server_hello),A.putInt24(Q),A.putByte(x.version.major),A.putByte(x.version.minor),A.putBytes(x.session.sp.server_random),c(A,1,t.util.createBuffer(X)),A.putByte(x.session.cipherSuite.id[0]),A.putByte(x.session.cipherSuite.id[1]),A.putByte(x.session.compressionMethod),A},a.createCertificate=function(x){var X=x.entity===a.ConnectionEnd.client,Q=null;if(x.getCertificate){var A;X?A=x.session.certificateRequest:A=x.session.extensions.server_name.serverNameList,Q=x.getCertificate(x,A)}var K=t.util.createBuffer();if(Q!==null)try{t.util.isArray(Q)||(Q=[Q]);for(var se=null,te=0;te0&&(Q.putByte(a.HandshakeType.server_key_exchange),Q.putInt24(X)),Q},a.getClientSignature=function(x,X){var Q=t.util.createBuffer();Q.putBuffer(x.session.md5.digest()),Q.putBuffer(x.session.sha1.digest()),Q=Q.getBytes(),x.getSignature=x.getSignature||function(A,K,se){var te=null;if(A.getPrivateKey)try{te=A.getPrivateKey(A,A.session.clientCertificate),te=t.pki.privateKeyFromPem(te)}catch(Ee){A.error(A,{message:"Could not get private key.",cause:Ee,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}te===null?A.error(A,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):K=te.sign(K,null),se(A,K)},x.getSignature(x,Q,X)},a.createCertificateVerify=function(x,X){var Q=X.length+2,A=t.util.createBuffer();return A.putByte(a.HandshakeType.certificate_verify),A.putInt24(Q),A.putInt16(X.length),A.putBytes(X),A},a.createCertificateRequest=function(x){var X=t.util.createBuffer();X.putByte(1);var Q=t.util.createBuffer();for(var A in x.caStore.certs){var K=x.caStore.certs[A],se=t.pki.distinguishedNameToAsn1(K.subject),te=t.asn1.toDer(se);Q.putInt16(te.length()),Q.putBuffer(te)}var Ee=1+X.length()+2+Q.length(),xe=t.util.createBuffer();return xe.putByte(a.HandshakeType.certificate_request),xe.putInt24(Ee),c(xe,1,X),c(xe,2,Q),xe},a.createServerHelloDone=function(x){var X=t.util.createBuffer();return X.putByte(a.HandshakeType.server_hello_done),X.putInt24(0),X},a.createChangeCipherSpec=function(){var x=t.util.createBuffer();return x.putByte(1),x},a.createFinished=function(x){var X=t.util.createBuffer();X.putBuffer(x.session.md5.digest()),X.putBuffer(x.session.sha1.digest());var Q=x.entity===a.ConnectionEnd.client,A=x.session.sp,K=12,se=r,te=Q?"client finished":"server finished";X=se(A.master_secret,te,X.getBytes(),K);var Ee=t.util.createBuffer();return Ee.putByte(a.HandshakeType.finished),Ee.putInt24(X.length()),Ee.putBuffer(X),Ee},a.createHeartbeat=function(x,X,Q){typeof Q>"u"&&(Q=X.length);var A=t.util.createBuffer();A.putByte(x),A.putInt16(Q),A.putBytes(X);var K=A.length(),se=Math.max(16,K-Q-3);return A.putBytes(t.random.getBytes(se)),A},a.queue=function(x,X){if(X&&!(X.fragment.length()===0&&(X.type===a.ContentType.handshake||X.type===a.ContentType.alert||X.type===a.ContentType.change_cipher_spec))){if(X.type===a.ContentType.handshake){var Q=X.fragment.bytes();x.session.md5.update(Q),x.session.sha1.update(Q),Q=null}var A;if(X.fragment.length()<=a.MaxFragment)A=[X];else{A=[];for(var K=X.fragment.bytes();K.length>a.MaxFragment;)A.push(a.createRecord(x,{type:X.type,data:t.util.createBuffer(K.slice(0,a.MaxFragment))})),K=K.slice(a.MaxFragment);K.length>0&&A.push(a.createRecord(x,{type:X.type,data:t.util.createBuffer(K)}))}for(var se=0;se0&&(te=Q.order[0]),te!==null&&te in Q.cache){se=Q.cache[te],delete Q.cache[te];for(var Ee in Q.order)if(Q.order[Ee]===te){Q.order.splice(Ee,1);break}}return se},Q.setSession=function(K,se){if(Q.order.length===Q.capacity){var te=Q.order.shift();delete Q.cache[te]}var te=t.util.bytesToHex(K);Q.order.push(te),Q.cache[te]=se}}return Q},a.createConnection=function(x){var X=null;x.caStore?t.util.isArray(x.caStore)?X=t.pki.createCaStore(x.caStore):X=x.caStore:X=t.pki.createCaStore();var Q=x.cipherSuites||null;if(Q===null){Q=[];for(var A in a.CipherSuites)Q.push(a.CipherSuites[A])}var K=x.server?a.ConnectionEnd.server:a.ConnectionEnd.client,se=x.sessionCache?a.createSessionCache(x.sessionCache):null,te={version:{major:a.Version.major,minor:a.Version.minor},entity:K,sessionId:x.sessionId,caStore:X,sessionCache:se,cipherSuites:Q,connected:x.connected,virtualHost:x.virtualHost||null,verifyClient:x.verifyClient||!1,verify:x.verify||function(ge,Le,We,rt){return Le},verifyOptions:x.verifyOptions||{},getCertificate:x.getCertificate||null,getPrivateKey:x.getPrivateKey||null,getSignature:x.getSignature||null,input:t.util.createBuffer(),tlsData:t.util.createBuffer(),data:t.util.createBuffer(),tlsDataReady:x.tlsDataReady,dataReady:x.dataReady,heartbeatReceived:x.heartbeatReceived,closed:x.closed,error:function(ge,Le){Le.origin=Le.origin||(ge.entity===a.ConnectionEnd.client?"client":"server"),Le.send&&(a.queue(ge,a.createAlert(ge,Le.alert)),a.flush(ge));var We=Le.fatal!==!1;We&&(ge.fail=!0),x.error(ge,Le),We&&ge.close(!1)},deflate:x.deflate||null,inflate:x.inflate||null};te.reset=function(ge){te.version={major:a.Version.major,minor:a.Version.minor},te.record=null,te.session=null,te.peerCertificate=null,te.state={pending:null,current:null},te.expect=te.entity===a.ConnectionEnd.client?d:y,te.fragmented=null,te.records=[],te.open=!1,te.handshakes=0,te.handshaking=!1,te.isConnected=!1,te.fail=!(ge||typeof ge>"u"),te.input.clear(),te.tlsData.clear(),te.data.clear(),te.state.current=a.createConnectionState(te)},te.reset();var Ee=function(ge,Le){var We=Le.type-a.ContentType.change_cipher_spec,rt=j[ge.entity][ge.expect];We in rt?rt[We](ge,Le):a.handleUnexpected(ge,Le)},xe=function(ge){var Le=0,We=ge.input,rt=We.length();if(rt<5)Le=5-rt;else{ge.record={type:We.getByte(),version:{major:We.getByte(),minor:We.getByte()},length:We.getInt16(),fragment:t.util.createBuffer(),ready:!1};var He=ge.record.version.major===ge.version.major;He&&ge.session&&ge.session.version&&(He=ge.record.version.minor===ge.version.minor),He||ge.error(ge,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}})}return Le},je=function(ge){var Le=0,We=ge.input,rt=We.length();if(rt0&&(te.sessionCache&&(Le=te.sessionCache.getSession(ge)),Le===null&&(ge="")),ge.length===0&&te.sessionCache&&(Le=te.sessionCache.getSession(),Le!==null&&(ge=Le.id)),te.session={id:ge,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:t.md.md5.create(),sha1:t.md.sha1.create()},Le&&(te.version=Le.version,te.session.sp=Le.sp),te.session.sp.client_random=a.createRandom().getBytes(),te.open=!0,a.queue(te,a.createRecord(te,{type:a.ContentType.handshake,data:a.createClientHello(te)})),a.flush(te)}},te.process=function(ge){var Le=0;return ge&&te.input.putBytes(ge),te.fail||(te.record!==null&&te.record.ready&&te.record.fragment.isEmpty()&&(te.record=null),te.record===null&&(Le=xe(te)),!te.fail&&te.record!==null&&!te.record.ready&&(Le=je(te)),!te.fail&&te.record!==null&&te.record.ready&&Ee(te,te.record)),Le},te.prepare=function(ge){return a.queue(te,a.createRecord(te,{type:a.ContentType.application_data,data:t.util.createBuffer(ge)})),a.flush(te)},te.prepareHeartbeatRequest=function(ge,Le){return ge instanceof t.util.ByteBuffer&&(ge=ge.bytes()),typeof Le>"u"&&(Le=ge.length),te.expectedHeartbeatPayload=ge,a.queue(te,a.createRecord(te,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_request,ge,Le)})),a.flush(te)},te.close=function(ge){if(!te.fail&&te.sessionCache&&te.session){var Le={id:te.session.id,version:te.session.version,sp:te.session.sp};Le.sp.keys=null,te.sessionCache.setSession(Le.id,Le)}te.open&&(te.open=!1,te.input.clear(),(te.isConnected||te.handshaking)&&(te.isConnected=te.handshaking=!1,a.queue(te,a.createAlert(te,{level:a.Alert.Level.warning,description:a.Alert.Description.close_notify})),a.flush(te)),te.closed(te)),te.reset(ge)},te},n.exports=t.tls=t.tls||{};for(Je in a)typeof a[Je]!="function"&&(t.tls[Je]=a[Je]);var Je;t.tls.prf_tls1=r,t.tls.hmac_sha1=i,t.tls.createSessionCache=a.createSessionCache,t.tls.createConnection=a.createConnection}),z5=Qe((e,n)=>{var t=lt();Pa(),fb();var r=n.exports=t.tls;r.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(d){d.bulk_cipher_algorithm=r.BulkCipherAlgorithm.aes,d.cipher_type=r.CipherType.block,d.enc_key_length=16,d.block_length=16,d.fixed_iv_length=16,d.record_iv_length=16,d.mac_algorithm=r.MACAlgorithm.hmac_sha1,d.mac_length=20,d.mac_key_length=20},initConnectionState:i},r.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(d){d.bulk_cipher_algorithm=r.BulkCipherAlgorithm.aes,d.cipher_type=r.CipherType.block,d.enc_key_length=32,d.block_length=16,d.fixed_iv_length=16,d.record_iv_length=16,d.mac_algorithm=r.MACAlgorithm.hmac_sha1,d.mac_length=20,d.mac_key_length=20},initConnectionState:i};function i(d,f,g){var I=f.entity===t.tls.ConnectionEnd.client;d.read.cipherState={init:!1,cipher:t.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},d.write.cipherState={init:!1,cipher:t.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},d.read.cipherFunction=c,d.write.cipherFunction=s,d.read.macLength=d.write.macLength=g.mac_length,d.read.macFunction=d.write.macFunction=r.hmac_sha1}function s(d,f){var g=!1,I=f.macFunction(f.macKey,f.sequenceNumber,d);d.fragment.putBytes(I),f.updateSequenceNumber();var C;d.version.minor===r.Versions.TLS_1_0.minor?C=f.cipherState.init?null:f.cipherState.iv:C=t.random.getBytesSync(16),f.cipherState.init=!0;var v=f.cipherState.cipher;return v.start({iv:C}),d.version.minor>=r.Versions.TLS_1_1.minor&&v.output.putBytes(C),v.update(d.fragment),v.finish(u)&&(d.fragment=v.output,d.length=d.fragment.length(),g=!0),g}function u(d,f,g){if(!g){var I=d-f.length()%d;f.fillWithByte(I-1,I)}return!0}function h(d,f,g){var I=!0;if(g){for(var C=f.length(),v=f.last(),T=C-1-v;T=v?(d.fragment=C.output.getBytes(O-v),T=C.output.getBytes(v)):d.fragment=C.output.getBytes(),d.fragment=t.util.createBuffer(d.fragment),d.length=d.fragment.length();var k=f.macFunction(f.macKey,f.sequenceNumber,d);return f.updateSequenceNumber(),g=a(f.macKey,T,k)&&g,g}function a(d,f,g){var I=t.hmac.create();return I.start("SHA1",d),I.update(f),f=I.digest().getBytes(),I.start(null,null),I.update(g),g=I.digest().getBytes(),f===g}}),db=Qe((e,n)=>{var t=lt();ho(),Et();var r=n.exports=t.sha512=t.sha512||{};t.md.sha512=t.md.algorithms.sha512=r;var i=t.sha384=t.sha512.sha384=t.sha512.sha384||{};i.create=function(){return r.create("SHA-384")},t.md.sha384=t.md.algorithms.sha384=i,t.sha512.sha256=t.sha512.sha256||{create:function(){return r.create("SHA-512/256")}},t.md["sha512/256"]=t.md.algorithms["sha512/256"]=t.sha512.sha256,t.sha512.sha224=t.sha512.sha224||{create:function(){return r.create("SHA-512/224")}},t.md["sha512/224"]=t.md.algorithms["sha512/224"]=t.sha512.sha224,r.create=function(f){if(u||a(),typeof f>"u"&&(f="SHA-512"),!(f in c))throw new Error("Invalid SHA-512 algorithm: "+f);for(var g=c[f],I=null,C=t.util.createBuffer(),v=new Array(80),T=0;T<80;++T)v[T]=new Array(2);var O=64;switch(f){case"SHA-384":O=48;break;case"SHA-512/256":O=32;break;case"SHA-512/224":O=28;break}var k={algorithm:f.replace("-","").toLowerCase(),blockLength:128,digestLength:O,messageLength:0,fullMessageLength:null,messageLengthSize:16};return k.start=function(){k.messageLength=0,k.fullMessageLength=k.messageLength128=[];for(var y=k.messageLengthSize/4,R=0;R>>0,w>>>0];for(var L=k.fullMessageLength.length-1;L>=0;--L)k.fullMessageLength[L]+=w[1],w[1]=w[0]+(k.fullMessageLength[L]/4294967296>>>0),k.fullMessageLength[L]=k.fullMessageLength[L]>>>0,w[0]=w[1]/4294967296>>>0;return C.putBytes(y),d(I,v,C),(C.read>2048||C.length()===0)&&C.compact(),k},k.digest=function(){var y=t.util.createBuffer();y.putBytes(C.bytes());var R=k.fullMessageLength[k.fullMessageLength.length-1]+k.messageLengthSize,w=R&k.blockLength-1;y.putBytes(s.substr(0,k.blockLength-w));for(var L,D,S=k.fullMessageLength[0]*8,m=0;m>>0,S+=D,y.putInt32(S>>>0),S=L>>>0;y.putInt32(S);for(var p=new Array(I.length),m=0;m=128;){for(Ce=0;Ce<16;++Ce)g[Ce][0]=I.getInt32()>>>0,g[Ce][1]=I.getInt32()>>>0;for(;Ce<80;++Ce)et=g[Ce-2],$e=et[0],Ie=et[1],C=(($e>>>19|Ie<<13)^(Ie>>>29|$e<<3)^$e>>>6)>>>0,v=(($e<<13|Ie>>>19)^(Ie<<3|$e>>>29)^($e<<26|Ie>>>6))>>>0,x=g[Ce-15],$e=x[0],Ie=x[1],T=(($e>>>1|Ie<<31)^($e>>>8|Ie<<24)^$e>>>7)>>>0,O=(($e<<31|Ie>>>1)^($e<<24|Ie>>>8)^($e<<25|Ie>>>7))>>>0,Je=g[Ce-7],X=g[Ce-16],Ie=v+Je[1]+O+X[1],g[Ce][0]=C+Je[0]+T+X[0]+(Ie/4294967296>>>0)>>>0,g[Ce][1]=Ie>>>0;for(p=f[0][0],q=f[0][1],V=f[1][0],$=f[1][1],E=f[2][0],B=f[2][1],j=f[3][0],N=f[3][1],M=f[4][0],ee=f[4][1],oe=f[5][0],ae=f[5][1],pe=f[6][0],_e=f[6][1],Re=f[7][0],qe=f[7][1],Ce=0;Ce<80;++Ce)R=((M>>>14|ee<<18)^(M>>>18|ee<<14)^(ee>>>9|M<<23))>>>0,w=((M<<18|ee>>>14)^(M<<14|ee>>>18)^(ee<<23|M>>>9))>>>0,L=(pe^M&(oe^pe))>>>0,D=(_e^ee&(ae^_e))>>>0,k=((p>>>28|q<<4)^(q>>>2|p<<30)^(q>>>7|p<<25))>>>0,y=((p<<4|q>>>28)^(q<<30|p>>>2)^(q<<25|p>>>7))>>>0,S=(p&V|E&(p^V))>>>0,m=(q&$|B&(q^$))>>>0,Ie=qe+w+D+h[Ce][1]+g[Ce][1],C=Re+R+L+h[Ce][0]+g[Ce][0]+(Ie/4294967296>>>0)>>>0,v=Ie>>>0,Ie=y+m,T=k+S+(Ie/4294967296>>>0)>>>0,O=Ie>>>0,Re=pe,qe=_e,pe=oe,_e=ae,oe=M,ae=ee,Ie=N+v,M=j+C+(Ie/4294967296>>>0)>>>0,ee=Ie>>>0,j=E,N=B,E=V,B=$,V=p,$=q,Ie=v+O,p=C+T+(Ie/4294967296>>>0)>>>0,q=Ie>>>0;Ie=f[0][1]+q,f[0][0]=f[0][0]+p+(Ie/4294967296>>>0)>>>0,f[0][1]=Ie>>>0,Ie=f[1][1]+$,f[1][0]=f[1][0]+V+(Ie/4294967296>>>0)>>>0,f[1][1]=Ie>>>0,Ie=f[2][1]+B,f[2][0]=f[2][0]+E+(Ie/4294967296>>>0)>>>0,f[2][1]=Ie>>>0,Ie=f[3][1]+N,f[3][0]=f[3][0]+j+(Ie/4294967296>>>0)>>>0,f[3][1]=Ie>>>0,Ie=f[4][1]+ee,f[4][0]=f[4][0]+M+(Ie/4294967296>>>0)>>>0,f[4][1]=Ie>>>0,Ie=f[5][1]+ae,f[5][0]=f[5][0]+oe+(Ie/4294967296>>>0)>>>0,f[5][1]=Ie>>>0,Ie=f[6][1]+_e,f[6][0]=f[6][0]+pe+(Ie/4294967296>>>0)>>>0,f[6][1]=Ie>>>0,Ie=f[7][1]+qe,f[7][0]=f[7][0]+Re+(Ie/4294967296>>>0)>>>0,f[7][1]=Ie>>>0,Q-=128}}}),H5=Qe(e=>{var n=lt();ki();var t=n.asn1;e.privateKeyValidator={name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},e.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}}),K5=Qe((e,n)=>{var t=lt();oh(),ui(),db(),Et();var r=H5(),i=r.publicKeyValidator,s=r.privateKeyValidator;typeof u>"u"&&(u=t.jsbn.BigInteger);var u,h=t.util.ByteBuffer,c=typeof Buffer>"u"?Uint8Array:Buffer;t.pki=t.pki||{},n.exports=t.pki.ed25519=t.ed25519=t.ed25519||{};var a=t.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(x){x=x||{};var X=x.seed;if(X===void 0)X=t.random.getBytesSync(a.constants.SEED_BYTE_LENGTH);else if(typeof X=="string"){if(X.length!==a.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+a.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(X instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');X=d({message:X,encoding:"binary"});for(var Q=new c(a.constants.PUBLIC_KEY_BYTE_LENGTH),A=new c(a.constants.PRIVATE_KEY_BYTE_LENGTH),K=0;K<32;++K)A[K]=X[K];return R(Q,A),{publicKey:Q,privateKey:A}},a.privateKeyFromAsn1=function(x){var X={},Q=[],A=t.asn1.validate(x,s,X,Q);if(!A){var K=new Error("Invalid Key.");throw K.errors=Q,K}var se=t.asn1.derToOid(X.privateKeyOid),te=t.oids.EdDSA25519;if(se!==te)throw new Error('Invalid OID "'+se+'"; OID must be "'+te+'".');var Ee=X.privateKey,xe=d({message:t.asn1.fromDer(Ee).value,encoding:"binary"});return{privateKeyBytes:xe}},a.publicKeyFromAsn1=function(x){var X={},Q=[],A=t.asn1.validate(x,i,X,Q);if(!A){var K=new Error("Invalid Key.");throw K.errors=Q,K}var se=t.asn1.derToOid(X.publicKeyOid),te=t.oids.EdDSA25519;if(se!==te)throw new Error('Invalid OID "'+se+'"; OID must be "'+te+'".');var Ee=X.ed25519PublicKey;if(Ee.length!==a.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return d({message:Ee,encoding:"binary"})},a.publicKeyFromPrivateKey=function(x){x=x||{};var X=d({message:x.privateKey,encoding:"binary"});if(X.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 Q=new c(a.constants.PUBLIC_KEY_BYTE_LENGTH),A=0;A=0};function d(x){var X=x.message;if(X instanceof Uint8Array||X instanceof c)return X;var Q=x.encoding;if(X===void 0)if(x.md)X=x.md.digest().getBytes(),Q="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof X=="string"&&!Q)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof X=="string"){if(typeof Buffer<"u")return Buffer.from(X,Q);X=new h(X,Q)}else if(!(X instanceof h))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 A=new c(X.length()),K=0;K=32;--A){for(Q=0,K=A-32,se=A-12;K>8,X[K]-=Q*256;X[K]+=Q,X[A]=0}for(Q=0,K=0;K<32;++K)X[K]+=Q-(X[31]>>4)*O[K],Q=X[K]>>8,X[K]&=255;for(K=0;K<32;++K)X[K]-=Q*O[K];for(A=0;A<32;++A)X[A+1]+=X[A]>>8,x[A]=X[A]&255}function S(x){for(var X=new Float64Array(64),Q=0;Q<64;++Q)X[Q]=x[Q],x[Q]=0;D(x,X)}function m(x,X){var Q=Ce(),A=Ce(),K=Ce(),se=Ce(),te=Ce(),Ee=Ce(),xe=Ce(),je=Ce(),ge=Ce();Ie(Q,x[1],x[0]),Ie(ge,X[1],X[0]),Je(Q,Q,ge),$e(A,x[0],x[1]),$e(ge,X[0],X[1]),Je(A,A,ge),Je(K,x[3],X[3]),Je(K,K,C),Je(se,x[2],X[2]),$e(se,se,se),Ie(te,A,Q),Ie(Ee,se,K),$e(xe,se,K),$e(je,A,Q),Je(x[0],te,Ee),Je(x[1],je,xe),Je(x[2],xe,Ee),Je(x[3],te,je)}function p(x,X,Q){for(var A=0;A<4;++A)qe(x[A],X[A],Q)}function q(x,X){var Q=Ce(),A=Ce(),K=Ce();_e(K,X[2]),Je(Q,X[0],K),Je(A,X[1],K),V(x,A),x[31]^=ee(Q)<<7}function V(x,X){var Q,A,K,se=Ce(),te=Ce();for(Q=0;Q<16;++Q)te[Q]=X[Q];for(Re(te),Re(te),Re(te),A=0;A<2;++A){for(se[0]=te[0]-65517,Q=1;Q<15;++Q)se[Q]=te[Q]-65535-(se[Q-1]>>16&1),se[Q-1]&=65535;se[15]=te[15]-32767-(se[14]>>16&1),K=se[15]>>16&1,se[14]&=65535,qe(te,se,1-K)}for(Q=0;Q<16;Q++)x[2*Q]=te[Q]&255,x[2*Q+1]=te[Q]>>8}function $(x,X){var Q=Ce(),A=Ce(),K=Ce(),se=Ce(),te=Ce(),Ee=Ce(),xe=Ce();return pe(x[2],g),E(x[1],X),et(K,x[1]),Je(se,K,I),Ie(K,K,x[2]),$e(se,x[2],se),et(te,se),et(Ee,te),Je(xe,Ee,te),Je(Q,xe,K),Je(Q,Q,se),B(Q,Q),Je(Q,Q,K),Je(Q,Q,se),Je(Q,Q,se),Je(x[0],Q,se),et(A,x[0]),Je(A,A,se),j(A,K)&&Je(x[0],x[0],k),et(A,x[0]),Je(A,A,se),j(A,K)?-1:(ee(x[0])===X[31]>>7&&Ie(x[0],f,x[0]),Je(x[3],x[0],x[1]),0)}function E(x,X){var Q;for(Q=0;Q<16;++Q)x[Q]=X[2*Q]+(X[2*Q+1]<<8);x[15]&=32767}function B(x,X){var Q=Ce(),A;for(A=0;A<16;++A)Q[A]=X[A];for(A=250;A>=0;--A)et(Q,Q),A!==1&&Je(Q,Q,X);for(A=0;A<16;++A)x[A]=Q[A]}function j(x,X){var Q=new c(32),A=new c(32);return V(Q,x),V(A,X),N(Q,0,A,0)}function N(x,X,Q,A){return M(x,X,Q,A,32)}function M(x,X,Q,A,K){var se,te=0;for(se=0;se>>8)-1}function ee(x){var X=new c(32);return V(X,x),X[0]&1}function oe(x,X,Q){var A,K;for(pe(x[0],f),pe(x[1],g),pe(x[2],g),pe(x[3],f),K=255;K>=0;--K)A=Q[K/8|0]>>(K&7)&1,p(x,X,A),m(X,x),m(x,x),p(x,X,A)}function ae(x,X){var Q=[Ce(),Ce(),Ce(),Ce()];pe(Q[0],v),pe(Q[1],T),pe(Q[2],g),Je(Q[3],v,T),oe(x,Q,X)}function pe(x,X){var Q;for(Q=0;Q<16;Q++)x[Q]=X[Q]|0}function _e(x,X){var Q=Ce(),A;for(A=0;A<16;++A)Q[A]=X[A];for(A=253;A>=0;--A)et(Q,Q),A!==2&&A!==4&&Je(Q,Q,X);for(A=0;A<16;++A)x[A]=Q[A]}function Re(x){var X,Q,A=1;for(X=0;X<16;++X)Q=x[X]+A+65535,A=Math.floor(Q/65536),x[X]=Q-A*65536;x[0]+=A-1+37*(A-1)}function qe(x,X,Q){for(var A,K=~(Q-1),se=0;se<16;++se)A=K&(x[se]^X[se]),x[se]^=A,X[se]^=A}function Ce(x){var X,Q=new Float64Array(16);if(x)for(X=0;X{var t=lt();Et(),ui(),oh(),n.exports=t.kem=t.kem||{};var r=t.jsbn.BigInteger;t.kem.rsa={},t.kem.rsa.create=function(s,u){u=u||{};var h=u.prng||t.random,c={};return c.encrypt=function(a,d){var f=Math.ceil(a.n.bitLength()/8),g;do g=new r(t.util.bytesToHex(h.getBytesSync(f)),16).mod(a.n);while(g.compareTo(r.ONE)<=0);g=t.util.hexToBytes(g.toString(16));var I=f-g.length;I>0&&(g=t.util.fillString(String.fromCharCode(0),I)+g);var C=a.encrypt(g,"NONE"),v=s.generate(g,d);return{encapsulation:C,key:v}},c.decrypt=function(a,d,f){var g=a.decrypt(d,"NONE");return s.generate(g,f)},c},t.kem.kdf1=function(s,u){i(this,s,0,u||s.digestLength)},t.kem.kdf2=function(s,u){i(this,s,1,u||s.digestLength)};function i(s,u,h,c){s.generate=function(a,d){for(var f=new t.util.ByteBuffer,g=Math.ceil(d/c)+h,I=new t.util.ByteBuffer,C=h;C{var t=lt();Et(),n.exports=t.log=t.log||{},t.log.levels=["none","error","warning","info","debug","verbose","max"];var r={},i=[],s=null;for(t.log.LEVEL_LOCKED=2,t.log.NO_LEVEL_CHECK=4,t.log.INTERPOLATE=8,c=0;c"u"||v?C.flags|=t.log.LEVEL_LOCKED:C.flags&=~t.log.LEVEL_LOCKED},t.log.addLogger=function(C){i.push(C)},typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(d={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},f=function(C,v){t.log.prepareStandard(v);var T=d[v.level],O=[v.standard];O=O.concat(v.arguments.slice()),T.apply(console,O)},a=t.log.makeLogger(f)):(f=function(C,v){t.log.prepareStandardFull(v),console.log(v.standardFull)},a=t.log.makeLogger(f)),t.log.setLevel(a,"debug"),t.log.addLogger(a),s=a):console={log:function(){}};var a,d,f;s!==null&&typeof window<"u"&&window.location&&(g=new URL(window.location.href).searchParams,g.has("console.level")&&t.log.setLevel(s,g.get("console.level").slice(-1)[0]),g.has("console.lock")&&(I=g.get("console.lock").slice(-1)[0],I=="true"&&t.log.lock(s)));var g,I;t.log.consoleLogger=s}),Q5=Qe((e,n)=>{n.exports=ho(),Vp(),Ku(),rb(),db()}),Y5=Qe((e,n)=>{var t=lt();Pa(),ki(),ih(),Ba(),ks(),ub(),ui(),Et(),zp();var r=t.asn1,i=n.exports=t.pkcs7=t.pkcs7||{};i.messageFromPem=function(v){var T=t.pem.decode(v)[0];if(T.type!=="PKCS7"){var O=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw O.headerType=T.type,O}if(T.procType&&T.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var k=r.fromDer(T.body);return i.messageFromAsn1(k)},i.messageToPem=function(v,T){var O={type:"PKCS7",body:r.toDer(v.toAsn1()).getBytes()};return t.pem.encode(O,{maxline:T})},i.messageFromAsn1=function(v){var T={},O=[];if(!r.validate(v,i.asn1.contentInfoValidator,T,O)){var k=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw k.errors=O,k}var y=r.derToOid(T.contentType),R;switch(y){case t.pki.oids.envelopedData:R=i.createEnvelopedData();break;case t.pki.oids.encryptedData:R=i.createEncryptedData();break;case t.pki.oids.signedData:R=i.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+y+" is not (yet) supported.")}return R.fromAsn1(T.content.value[0]),R},i.createSignedData=function(){var v=null;return v={type:t.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(k){if(I(v,k,i.asn1.signedDataValidator),v.certificates=[],v.crls=[],v.digestAlgorithmIdentifiers=[],v.contentInfo=null,v.signerInfos=[],v.rawCapture.certificates)for(var y=v.rawCapture.certificates.value,R=0;R0&&w.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,k)),R.length>0&&w.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,R)),w.value[0].value.push(r.create(r.Class.UNIVERSAL,r.Type.SET,!0,v.signerInfos)),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(v.type).getBytes()),w])},addSigner:function(k){var y=k.issuer,R=k.serialNumber;if(k.certificate){var w=k.certificate;typeof w=="string"&&(w=t.pki.certificateFromPem(w)),y=w.issuer.attributes,R=w.serialNumber}var L=k.key;if(!L)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof L=="string"&&(L=t.pki.privateKeyFromPem(L));var D=k.digestAlgorithm||t.pki.oids.sha1;switch(D){case t.pki.oids.sha1:case t.pki.oids.sha256:case t.pki.oids.sha384:case t.pki.oids.sha512:case t.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+D)}var S=k.authenticatedAttributes||[];if(S.length>0){for(var m=!1,p=!1,q=0;q0){for(var O=r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[]),k=0;k=O&&y{var t=lt();Pa(),Hu(),Vp(),Ku(),Et();var r=n.exports=t.ssh=t.ssh||{};r.privateKeyToPutty=function(h,c,a){a=a||"",c=c||"";var d="ssh-rsa",f=c===""?"none":"aes256-cbc",g="PuTTY-User-Key-File-2: "+d+`\r `;g+="Encryption: "+f+`\r `,g+="Comment: "+a+`\r `;var I=t.util.createBuffer();s(I,d),i(I,h.e),i(I,h.n);var C=t.util.encode64(I.bytes(),64),v=Math.floor(C.length/66)+1;g+="Public-Lines: "+v+`\r @@ -63,12 +63,12 @@ web-ext-deploy --get-cookies=opera`},jm="opera";function UI(e){return ho(this,nu Private-Lines: `+v+`\r `,g+=O;var D=u("putty-private-key-file-mac-key",c),S=t.util.createBuffer();s(S,d),s(S,f),s(S,a),S.putInt32(I.length()),S.putBuffer(I),S.putInt32(T.length()),S.putBuffer(T);var m=t.hmac.create();return m.start("sha1",D),m.update(S.bytes()),g+=`\r Private-MAC: `+m.digest().toHex()+`\r -`,g},r.publicKeyToOpenSSH=function(h,c){var a="ssh-rsa";c=c||"";var d=t.util.createBuffer();return s(d,a),i(d,h.e),i(d,h.n),a+" "+t.util.encode64(d.bytes())+" "+c},r.privateKeyToOpenSSH=function(h,c){return c?t.pki.encryptRsaPrivateKey(h,c,{legacy:!0,algorithm:"aes128"}):t.pki.privateKeyToPem(h)},r.getPublicKeyFingerprint=function(h,c){c=c||{};var a=c.md||t.md.md5.create(),d="ssh-rsa",f=t.util.createBuffer();s(f,d),i(f,h.e),i(f,h.n),a.start(),a.update(f.getBytes());var g=a.digest();if(c.encoding==="hex"){var I=g.toHex();return c.delimiter?I.match(/.{2}/g).join(c.delimiter):I}else{if(c.encoding==="binary")return g.getBytes();if(c.encoding)throw new Error('Unknown encoding "'+c.encoding+'".')}return g};function i(h,c){var a=c.toString(16);a[0]>="8"&&(a="00"+a);var d=t.util.hexToBytes(a);h.putInt32(d.length),h.putBytes(d)}function s(h,c){h.putInt32(c.length),h.putString(c)}function u(){for(var h=t.md.sha1.create(),c=arguments.length,a=0;a{n.exports=lt(),Ba(),X5(),ki(),Hp(),lh(),Z5(),Wu(),eA(),tA(),rA(),mb(),Wp(),Os(),db(),vb(),nA(),bb(),pb(),hb(),Gp(),ui(),fb(),iA(),_b(),Et()});function oA(e,n){return Sb(n,(t,r)=>`${e}/${r}`)}function Sb(e,n=(t,r)=>`${t}: ${r}`){return Object.entries(e).reduce((t,[r,i])=>(t[r]=n(r,i),t),{})}var xu={Itero:"https://itero.plasmo.com"},aA={Base:"/api/chrome-policy",Hash:"/api/chrome-policy/hash"},Ck=oA(xu.Itero,aA),Tk=ks(V5(),1),Qm=65536;async function*Id(e,n=!0){for(let t of e)if("stream"in t)yield*t.stream();else if(ArrayBuffer.isView(t))if(n){let r=t.byteOffset,i=t.byteOffset+t.byteLength;for(;r!==i;){let s=Math.min(i-r,Qm),u=t.buffer.slice(r,r+s);r+=u.byteLength,yield new Uint8Array(u)}}else yield t;else{let r=0,i=t;for(;r!==i.size;){let s=await i.slice(r,Math.min(i.size,r+Qm)).arrayBuffer();r+=s.byteLength,yield new Uint8Array(s)}}}var Cb=class Qd{#e=[];#r="";#t=0;#n="transparent";constructor(n=[],t={}){if(typeof n!="object"||n===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof n[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof t!="object"&&typeof t!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");t===null&&(t={});let r=new TextEncoder;for(let s of n){let u;ArrayBuffer.isView(s)?u=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?u=new Uint8Array(s.slice(0)):s instanceof Qd?u=s:u=r.encode(`${s}`),this.#t+=ArrayBuffer.isView(u)?u.byteLength:u.size,this.#e.push(u)}this.#n=`${t.endings===void 0?"transparent":t.endings}`;let i=t.type===void 0?"":String(t.type);this.#r=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#t}get type(){return this.#r}async text(){let n=new TextDecoder,t="";for await(let r of Id(this.#e,!1))t+=n.decode(r,{stream:!0});return t+=n.decode(),t}async arrayBuffer(){let n=new Uint8Array(this.size),t=0;for await(let r of Id(this.#e,!1))n.set(r,t),t+=r.length;return n.buffer}stream(){let n=Id(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(t){let r=await n.next();r.done?t.close():t.enqueue(r.value)},async cancel(){await n.return()}})}slice(n=0,t=this.size,r=""){let{size:i}=this,s=n<0?Math.max(i+n,0):Math.min(n,i),u=t<0?Math.max(i+t,0):Math.min(t,i),h=Math.max(u-s,0),c=this.#e,a=[],d=0;for(let g of c){if(d>=h)break;let I=ArrayBuffer.isView(g)?g.byteLength:g.size;if(s&&I<=s)s-=I,u-=I;else{let C;ArrayBuffer.isView(g)?(C=g.subarray(s,Math.min(I,u)),d+=C.byteLength):(C=g.slice(s,Math.min(I,u)),d+=C.size),u-=I,a.push(C),s=0}}let f=new Qd([],{type:String(r).toLowerCase()});return f.#t=h,f.#e=a,f}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](n){return n&&typeof n=="object"&&typeof n.constructor=="function"&&(typeof n.stream=="function"||typeof n.arrayBuffer=="function")&&/^(Blob|File)$/.test(n[Symbol.toStringTag])}};Object.defineProperties(Cb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});var sA=Cb,Tc=sA,uA=(0,L5.createRequire)("/"),lA;try{lA=uA("worker_threads").Worker}catch{}var dr=Uint8Array,bn=Uint16Array,fh=Uint32Array,dh=new dr([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]),ph=new dr([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]),Yd=new dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tb=function(e,n){for(var t=new bn(31),r=0;r<31;++r)t[r]=n+=1<>>1|(At&21845)<<1,ro=(ro&52428)>>>2|(ro&13107)<<2,ro=(ro&61680)>>>4|(ro&3855)<<4,Jd[At]=((ro&65280)>>>8|(ro&255)<<8)>>>1;var ro,At,Ii=function(e,n,t){for(var r=e.length,i=0,s=new bn(n);i>>c]=a}else for(h=new bn(r),i=0;i>>15-e[i]);return h},zo=new dr(288);for(At=0;At<144;++At)zo[At]=8;var At;for(At=144;At<256;++At)zo[At]=9;var At;for(At=256;At<280;++At)zo[At]=7;var At;for(At=280;At<288;++At)zo[At]=8;var At,Uu=new dr(32);for(At=0;At<32;++At)Uu[At]=5;var At,hA=Ii(zo,9,0),fA=Ii(zo,9,1),dA=Ii(Uu,5,0),pA=Ii(Uu,5,1),Ad=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},ti=function(e,n,t){var r=n/8|0;return(e[r]|e[r+1]<<8)>>(n&7)&t},kd=function(e,n){var t=n/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(n&7)},Yp=function(e){return(e+7)/8|0},Qu=function(e,n,t){(n==null||n<0)&&(n=0),(t==null||t>e.length)&&(t=e.length);var r=new(e.BYTES_PER_ELEMENT==2?bn:e.BYTES_PER_ELEMENT==4?fh:dr)(t-n);return r.set(e.subarray(n,t)),r},yA=["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"],mn=function(e,n,t){var r=new Error(n||yA[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,mn),!t)throw r;return r},gA=function(e,n,t){var r=e.length;if(!r||t&&t.f&&!t.l)return n||new dr(0);var i=!n||t,s=!t||t.i;t||(t={}),n||(n=new dr(r*3));var u=function(Ce){var $e=n.length;if(Ce>$e){var Ie=new dr(Math.max($e*2,Ce));Ie.set(n),n=Ie}},h=t.f||0,c=t.p||0,a=t.b||0,d=t.l,f=t.d,g=t.m,I=t.n,C=r*8;do{if(!d){h=ti(e,c,1);var v=ti(e,c+1,3);if(c+=3,v)if(v==1)d=fA,f=pA,g=9,I=5;else if(v==2){var T=ti(e,c,31)+257,O=ti(e,c+10,15)+4,k=T+ti(e,c+5,31)+1;c+=14;for(var y=new dr(k),R=new dr(19),w=0;w>>4;if(p<16)y[w++]=p;else{var q=0,V=0;for(p==16?(V=3+ti(e,c,3),c+=2,q=y[w-1]):p==17?(V=3+ti(e,c,7),c+=3):p==18&&(V=11+ti(e,c,127),c+=7);V--;)y[w++]=q}}var $=y.subarray(0,T),E=y.subarray(T);g=Ad($),I=Ad(E),d=Ii($,g,1),f=Ii(E,I,1)}else mn(1);else{var p=Yp(c)+4,B=e[p-4]|e[p-3]<<8,j=p+B;if(j>r){s&&mn(0);break}i&&u(a+B),n.set(e.subarray(p,j),a),t.b=a+=B,t.p=c=j*8,t.f=h;continue}if(c>C){s&&mn(0);break}}i&&u(a+131072);for(var N=(1<>>4;if(c+=q&15,c>C){s&&mn(0);break}if(q||mn(2),oe<256)n[a++]=oe;else if(oe==256){ee=c,d=null;break}else{var ae=oe-254;if(oe>264){var w=oe-257,pe=dh[w];ae=ti(e,c,(1<>>4;_e||mn(3),c+=_e&15;var E=cA[Re];if(Re>3){var pe=ph[Re];E+=kd(e,c)&(1<C){s&&mn(0);break}i&&u(a+131072);for(var qe=a+ae;a>>8},wu=function(e,n,t){t<<=n&7;var r=n/8|0;e[r]|=t,e[r+1]|=t>>>8,e[r+2]|=t>>>16},Od=function(e,n){for(var t=[],r=0;rg&&(g=s[r].s);var I=new bn(g+1),C=Zd(t[d-1],I,0);if(C>n){var r=0,v=0,T=C-n,O=1<n)v+=O-(1<>>=T;v>0;){var y=s[r].s;I[y]=0&&v;--r){var R=s[r].s;I[R]==n&&(--I[R],++v)}C=n}return[new dr(I),C]},Zd=function(e,n,t){return e.s==-1?Math.max(Zd(e.l,n,t+1),Zd(e.r,n,t+1)):n[e.s]=t},Xm=function(e){for(var n=e.length;n&&!e[--n];);for(var t=new bn(++n),r=0,i=e[0],s=1,u=function(c){t[r++]=c},h=1;h<=n;++h)if(e[h]==i&&h!=n)++s;else{if(!i&&s>2){for(;s>138;s-=138)u(32754);s>2&&(u(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(u(i),--s;s>6;s-=6)u(8304);s>2&&(u(s-3<<5|8208),s=0)}for(;s--;)u(i);s=1,i=e[h]}return[t.subarray(0,r),n]},Eu=function(e,n){for(var t=0,r=0;r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s4&&!p[Yd[V-1]];--V);var $=a+5<<3,E=Eu(i,zo)+Eu(s,Uu)+u,B=Eu(i,g)+Eu(s,v)+u+14+3*V+Eu(D,p)+(2*D[16]+3*D[17]+7*D[18]);if($<=E&&$<=B)return ep(n,d,e.subarray(c,c+a));var j,N,M,ee;if(no(n,d,1+(B15&&(no(n,d,_e[S]>>>5&127),d+=_e[S]>>>12)}}else j=hA,N=zo,M=dA,ee=Uu;for(var S=0;S255){var Re=r[S]>>>18&31;wu(n,d,j[Re+257]),d+=N[Re+257],Re>7&&(no(n,d,r[S]>>>23&31),d+=dh[Re]);var qe=r[S]&31;wu(n,d,M[qe]),d+=ee[qe],qe>3&&(wu(n,d,r[S]>>>5&8191),d+=ph[qe])}else wu(n,d,j[r[S]]),d+=N[r[S]];return wu(n,d,j[256]),d+N[256]},mA=new fh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xp=new dr(0),vA=function(e,n,t,r,i,s){var u=e.length,h=new dr(r+u+5*(1+Math.ceil(u/7e3))+i),c=h.subarray(r,h.length-i),a=0;if(!n||u<8)for(var d=0;d<=u;d+=65535){var f=d+65535;f>=u&&(c[a>>3]=s),a=ep(c,a+1,e.subarray(d,f))}else{for(var g=mA[n-1],I=g>>>13,C=g&8191,v=(1<7e3||p>24576)&&j>423){a=Jm(e,c,0,w,L,D,m,p,V,d-V,a),p=S=m=0,V=d;for(var N=0;N<286;++N)L[N]=0;for(var N=0;N<30;++N)D[N]=0}var M=2,ee=0,oe=C,ae=E-B&32767;if(j>2&&$==R(d-ae))for(var pe=Math.min(I,j)-1,_e=Math.min(32767,d),Re=Math.min(258,j);ae<=_e&&--oe&&E!=B;){if(e[d+M]==e[d+M-ae]){for(var qe=0;qeM){if(M=qe,ee=ae,qe>pe)break;for(var Ce=Math.min(ae,qe-2),$e=0,N=0;N$e&&($e=Je,B=Ie)}}}E=B,B=T[E],ae+=E-B+32768&32767}if(ee){w[p++]=268435456|Xd[M]<<18|Ym[ee];var x=Xd[M]&31,X=Ym[ee]&31;m+=dh[x]+ph[X],++L[257+x],++D[X],q=d+M,++S}else w[p++]=e[d],++L[e[d]]}}a=Jm(e,c,s,w,L,D,m,p,V,d-V,a),!s&&a&7&&(a=ep(c,a+1,Xp))}return Qu(h,0,r+Yp(a)+i)},bA=function(){for(var e=new Int32Array(256),n=0;n<256;++n){for(var t=n,r=9;--r;)t=(t&1&&-306674912)^t>>>1;e[n]=t}return e}(),_A=function(){var e=-1;return{p:function(n){for(var t=e,r=0;r>>8;e=t},d:function(){return~e}}},wA=function(e,n,t,r,i){return vA(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,t,r,!i)},kb=function(e,n){var t={};for(var r in e)t[r]=e[r];for(var r in n)t[r]=n[r];return t},Ti=function(e,n){return e[n]|e[n+1]<<8},ni=function(e,n){return(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24)>>>0},Pd=function(e,n){return ni(e,n)+ni(e,n+4)*4294967296},Dr=function(e,n,t){for(;t;++n)e[n]=t,t>>>=8};function EA(e,n){return wA(e,n||{},0,0)}function SA(e,n){return gA(e,n)}var Ob=function(e,n,t,r){for(var i in e){var s=e[i],u=n+i,h=r;Array.isArray(s)&&(h=kb(r,s[1]),s=s[0]),s instanceof dr?t[u]=[s,h]:(t[u+="/"]=[new dr(0),h],Ob(s,u,t,r))}},Zm=typeof TextEncoder<"u"&&new TextEncoder,tp=typeof TextDecoder<"u"&&new TextDecoder,CA=0;try{tp.decode(Xp,{stream:!0}),CA=1}catch{}var TA=function(e){for(var n="",t=0;;){var r=e[t++],i=(r>127)+(r>223)+(r>239);if(t+i>e.length)return[n,Qu(e,t-1)];i?i==3?(r=((r&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,n+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?n+=String.fromCharCode((r&31)<<6|e[t++]&63):n+=String.fromCharCode((r&15)<<12|(e[t++]&63)<<6|e[t++]&63):n+=String.fromCharCode(r)}};function rp(e,n){if(n){for(var t=new dr(e.length),r=0;r>1)),u=0,h=function(f){s[u++]=f},r=0;rs.length){var c=new dr(u+8+(i-r<<1));c.set(s),s=c}var a=e.charCodeAt(r);a<128||n?h(a):a<2048?(h(192|a>>6),h(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++r)&1023,h(240|a>>18),h(128|a>>12&63),h(128|a>>6&63),h(128|a&63)):(h(224|a>>12),h(128|a>>6&63),h(128|a&63))}return Qu(s,0,u)}function Jp(e,n){if(n){for(var t="",r=0;r65535&&mn(9),n+=r+4}return n},ev=function(e,n,t,r,i,s,u,h){var c=r.length,a=t.extra,d=h&&h.length,f=np(a);Dr(e,n,u!=null?33639248:67324752),n+=4,u!=null&&(e[n++]=20,e[n++]=t.os),e[n]=20,n+=2,e[n++]=t.flag<<1|(s<0&&8),e[n++]=i&&8,e[n++]=t.compression&255,e[n++]=t.compression>>8;var g=new Date(t.mtime==null?Date.now():t.mtime),I=g.getFullYear()-1980;if((I<0||I>119)&&mn(10),Dr(e,n,I<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>>1),n+=4,s!=-1&&(Dr(e,n,t.crc),Dr(e,n+4,s<0?-s-2:s),Dr(e,n+8,t.size)),Dr(e,n+12,c),Dr(e,n+14,f),n+=16,u!=null&&(Dr(e,n,d),Dr(e,n+6,t.attrs),Dr(e,n+10,u),n+=14),e.set(r,n),n+=c,f)for(var C in a){var v=a[C],T=v.length;Dr(e,n,+C),Dr(e,n+2,T),e.set(v,n+4),n+=4+T}return d&&(e.set(h,n),n+=d),n},kA=function(e,n,t,r,i){Dr(e,n,101010256),Dr(e,n+8,t),Dr(e,n+10,t),Dr(e,n+12,r),Dr(e,n+16,i)};function OA(e,n){n||(n={});var t={},r=[];Ob(e,"",t,n);var i=0,s=0;for(var u in t){var h=t[u],c=h[0],a=h[1],d=a.level==0?0:8,f=rp(u),g=f.length,I=a.comment,C=I&&rp(I),v=C&&C.length,T=np(a.extra);g>65535&&mn(11);var O=d?EA(c,a):c,k=O.length,y=_A();y.p(c),r.push(kb(a,{size:c.length,crc:y.d(),c:O,f,m:C,u:g!=u.length||C&&I.length!=v,o:i,compression:d})),i+=30+g+T+k,s+=76+2*(g+T)+(v||0)+k}for(var R=new dr(s+22),w=i,L=s-i,D=0;D65558)&&mn(13);var i=Ti(e,r+8);if(!i)return{};var s=ni(e,r+16),u=s==4294967295||i==65535;if(u){var h=ni(e,r-12);u=ni(e,h)==101075792,u&&(i=ni(e,h+32),s=ni(e,h+48))}for(var c=n&&n.filter,a=0;a=0,ap=Mo.indexOf("Macintosh")>=0,jA=(Mo.indexOf("Macintosh")>=0||Mo.indexOf("iPad")>=0||Mo.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Rc=Mo.indexOf("Linux")>=0,Pb=!0,Bd=navigator.language,sp=Bd):typeof Bn=="object"?(op=Bn.platform==="win32",ap=Bn.platform==="darwin",Rc=Bn.platform==="linux",xA=Rc&&!!Bn.env.SNAP&&!!Bn.env.SNAP_REVISION,DA=Bb,qA=!!Bn.env.CI||!!Bn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Bd=ip,sp=ip,UA=!0):console.error("Unable to resolve platform.");var Nb={[1]:"Mac",[2]:"Linux",[3]:"Windows"};function MA(e){switch(e){case 0:return"Web";case 1:case 2:case 3:return Nb[e];default:NA(e)}}var Ic=0;ap?Ic=1:op?Ic=3:Rc&&(Ic=2);var Ak=Object.values(Nb),kk=MA(Ic),Ok=Pb&&typeof $o.importScripts=="function",Ai=Mo,qo=sp,VA;(e=>{function n(){return qo}e.value=n;function t(){return qo.length===2?qo==="en":qo.length>=3?qo[0]==="e"&&qo[1]==="n"&&qo[2]==="-":!1}e.isDefaultVariant=t;function r(){return qo==="en"}e.isDefault=r})(VA||={});var Pk=(()=>{if(typeof $o.postMessage=="function"&&!$o.importScripts){let e=[];$o.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let r=0,i=e.length;r{let r=++n;e.push({id:r,callback:t}),$o.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})(),FA=!!(Ai&&Ai.indexOf("Chrome")>=0),Bk=!!(Ai&&Ai.indexOf("Firefox")>=0),Lk=!!(!FA&&Ai&&Ai.indexOf("Safari")>=0),Nk=!!(Ai&&Ai.indexOf("Edg/")>=0),xk=!!(Ai&&Ai.indexOf("Android")>=0),rv=ks($5()),xb=class{static read(e,n){return e.readFields(xb._readField,{sha256_with_rsa:[],sha256_with_ecdsa:[],signed_header_data:null},n)}static _readField(e,n,t){!n||!t||(e===2?n.sha256_with_rsa?.push(Tu.read(t,t.readVarint()+t.pos)):e===3?n.sha256_with_ecdsa?.push(Tu.read(t,t.readVarint()+t.pos)):e===1e4&&(n.signed_header_data=t.readBytes()))}static write(e,n){if(!(!e||!n)){if(e.sha256_with_rsa)for(var t=0;tHA(e,n),QA=ks(z5()),YA=ks(G5()),XA=ks(Eb()),JA={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"},ZA=e=>e.replace(/[0-9a-f]/gi,n=>JA[n]),e8=e=>ZA(QA.encode(YA.hash(XA.default.util.binary.base64.decode(e)),!0).slice(0,32)),t8=(e,n,t)=>` +`,g},r.publicKeyToOpenSSH=function(h,c){var a="ssh-rsa";c=c||"";var d=t.util.createBuffer();return s(d,a),i(d,h.e),i(d,h.n),a+" "+t.util.encode64(d.bytes())+" "+c},r.privateKeyToOpenSSH=function(h,c){return c?t.pki.encryptRsaPrivateKey(h,c,{legacy:!0,algorithm:"aes128"}):t.pki.privateKeyToPem(h)},r.getPublicKeyFingerprint=function(h,c){c=c||{};var a=c.md||t.md.md5.create(),d="ssh-rsa",f=t.util.createBuffer();s(f,d),i(f,h.e),i(f,h.n),a.start(),a.update(f.getBytes());var g=a.digest();if(c.encoding==="hex"){var I=g.toHex();return c.delimiter?I.match(/.{2}/g).join(c.delimiter):I}else{if(c.encoding==="binary")return g.getBytes();if(c.encoding)throw new Error('Unknown encoding "'+c.encoding+'".')}return g};function i(h,c){var a=c.toString(16);a[0]>="8"&&(a="00"+a);var d=t.util.hexToBytes(a);h.putInt32(d.length),h.putBytes(d)}function s(h,c){h.putInt32(c.length),h.putString(c)}function u(){for(var h=t.md.sha1.create(),c=arguments.length,a=0;a{n.exports=lt(),Pa(),z5(),ki(),Mp(),ih(),K5(),Hu(),W5(),G5(),Q5(),lb(),Fp(),ks(),ob(),cb(),Y5(),hb(),ab(),nb(),$p(),ui(),ib(),X5(),fb(),Et()});function J5(e,n){return yb(n,(t,r)=>`${e}/${r}`)}function yb(e,n=(t,r)=>`${t}: ${r}`){return Object.entries(e).reduce((t,[r,i])=>(t[r]=n(r,i),t),{})}var Nu={Itero:"https://itero.plasmo.com"},Z5={Base:"/api/chrome-policy",Hash:"/api/chrome-policy/hash"},mk=J5(Nu.Itero,Z5),vk=As(N5(),1),Fm=65536;async function*Sd(e,n=!0){for(let t of e)if("stream"in t)yield*t.stream();else if(ArrayBuffer.isView(t))if(n){let r=t.byteOffset,i=t.byteOffset+t.byteLength;for(;r!==i;){let s=Math.min(i-r,Fm),u=t.buffer.slice(r,r+s);r+=u.byteLength,yield new Uint8Array(u)}}else yield t;else{let r=0,i=t;for(;r!==i.size;){let s=await i.slice(r,Math.min(i.size,r+Fm)).arrayBuffer();r+=s.byteLength,yield new Uint8Array(s)}}}var gb=class Hd{#e=[];#r="";#t=0;#n="transparent";constructor(n=[],t={}){if(typeof n!="object"||n===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof n[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof t!="object"&&typeof t!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");t===null&&(t={});let r=new TextEncoder;for(let s of n){let u;ArrayBuffer.isView(s)?u=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?u=new Uint8Array(s.slice(0)):s instanceof Hd?u=s:u=r.encode(`${s}`),this.#t+=ArrayBuffer.isView(u)?u.byteLength:u.size,this.#e.push(u)}this.#n=`${t.endings===void 0?"transparent":t.endings}`;let i=t.type===void 0?"":String(t.type);this.#r=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#t}get type(){return this.#r}async text(){let n=new TextDecoder,t="";for await(let r of Sd(this.#e,!1))t+=n.decode(r,{stream:!0});return t+=n.decode(),t}async arrayBuffer(){let n=new Uint8Array(this.size),t=0;for await(let r of Sd(this.#e,!1))n.set(r,t),t+=r.length;return n.buffer}stream(){let n=Sd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(t){let r=await n.next();r.done?t.close():t.enqueue(r.value)},async cancel(){await n.return()}})}slice(n=0,t=this.size,r=""){let{size:i}=this,s=n<0?Math.max(i+n,0):Math.min(n,i),u=t<0?Math.max(i+t,0):Math.min(t,i),h=Math.max(u-s,0),c=this.#e,a=[],d=0;for(let g of c){if(d>=h)break;let I=ArrayBuffer.isView(g)?g.byteLength:g.size;if(s&&I<=s)s-=I,u-=I;else{let C;ArrayBuffer.isView(g)?(C=g.subarray(s,Math.min(I,u)),d+=C.byteLength):(C=g.slice(s,Math.min(I,u)),d+=C.size),u-=I,a.push(C),s=0}}let f=new Hd([],{type:String(r).toLowerCase()});return f.#t=h,f.#e=a,f}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](n){return n&&typeof n=="object"&&typeof n.constructor=="function"&&(typeof n.stream=="function"||typeof n.arrayBuffer=="function")&&/^(Blob|File)$/.test(n[Symbol.toStringTag])}};Object.defineProperties(gb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});var eA=gb,Ec=eA,tA=(0,R5.createRequire)("/"),rA;try{rA=tA("worker_threads").Worker}catch{}var dr=Uint8Array,bn=Uint16Array,sh=Uint32Array,uh=new dr([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]),lh=new dr([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]),Kd=new dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),mb=function(e,n){for(var t=new bn(31),r=0;r<31;++r)t[r]=n+=1<>>1|(At&21845)<<1,ro=(ro&52428)>>>2|(ro&13107)<<2,ro=(ro&61680)>>>4|(ro&3855)<<4,Gd[At]=((ro&65280)>>>8|(ro&255)<<8)>>>1;var ro,At,Ii=function(e,n,t){for(var r=e.length,i=0,s=new bn(n);i>>c]=a}else for(h=new bn(r),i=0;i>>15-e[i]);return h},$o=new dr(288);for(At=0;At<144;++At)$o[At]=8;var At;for(At=144;At<256;++At)$o[At]=9;var At;for(At=256;At<280;++At)$o[At]=7;var At;for(At=280;At<288;++At)$o[At]=8;var At,xu=new dr(32);for(At=0;At<32;++At)xu[At]=5;var At,iA=Ii($o,9,0),oA=Ii($o,9,1),aA=Ii(xu,5,0),sA=Ii(xu,5,1),Cd=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},ti=function(e,n,t){var r=n/8|0;return(e[r]|e[r+1]<<8)>>(n&7)&t},Td=function(e,n){var t=n/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(n&7)},Hp=function(e){return(e+7)/8|0},Wu=function(e,n,t){(n==null||n<0)&&(n=0),(t==null||t>e.length)&&(t=e.length);var r=new(e.BYTES_PER_ELEMENT==2?bn:e.BYTES_PER_ELEMENT==4?sh:dr)(t-n);return r.set(e.subarray(n,t)),r},uA=["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"],mn=function(e,n,t){var r=new Error(n||uA[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,mn),!t)throw r;return r},lA=function(e,n,t){var r=e.length;if(!r||t&&t.f&&!t.l)return n||new dr(0);var i=!n||t,s=!t||t.i;t||(t={}),n||(n=new dr(r*3));var u=function(Ce){var $e=n.length;if(Ce>$e){var Ie=new dr(Math.max($e*2,Ce));Ie.set(n),n=Ie}},h=t.f||0,c=t.p||0,a=t.b||0,d=t.l,f=t.d,g=t.m,I=t.n,C=r*8;do{if(!d){h=ti(e,c,1);var v=ti(e,c+1,3);if(c+=3,v)if(v==1)d=oA,f=sA,g=9,I=5;else if(v==2){var T=ti(e,c,31)+257,O=ti(e,c+10,15)+4,k=T+ti(e,c+5,31)+1;c+=14;for(var y=new dr(k),R=new dr(19),w=0;w>>4;if(p<16)y[w++]=p;else{var q=0,V=0;for(p==16?(V=3+ti(e,c,3),c+=2,q=y[w-1]):p==17?(V=3+ti(e,c,7),c+=3):p==18&&(V=11+ti(e,c,127),c+=7);V--;)y[w++]=q}}var $=y.subarray(0,T),E=y.subarray(T);g=Cd($),I=Cd(E),d=Ii($,g,1),f=Ii(E,I,1)}else mn(1);else{var p=Hp(c)+4,B=e[p-4]|e[p-3]<<8,j=p+B;if(j>r){s&&mn(0);break}i&&u(a+B),n.set(e.subarray(p,j),a),t.b=a+=B,t.p=c=j*8,t.f=h;continue}if(c>C){s&&mn(0);break}}i&&u(a+131072);for(var N=(1<>>4;if(c+=q&15,c>C){s&&mn(0);break}if(q||mn(2),oe<256)n[a++]=oe;else if(oe==256){ee=c,d=null;break}else{var ae=oe-254;if(oe>264){var w=oe-257,pe=uh[w];ae=ti(e,c,(1<>>4;_e||mn(3),c+=_e&15;var E=nA[Re];if(Re>3){var pe=lh[Re];E+=Td(e,c)&(1<C){s&&mn(0);break}i&&u(a+131072);for(var qe=a+ae;a>>8},_u=function(e,n,t){t<<=n&7;var r=n/8|0;e[r]|=t,e[r+1]|=t>>>8,e[r+2]|=t>>>16},Rd=function(e,n){for(var t=[],r=0;rg&&(g=s[r].s);var I=new bn(g+1),C=Qd(t[d-1],I,0);if(C>n){var r=0,v=0,T=C-n,O=1<n)v+=O-(1<>>=T;v>0;){var y=s[r].s;I[y]=0&&v;--r){var R=s[r].s;I[R]==n&&(--I[R],++v)}C=n}return[new dr(I),C]},Qd=function(e,n,t){return e.s==-1?Math.max(Qd(e.l,n,t+1),Qd(e.r,n,t+1)):n[e.s]=t},zm=function(e){for(var n=e.length;n&&!e[--n];);for(var t=new bn(++n),r=0,i=e[0],s=1,u=function(c){t[r++]=c},h=1;h<=n;++h)if(e[h]==i&&h!=n)++s;else{if(!i&&s>2){for(;s>138;s-=138)u(32754);s>2&&(u(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(u(i),--s;s>6;s-=6)u(8304);s>2&&(u(s-3<<5|8208),s=0)}for(;s--;)u(i);s=1,i=e[h]}return[t.subarray(0,r),n]},wu=function(e,n){for(var t=0,r=0;r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s4&&!p[Kd[V-1]];--V);var $=a+5<<3,E=wu(i,$o)+wu(s,xu)+u,B=wu(i,g)+wu(s,v)+u+14+3*V+wu(D,p)+(2*D[16]+3*D[17]+7*D[18]);if($<=E&&$<=B)return Yd(n,d,e.subarray(c,c+a));var j,N,M,ee;if(no(n,d,1+(B15&&(no(n,d,_e[S]>>>5&127),d+=_e[S]>>>12)}}else j=iA,N=$o,M=aA,ee=xu;for(var S=0;S255){var Re=r[S]>>>18&31;_u(n,d,j[Re+257]),d+=N[Re+257],Re>7&&(no(n,d,r[S]>>>23&31),d+=uh[Re]);var qe=r[S]&31;_u(n,d,M[qe]),d+=ee[qe],qe>3&&(_u(n,d,r[S]>>>5&8191),d+=lh[qe])}else _u(n,d,j[r[S]]),d+=N[r[S]];return _u(n,d,j[256]),d+N[256]},cA=new sh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Kp=new dr(0),hA=function(e,n,t,r,i,s){var u=e.length,h=new dr(r+u+5*(1+Math.ceil(u/7e3))+i),c=h.subarray(r,h.length-i),a=0;if(!n||u<8)for(var d=0;d<=u;d+=65535){var f=d+65535;f>=u&&(c[a>>3]=s),a=Yd(c,a+1,e.subarray(d,f))}else{for(var g=cA[n-1],I=g>>>13,C=g&8191,v=(1<7e3||p>24576)&&j>423){a=Hm(e,c,0,w,L,D,m,p,V,d-V,a),p=S=m=0,V=d;for(var N=0;N<286;++N)L[N]=0;for(var N=0;N<30;++N)D[N]=0}var M=2,ee=0,oe=C,ae=E-B&32767;if(j>2&&$==R(d-ae))for(var pe=Math.min(I,j)-1,_e=Math.min(32767,d),Re=Math.min(258,j);ae<=_e&&--oe&&E!=B;){if(e[d+M]==e[d+M-ae]){for(var qe=0;qeM){if(M=qe,ee=ae,qe>pe)break;for(var Ce=Math.min(ae,qe-2),$e=0,N=0;N$e&&($e=Je,B=Ie)}}}E=B,B=T[E],ae+=E-B+32768&32767}if(ee){w[p++]=268435456|Wd[M]<<18|$m[ee];var x=Wd[M]&31,X=$m[ee]&31;m+=uh[x]+lh[X],++L[257+x],++D[X],q=d+M,++S}else w[p++]=e[d],++L[e[d]]}}a=Hm(e,c,s,w,L,D,m,p,V,d-V,a),!s&&a&7&&(a=Yd(c,a+1,Kp))}return Wu(h,0,r+Hp(a)+i)},fA=function(){for(var e=new Int32Array(256),n=0;n<256;++n){for(var t=n,r=9;--r;)t=(t&1&&-306674912)^t>>>1;e[n]=t}return e}(),dA=function(){var e=-1;return{p:function(n){for(var t=e,r=0;r>>8;e=t},d:function(){return~e}}},pA=function(e,n,t,r,i){return hA(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,t,r,!i)},wb=function(e,n){var t={};for(var r in e)t[r]=e[r];for(var r in n)t[r]=n[r];return t},Ti=function(e,n){return e[n]|e[n+1]<<8},ni=function(e,n){return(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24)>>>0},Id=function(e,n){return ni(e,n)+ni(e,n+4)*4294967296},Dr=function(e,n,t){for(;t;++n)e[n]=t,t>>>=8};function yA(e,n){return pA(e,n||{},0,0)}function gA(e,n){return lA(e,n)}var Eb=function(e,n,t,r){for(var i in e){var s=e[i],u=n+i,h=r;Array.isArray(s)&&(h=wb(r,s[1]),s=s[0]),s instanceof dr?t[u]=[s,h]:(t[u+="/"]=[new dr(0),h],Eb(s,u,t,r))}},Km=typeof TextEncoder<"u"&&new TextEncoder,Xd=typeof TextDecoder<"u"&&new TextDecoder,mA=0;try{Xd.decode(Kp,{stream:!0}),mA=1}catch{}var vA=function(e){for(var n="",t=0;;){var r=e[t++],i=(r>127)+(r>223)+(r>239);if(t+i>e.length)return[n,Wu(e,t-1)];i?i==3?(r=((r&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,n+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?n+=String.fromCharCode((r&31)<<6|e[t++]&63):n+=String.fromCharCode((r&15)<<12|(e[t++]&63)<<6|e[t++]&63):n+=String.fromCharCode(r)}};function Jd(e,n){if(n){for(var t=new dr(e.length),r=0;r>1)),u=0,h=function(f){s[u++]=f},r=0;rs.length){var c=new dr(u+8+(i-r<<1));c.set(s),s=c}var a=e.charCodeAt(r);a<128||n?h(a):a<2048?(h(192|a>>6),h(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++r)&1023,h(240|a>>18),h(128|a>>12&63),h(128|a>>6&63),h(128|a&63)):(h(224|a>>12),h(128|a>>6&63),h(128|a&63))}return Wu(s,0,u)}function Wp(e,n){if(n){for(var t="",r=0;r65535&&mn(9),n+=r+4}return n},Wm=function(e,n,t,r,i,s,u,h){var c=r.length,a=t.extra,d=h&&h.length,f=Zd(a);Dr(e,n,u!=null?33639248:67324752),n+=4,u!=null&&(e[n++]=20,e[n++]=t.os),e[n]=20,n+=2,e[n++]=t.flag<<1|(s<0&&8),e[n++]=i&&8,e[n++]=t.compression&255,e[n++]=t.compression>>8;var g=new Date(t.mtime==null?Date.now():t.mtime),I=g.getFullYear()-1980;if((I<0||I>119)&&mn(10),Dr(e,n,I<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>>1),n+=4,s!=-1&&(Dr(e,n,t.crc),Dr(e,n+4,s<0?-s-2:s),Dr(e,n+8,t.size)),Dr(e,n+12,c),Dr(e,n+14,f),n+=16,u!=null&&(Dr(e,n,d),Dr(e,n+6,t.attrs),Dr(e,n+10,u),n+=14),e.set(r,n),n+=c,f)for(var C in a){var v=a[C],T=v.length;Dr(e,n,+C),Dr(e,n+2,T),e.set(v,n+4),n+=4+T}return d&&(e.set(h,n),n+=d),n},EA=function(e,n,t,r,i){Dr(e,n,101010256),Dr(e,n+8,t),Dr(e,n+10,t),Dr(e,n+12,r),Dr(e,n+16,i)};function SA(e,n){n||(n={});var t={},r=[];Eb(e,"",t,n);var i=0,s=0;for(var u in t){var h=t[u],c=h[0],a=h[1],d=a.level==0?0:8,f=Jd(u),g=f.length,I=a.comment,C=I&&Jd(I),v=C&&C.length,T=Zd(a.extra);g>65535&&mn(11);var O=d?yA(c,a):c,k=O.length,y=dA();y.p(c),r.push(wb(a,{size:c.length,crc:y.d(),c:O,f,m:C,u:g!=u.length||C&&I.length!=v,o:i,compression:d})),i+=30+g+T+k,s+=76+2*(g+T)+(v||0)+k}for(var R=new dr(s+22),w=i,L=s-i,D=0;D65558)&&mn(13);var i=Ti(e,r+8);if(!i)return{};var s=ni(e,r+16),u=s==4294967295||i==65535;if(u){var h=ni(e,r-12);u=ni(e,h)==101075792,u&&(i=ni(e,h+32),s=ni(e,h+48))}for(var c=n&&n.filter,a=0;a=0,rp=qo.indexOf("Macintosh")>=0,PA=(qo.indexOf("Macintosh")>=0||qo.indexOf("iPad")>=0||qo.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Sc=qo.indexOf("Linux")>=0,Sb=!0,Ad=navigator.language,np=Ad):typeof Bn=="object"?(tp=Bn.platform==="win32",rp=Bn.platform==="darwin",Sc=Bn.platform==="linux",AA=Sc&&!!Bn.env.SNAP&&!!Bn.env.SNAP_REVISION,OA=Cb,BA=!!Bn.env.CI||!!Bn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ad=ep,np=ep,kA=!0):console.error("Unable to resolve platform.");var Rb={[1]:"Mac",[2]:"Linux",[3]:"Windows"};function LA(e){switch(e){case 0:return"Web";case 1:case 2:case 3:return Rb[e];default:IA(e)}}var Cc=0;rp?Cc=1:tp?Cc=3:Sc&&(Cc=2);var wk=Object.values(Rb),Ek=LA(Cc),Sk=Sb&&typeof Fo.importScripts=="function",Ai=qo,jo=np,NA;(e=>{function n(){return jo}e.value=n;function t(){return jo.length===2?jo==="en":jo.length>=3?jo[0]==="e"&&jo[1]==="n"&&jo[2]==="-":!1}e.isDefaultVariant=t;function r(){return jo==="en"}e.isDefault=r})(NA||={});var Ck=(()=>{if(typeof Fo.postMessage=="function"&&!Fo.importScripts){let e=[];Fo.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let r=0,i=e.length;r{let r=++n;e.push({id:r,callback:t}),Fo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})(),xA=!!(Ai&&Ai.indexOf("Chrome")>=0),Tk=!!(Ai&&Ai.indexOf("Firefox")>=0),Rk=!!(!xA&&Ai&&Ai.indexOf("Safari")>=0),Ik=!!(Ai&&Ai.indexOf("Edg/")>=0),Ak=!!(Ai&&Ai.indexOf("Android")>=0),Qm=As(U5()),Ib=class{static read(e,n){return e.readFields(Ib._readField,{sha256_with_rsa:[],sha256_with_ecdsa:[],signed_header_data:null},n)}static _readField(e,n,t){!n||!t||(e===2?n.sha256_with_rsa?.push(Cu.read(t,t.readVarint()+t.pos)):e===3?n.sha256_with_ecdsa?.push(Cu.read(t,t.readVarint()+t.pos)):e===1e4&&(n.signed_header_data=t.readBytes()))}static write(e,n){if(!(!e||!n)){if(e.sha256_with_rsa)for(var t=0;tjA(e,n),FA=As(D5()),$A=As(V5()),zA=As(pb()),HA={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"},KA=e=>e.replace(/[0-9a-f]/gi,n=>HA[n]),WA=e=>KA(FA.encode($A.hash(zA.default.util.binary.base64.decode(e)),!0).slice(0,32)),GA=(e,n,t)=>` -`,r8=e=>`${xu.Itero}/api/ext/update/${e}`,n8=e=>`${xu.Itero}/api/ext/install/${e}`,i8=ks(Eb()),{pki:lo,asn1:nv}=i8.default,o8=(e="")=>new Promise((n,t)=>{try{if(e){let r=lo.privateKeyFromPem(e),i=lo.rsa.setPublicKey(r.n,r.e);n({privateKey:r,publicKey:i})}else lo.rsa.generateKeyPair({bits:2048,workers:2},(r,i)=>{n(i)})}catch(r){t(r)}}),a8=e=>{let n=lo.privateKeyToAsn1(e),t=lo.wrapRsaPrivateKey(n);return lo.privateKeyInfoToPem(t)},s8=async(e="")=>{let{publicKey:n,privateKey:t}=await o8(e);return{text:{public:()=>{let r=lo.publicKeyToPem(n),i=u8(r);return console.log({publicKey:n,untrimmedKey:r,trimmedKey:i}),i},private:()=>a8(t)},binary:{public:()=>Buffer.from(nv.toDer(lo.publicKeyToAsn1(n)).getBytes(),"binary"),private:()=>Buffer.from(nv.toDer(lo.privateKeyToAsn1(t)).getBytes(),"binary")}}},u8=(e,n=!1)=>{let t=n?"PRIVATE":"PUBLIC";return e.replace(`-----BEGIN ${t} KEY-----`,"").replace(`-----END ${t} KEY-----`,"").replace(/\n|\r/g,"").trim()},l8=(e,n)=>{if(!e.icons)throw new Error("No icons found in manifest");let t=Object.keys(e.icons).reduce((c,a)=>Math.max(c,parseInt(a)),0);if(!t)throw new Error("Invalid icon sizes, must be a number");let r=(0,$c.normalize)(e.icons[t]),i=(0,$c.extname)(r).slice(1);if(!tv.has(i))throw new Error("Invalid icon type. Valid types are: "+[...tv].join(", "));let s=Zp[i];if(!n[r])throw new Error("Could not find extension icon. Please ensure the icon paths are correct in your manifest.json");let u=Buffer.from(n[r]),h=new Tc([u],{type:s});return{path:r,type:s,blob:h}},xd=/__MSG_(?.*)__/gm,c8=e=>new Promise((n,t)=>{let r,i=PA(e);if(i["manifest.json"])r=i;else{let u=Object.keys(i),h=u.find(a=>a.endsWith("manifest.json"));if(!h){t(new Error("Cannot locate manifest.json"));return}let c=(0,$c.dirname)(h);r=u.reduce((a,d)=>{if(d.startsWith(c)){let f=(0,$c.relative)(c,d);f&&(a[f+(d.endsWith("/")?"/":"")]=i[d])}return a},{})}let s=JSON.parse(Jp(r["manifest.json"]));n({unzip:r,manifestData:s})}),h8=class{manifest;displayManifest;iconData;#e;get submitManifest(){return{...this.manifest,...this.displayManifest}}loadManifest=async e=>{let{unzip:n,manifestData:t}=await c8(e);this.#e=n,this.manifest=t,this.displayManifest=this.getDisplayManifest(),this.iconData=l8(this.manifest,n)};getDisplayManifest(){let e={name:this.manifest.name,version:this.manifest.version,description:this.manifest.description||"",version_name:this.manifest.version_name||""};try{if(this.manifest.default_locale){let n=this.manifest.default_locale,t=JSON.parse(Jp(this.#e[`_locales/${n}/messages.json`]));e.name=e.name.replace(xd,(r,i)=>t[i].message),e.description=e.description.replace(xd,(r,i)=>t[i].message),e.version_name=e.version_name.replace(xd,(r,i)=>t[i].message)}}catch{throw new Error("default_locale is defined, but no locale data is found")}return e}#r;#t;loadKey=async e=>{if(!e)throw new Error("Missing private key?!");this.#r=await s8(e);let n=this.#r.text.public();this.manifest.key=n,this.#t=e8(this.manifest.key),this.manifest.update_url=r8(this.#t)};generateResources=async()=>{if(!this.#r||!this.#t||!this.manifest.key)throw new Error("Key not loaded");this.#e["manifest.json"]=rp(JSON.stringify(this.manifest));let e=Buffer.from(OA(this.#e)),n=GA(this.#r,Buffer.from(e));return{icon:this.iconData.blob,crx:new Tc([n],{type:"application/x-chrome-extension"}),zip:new Tc([e],{type:"application/zip"}),xml:new Tc([t8(this.#t,n8(this.#t),this.manifest.version)],{type:"text/xml"})}}},Db=typeof globalThis.process<"u"?globalThis.process.argv:[],f8=()=>typeof globalThis.process<"u"?globalThis.process.env:{},d8=new Set(Db),jb=e=>d8.has(e),Uk=Db.filter(e=>e.startsWith("--")&&e.includes("=")).map(e=>e.split("=")).reduce((e,[n,t])=>(e[n]=t,e),{}),Dk=jb("--dry-run"),qb=()=>jb("--verbose")||f8().VERBOSE==="true",jk=qb(),p8=(e="",...n)=>console.log(e.padEnd(9),"|",...n),y8=0,g8=(...e)=>qb()&&p8(`\u{1F7E1} ${y8++}`,...e),m8=async(e,n)=>{let t=Buffer.from(await n.arrayBuffer());return Gd.put(e,{headers:{"Content-Type":n.type},body:t})},v8={privateKey:"",token:"",entityId:"",extensionId:""},e0=Sb(v8,e=>`Missing ${e}`),b8=Object.keys(e0),_8=class{options={};constructor(e){for(let n of b8){if(!e[n])throw new Error(e0[n]);this.options[n]=e[n]}}async submit({filePath:e=""}){let n=await(0,DI.readFile)(e),t=new h8;await t.loadManifest(n),await t.loadKey(this.options.privateKey);let{version:r,...i}=await Gd.post(`${xu.Itero}/api/submit`,{json:{token:this.options.token,entityId:this.options.entityId,manifest:t.submitManifest,iconContentType:t.iconData.type}}).json();g8(`New version: ${r}`),t.manifest.version=r;let s=await t.generateResources(),u={xml:i.uploadXmlUrl,crx:i.crxFileUrl,zip:i.zipUrl,icon:i.iconUrl};await Promise.all(Object.entries(u).map(([h,c])=>m8(c,s[h]))),await Gd.put(`${xu.Itero}/api/submit`,{json:{token:this.options.token,entityId:this.options.entityId,extensionId:this.options.extensionId}})}},Du="itero",w8=rh(Du);function E8(e){return ho(this,null,function*(){var n=e,{zip:t,dryRun:r}=n,i=Hc(n,["zip","dryRun"]);let s=new _8(zc({},i));if(w8("Updating extension to Itero TestBed"),r)return!0;try{return yield s.submit({filePath:t}),th({market:Du,zip:t}),!0}catch(u){throw nh(u,Du)}})}function S8(e){return ho(this,null,function*(){return e.zip=zu(e),e.verbose&&Hu(Du),Ku({market:Du,options:e,errorMap:e0}),E8(e)})}});var ur=uu(Wf()),sn=uu(Vb());var Yu=e=>`${e.padEnd(9)} |`,$b=e=>e.zip||e.file,Fb=e=>!!$b(e);function C8(){return Dy(this,null,function*(){try{(0,ur.info)("\u{1F7E3} Plasmo Browser Platform Publish v3");let e=JSON.parse((0,ur.getInput)("keys",{required:!0})),n=(0,ur.getInput)("file")||(0,ur.getInput)("zip")||(0,ur.getInput)("artifact"),t=(0,ur.getInput)("version-file"),r=(0,ur.getInput)("notes")||(0,ur.getInput)("edge-notes"),i=!!(0,ur.getInput)("verbose");i&&(console.log=ur.info);let s=Object.keys(e).filter(a=>sn.supportedBrowserSet.has(a));if(s.length===0)throw new Error("No supported browser found");for(let a of s){let d=(0,ur.getInput)(`${a}-file`),f=$b(e[a]);d?e[a].zip=d:f?e[a].zip=f:n?e[a].zip=n:(0,ur.warning)(`${Yu("\u{1F7E1} SKIP")} No artifact available to submit for ${a}`),i&&(e[a].verbose=i),t&&(e[a].versionFile=t)}if(!s.some(a=>Fb(e[a])))throw new Error("No artifact found for deployment");if(e.edge&&r&&(e.edge.notes=r),process.env.NODE_ENV==="test"){(0,ur.debug)(JSON.stringify({artifact:n,versionFile:t,verbose:i})),(0,ur.debug)(s.join(","));return}let h=s.map(a=>{if(!Fb(e[a]))return!1;switch((0,ur.info)(`${Yu("\u{1F7E1} QUEUE")} Prepare for ${a} submission`),a){case sn.BrowserName.Chrome:return(0,sn.submitChrome)(e[a]);case sn.BrowserName.Firefox:return(0,sn.submitFirefox)(e[a]);case sn.BrowserName.Edge:return(0,sn.submitEdge)(e[a]);case sn.BrowserName.Itero:return(0,sn.submitItero)(e[a])}});(yield Promise.allSettled(h)).forEach((a,d)=>{a.status==="rejected"?(0,ur.setFailed)(`${Yu("\u{1F534} ERROR")} ${a.reason}`):a.value&&(0,ur.info)(`${Yu("\u{1F7E2} DONE")} ${s[d]} submission successful`)})}catch(e){e instanceof Error&&(0,ur.setFailed)(`${Yu("\u{1F534} ERROR")} ${e.message}`)}})}C8(); +`,QA=e=>`${Nu.Itero}/api/ext/update/${e}`,YA=e=>`${Nu.Itero}/api/ext/install/${e}`,XA=As(pb()),{pki:lo,asn1:Ym}=XA.default,JA=(e="")=>new Promise((n,t)=>{try{if(e){let r=lo.privateKeyFromPem(e),i=lo.rsa.setPublicKey(r.n,r.e);n({privateKey:r,publicKey:i})}else lo.rsa.generateKeyPair({bits:2048,workers:2},(r,i)=>{n(i)})}catch(r){t(r)}}),ZA=e=>{let n=lo.privateKeyToAsn1(e),t=lo.wrapRsaPrivateKey(n);return lo.privateKeyInfoToPem(t)},e8=async(e="")=>{let{publicKey:n,privateKey:t}=await JA(e);return{text:{public:()=>{let r=lo.publicKeyToPem(n),i=t8(r);return console.log({publicKey:n,untrimmedKey:r,trimmedKey:i}),i},private:()=>ZA(t)},binary:{public:()=>Buffer.from(Ym.toDer(lo.publicKeyToAsn1(n)).getBytes(),"binary"),private:()=>Buffer.from(Ym.toDer(lo.privateKeyToAsn1(t)).getBytes(),"binary")}}},t8=(e,n=!1)=>{let t=n?"PRIVATE":"PUBLIC";return e.replace(`-----BEGIN ${t} KEY-----`,"").replace(`-----END ${t} KEY-----`,"").replace(/\n|\r/g,"").trim()},r8=(e,n)=>{if(!e.icons)throw new Error("No icons found in manifest");let t=Object.keys(e.icons).reduce((c,a)=>Math.max(c,parseInt(a)),0);if(!t)throw new Error("Invalid icon sizes, must be a number");let r=(0,qc.normalize)(e.icons[t]),i=(0,qc.extname)(r).slice(1);if(!Gm.has(i))throw new Error("Invalid icon type. Valid types are: "+[...Gm].join(", "));let s=Gp[i];if(!n[r])throw new Error("Could not find extension icon. Please ensure the icon paths are correct in your manifest.json");let u=Buffer.from(n[r]),h=new Ec([u],{type:s});return{path:r,type:s,blob:h}},Pd=/__MSG_(?.*)__/gm,n8=e=>new Promise((n,t)=>{let r,i=CA(e);if(i["manifest.json"])r=i;else{let u=Object.keys(i),h=u.find(a=>a.endsWith("manifest.json"));if(!h){t(new Error("Cannot locate manifest.json"));return}let c=(0,qc.dirname)(h);r=u.reduce((a,d)=>{if(d.startsWith(c)){let f=(0,qc.relative)(c,d);f&&(a[f+(d.endsWith("/")?"/":"")]=i[d])}return a},{})}let s=JSON.parse(Wp(r["manifest.json"]));n({unzip:r,manifestData:s})}),i8=class{manifest;displayManifest;iconData;#e;get submitManifest(){return{...this.manifest,...this.displayManifest}}loadManifest=async e=>{let{unzip:n,manifestData:t}=await n8(e);this.#e=n,this.manifest=t,this.displayManifest=this.getDisplayManifest(),this.iconData=r8(this.manifest,n)};getDisplayManifest(){let e={name:this.manifest.name,version:this.manifest.version,description:this.manifest.description||"",version_name:this.manifest.version_name||""};try{if(this.manifest.default_locale){let n=this.manifest.default_locale,t=JSON.parse(Wp(this.#e[`_locales/${n}/messages.json`]));e.name=e.name.replace(Pd,(r,i)=>t[i].message),e.description=e.description.replace(Pd,(r,i)=>t[i].message),e.version_name=e.version_name.replace(Pd,(r,i)=>t[i].message)}}catch{throw new Error("default_locale is defined, but no locale data is found")}return e}#r;#t;loadKey=async e=>{if(!e)throw new Error("Missing private key?!");this.#r=await e8(e);let n=this.#r.text.public();this.manifest.key=n,this.#t=WA(this.manifest.key),this.manifest.update_url=QA(this.#t)};generateResources=async()=>{if(!this.#r||!this.#t||!this.manifest.key)throw new Error("Key not loaded");this.#e["manifest.json"]=Jd(JSON.stringify(this.manifest));let e=Buffer.from(SA(this.#e)),n=VA(this.#r,Buffer.from(e));return{icon:this.iconData.blob,crx:new Ec([n],{type:"application/x-chrome-extension"}),zip:new Ec([e],{type:"application/zip"}),xml:new Ec([GA(this.#t,YA(this.#t),this.manifest.version)],{type:"text/xml"})}}},kb=typeof globalThis.process<"u"?globalThis.process.argv:[],o8=()=>typeof globalThis.process<"u"?globalThis.process.env:{},a8=new Set(kb),Ob=e=>a8.has(e),kk=kb.filter(e=>e.startsWith("--")&&e.includes("=")).map(e=>e.split("=")).reduce((e,[n,t])=>(e[n]=t,e),{}),Ok=Ob("--dry-run"),Pb=()=>Ob("--verbose")||o8().VERBOSE==="true",Pk=Pb(),s8=(e="",...n)=>console.log(e.padEnd(9),"|",...n),u8=0,l8=(...e)=>Pb()&&s8(`\u{1F7E1} ${u8++}`,...e),c8=async(e,n)=>{let t=Buffer.from(await n.arrayBuffer());return zd.put(e,{headers:{"Content-Type":n.type},body:t})},h8={privateKey:"",token:"",entityId:"",extensionId:""},Qp=yb(h8,e=>`Missing ${e}`),f8=Object.keys(Qp),d8=class{options={};constructor(e){for(let n of f8){if(!e[n])throw new Error(Qp[n]);this.options[n]=e[n]}}async submit({filePath:e=""}){let n=await(0,OI.readFile)(e),t=new i8;await t.loadManifest(n),await t.loadKey(this.options.privateKey);let{version:r,...i}=await zd.post(`${Nu.Itero}/api/submit`,{json:{token:this.options.token,entityId:this.options.entityId,manifest:t.submitManifest,iconContentType:t.iconData.type}}).json();l8(`New version: ${r}`),t.manifest.version=r;let s=await t.generateResources(),u={xml:i.uploadXmlUrl,crx:i.crxFileUrl,zip:i.zipUrl,icon:i.iconUrl};await Promise.all(Object.entries(u).map(([h,c])=>c8(c,s[h]))),await zd.put(`${Nu.Itero}/api/submit`,{json:{token:this.options.token,entityId:this.options.entityId,extensionId:this.options.extensionId}})}},Uu="itero",p8=Xc(Uu);async function y8({zip:e,dryRun:n,...t}){let r=new d8({...t});if(p8("Updating extension to Itero TestBed"),n)return!0;try{return await r.submit({filePath:e}),Yc({market:Uu,zip:e}),!0}catch(i){throw Jc(i,Uu)}}async function g8(e){return e.zip=Fu(e),e.verbose&&$u(Uu),zu({market:Uu,options:e,errorMap:Qp}),y8(e)}});var ur=su(Ff()),sn=su(Lb()),Gu=e=>`${e.padEnd(9)} |`,xb=e=>e.zip||e.file,Nb=e=>!!xb(e);async function m8(){try{(0,ur.info)("\u{1F7E3} Plasmo Browser Platform Publish v3");let e=JSON.parse((0,ur.getInput)("keys",{required:!0})),n=(0,ur.getInput)("file")||(0,ur.getInput)("zip")||(0,ur.getInput)("artifact"),t=(0,ur.getInput)("version-file"),r=(0,ur.getInput)("notes")||(0,ur.getInput)("edge-notes"),i=!!(0,ur.getInput)("verbose");i&&(console.log=ur.info);let s=Object.keys(e).filter(a=>sn.supportedBrowserSet.has(a));if(s.length===0)throw new Error("No supported browser found");for(let a of s){let d=(0,ur.getInput)(`${a}-file`),f=xb(e[a]);d?e[a].zip=d:f?e[a].zip=f:n?e[a].zip=n:(0,ur.warning)(`${Gu("\u{1F7E1} SKIP")} No artifact available to submit for ${a}`),i&&(e[a].verbose=i),t&&(e[a].versionFile=t)}if(!s.some(a=>Nb(e[a])))throw new Error("No artifact found for deployment");if(e.edge&&r&&(e.edge.notes=r),process.env.NODE_ENV==="test"){(0,ur.debug)(JSON.stringify({artifact:n,versionFile:t,verbose:i})),(0,ur.debug)(s.join(","));return}let h=s.map(a=>{if(!Nb(e[a]))return!1;switch((0,ur.info)(`${Gu("\u{1F7E1} QUEUE")} Prepare for ${a} submission`),a){case sn.BrowserName.Chrome:return(0,sn.submitChrome)(e[a]);case sn.BrowserName.Firefox:return(0,sn.submitFirefox)(e[a]);case sn.BrowserName.Edge:return(0,sn.submitEdge)(e[a]);case sn.BrowserName.Itero:return(0,sn.submitItero)(e[a])}});(await Promise.allSettled(h)).forEach((a,d)=>{a.status==="rejected"?(0,ur.setFailed)(`${Gu("\u{1F534} ERROR")} ${a.reason}`):a.value&&(0,ur.info)(`${Gu("\u{1F7E2} DONE")} ${s[d]} submission successful`)})}catch(e){e instanceof Error&&(0,ur.setFailed)(`${Gu("\u{1F534} ERROR")} ${e.message}`)}}m8(); /*! Bundled license information: node-domexception/index.js: