@activepieces/piece-google-contacts 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +36 -36
package/src/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
"use strict";var tw=Object.create;var Ii=Object.defineProperty;var rw=Object.getOwnPropertyDescriptor;var nw=Object.getOwnPropertyNames;var ow=Object.getPrototypeOf,iw=Object.prototype.hasOwnProperty;var o=(t,e)=>Ii(t,"name",{value:e,configurable:!0});var gt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var k=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},gs=(t,e)=>{for(var r in e)Ii(t,r,{get:e[r],enumerable:!0})},hh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nw(e))!iw.call(t,i)&&i!==r&&Ii(t,i,{get:()=>e[i],enumerable:!(n=rw(e,i))||n.enumerable});return t};var ft=(t,e,r)=>(r=t!=null?tw(ow(t)):{},hh(e||!t||!t.__esModule?Ii(r,"default",{value:t,enumerable:!0}):r,t)),aw=t=>hh(Ii({},"__esModule",{value:!0}),t);var Mg=k((Ug,Us)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function l(g,y){if(g.indexOf("::")!==g.lastIndexOf("::"))return null;let T=0,P=-1,x=(g.match(d.zoneIndex)||[])[0],N,L;for(x&&(x=x.substring(1),g=g.replace(/%.+$/,""));(P=g.indexOf(":",P+1))>=0;)T++;if(g.substr(0,2)==="::"&&T--,g.substr(-2,2)==="::"&&T--,T>y)return null;for(L=y-T,N=":";L--;)N+="0:";return g=g.replace("::",N),g[0]===":"&&(g=g.slice(1)),g[g.length-1]===":"&&(g=g.slice(0,-1)),y=(function(){let X=g.split(":"),W=[];for(let G=0;G<X.length;G++)W.push(parseInt(X[G],16));return W})(),{parts:y,zoneId:x}}o(l,"expandIPv6");function p(g,y,T,P){if(g.length!==y.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,N;for(;P>0;){if(N=T-P,N<0&&(N=0),g[x]>>N!==y[x]>>N)return!1;P-=T,x+=1}return!0}o(p,"matchCIDR");function f(g){if(i.test(g))return parseInt(g,16);if(g[0]==="0"&&!isNaN(parseInt(g[1],10))){if(n.test(g))return parseInt(g,8);throw new Error(`ipaddr: cannot parse ${g} as octal`)}return parseInt(g,10)}o(f,"parseIntAuto");function _(g,y){for(;g.length<y;)g=`0${g}`;return g}o(_,"padPart");let h={};h.IPv4=(function(){function g(y){if(y.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let T,P;for(T=0;T<y.length;T++)if(P=y[T],!(0<=P&&P<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=y}return o(g,"IPv4"),g.prototype.SpecialRanges={unspecified:[[new g([0,0,0,0]),8]],broadcast:[[new g([255,255,255,255]),32]],multicast:[[new g([224,0,0,0]),4]],linkLocal:[[new g([169,254,0,0]),16]],loopback:[[new g([127,0,0,0]),8]],carrierGradeNat:[[new g([100,64,0,0]),10]],private:[[new g([10,0,0,0]),8],[new g([172,16,0,0]),12],[new g([192,168,0,0]),16]],reserved:[[new g([192,0,0,0]),24],[new g([192,0,2,0]),24],[new g([192,88,99,0]),24],[new g([198,18,0,0]),15],[new g([198,51,100,0]),24],[new g([203,0,113,0]),24],[new g([240,0,0,0]),4]],as112:[[new g([192,175,48,0]),24],[new g([192,31,196,0]),24]],amt:[[new g([192,52,193,0]),24]]},g.prototype.kind=function(){return"ipv4"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,y.octets,8,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,N,L;for(x=3;x>=0;x-=1)if(N=this.octets[x],N in P){if(L=P[N],T&&L!==0)return null;L!==8&&(T=!0),y+=L}else return null;return 32-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){return this.octets.slice(0)},g.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},g.prototype.toNormalizedString=function(){return this.toString()},g.prototype.toString=function(){return this.octets.join(".")},g})(),h.IPv4.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<4;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(g){return this.parser(g)!==null},h.IPv4.isValid=function(g){try{return new this(this.parser(g)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(g){try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(g){return!!(h.IPv4.isValid(g)&&g.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(g){let y=g.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(g)||!y?!1:h.IPv4.isValidFourPartDecimal(y[1])},h.IPv4.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<4;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(g){let y=this.parser(g);if(y===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(y)},h.IPv4.parseCIDR=function(g){let y;if(y=g.match(/^(.+)\/(\d+)$/)){let T=parseInt(y[2]);if(T>=0&&T<=32){let P=[this.parse(y[1]),T];return Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(g){let y,T,P;if(y=g.match(r.fourOctet))return(function(){let x=y.slice(1,6),N=[];for(let L=0;L<x.length;L++)T=x[L],N.push(f(T));return N})();if(y=g.match(r.longValue)){if(P=f(y[1]),P>4294967295||P<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],N;for(N=0;N<=24;N+=8)x.push(P>>N&255);return x})().reverse()}else return(y=g.match(r.twoOctet))?(function(){let x=y.slice(1,4),N=[];if(P=f(x[1]),P>16777215||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(P>>16&255),N.push(P>>8&255),N.push(P&255),N})():(y=g.match(r.threeOctet))?(function(){let x=y.slice(1,5),N=[];if(P=f(x[2]),P>65535||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(f(x[1])),N.push(P>>8&255),N.push(P&255),N})():null},h.IPv4.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>32)throw new Error("ipaddr: invalid IPv4 prefix length");let y=[0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<4&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.IPv6=(function(){function g(y,T){let P,x;if(y.length===16)for(this.parts=[],P=0;P<=14;P+=2)this.parts.push(y[P]<<8|y[P+1]);else if(y.length===8)this.parts=y;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(P=0;P<this.parts.length;P++)if(x=this.parts[P],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");T&&(this.zoneId=T)}return o(g,"IPv6"),g.prototype.SpecialRanges={unspecified:[new g([0,0,0,0,0,0,0,0]),128],linkLocal:[new g([65152,0,0,0,0,0,0,0]),10],multicast:[new g([65280,0,0,0,0,0,0,0]),8],loopback:[new g([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new g([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new g([0,0,0,0,0,65535,0,0]),96],discard:[new g([256,0,0,0,0,0,0,0]),64],rfc6145:[new g([0,0,0,0,65535,0,0,0]),96],rfc6052:[new g([100,65435,0,0,0,0,0,0]),96],"6to4":[new g([8194,0,0,0,0,0,0,0]),16],teredo:[new g([8193,0,0,0,0,0,0,0]),32],benchmarking:[new g([8193,2,0,0,0,0,0,0]),48],amt:[new g([8193,3,0,0,0,0,0,0]),32],as112v6:[[new g([8193,4,274,0,0,0,0,0]),48],[new g([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new g([8193,16,0,0,0,0,0,0]),28],orchid2:[new g([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new g([8193,48,0,0,0,0,0,0]),28],reserved:[[new g([8193,0,0,0,0,0,0,0]),23],[new g([8193,3512,0,0,0,0,0,0]),32]]},g.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},g.prototype.kind=function(){return"ipv6"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,y.parts,16,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,N;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in P){if(N=P[x],T&&N!==0)return null;N!==16&&(T=!0),y+=N}else return null;return 128-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){let y,T=[],P=this.parts;for(let x=0;x<P.length;x++)y=P[x],T.push(y>>8),T.push(y&255);return T},g.prototype.toFixedLengthString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(_(this.parts[x].toString(16),4));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let y=this.parts.slice(-2),T=y[0],P=y[1];return new h.IPv4([T>>8,T&255,P>>8,P&255])},g.prototype.toNormalizedString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(this.parts[x].toString(16));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toRFC5952String=function(){let y=/((^|:)(0(:|$)){2,})/g,T=this.toNormalizedString(),P=0,x=-1,N;for(;N=y.exec(T);)N[0].length>x&&(P=N.index,x=N[0].length);return x<0?T:`${T.substring(0,P)}::${T.substring(P+x)}`},g.prototype.toString=function(){return this.toRFC5952String()},g})(),h.IPv6.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<16;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch(y){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${y})`)}},h.IPv6.isIPv6=function(g){return this.parser(g)!==null},h.IPv6.isValid=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{let y=this.parser(g);return new this(y.parts,y.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<16;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},h.IPv6.parse=function(g){let y=this.parser(g);if(y.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(y.parts,y.zoneId)},h.IPv6.parseCIDR=function(g){let y,T,P;if((T=g.match(/^(.+)\/(\d+)$/))&&(y=parseInt(T[2]),y>=0&&y<=128))return P=[this.parse(T[1]),y],Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(g){let y,T,P,x,N,L;if(P=g.match(d.deprecatedTransitional))return this.parser(`::ffff:${P[1]}`);if(d.native.test(g))return l(g,8);if((P=g.match(d.transitional))&&(L=P[6]||"",y=P[1],P[1].endsWith("::")||(y=y.slice(0,-1)),y=l(y+L,6),y.parts)){for(N=[parseInt(P[2]),parseInt(P[3]),parseInt(P[4]),parseInt(P[5])],T=0;T<N.length;T++)if(x=N[T],!(0<=x&&x<=255))return null;return y.parts.push(N[0]<<8|N[1]),y.parts.push(N[2]<<8|N[3]),{parts:y.parts,zoneId:y.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>128)throw new Error("ipaddr: invalid IPv6 prefix length");let y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<16&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.fromByteArray=function(g){let y=g.length;if(y===4)return new h.IPv4(g);if(y===16)return new h.IPv6(g);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(g){return h.IPv6.isValid(g)||h.IPv4.isValid(g)},h.isValidCIDR=function(g){return h.IPv6.isValidCIDR(g)||h.IPv4.isValidCIDR(g)},h.parse=function(g){if(h.IPv6.isValid(g))return h.IPv6.parse(g);if(h.IPv4.isValid(g))return h.IPv4.parse(g);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(g){try{return h.IPv6.parseCIDR(g)}catch{try{return h.IPv4.parseCIDR(g)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(g){let y=this.parse(g);return y.kind()==="ipv6"&&y.isIPv4MappedAddress()?y.toIPv4Address():y},h.subnetMatch=function(g,y,T){let P,x,N,L;T==null&&(T="unicast");for(x in y)if(Object.prototype.hasOwnProperty.call(y,x)){for(N=y[x],N[0]&&!(N[0]instanceof Array)&&(N=[N]),P=0;P<N.length;P++)if(L=N[P],g.kind()===L[0].kind()&&g.match.apply(g,L))return x}return T},typeof Us<"u"&&Us.exports?Us.exports=h:t.ipaddr=h})(Ug)});var Fy=k((cK,Ly)=>{var jy=require("stream").Stream,qR=require("util");Ly.exports=fr;function fr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fr,"DelayedStream");qR.inherits(fr,jy);fr.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(fr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fr.prototype.resume=function(){this._released||this.release(),this.source.resume()};fr.prototype.pause=function(){this.source.pause()};fr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};fr.prototype.pipe=function(){var t=jy.prototype.pipe.apply(this,arguments);return this.resume(),t};fr.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};fr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Hy=k((dK,Vy)=>{var VR=require("util"),qy=require("stream").Stream,By=Fy();Vy.exports=ot;function ot(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(ot,"CombinedStream");VR.inherits(ot,qy);ot.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ot.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ot.prototype.append=function(t){var e=ot.isStreamLike(t);if(e){if(!(t instanceof By)){var r=By.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};ot.prototype.pipe=function(t,e){return qy.prototype.pipe.call(this,t,e),this.resume(),t};ot.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};ot.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=ot.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ot.prototype._pipeNext=function(t){this._currentStream=t;var e=ot.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};ot.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ot.prototype.write=function(t){this.emit("data",t)};ot.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ot.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};ot.prototype.end=function(){this._reset(),this.emit("end")};ot.prototype.destroy=function(){this._reset(),this.emit("close")};ot.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ot.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ot.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ot.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Wy=k((fK,Gy)=>{"use strict";Gy.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Jy=k(Rt=>{"use strict";var Bs=Wy(),HR=require("path").extname,Zy=/^\s*([^;\s]*)(?:;|\s|$)/,GR=/^text\//i;Rt.charset=Ky;Rt.charsets={lookup:Ky};Rt.contentType=WR;Rt.extension=ZR;Rt.extensions=Object.create(null);Rt.lookup=KR;Rt.types=Object.create(null);JR(Rt.extensions,Rt.types);function Ky(t){if(!t||typeof t!="string")return!1;var e=Zy.exec(t),r=e&&Bs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&GR.test(e[1])?"UTF-8":!1}o(Ky,"charset");function WR(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Rt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Rt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(WR,"contentType");function ZR(t){if(!t||typeof t!="string")return!1;var e=Zy.exec(t),r=e&&Rt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ZR,"extension");function KR(t){if(!t||typeof t!="string")return!1;var e=HR("x."+t).toLowerCase().substr(1);return e&&Rt.types[e]||!1}o(KR,"lookup");function JR(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Bs).forEach(o(function(i){var s=Bs[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var l=c[d];if(e[l]){var p=r.indexOf(Bs[e[l]].source),f=r.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=i}}},"forEachMimeType"))}o(JR,"populateMaps")});var Xy=k((gK,Yy)=>{Yy.exports=YR;function YR(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(YR,"defer")});var ql=k((_K,e_)=>{var Qy=Xy();e_.exports=XR;function XR(t){var e=!1;return Qy(function(){e=!0}),o(function(n,i){e?t(n,i):Qy(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(XR,"async")});var Vl=k((bK,t_)=>{t_.exports=QR;function QR(t){Object.keys(t.jobs).forEach(eO.bind(t)),t.jobs={}}o(QR,"abort");function eO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(eO,"clean")});var Hl=k((SK,n_)=>{var r_=ql(),tO=Vl();n_.exports=rO;function rO(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=nO(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?tO(r):r.results[i]=c,n(s,r.results))})}o(rO,"iterate");function nO(t,e,r,n){var i;return t.length==2?i=t(r,r_(n)):i=t(r,e,r_(n)),i}o(nO,"runJob")});var Gl=k((TK,o_)=>{o_.exports=oO;function oO(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(oO,"state")});var Wl=k((AK,i_)=>{var iO=Vl(),aO=ql();i_.exports=sO;function sO(t){Object.keys(this.jobs).length&&(this.index=this.size,iO(this),aO(t)(null,this.results))}o(sO,"terminator")});var s_=k((IK,a_)=>{var uO=Hl(),cO=Gl(),lO=Wl();a_.exports=dO;function dO(t,e,r){for(var n=cO(t);n.index<(n.keyedList||t).length;)uO(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return lO.bind(n,r)}o(dO,"parallel")});var Zl=k((OK,qs)=>{var u_=Hl(),pO=Gl(),fO=Wl();qs.exports=mO;qs.exports.ascending=c_;qs.exports.descending=hO;function mO(t,e,r,n){var i=pO(t,r);return u_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){u_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),fO.bind(i,n)}o(mO,"serialOrdered");function c_(t,e){return t<e?-1:t>e?1:0}o(c_,"ascending");function hO(t,e){return-1*c_(t,e)}o(hO,"descending")});var d_=k(($K,l_)=>{var gO=Zl();l_.exports=yO;function yO(t,e,r){return gO(t,e,null,r)}o(yO,"serial")});var f_=k((NK,p_)=>{p_.exports={parallel:s_(),serial:d_(),serialOrdered:Zl()}});var Kl=k((zK,m_)=>{"use strict";m_.exports=Object});var g_=k((DK,h_)=>{"use strict";h_.exports=Error});var __=k((UK,y_)=>{"use strict";y_.exports=EvalError});var b_=k((MK,v_)=>{"use strict";v_.exports=RangeError});var S_=k((jK,P_)=>{"use strict";P_.exports=ReferenceError});var T_=k((LK,E_)=>{"use strict";E_.exports=SyntaxError});var Cn=k((FK,x_)=>{"use strict";x_.exports=TypeError});var w_=k((BK,A_)=>{"use strict";A_.exports=URIError});var R_=k((qK,I_)=>{"use strict";I_.exports=Math.abs});var C_=k((VK,O_)=>{"use strict";O_.exports=Math.floor});var k_=k((HK,$_)=>{"use strict";$_.exports=Math.max});var z_=k((GK,N_)=>{"use strict";N_.exports=Math.min});var U_=k((WK,D_)=>{"use strict";D_.exports=Math.pow});var j_=k((ZK,M_)=>{"use strict";M_.exports=Math.round});var F_=k((KK,L_)=>{"use strict";L_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var q_=k((YK,B_)=>{"use strict";var _O=F_();B_.exports=o(function(e){return _O(e)||e===0?e:e<0?-1:1},"sign")});var H_=k((QK,V_)=>{"use strict";V_.exports=Object.getOwnPropertyDescriptor});var Jl=k((eJ,G_)=>{"use strict";var Vs=H_();if(Vs)try{Vs([],"length")}catch{Vs=null}G_.exports=Vs});var Z_=k((tJ,W_)=>{"use strict";var Hs=Object.defineProperty||!1;if(Hs)try{Hs({},"a",{value:1})}catch{Hs=!1}W_.exports=Hs});var Yl=k((rJ,K_)=>{"use strict";K_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var X_=k((oJ,Y_)=>{"use strict";var J_=typeof Symbol<"u"&&Symbol,vO=Yl();Y_.exports=o(function(){return typeof J_!="function"||typeof Symbol!="function"||typeof J_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vO()},"hasNativeSymbols")});var Xl=k((aJ,Q_)=>{"use strict";Q_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ql=k((sJ,ev)=>{"use strict";var bO=Kl();ev.exports=bO.getPrototypeOf||null});var nv=k((uJ,rv)=>{"use strict";var PO="Function.prototype.bind called on incompatible ",SO=Object.prototype.toString,EO=Math.max,TO="[object Function]",tv=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),xO=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),AO=o(function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},"joiny");rv.exports=o(function(e){var r=this;if(typeof r!="function"||SO.apply(r)!==TO)throw new TypeError(PO+r);for(var n=xO(arguments,1),i,s=o(function(){if(this instanceof i){var f=r.apply(this,tv(n,arguments));return Object(f)===f?f:this}return r.apply(e,tv(n,arguments))},"binder"),c=EO(0,r.length-n.length),d=[],l=0;l<c;l++)d[l]="$"+l;if(i=Function("binder","return function ("+AO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var p=o(function(){},"Empty");p.prototype=r.prototype,i.prototype=new p,p.prototype=null}return i},"bind")});var Lo=k((lJ,ov)=>{"use strict";var wO=nv();ov.exports=Function.prototype.bind||wO});var Gs=k((dJ,iv)=>{"use strict";iv.exports=Function.prototype.call});var ed=k((pJ,av)=>{"use strict";av.exports=Function.prototype.apply});var uv=k((fJ,sv)=>{"use strict";sv.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var lv=k((mJ,cv)=>{"use strict";var IO=Lo(),RO=ed(),OO=Gs(),CO=uv();cv.exports=CO||IO.call(OO,RO)});var td=k((hJ,dv)=>{"use strict";var $O=Lo(),kO=Cn(),NO=Gs(),zO=lv();dv.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new kO("a function is required");return zO($O,NO,e)},"callBindBasic")});var yv=k((yJ,gv)=>{"use strict";var DO=td(),pv=Jl(),mv;try{mv=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var rd=!!mv&&pv&&pv(Object.prototype,"__proto__"),hv=Object,fv=hv.getPrototypeOf;gv.exports=rd&&typeof rd.get=="function"?DO([rd.get]):typeof fv=="function"?o(function(e){return fv(e==null?e:hv(e))},"getDunder"):!1});var Sv=k((vJ,Pv)=>{"use strict";var _v=Xl(),vv=Ql(),bv=yv();Pv.exports=_v?o(function(e){return _v(e)},"getProto"):vv?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return vv(e)},"getProto"):bv?o(function(e){return bv(e)},"getProto"):null});var nd=k((PJ,Ev)=>{"use strict";var UO=Function.prototype.call,MO=Object.prototype.hasOwnProperty,jO=Lo();Ev.exports=jO.call(UO,MO)});var Qi=k((SJ,Rv)=>{"use strict";var ke,LO=Kl(),FO=g_(),BO=__(),qO=b_(),VO=S_(),Vo=T_(),qo=Cn(),HO=w_(),GO=R_(),WO=C_(),ZO=k_(),KO=z_(),JO=U_(),YO=j_(),XO=q_(),wv=Function,od=o(function(t){try{return wv('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Ji=Jl(),QO=Z_(),id=o(function(){throw new qo},"throwTypeError"),eC=Ji?(function(){try{return arguments.callee,id}catch{try{return Ji(arguments,"callee").get}catch{return id}}})():id,Fo=X_()(),yt=Sv(),tC=Ql(),rC=Xl(),Iv=ed(),Yi=Gs(),Bo={},nC=typeof Uint8Array>"u"||!yt?ke:yt(Uint8Array),to={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":Fo&&yt?yt([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":Bo,"%AsyncGenerator%":Bo,"%AsyncGeneratorFunction%":Bo,"%AsyncIteratorPrototype%":Bo,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":FO,"%eval%":eval,"%EvalError%":BO,"%Float16Array%":typeof Float16Array>"u"?ke:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":wv,"%GeneratorFunction%":Bo,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fo&&yt?yt(yt([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fo||!yt?ke:yt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":LO,"%Object.getOwnPropertyDescriptor%":Ji,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":qO,"%ReferenceError%":VO,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fo||!yt?ke:yt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fo&&yt?yt(""[Symbol.iterator]()):ke,"%Symbol%":Fo?Symbol:ke,"%SyntaxError%":Vo,"%ThrowTypeError%":eC,"%TypedArray%":nC,"%TypeError%":qo,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":HO,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet,"%Function.prototype.call%":Yi,"%Function.prototype.apply%":Iv,"%Object.defineProperty%":QO,"%Object.getPrototypeOf%":tC,"%Math.abs%":GO,"%Math.floor%":WO,"%Math.max%":ZO,"%Math.min%":KO,"%Math.pow%":JO,"%Math.round%":YO,"%Math.sign%":XO,"%Reflect.getPrototypeOf%":rC};if(yt)try{null.error}catch(t){Tv=yt(yt(t)),to["%Error.prototype%"]=Tv}var Tv,oC=o(function t(e){var r;if(e==="%AsyncFunction%")r=od("async function () {}");else if(e==="%GeneratorFunction%")r=od("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=od("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&yt&&(r=yt(i.prototype))}return to[e]=r,r},"doEval"),xv={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Xi=Lo(),Ws=nd(),iC=Xi.call(Yi,Array.prototype.concat),aC=Xi.call(Iv,Array.prototype.splice),Av=Xi.call(Yi,String.prototype.replace),Zs=Xi.call(Yi,String.prototype.slice),sC=Xi.call(Yi,RegExp.prototype.exec),uC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cC=/\\(\\)?/g,lC=o(function(e){var r=Zs(e,0,1),n=Zs(e,-1);if(r==="%"&&n!=="%")throw new Vo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Vo("invalid intrinsic syntax, expected opening `%`");var i=[];return Av(e,uC,function(s,c,d,l){i[i.length]=d?Av(l,cC,"$1"):c||s}),i},"stringToPath"),dC=o(function(e,r){var n=e,i;if(Ws(xv,n)&&(i=xv[n],n="%"+i[0]+"%"),Ws(to,n)){var s=to[n];if(s===Bo&&(s=oC(n)),typeof s>"u"&&!r)throw new qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Vo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Rv.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qo('"allowMissing" argument must be a boolean');if(sC(/^%?[^%]*%?$/,e)===null)throw new Vo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=lC(e),i=n.length>0?n[0]:"",s=dC("%"+i+"%",r),c=s.name,d=s.value,l=!1,p=s.alias;p&&(i=p[0],aC(n,iC([0,1],p)));for(var f=1,_=!0;f<n.length;f+=1){var h=n[f],g=Zs(h,0,1),y=Zs(h,-1);if((g==='"'||g==="'"||g==="`"||y==='"'||y==="'"||y==="`")&&g!==y)throw new Vo("property names with quotes must have matching quotes");if((h==="constructor"||!_)&&(l=!0),i+="."+h,c="%"+i+"%",Ws(to,c))d=to[c];else if(d!=null){if(!(h in d)){if(!r)throw new qo("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ji&&f+1>=n.length){var T=Ji(d,h);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?d=T.get:d=d[h]}else _=Ws(d,h),d=d[h];_&&!l&&(to[c]=d)}}return d},"GetIntrinsic")});var Cv=k((TJ,Ov)=>{"use strict";var pC=Yl();Ov.exports=o(function(){return pC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Nv=k((AJ,kv)=>{"use strict";var fC=Qi(),$v=fC("%Object.defineProperty%",!0),mC=Cv()(),hC=nd(),gC=Cn(),Ks=mC?Symbol.toStringTag:null;kv.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new gC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ks&&(n||!hC(e,Ks))&&($v?$v(e,Ks,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[Ks]=r)},"setToStringTag")});var Dv=k((IJ,zv)=>{"use strict";var yC=Function.prototype.call,_C=Object.prototype.hasOwnProperty,vC=Lo();zv.exports=vC.call(yC,_C)});var Mv=k((RJ,Uv)=>{"use strict";Uv.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var Fv=k((OJ,Lv)=>{"use strict";var cd=Hy(),bC=require("util"),ad=require("path"),PC=require("http"),SC=require("https"),EC=require("url").parse,TC=require("fs"),xC=require("stream").Stream,AC=require("crypto"),sd=Jy(),wC=f_(),IC=Nv(),$n=Dv(),ud=Mv();function jv(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(jv,"escapeHeaderParam");function Ue(t){if(!(this instanceof Ue))return new Ue(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Ue,"FormData");bC.inherits(Ue,cd);Ue.LINE_BREAK=`\r
|
|
2
|
-
`;Ue.DEFAULT_CONTENT_TYPE="application/octet-stream";Ue.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cd.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};Ue.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+Ue.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&$n(e,"httpVersion"))&&!(e instanceof xC))&&(r.knownLength||this._valuesToMeasure.push(e))};Ue.prototype._lengthRetriever=function(t,e){$n(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):TC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):$n(t,"httpVersion")?e(null,Number(t.headers["content-length"])):$n(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Ue.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+jv(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ud(c,r.header);var d;for(var l in c)if($n(c,l)){if(d=c[l],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=l+": "+d.join("; ")+Ue.LINE_BREAK)}return"--"+this.getBoundary()+Ue.LINE_BREAK+s+Ue.LINE_BREAK};Ue.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=ad.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=ad.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&$n(t,"httpVersion")&&(r=ad.basename(t.client._httpMessage.path||"")),r)return'filename="'+jv(r)+'"'};Ue.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=sd.lookup(t.name)),!r&&t&&t.path&&(r=sd.lookup(t.path)),!r&&t&&t.readable&&$n(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=sd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ue.DEFAULT_CONTENT_TYPE),r};Ue.prototype._multiPartFooter=function(){return function(t){var e=Ue.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ue.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ue.LINE_BREAK};Ue.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)$n(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Ue.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ue.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ue.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Ue.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ue.prototype._generateBoundary=function(){this._boundary="--------------------------"+AC.randomBytes(12).toString("hex")};Ue.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Ue.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ue.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}wC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Ue.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=EC(t),n=ud({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=ud(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=SC.request(n):r=PC.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,l=o(function(p,f){return r.removeListener("error",l),r.removeListener("response",d),e.call(this,p,f)},"callback");d=l.bind(this,null),r.on("error",l),r.on("response",d)}}.bind(this)),r};Ue.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ue.prototype.toString=function(){return"[object FormData]"};IC(Ue.prototype,"FormData");Lv.exports=Ue});var ta=k((P8,tb)=>{"use strict";var Js=Object.prototype.hasOwnProperty,eb=Object.prototype.toString,Zv=Object.defineProperty,Kv=Object.getOwnPropertyDescriptor,Jv=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):eb.call(e)==="[object Array]"},"isArray"),Yv=o(function(e){if(!e||eb.call(e)!=="[object Object]")return!1;var r=Js.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Js.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||Js.call(e,i)},"isPlainObject"),Xv=o(function(e,r){Zv&&r.name==="__proto__"?Zv(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Qv=o(function(e,r){if(r==="__proto__")if(Js.call(e,r)){if(Kv)return Kv(e,r).value}else return;return e[r]},"getProperty");tb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],l=1,p=arguments.length,f=!1;for(typeof d=="boolean"&&(f=d,d=arguments[1]||{},l=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});l<p;++l)if(e=arguments[l],e!=null)for(r in e)n=Qv(d,r),i=Qv(e,r),d!==i&&(f&&i&&(Yv(i)||(s=Jv(i)))?(s?(s=!1,c=n&&Jv(n)?n:[]):c=n&&Yv(n)?n:{},Xv(d,{name:r,newValue:t(f,c,i)})):typeof i<"u"&&Xv(d,{name:r,newValue:i}));return d},"extend")});var rb=k((E8,UC)=>{UC.exports={name:"gaxios",version:"7.1.3",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","@types/tmp":"0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.0.0",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.0-beta.13","null-loader":"^4.0.0","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"^5.8.3",webpack:"^5.35.0","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2",rimraf:"^5.0.1"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}});var ob=k((T8,nb)=>{"use strict";var MC=rb();nb.exports={pkg:MC}});var pd=k(er=>{"use strict";var ab=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(er,"__esModule",{value:!0});er.GaxiosError=er.GAXIOS_ERROR_SYMBOL=void 0;er.defaultErrorRedactor=sb;var ib=ab(ta()),jC=ab(ob()),ld=jC.default.pkg;er.GAXIOS_ERROR_SYMBOL=Symbol.for(`${ld.name}-gaxios-error`);var dd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[er.GAXIOS_ERROR_SYMBOL]=ld.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&er.GAXIOS_ERROR_SYMBOL in e&&e[er.GAXIOS_ERROR_SYMBOL]===ld.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,i){if(super(e,{cause:i}),this.config=r,this.response=n,this.error=i instanceof Error?i:void 0,this.config=(0,ib.default)(!0,{},r),this.response&&(this.response.config=(0,ib.default)(!0,{},this.response.config)),this.response){try{this.response.data=LC(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
|
|
3
|
-
`)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};er.GaxiosError=dd;function LC(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}o(LC,"translateData");function sb(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(sb({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(sb,"defaultErrorRedactor")});var cb=k(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.getRetryConfig=FC;async function FC(t){let e=ub(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let r=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||r,t.config.retryConfig=e,!await(e.shouldRetry||BC)(t))return{shouldRetry:!1,config:t.config};let i=qC(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(FC,"getRetryConfig");function BC(t){let e=ub(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(BC,"shouldRetryRequest");function ub(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(ub,"getConfig");function qC(t){let r=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,n=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(r,n,t.maxRetryDelay)}o(qC,"getNextRetryDelay")});var hd=k(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.GaxiosInterceptorManager=void 0;var md=class extends Set{static{o(this,"GaxiosInterceptorManager")}};Ys.GaxiosInterceptorManager=md});var db=k((C8,lb)=>{var Ho=1e3,Go=Ho*60,Wo=Go*60,ro=Wo*24,VC=ro*7,HC=ro*365.25;lb.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return GC(t);if(r==="number"&&isFinite(t))return e.long?ZC(t):WC(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function GC(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*HC;case"weeks":case"week":case"w":return r*VC;case"days":case"day":case"d":return r*ro;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Wo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Go;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ho;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(GC,"parse");function WC(t){var e=Math.abs(t);return e>=ro?Math.round(t/ro)+"d":e>=Wo?Math.round(t/Wo)+"h":e>=Go?Math.round(t/Go)+"m":e>=Ho?Math.round(t/Ho)+"s":t+"ms"}o(WC,"fmtShort");function ZC(t){var e=Math.abs(t);return e>=ro?Xs(t,e,ro,"day"):e>=Wo?Xs(t,e,Wo,"hour"):e>=Go?Xs(t,e,Go,"minute"):e>=Ho?Xs(t,e,Ho,"second"):t+" ms"}o(ZC,"fmtLong");function Xs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(Xs,"plural")});var gd=k((k8,pb)=>{function KC(t){r.debug=r,r.default=r,r.coerce=l,r.disable=c,r.enable=i,r.enabled=d,r.humanize=db(),r.destroy=p,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let _=0;for(let h=0;h<f.length;h++)_=(_<<5)-_+f.charCodeAt(h),_|=0;return r.colors[Math.abs(_)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(f){let _,h=null,g,y;function T(...P){if(!T.enabled)return;let x=T,N=Number(new Date),L=N-(_||N);x.diff=L,x.prev=_,x.curr=N,_=N,P[0]=r.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let X=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(G,Z)=>{if(G==="%%")return"%";X++;let ee=r.formatters[Z];if(typeof ee=="function"){let Y=P[X];G=ee.call(x,Y),P.splice(X,1),X--}return G}),r.formatArgs.call(x,P),(x.log||r.log).apply(x,P)}return o(T,"debug"),T.namespace=f,T.useColors=r.useColors(),T.color=r.selectColor(f),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:o(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,y=r.enabled(f)),y),"get"),set:o(P=>{h=P},"set")}),typeof r.init=="function"&&r.init(T),T}o(r,"createDebug");function n(f,_){let h=r(this.namespace+(typeof _>"u"?":":_)+f);return h.log=this.log,h}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let _=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of _)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}o(i,"enable");function s(f,_){let h=0,g=0,y=-1,T=0;for(;h<f.length;)if(g<_.length&&(_[g]===f[h]||_[g]==="*"))_[g]==="*"?(y=g,T=h,g++):(h++,g++);else if(y!==-1)g=y+1,T++,h=T;else return!1;for(;g<_.length&&_[g]==="*";)g++;return g===_.length}o(s,"matchesTemplate");function c(){let f=[...r.names,...r.skips.map(_=>"-"+_)].join(",");return r.enable(""),f}o(c,"disable");function d(f){for(let _ of r.skips)if(s(f,_))return!1;for(let _ of r.names)if(s(f,_))return!0;return!1}o(d,"enabled");function l(f){return f instanceof Error?f.stack||f.message:f}o(l,"coerce");function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(p,"destroy"),r.enable(r.load()),r}o(KC,"setup");pb.exports=KC});var fb=k((Ot,Qs)=>{Ot.formatArgs=YC;Ot.save=XC;Ot.load=QC;Ot.useColors=JC;Ot.storage=e0();Ot.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ot.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function JC(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(JC,"useColors");function YC(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Qs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(YC,"formatArgs");Ot.log=console.debug||console.log||(()=>{});function XC(t){try{t?Ot.storage.setItem("debug",t):Ot.storage.removeItem("debug")}catch{}}o(XC,"save");function QC(){let t;try{t=Ot.storage.getItem("debug")||Ot.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(QC,"load");function e0(){try{return localStorage}catch{}}o(e0,"localstorage");Qs.exports=gd()(Ot);var{formatters:t0}=Qs.exports;t0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var hb=k((D8,mb)=>{"use strict";mb.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var _b=k((U8,yb)=>{"use strict";var r0=require("os"),gb=require("tty"),tr=hb(),{env:_t}=process,Nn;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Nn=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Nn=1);"FORCE_COLOR"in _t&&(_t.FORCE_COLOR==="true"?Nn=1:_t.FORCE_COLOR==="false"?Nn=0:Nn=_t.FORCE_COLOR.length===0?1:Math.min(parseInt(_t.FORCE_COLOR,10),3));function yd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(yd,"translateLevel");function _d(t,e){if(Nn===0)return 0;if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2;if(t&&!e&&Nn===void 0)return 0;let r=Nn||0;if(_t.TERM==="dumb")return r;if(process.platform==="win32"){let n=r0.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in _t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in _t)||_t.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in _t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_t.TEAMCITY_VERSION)?1:0;if(_t.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in _t){let n=parseInt((_t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_t.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_t.TERM)||"COLORTERM"in _t?1:r}o(_d,"supportsColor");function n0(t){let e=_d(t,t&&t.isTTY);return yd(e)}o(n0,"getSupportLevel");yb.exports={supportsColor:n0,stdout:yd(_d(!0,gb.isatty(1))),stderr:yd(_d(!0,gb.isatty(2)))}});var bb=k((vt,tu)=>{var o0=require("tty"),eu=require("util");vt.init=d0;vt.log=u0;vt.formatArgs=a0;vt.save=c0;vt.load=l0;vt.useColors=i0;vt.destroy=eu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vt.colors=[6,2,3,4,5,1];try{let t=_b();t&&(t.stderr||t).level>=2&&(vt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}vt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function i0(){return"colors"in vt.inspectOpts?!!vt.inspectOpts.colors:o0.isatty(process.stderr.fd)}o(i0,"useColors");function a0(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
1
|
+
"use strict";var fw=Object.create;var Ri=Object.defineProperty;var mw=Object.getOwnPropertyDescriptor;var hw=Object.getOwnPropertyNames;var gw=Object.getPrototypeOf,yw=Object.prototype.hasOwnProperty;var o=(t,e)=>Ri(t,"name",{value:e,configurable:!0});var gt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var k=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ys=(t,e)=>{for(var r in e)Ri(t,r,{get:e[r],enumerable:!0})},vh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hw(e))!yw.call(t,i)&&i!==r&&Ri(t,i,{get:()=>e[i],enumerable:!(n=mw(e,i))||n.enumerable});return t};var ft=(t,e,r)=>(r=t!=null?fw(gw(t)):{},vh(e||!t||!t.__esModule?Ri(r,"default",{value:t,enumerable:!0}):r,t)),_w=t=>vh(Ri({},"__esModule",{value:!0}),t);var Vg=k((qg,Ms)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function l(g,y){if(g.indexOf("::")!==g.lastIndexOf("::"))return null;let T=0,P=-1,x=(g.match(d.zoneIndex)||[])[0],N,F;for(x&&(x=x.substring(1),g=g.replace(/%.+$/,""));(P=g.indexOf(":",P+1))>=0;)T++;if(g.substr(0,2)==="::"&&T--,g.substr(-2,2)==="::"&&T--,T>y)return null;for(F=y-T,N=":";F--;)N+="0:";return g=g.replace("::",N),g[0]===":"&&(g=g.slice(1)),g[g.length-1]===":"&&(g=g.slice(0,-1)),y=(function(){let X=g.split(":"),Z=[];for(let G=0;G<X.length;G++)Z.push(parseInt(X[G],16));return Z})(),{parts:y,zoneId:x}}o(l,"expandIPv6");function f(g,y,T,P){if(g.length!==y.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,N;for(;P>0;){if(N=T-P,N<0&&(N=0),g[x]>>N!==y[x]>>N)return!1;P-=T,x+=1}return!0}o(f,"matchCIDR");function p(g){if(i.test(g))return parseInt(g,16);if(g[0]==="0"&&!isNaN(parseInt(g[1],10))){if(n.test(g))return parseInt(g,8);throw new Error(`ipaddr: cannot parse ${g} as octal`)}return parseInt(g,10)}o(p,"parseIntAuto");function _(g,y){for(;g.length<y;)g=`0${g}`;return g}o(_,"padPart");let h={};h.IPv4=(function(){function g(y){if(y.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let T,P;for(T=0;T<y.length;T++)if(P=y[T],!(0<=P&&P<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=y}return o(g,"IPv4"),g.prototype.SpecialRanges={unspecified:[[new g([0,0,0,0]),8]],broadcast:[[new g([255,255,255,255]),32]],multicast:[[new g([224,0,0,0]),4]],linkLocal:[[new g([169,254,0,0]),16]],loopback:[[new g([127,0,0,0]),8]],carrierGradeNat:[[new g([100,64,0,0]),10]],private:[[new g([10,0,0,0]),8],[new g([172,16,0,0]),12],[new g([192,168,0,0]),16]],reserved:[[new g([192,0,0,0]),24],[new g([192,0,2,0]),24],[new g([192,88,99,0]),24],[new g([198,18,0,0]),15],[new g([198,51,100,0]),24],[new g([203,0,113,0]),24],[new g([240,0,0,0]),4]],as112:[[new g([192,175,48,0]),24],[new g([192,31,196,0]),24]],amt:[[new g([192,52,193,0]),24]]},g.prototype.kind=function(){return"ipv4"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return f(this.octets,y.octets,8,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,N,F;for(x=3;x>=0;x-=1)if(N=this.octets[x],N in P){if(F=P[N],T&&F!==0)return null;F!==8&&(T=!0),y+=F}else return null;return 32-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){return this.octets.slice(0)},g.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},g.prototype.toNormalizedString=function(){return this.toString()},g.prototype.toString=function(){return this.octets.join(".")},g})(),h.IPv4.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<4;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(g){return this.parser(g)!==null},h.IPv4.isValid=function(g){try{return new this(this.parser(g)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(g){try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(g){return!!(h.IPv4.isValid(g)&&g.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(g){let y=g.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(g)||!y?!1:h.IPv4.isValidFourPartDecimal(y[1])},h.IPv4.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<4;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(g){let y=this.parser(g);if(y===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(y)},h.IPv4.parseCIDR=function(g){let y;if(y=g.match(/^(.+)\/(\d+)$/)){let T=parseInt(y[2]);if(T>=0&&T<=32){let P=[this.parse(y[1]),T];return Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(g){let y,T,P;if(y=g.match(r.fourOctet))return(function(){let x=y.slice(1,6),N=[];for(let F=0;F<x.length;F++)T=x[F],N.push(p(T));return N})();if(y=g.match(r.longValue)){if(P=p(y[1]),P>4294967295||P<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],N;for(N=0;N<=24;N+=8)x.push(P>>N&255);return x})().reverse()}else return(y=g.match(r.twoOctet))?(function(){let x=y.slice(1,4),N=[];if(P=p(x[1]),P>16777215||P<0)throw new Error("ipaddr: address outside defined range");return N.push(p(x[0])),N.push(P>>16&255),N.push(P>>8&255),N.push(P&255),N})():(y=g.match(r.threeOctet))?(function(){let x=y.slice(1,5),N=[];if(P=p(x[2]),P>65535||P<0)throw new Error("ipaddr: address outside defined range");return N.push(p(x[0])),N.push(p(x[1])),N.push(P>>8&255),N.push(P&255),N})():null},h.IPv4.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>32)throw new Error("ipaddr: invalid IPv4 prefix length");let y=[0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<4&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.IPv6=(function(){function g(y,T){let P,x;if(y.length===16)for(this.parts=[],P=0;P<=14;P+=2)this.parts.push(y[P]<<8|y[P+1]);else if(y.length===8)this.parts=y;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(P=0;P<this.parts.length;P++)if(x=this.parts[P],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");T&&(this.zoneId=T)}return o(g,"IPv6"),g.prototype.SpecialRanges={unspecified:[new g([0,0,0,0,0,0,0,0]),128],linkLocal:[new g([65152,0,0,0,0,0,0,0]),10],multicast:[new g([65280,0,0,0,0,0,0,0]),8],loopback:[new g([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new g([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new g([0,0,0,0,0,65535,0,0]),96],discard:[new g([256,0,0,0,0,0,0,0]),64],rfc6145:[new g([0,0,0,0,65535,0,0,0]),96],rfc6052:[new g([100,65435,0,0,0,0,0,0]),96],"6to4":[new g([8194,0,0,0,0,0,0,0]),16],teredo:[new g([8193,0,0,0,0,0,0,0]),32],benchmarking:[new g([8193,2,0,0,0,0,0,0]),48],amt:[new g([8193,3,0,0,0,0,0,0]),32],as112v6:[[new g([8193,4,274,0,0,0,0,0]),48],[new g([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new g([8193,16,0,0,0,0,0,0]),28],orchid2:[new g([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new g([8193,48,0,0,0,0,0,0]),28],reserved:[[new g([8193,0,0,0,0,0,0,0]),23],[new g([8193,3512,0,0,0,0,0,0]),32]]},g.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},g.prototype.kind=function(){return"ipv6"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return f(this.parts,y.parts,16,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,N;for(let F=7;F>=0;F-=1)if(x=this.parts[F],x in P){if(N=P[x],T&&N!==0)return null;N!==16&&(T=!0),y+=N}else return null;return 128-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){let y,T=[],P=this.parts;for(let x=0;x<P.length;x++)y=P[x],T.push(y>>8),T.push(y&255);return T},g.prototype.toFixedLengthString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(_(this.parts[x].toString(16),4));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let y=this.parts.slice(-2),T=y[0],P=y[1];return new h.IPv4([T>>8,T&255,P>>8,P&255])},g.prototype.toNormalizedString=function(){let y=(function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(this.parts[x].toString(16));return P}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toRFC5952String=function(){let y=/((^|:)(0(:|$)){2,})/g,T=this.toNormalizedString(),P=0,x=-1,N;for(;N=y.exec(T);)N[0].length>x&&(P=N.index,x=N[0].length);return x<0?T:`${T.substring(0,P)}::${T.substring(P+x)}`},g.prototype.toString=function(){return this.toRFC5952String()},g})(),h.IPv6.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<16;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch(y){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${y})`)}},h.IPv6.isIPv6=function(g){return this.parser(g)!==null},h.IPv6.isValid=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{let y=this.parser(g);return new this(y.parts,y.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<16;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},h.IPv6.parse=function(g){let y=this.parser(g);if(y.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(y.parts,y.zoneId)},h.IPv6.parseCIDR=function(g){let y,T,P;if((T=g.match(/^(.+)\/(\d+)$/))&&(y=parseInt(T[2]),y>=0&&y<=128))return P=[this.parse(T[1]),y],Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(g){let y,T,P,x,N,F;if(P=g.match(d.deprecatedTransitional))return this.parser(`::ffff:${P[1]}`);if(d.native.test(g))return l(g,8);if((P=g.match(d.transitional))&&(F=P[6]||"",y=P[1],P[1].endsWith("::")||(y=y.slice(0,-1)),y=l(y+F,6),y.parts)){for(N=[parseInt(P[2]),parseInt(P[3]),parseInt(P[4]),parseInt(P[5])],T=0;T<N.length;T++)if(x=N[T],!(0<=x&&x<=255))return null;return y.parts.push(N[0]<<8|N[1]),y.parts.push(N[2]<<8|N[3]),{parts:y.parts,zoneId:y.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>128)throw new Error("ipaddr: invalid IPv6 prefix length");let y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<16&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.fromByteArray=function(g){let y=g.length;if(y===4)return new h.IPv4(g);if(y===16)return new h.IPv6(g);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(g){return h.IPv6.isValid(g)||h.IPv4.isValid(g)},h.isValidCIDR=function(g){return h.IPv6.isValidCIDR(g)||h.IPv4.isValidCIDR(g)},h.parse=function(g){if(h.IPv6.isValid(g))return h.IPv6.parse(g);if(h.IPv4.isValid(g))return h.IPv4.parse(g);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(g){try{return h.IPv6.parseCIDR(g)}catch{try{return h.IPv4.parseCIDR(g)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(g){let y=this.parse(g);return y.kind()==="ipv6"&&y.isIPv4MappedAddress()?y.toIPv4Address():y},h.subnetMatch=function(g,y,T){let P,x,N,F;T==null&&(T="unicast");for(x in y)if(Object.prototype.hasOwnProperty.call(y,x)){for(N=y[x],N[0]&&!(N[0]instanceof Array)&&(N=[N]),P=0;P<N.length;P++)if(F=N[P],g.kind()===F[0].kind()&&g.match.apply(g,F))return x}return T},typeof Ms<"u"&&Ms.exports?Ms.exports=h:t.ipaddr=h})(qg)});var Ky=k((BK,Zy)=>{var Wy=require("stream").Stream,rO=require("util");Zy.exports=fr;function fr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fr,"DelayedStream");rO.inherits(fr,Wy);fr.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(fr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fr.prototype.resume=function(){this._released||this.release(),this.source.resume()};fr.prototype.pause=function(){this.source.pause()};fr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};fr.prototype.pipe=function(){var t=Wy.prototype.pipe.apply(this,arguments);return this.resume(),t};fr.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};fr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Qy=k((VK,Xy)=>{var nO=require("util"),Yy=require("stream").Stream,Jy=Ky();Xy.exports=ot;function ot(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(ot,"CombinedStream");nO.inherits(ot,Yy);ot.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ot.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ot.prototype.append=function(t){var e=ot.isStreamLike(t);if(e){if(!(t instanceof Jy)){var r=Jy.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};ot.prototype.pipe=function(t,e){return Yy.prototype.pipe.call(this,t,e),this.resume(),t};ot.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};ot.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=ot.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ot.prototype._pipeNext=function(t){this._currentStream=t;var e=ot.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};ot.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ot.prototype.write=function(t){this.emit("data",t)};ot.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ot.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};ot.prototype.end=function(){this._reset(),this.emit("end")};ot.prototype.destroy=function(){this._reset(),this.emit("close")};ot.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ot.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ot.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ot.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var t_=k((GK,e_)=>{"use strict";e_.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var o_=k(Rt=>{"use strict";var qs=t_(),oO=require("path").extname,r_=/^\s*([^;\s]*)(?:;|\s|$)/,iO=/^text\//i;Rt.charset=n_;Rt.charsets={lookup:n_};Rt.contentType=aO;Rt.extension=sO;Rt.extensions=Object.create(null);Rt.lookup=uO;Rt.types=Object.create(null);cO(Rt.extensions,Rt.types);function n_(t){if(!t||typeof t!="string")return!1;var e=r_.exec(t),r=e&&qs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&iO.test(e[1])?"UTF-8":!1}o(n_,"charset");function aO(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Rt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Rt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(aO,"contentType");function sO(t){if(!t||typeof t!="string")return!1;var e=r_.exec(t),r=e&&Rt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(sO,"extension");function uO(t){if(!t||typeof t!="string")return!1;var e=oO("x."+t).toLowerCase().substr(1);return e&&Rt.types[e]||!1}o(uO,"lookup");function cO(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(qs).forEach(o(function(i){var s=qs[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var l=c[d];if(e[l]){var f=r.indexOf(qs[e[l]].source),p=r.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(f>p||f===p&&e[l].substr(0,12)==="application/"))continue}e[l]=i}}},"forEachMimeType"))}o(cO,"populateMaps")});var a_=k((KK,i_)=>{i_.exports=lO;function lO(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(lO,"defer")});var Wl=k((YK,u_)=>{var s_=a_();u_.exports=dO;function dO(t){var e=!1;return s_(function(){e=!0}),o(function(n,i){e?t(n,i):s_(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(dO,"async")});var Zl=k((QK,c_)=>{c_.exports=pO;function pO(t){Object.keys(t.jobs).forEach(fO.bind(t)),t.jobs={}}o(pO,"abort");function fO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(fO,"clean")});var Kl=k((tJ,d_)=>{var l_=Wl(),mO=Zl();d_.exports=hO;function hO(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=gO(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?mO(r):r.results[i]=c,n(s,r.results))})}o(hO,"iterate");function gO(t,e,r,n){var i;return t.length==2?i=t(r,l_(n)):i=t(r,e,l_(n)),i}o(gO,"runJob")});var Jl=k((nJ,p_)=>{p_.exports=yO;function yO(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(yO,"state")});var Yl=k((iJ,f_)=>{var _O=Zl(),vO=Wl();f_.exports=bO;function bO(t){Object.keys(this.jobs).length&&(this.index=this.size,_O(this),vO(t)(null,this.results))}o(bO,"terminator")});var h_=k((sJ,m_)=>{var PO=Kl(),SO=Jl(),EO=Yl();m_.exports=TO;function TO(t,e,r){for(var n=SO(t);n.index<(n.keyedList||t).length;)PO(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return EO.bind(n,r)}o(TO,"parallel")});var Xl=k((cJ,Vs)=>{var g_=Kl(),xO=Jl(),AO=Yl();Vs.exports=wO;Vs.exports.ascending=y_;Vs.exports.descending=IO;function wO(t,e,r,n){var i=xO(t,r);return g_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){g_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),AO.bind(i,n)}o(wO,"serialOrdered");function y_(t,e){return t<e?-1:t>e?1:0}o(y_,"ascending");function IO(t,e){return-1*y_(t,e)}o(IO,"descending")});var v_=k((dJ,__)=>{var RO=Xl();__.exports=OO;function OO(t,e,r){return RO(t,e,null,r)}o(OO,"serial")});var P_=k((fJ,b_)=>{b_.exports={parallel:h_(),serial:v_(),serialOrdered:Xl()}});var Ql=k((mJ,S_)=>{"use strict";S_.exports=Object});var T_=k((hJ,E_)=>{"use strict";E_.exports=Error});var A_=k((gJ,x_)=>{"use strict";x_.exports=EvalError});var I_=k((yJ,w_)=>{"use strict";w_.exports=RangeError});var O_=k((_J,R_)=>{"use strict";R_.exports=ReferenceError});var $_=k((vJ,C_)=>{"use strict";C_.exports=SyntaxError});var $n=k((bJ,k_)=>{"use strict";k_.exports=TypeError});var z_=k((PJ,N_)=>{"use strict";N_.exports=URIError});var U_=k((SJ,D_)=>{"use strict";D_.exports=Math.abs});var j_=k((EJ,M_)=>{"use strict";M_.exports=Math.floor});var F_=k((TJ,L_)=>{"use strict";L_.exports=Math.max});var q_=k((xJ,B_)=>{"use strict";B_.exports=Math.min});var H_=k((AJ,V_)=>{"use strict";V_.exports=Math.pow});var W_=k((wJ,G_)=>{"use strict";G_.exports=Math.round});var K_=k((IJ,Z_)=>{"use strict";Z_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var Y_=k((OJ,J_)=>{"use strict";var CO=K_();J_.exports=o(function(e){return CO(e)||e===0?e:e<0?-1:1},"sign")});var Q_=k(($J,X_)=>{"use strict";X_.exports=Object.getOwnPropertyDescriptor});var ed=k((kJ,ev)=>{"use strict";var Hs=Q_();if(Hs)try{Hs([],"length")}catch{Hs=null}ev.exports=Hs});var rv=k((NJ,tv)=>{"use strict";var Gs=Object.defineProperty||!1;if(Gs)try{Gs({},"a",{value:1})}catch{Gs=!1}tv.exports=Gs});var td=k((zJ,nv)=>{"use strict";nv.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var av=k((UJ,iv)=>{"use strict";var ov=typeof Symbol<"u"&&Symbol,$O=td();iv.exports=o(function(){return typeof ov!="function"||typeof Symbol!="function"||typeof ov("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:$O()},"hasNativeSymbols")});var rd=k((jJ,sv)=>{"use strict";sv.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nd=k((LJ,uv)=>{"use strict";var kO=Ql();uv.exports=kO.getPrototypeOf||null});var dv=k((FJ,lv)=>{"use strict";var NO="Function.prototype.bind called on incompatible ",zO=Object.prototype.toString,DO=Math.max,UO="[object Function]",cv=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),MO=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),jO=o(function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},"joiny");lv.exports=o(function(e){var r=this;if(typeof r!="function"||zO.apply(r)!==UO)throw new TypeError(NO+r);for(var n=MO(arguments,1),i,s=o(function(){if(this instanceof i){var p=r.apply(this,cv(n,arguments));return Object(p)===p?p:this}return r.apply(e,cv(n,arguments))},"binder"),c=DO(0,r.length-n.length),d=[],l=0;l<c;l++)d[l]="$"+l;if(i=Function("binder","return function ("+jO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var f=o(function(){},"Empty");f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i},"bind")});var Fo=k((qJ,pv)=>{"use strict";var LO=dv();pv.exports=Function.prototype.bind||LO});var Ws=k((VJ,fv)=>{"use strict";fv.exports=Function.prototype.call});var od=k((HJ,mv)=>{"use strict";mv.exports=Function.prototype.apply});var gv=k((GJ,hv)=>{"use strict";hv.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var _v=k((WJ,yv)=>{"use strict";var FO=Fo(),BO=od(),qO=Ws(),VO=gv();yv.exports=VO||FO.call(qO,BO)});var id=k((ZJ,vv)=>{"use strict";var HO=Fo(),GO=$n(),WO=Ws(),ZO=_v();vv.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new GO("a function is required");return ZO(HO,WO,e)},"callBindBasic")});var xv=k((JJ,Tv)=>{"use strict";var KO=id(),bv=ed(),Sv;try{Sv=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var ad=!!Sv&&bv&&bv(Object.prototype,"__proto__"),Ev=Object,Pv=Ev.getPrototypeOf;Tv.exports=ad&&typeof ad.get=="function"?KO([ad.get]):typeof Pv=="function"?o(function(e){return Pv(e==null?e:Ev(e))},"getDunder"):!1});var Ov=k((XJ,Rv)=>{"use strict";var Av=rd(),wv=nd(),Iv=xv();Rv.exports=Av?o(function(e){return Av(e)},"getProto"):wv?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return wv(e)},"getProto"):Iv?o(function(e){return Iv(e)},"getProto"):null});var sd=k((e8,Cv)=>{"use strict";var JO=Function.prototype.call,YO=Object.prototype.hasOwnProperty,XO=Fo();Cv.exports=XO.call(JO,YO)});var ea=k((t8,Uv)=>{"use strict";var ke,QO=Ql(),eC=T_(),tC=A_(),rC=I_(),nC=O_(),Ho=$_(),Vo=$n(),oC=z_(),iC=U_(),aC=j_(),sC=F_(),uC=q_(),cC=H_(),lC=W_(),dC=Y_(),zv=Function,ud=o(function(t){try{return zv('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Yi=ed(),pC=rv(),cd=o(function(){throw new Vo},"throwTypeError"),fC=Yi?(function(){try{return arguments.callee,cd}catch{try{return Yi(arguments,"callee").get}catch{return cd}}})():cd,Bo=av()(),_t=Ov(),mC=nd(),hC=rd(),Dv=od(),Xi=Ws(),qo={},gC=typeof Uint8Array>"u"||!_t?ke:_t(Uint8Array),to={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":Bo&&_t?_t([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":qo,"%AsyncGenerator%":qo,"%AsyncGeneratorFunction%":qo,"%AsyncIteratorPrototype%":qo,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":eC,"%eval%":eval,"%EvalError%":tC,"%Float16Array%":typeof Float16Array>"u"?ke:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":zv,"%GeneratorFunction%":qo,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Bo&&_t?_t(_t([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Bo||!_t?ke:_t(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":QO,"%Object.getOwnPropertyDescriptor%":Yi,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":rC,"%ReferenceError%":nC,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Bo||!_t?ke:_t(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Bo&&_t?_t(""[Symbol.iterator]()):ke,"%Symbol%":Bo?Symbol:ke,"%SyntaxError%":Ho,"%ThrowTypeError%":fC,"%TypedArray%":gC,"%TypeError%":Vo,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":oC,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet,"%Function.prototype.call%":Xi,"%Function.prototype.apply%":Dv,"%Object.defineProperty%":pC,"%Object.getPrototypeOf%":mC,"%Math.abs%":iC,"%Math.floor%":aC,"%Math.max%":sC,"%Math.min%":uC,"%Math.pow%":cC,"%Math.round%":lC,"%Math.sign%":dC,"%Reflect.getPrototypeOf%":hC};if(_t)try{null.error}catch(t){$v=_t(_t(t)),to["%Error.prototype%"]=$v}var $v,yC=o(function t(e){var r;if(e==="%AsyncFunction%")r=ud("async function () {}");else if(e==="%GeneratorFunction%")r=ud("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ud("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&_t&&(r=_t(i.prototype))}return to[e]=r,r},"doEval"),kv={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Qi=Fo(),Zs=sd(),_C=Qi.call(Xi,Array.prototype.concat),vC=Qi.call(Dv,Array.prototype.splice),Nv=Qi.call(Xi,String.prototype.replace),Ks=Qi.call(Xi,String.prototype.slice),bC=Qi.call(Xi,RegExp.prototype.exec),PC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,SC=/\\(\\)?/g,EC=o(function(e){var r=Ks(e,0,1),n=Ks(e,-1);if(r==="%"&&n!=="%")throw new Ho("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ho("invalid intrinsic syntax, expected opening `%`");var i=[];return Nv(e,PC,function(s,c,d,l){i[i.length]=d?Nv(l,SC,"$1"):c||s}),i},"stringToPath"),TC=o(function(e,r){var n=e,i;if(Zs(kv,n)&&(i=kv[n],n="%"+i[0]+"%"),Zs(to,n)){var s=to[n];if(s===qo&&(s=yC(n)),typeof s>"u"&&!r)throw new Vo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ho("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Uv.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Vo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Vo('"allowMissing" argument must be a boolean');if(bC(/^%?[^%]*%?$/,e)===null)throw new Ho("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=EC(e),i=n.length>0?n[0]:"",s=TC("%"+i+"%",r),c=s.name,d=s.value,l=!1,f=s.alias;f&&(i=f[0],vC(n,_C([0,1],f)));for(var p=1,_=!0;p<n.length;p+=1){var h=n[p],g=Ks(h,0,1),y=Ks(h,-1);if((g==='"'||g==="'"||g==="`"||y==='"'||y==="'"||y==="`")&&g!==y)throw new Ho("property names with quotes must have matching quotes");if((h==="constructor"||!_)&&(l=!0),i+="."+h,c="%"+i+"%",Zs(to,c))d=to[c];else if(d!=null){if(!(h in d)){if(!r)throw new Vo("base intrinsic for "+e+" exists, but the property is not available.");return}if(Yi&&p+1>=n.length){var T=Yi(d,h);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?d=T.get:d=d[h]}else _=Zs(d,h),d=d[h];_&&!l&&(to[c]=d)}}return d},"GetIntrinsic")});var jv=k((n8,Mv)=>{"use strict";var xC=td();Mv.exports=o(function(){return xC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Bv=k((i8,Fv)=>{"use strict";var AC=ea(),Lv=AC("%Object.defineProperty%",!0),wC=jv()(),IC=sd(),RC=$n(),Js=wC?Symbol.toStringTag:null;Fv.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new RC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Js&&(n||!IC(e,Js))&&(Lv?Lv(e,Js,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[Js]=r)},"setToStringTag")});var Vv=k((s8,qv)=>{"use strict";var OC=Function.prototype.call,CC=Object.prototype.hasOwnProperty,$C=Fo();qv.exports=$C.call(OC,CC)});var Gv=k((u8,Hv)=>{"use strict";Hv.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var Kv=k((c8,Zv)=>{"use strict";var fd=Qy(),kC=require("util"),ld=require("path"),NC=require("http"),zC=require("https"),DC=require("url").parse,UC=require("fs"),MC=require("stream").Stream,jC=require("crypto"),dd=o_(),LC=P_(),FC=Bv(),kn=Vv(),pd=Gv();function Wv(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Wv,"escapeHeaderParam");function je(t){if(!(this instanceof je))return new je(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(je,"FormData");kC.inherits(je,fd);je.LINE_BREAK=`\r
|
|
2
|
+
`;je.DEFAULT_CONTENT_TYPE="application/octet-stream";je.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=fd.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};je.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+je.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&kn(e,"httpVersion"))&&!(e instanceof MC))&&(r.knownLength||this._valuesToMeasure.push(e))};je.prototype._lengthRetriever=function(t,e){kn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):UC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):kn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):kn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};je.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+Wv(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pd(c,r.header);var d;for(var l in c)if(kn(c,l)){if(d=c[l],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=l+": "+d.join("; ")+je.LINE_BREAK)}return"--"+this.getBoundary()+je.LINE_BREAK+s+je.LINE_BREAK};je.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=ld.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=ld.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&kn(t,"httpVersion")&&(r=ld.basename(t.client._httpMessage.path||"")),r)return'filename="'+Wv(r)+'"'};je.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=dd.lookup(t.name)),!r&&t&&t.path&&(r=dd.lookup(t.path)),!r&&t&&t.readable&&kn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=dd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=je.DEFAULT_CONTENT_TYPE),r};je.prototype._multiPartFooter=function(){return function(t){var e=je.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};je.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+je.LINE_BREAK};je.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)kn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};je.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};je.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};je.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(je.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};je.prototype._generateBoundary=function(){this._boundary="--------------------------"+jC.randomBytes(12).toString("hex")};je.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};je.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};je.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}LC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};je.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=DC(t),n=pd({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=pd(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=zC.request(n):r=NC.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,l=o(function(f,p){return r.removeListener("error",l),r.removeListener("response",d),e.call(this,f,p)},"callback");d=l.bind(this,null),r.on("error",l),r.on("response",d)}}.bind(this)),r};je.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};je.prototype.toString=function(){return"[object FormData]"};FC(je.prototype,"FormData");Zv.exports=je});var ra=k((i5,fb)=>{"use strict";var Xs=Object.prototype.hasOwnProperty,pb=Object.prototype.toString,ab=Object.defineProperty,sb=Object.getOwnPropertyDescriptor,ub=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):pb.call(e)==="[object Array]"},"isArray"),cb=o(function(e){if(!e||pb.call(e)!=="[object Object]")return!1;var r=Xs.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Xs.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||Xs.call(e,i)},"isPlainObject"),lb=o(function(e,r){ab&&r.name==="__proto__"?ab(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),db=o(function(e,r){if(r==="__proto__")if(Xs.call(e,r)){if(sb)return sb(e,r).value}else return;return e[r]},"getProperty");fb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],l=1,f=arguments.length,p=!1;for(typeof d=="boolean"&&(p=d,d=arguments[1]||{},l=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});l<f;++l)if(e=arguments[l],e!=null)for(r in e)n=db(d,r),i=db(e,r),d!==i&&(p&&i&&(cb(i)||(s=ub(i)))?(s?(s=!1,c=n&&ub(n)?n:[]):c=n&&cb(n)?n:{},lb(d,{name:r,newValue:t(p,c,i)})):typeof i<"u"&&lb(d,{name:r,newValue:i}));return d},"extend")});var mb=k((s5,n0)=>{n0.exports={name:"gaxios",version:"7.1.3",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","@types/tmp":"0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.0.0",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.0-beta.13","null-loader":"^4.0.0","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"^5.8.3",webpack:"^5.35.0","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2",rimraf:"^5.0.1"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}});var gb=k((u5,hb)=>{"use strict";var o0=mb();hb.exports={pkg:o0}});var gd=k(er=>{"use strict";var _b=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(er,"__esModule",{value:!0});er.GaxiosError=er.GAXIOS_ERROR_SYMBOL=void 0;er.defaultErrorRedactor=vb;var yb=_b(ra()),i0=_b(gb()),md=i0.default.pkg;er.GAXIOS_ERROR_SYMBOL=Symbol.for(`${md.name}-gaxios-error`);var hd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[er.GAXIOS_ERROR_SYMBOL]=md.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&er.GAXIOS_ERROR_SYMBOL in e&&e[er.GAXIOS_ERROR_SYMBOL]===md.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,i){if(super(e,{cause:i}),this.config=r,this.response=n,this.error=i instanceof Error?i:void 0,this.config=(0,yb.default)(!0,{},r),this.response&&(this.response.config=(0,yb.default)(!0,{},this.response.config)),this.response){try{this.response.data=a0(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
|
|
3
|
+
`)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};er.GaxiosError=hd;function a0(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}o(a0,"translateData");function vb(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(vb({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(vb,"defaultErrorRedactor")});var Pb=k(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.getRetryConfig=s0;async function s0(t){let e=bb(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let r=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||r,t.config.retryConfig=e,!await(e.shouldRetry||u0)(t))return{shouldRetry:!1,config:t.config};let i=c0(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(s0,"getRetryConfig");function u0(t){let e=bb(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(u0,"shouldRetryRequest");function bb(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(bb,"getConfig");function c0(t){let r=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,n=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(r,n,t.maxRetryDelay)}o(c0,"getNextRetryDelay")});var vd=k(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.GaxiosInterceptorManager=void 0;var _d=class extends Set{static{o(this,"GaxiosInterceptorManager")}};Qs.GaxiosInterceptorManager=_d});var Eb=k((h5,Sb)=>{var Go=1e3,Wo=Go*60,Zo=Wo*60,ro=Zo*24,l0=ro*7,d0=ro*365.25;Sb.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return p0(t);if(r==="number"&&isFinite(t))return e.long?m0(t):f0(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function p0(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*d0;case"weeks":case"week":case"w":return r*l0;case"days":case"day":case"d":return r*ro;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Zo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Wo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Go;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(p0,"parse");function f0(t){var e=Math.abs(t);return e>=ro?Math.round(t/ro)+"d":e>=Zo?Math.round(t/Zo)+"h":e>=Wo?Math.round(t/Wo)+"m":e>=Go?Math.round(t/Go)+"s":t+"ms"}o(f0,"fmtShort");function m0(t){var e=Math.abs(t);return e>=ro?eu(t,e,ro,"day"):e>=Zo?eu(t,e,Zo,"hour"):e>=Wo?eu(t,e,Wo,"minute"):e>=Go?eu(t,e,Go,"second"):t+" ms"}o(m0,"fmtLong");function eu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(eu,"plural")});var bd=k((y5,Tb)=>{function h0(t){r.debug=r,r.default=r,r.coerce=l,r.disable=c,r.enable=i,r.enabled=d,r.humanize=Eb(),r.destroy=f,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let _=0;for(let h=0;h<p.length;h++)_=(_<<5)-_+p.charCodeAt(h),_|=0;return r.colors[Math.abs(_)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(p){let _,h=null,g,y;function T(...P){if(!T.enabled)return;let x=T,N=Number(new Date),F=N-(_||N);x.diff=F,x.prev=_,x.curr=N,_=N,P[0]=r.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let X=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(G,Y)=>{if(G==="%%")return"%";X++;let ee=r.formatters[Y];if(typeof ee=="function"){let K=P[X];G=ee.call(x,K),P.splice(X,1),X--}return G}),r.formatArgs.call(x,P),(x.log||r.log).apply(x,P)}return o(T,"debug"),T.namespace=p,T.useColors=r.useColors(),T.color=r.selectColor(p),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:o(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,y=r.enabled(p)),y),"get"),set:o(P=>{h=P},"set")}),typeof r.init=="function"&&r.init(T),T}o(r,"createDebug");function n(p,_){let h=r(this.namespace+(typeof _>"u"?":":_)+p);return h.log=this.log,h}o(n,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let _=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of _)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}o(i,"enable");function s(p,_){let h=0,g=0,y=-1,T=0;for(;h<p.length;)if(g<_.length&&(_[g]===p[h]||_[g]==="*"))_[g]==="*"?(y=g,T=h,g++):(h++,g++);else if(y!==-1)g=y+1,T++,h=T;else return!1;for(;g<_.length&&_[g]==="*";)g++;return g===_.length}o(s,"matchesTemplate");function c(){let p=[...r.names,...r.skips.map(_=>"-"+_)].join(",");return r.enable(""),p}o(c,"disable");function d(p){for(let _ of r.skips)if(s(p,_))return!1;for(let _ of r.names)if(s(p,_))return!0;return!1}o(d,"enabled");function l(p){return p instanceof Error?p.stack||p.message:p}o(l,"coerce");function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(f,"destroy"),r.enable(r.load()),r}o(h0,"setup");Tb.exports=h0});var xb=k((Ot,tu)=>{Ot.formatArgs=y0;Ot.save=_0;Ot.load=v0;Ot.useColors=g0;Ot.storage=b0();Ot.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ot.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function g0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(g0,"useColors");function y0(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+tu.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(y0,"formatArgs");Ot.log=console.debug||console.log||(()=>{});function _0(t){try{t?Ot.storage.setItem("debug",t):Ot.storage.removeItem("debug")}catch{}}o(_0,"save");function v0(){let t;try{t=Ot.storage.getItem("debug")||Ot.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(v0,"load");function b0(){try{return localStorage}catch{}}o(b0,"localstorage");tu.exports=bd()(Ot);var{formatters:P0}=tu.exports;P0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var wb=k((b5,Ab)=>{"use strict";Ab.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Ob=k((P5,Rb)=>{"use strict";var S0=require("os"),Ib=require("tty"),tr=wb(),{env:vt}=process,zn;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?zn=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(zn=1);"FORCE_COLOR"in vt&&(vt.FORCE_COLOR==="true"?zn=1:vt.FORCE_COLOR==="false"?zn=0:zn=vt.FORCE_COLOR.length===0?1:Math.min(parseInt(vt.FORCE_COLOR,10),3));function Pd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(Pd,"translateLevel");function Sd(t,e){if(zn===0)return 0;if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2;if(t&&!e&&zn===void 0)return 0;let r=zn||0;if(vt.TERM==="dumb")return r;if(process.platform==="win32"){let n=S0.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in vt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in vt)||vt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in vt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(vt.TEAMCITY_VERSION)?1:0;if(vt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in vt){let n=parseInt((vt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(vt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(vt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(vt.TERM)||"COLORTERM"in vt?1:r}o(Sd,"supportsColor");function E0(t){let e=Sd(t,t&&t.isTTY);return Pd(e)}o(E0,"getSupportLevel");Rb.exports={supportsColor:E0,stdout:Pd(Sd(!0,Ib.isatty(1))),stderr:Pd(Sd(!0,Ib.isatty(2)))}});var $b=k((bt,nu)=>{var T0=require("tty"),ru=require("util");bt.init=C0;bt.log=I0;bt.formatArgs=A0;bt.save=R0;bt.load=O0;bt.useColors=x0;bt.destroy=ru.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");bt.colors=[6,2,3,4,5,1];try{let t=Ob();t&&(t.stderr||t).level>=2&&(bt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}bt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function x0(){return"colors"in bt.inspectOpts?!!bt.inspectOpts.colors:T0.isatty(process.stderr.fd)}o(x0,"useColors");function A0(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
4
4
|
`).join(`
|
|
5
|
-
`+s),t.push(i+"m+"+
|
|
6
|
-
`)}o(
|
|
7
|
-
`).map(e=>e.trim()).join(" ")};
|
|
8
|
-
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new
|
|
5
|
+
`+s),t.push(i+"m+"+nu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=w0()+e+" "+t[0]}o(A0,"formatArgs");function w0(){return bt.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(w0,"getDate");function I0(...t){return process.stderr.write(ru.formatWithOptions(bt.inspectOpts,...t)+`
|
|
6
|
+
`)}o(I0,"log");function R0(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(R0,"save");function O0(){return process.env.DEBUG}o(O0,"load");function C0(t){t.inspectOpts={};let e=Object.keys(bt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=bt.inspectOpts[e[r]]}o(C0,"init");nu.exports=bd()(bt);var{formatters:Cb}=nu.exports;Cb.o=function(t){return this.inspectOpts.colors=this.useColors,ru.inspect(t,this.inspectOpts).split(`
|
|
7
|
+
`).map(e=>e.trim()).join(" ")};Cb.O=function(t){return this.inspectOpts.colors=this.useColors,ru.inspect(t,this.inspectOpts)}});var Td=k((T5,Ed)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ed.exports=xb():Ed.exports=$b()});var zb=k(Ct=>{"use strict";var $0=Ct&&Ct.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k0=Ct&&Ct.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kb=Ct&&Ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$0(e,t,r);return k0(e,t),e};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.req=Ct.json=Ct.toBuffer=void 0;var N0=kb(require("http")),z0=kb(require("https"));async function Nb(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(Nb,"toBuffer");Ct.toBuffer=Nb;async function D0(t){let r=(await Nb(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(D0,"json");Ct.json=D0;function U0(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?z0:N0).request(t,e),i=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=i.then.bind(i),n}o(U0,"req");Ct.req=U0});var jb=k(jt=>{"use strict";var Ub=jt&&jt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M0=jt&&jt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Mb=jt&&jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Ub(e,t,r);return M0(e,t),e},j0=jt&&jt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ub(e,t,r)};Object.defineProperty(jt,"__esModule",{value:!0});jt.Agent=void 0;var L0=Mb(require("net")),Db=Mb(require("http")),F0=require("https");j0(zb(),jt);var Ir=Symbol("AgentBaseInternalState"),xd=class extends Db.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Ir]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
8
|
+
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new L0.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],i=n.indexOf(r);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?F0.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(d=>{if(this.decrementSockets(s,c),d instanceof Db.Agent)try{return d.addRequest(e,i)}catch(l){return n(l)}this[Ir].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Ir].currentSocket;if(this[Ir].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Ir].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Ir]&&(this[Ir].defaultPort=e)}get protocol(){return this[Ir].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Ir]&&(this[Ir].protocol=e)}};jt.Agent=xd});var Lb=k(Ko=>{"use strict";var B0=Ko&&Ko.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.parseProxyResponse=void 0;var q0=B0(Td()),ou=(0,q0.default)("https-proxy-agent:parse-proxy-response");function V0(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let p=t.read();p?f(p):t.once("readable",s)}o(s,"read");function c(){t.removeListener("end",d),t.removeListener("error",l),t.removeListener("readable",s)}o(c,"cleanup");function d(){c(),ou("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function l(p){c(),ou("onerror %o",p),r(p)}o(l,"onerror");function f(p){i.push(p),n+=p.length;let _=Buffer.concat(i,n),h=_.indexOf(`\r
|
|
9
9
|
\r
|
|
10
|
-
`);if(h===-1){
|
|
11
|
-
`),y=g.shift();if(!y)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let T=y.split(" "),P=+T[1],x=T.slice(2).join(" "),N={};for(let
|
|
10
|
+
`);if(h===-1){ou("have not received end of HTTP headers yet..."),s();return}let g=_.slice(0,h).toString("ascii").split(`\r
|
|
11
|
+
`),y=g.shift();if(!y)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let T=y.split(" "),P=+T[1],x=T.slice(2).join(" "),N={};for(let F of g){if(!F)continue;let X=F.indexOf(":");if(X===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${F}"`));let Z=F.slice(0,X).toLowerCase(),G=F.slice(X+1).trimStart(),Y=N[Z];typeof Y=="string"?N[Z]=[Y,G]:Array.isArray(Y)?Y.push(G):N[Z]=G}ou("got proxy server response: %o %o",y,N),c(),e({connect:{statusCode:P,statusText:x,headers:N},buffered:_})}o(f,"ondata"),t.on("error",l),t.on("end",d),s()})}o(V0,"parseProxyResponse");Ko.parseProxyResponse=V0});var Gb=k(rr=>{"use strict";var H0=rr&&rr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G0=rr&&rr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vb=rr&&rr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&H0(e,t,r);return G0(e,t),e},Hb=rr&&rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.HttpsProxyAgent=void 0;var iu=Vb(require("net")),Fb=Vb(require("tls")),W0=Hb(require("assert")),Z0=Hb(Td()),K0=jb(),J0=require("url"),Y0=Lb(),na=(0,Z0.default)("https-proxy-agent"),Bb=o(t=>t.servername===void 0&&t.host&&!iu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),au=class extends K0.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new J0.URL(e):e,this.proxyHeaders=r?.headers??{},na("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?qb(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(na("Creating `tls.Socket`: %o",this.connectOpts),i=Fb.connect(Bb(this.connectOpts))):(na("Creating `net.Socket`: %o",this.connectOpts),i=iu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=iu.isIPv6(r.host)?`[${r.host}]`:r.host,d=`CONNECT ${c}:${r.port} HTTP/1.1\r
|
|
12
12
|
`;if(n.username||n.password){let h=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(h).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(s))d+=`${h}: ${s[h]}\r
|
|
13
|
-
`;let l=(0,
|
|
14
|
-
`);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",$0),r.secureEndpoint?(ra("Upgrading socket connection to TLS"),Rb.connect({...Cb(Ob(r),"host","path","port"),socket:i})):i;i.destroy();let _=new nu.Socket({writable:!1});return _.readable=!0,e.once("socket",h=>{ra("Replaying proxy buffer for failed request"),(0,w0.default)(h.listenerCount("data")>0),h.push(f),h.push(null)}),_}};ou.protocols=["http","https"];rr.HttpsProxyAgent=ou;function $0(t){t.resume()}o($0,"resume");function Cb(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(Cb,"omit")});function k0(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let f=1;f<r.length;f++)r[f]==="base64"?i=!0:r[f]&&(c+=`;${r[f]}`,r[f].indexOf("charset=")===0&&(n=r[f].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",l=unescape(t.substring(e+1)),p=Buffer.from(l,d);return p.type=s,p.typeFull=c,p.charset=n,p}var zb,Db=gt(()=>{o(k0,"dataUriToBuffer");zb=k0});var Mb=k((iu,Ub)=>{(function(t,e){typeof iu=="object"&&typeof Ub<"u"?e(iu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(iu,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function l(a){return new s(a)}o(l,"newPromise");function p(a){return l(u=>u(a))}o(p,"promiseResolvedWith");function f(a){return d(a)}o(f,"promiseRejectedWith");function _(a,u,m){return c.call(a,u,m)}o(_,"PerformPromiseThen");function h(a,u,m){_(_(a,u,m),void 0,n)}o(h,"uponPromise");function g(a,u){h(a,u)}o(g,"uponFulfillment");function y(a,u){h(a,void 0,u)}o(y,"uponRejection");function T(a,u,m){return _(a,u,m)}o(T,"transformPromiseWith");function P(a){_(a,void 0,n)}o(P,"setPromiseIsHandledToTrue");let x=o(a=>{if(typeof queueMicrotask=="function")x=queueMicrotask;else{let u=p(void 0);x=o(m=>_(u,m),"_queueMicrotask")}return x(a)},"_queueMicrotask");function N(a,u,m){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,m)}o(N,"reflectCall");function L(a,u,m){try{return p(N(a,u,m))}catch(S){return f(S)}}o(L,"promiseCall");let X=16384;class W{static{o(this,"SimpleQueue")}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(u){let m=this._back,S=m;m._elements.length===X-1&&(S={_elements:[],_next:void 0}),m._elements.push(u),S!==m&&(this._back=S,m._next=S),++this._size}shift(){let u=this._front,m=u,S=this._cursor,w=S+1,M=u._elements,F=M[S];return w===X&&(m=u._next,w=0),--this._size,this._cursor=w,u!==m&&(this._front=m),M[S]=void 0,F}forEach(u){let m=this._cursor,S=this._front,w=S._elements;for(;(m!==w.length||S._next!==void 0)&&!(m===w.length&&(S=S._next,w=S._elements,m=0,w.length===0));)u(w[m]),++m}peek(){let u=this._front,m=this._cursor;return u._elements[m]}}let G=Symbol("[[AbortSteps]]"),Z=Symbol("[[ErrorSteps]]"),ee=Symbol("[[CancelSteps]]"),Y=Symbol("[[PullSteps]]"),Se=Symbol("[[ReleaseSteps]]");function te(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?K(a):u._state==="closed"?oe(a):re(a,u._storedError)}o(te,"ReadableStreamReaderGenericInitialize");function q(a,u){let m=a._ownerReadableStream;return lr(m,u)}o(q,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ae(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Oe(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Se](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function J(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(J,"readerLockException");function K(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m})}o(K,"defaultReaderClosedPromiseInitialize");function re(a,u){K(a),Ae(a,u)}o(re,"defaultReaderClosedPromiseInitializeAsRejected");function oe(a){K(a),Be(a)}o(oe,"defaultReaderClosedPromiseInitializeAsResolved");function Ae(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ae,"defaultReaderClosedPromiseReject");function Oe(a,u){re(a,u)}o(Oe,"defaultReaderClosedPromiseResetToRejected");function Be(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Be,"defaultReaderClosedPromiseResolve");let Ge=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},ht=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function Q(a){return typeof a=="object"||typeof a=="function"}o(Q,"isDictionary");function tt(a,u){if(a!==void 0&&!Q(a))throw new TypeError(`${u} is not an object.`)}o(tt,"assertDictionary");function it(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(it,"assertFunction");function Nt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Nt,"isObject");function Fe(a,u){if(!Nt(a))throw new TypeError(`${u} is not an object.`)}o(Fe,"assertObject");function qe(a,u,m){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${m}'.`)}o(qe,"assertRequiredArgument");function v(a,u,m){if(a===void 0)throw new TypeError(`${u} is required in '${m}'.`)}o(v,"assertRequiredField");function E(a){return Number(a)}o(E,"convertUnrestrictedDouble");function A(a){return a===0?0:a}o(A,"censorNegativeZero");function D(a){return A(ht(a))}o(D,"integerPart");function R(a,u){let S=Number.MAX_SAFE_INTEGER,w=Number(a);if(w=A(w),!Ge(w))throw new TypeError(`${u} is not a finite number`);if(w=D(w),w<0||w>S)throw new TypeError(`${u} is outside the accepted range of 0 to ${S}, inclusive`);return!Ge(w)||w===0?0:w}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!gn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new V(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,m){let w=a._reader._readRequests.shift();m?w._closeSteps():w._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function z(a){let u=a._reader;return!(u===void 0||!ie(u))}o(z,"ReadableStreamHasDefaultReader");class V{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(qe(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");te(this,u),this._readRequests=new W}get closed(){return ie(this)?this._closedPromise:f(Ye("closed"))}cancel(u=void 0){return ie(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ye("cancel"))}read(){if(!ie(this))return f(Ye("read"));if(this._ownerReadableStream===void 0)return f(J("read from"));let u,m,S=l((M,F)=>{u=M,m=F});return ue(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>m(M),"_errorSteps")}),S}releaseLock(){if(!ie(this))throw Ye("releaseLock");this._ownerReadableStream!==void 0&&De(this)}}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(V.prototype.cancel,"cancel"),i(V.prototype.read,"read"),i(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ie(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof V}o(ie,"IsReadableStreamDefaultReader");function ue(a,u){let m=a._ownerReadableStream;m._disturbed=!0,m._state==="closed"?u._closeSteps():m._state==="errored"?u._errorSteps(m._storedError):m._readableStreamController[Y](u)}o(ue,"ReadableStreamDefaultReaderRead");function De(a){B(a);let u=new TypeError("Reader was released");Je(a,u)}o(De,"ReadableStreamDefaultReaderRelease");function Je(a,u){let m=a._readRequests;a._readRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(Je,"ReadableStreamDefaultReaderErrorReadRequests");function Ye(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(Ye,"defaultReaderBrandCheckException");let ze=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Le{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,m){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=m}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let m=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?T(this._ongoingPromise,m,m):m()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,m,S,w=l((F,ne)=>{m=F,S=ne});return ue(u,{_chunkSteps:o(F=>{this._ongoingPromise=void 0,x(()=>m({value:F,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),m({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(F=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),S(F)},"_errorSteps")}),w}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let m=this._reader;if(!this._preventCancel){let S=q(m,u);return B(m),T(S,()=>({value:u,done:!0}))}return B(m),p({value:u,done:!0})}}let dt={next(){return _o(this)?this._asyncIteratorImpl.next():f(vo("next"))},return(a){return _o(this)?this._asyncIteratorImpl.return(a):f(vo("return"))}};Object.setPrototypeOf(dt,ze);function yo(a,u){let m=j(a),S=new Le(m,u),w=Object.create(dt);return w._asyncIteratorImpl=S,w}o(yo,"AcquireReadableStreamAsyncIterator");function _o(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof Le}catch{return!1}}o(_o,"IsReadableStreamAsyncIterator");function vo(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(vo,"streamAsyncIteratorBrandCheckException");let zt=Number.isNaN||function(a){return a!==a};var qr,Pt,pt;function Ve(a){return a.slice()}o(Ve,"CreateArrayFromList");function fm(a,u,m,S,w){new Uint8Array(a).set(new Uint8Array(m,S,w),u)}o(fm,"CopyDataBlockBytes");let Vr=o(a=>(typeof a.transfer=="function"?Vr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Vr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):Vr=o(u=>u,"TransferArrayBuffer"),Vr(a)),"TransferArrayBuffer"),pn=o(a=>(typeof a.detached=="boolean"?pn=o(u=>u.detached,"IsDetachedBuffer"):pn=o(u=>u.byteLength===0,"IsDetachedBuffer"),pn(a)),"IsDetachedBuffer");function mm(a,u,m){if(a.slice)return a.slice(u,m);let S=m-u,w=new ArrayBuffer(S);return fm(w,0,a,u,S),w}o(mm,"ArrayBufferSlice");function qa(a,u){let m=a[u];if(m!=null){if(typeof m!="function")throw new TypeError(`${String(u)} is not a function`);return m}}o(qa,"GetMethod");function bx(a){let u={[Symbol.iterator]:()=>a.iterator},m=(async function*(){return yield*u})(),S=m.next;return{iterator:m,nextMethod:S,done:!1}}o(bx,"CreateAsyncFromSyncIterator");let Cc=(pt=(qr=Symbol.asyncIterator)!==null&&qr!==void 0?qr:(Pt=Symbol.for)===null||Pt===void 0?void 0:Pt.call(Symbol,"Symbol.asyncIterator"))!==null&&pt!==void 0?pt:"@@asyncIterator";function hm(a,u="sync",m){if(m===void 0)if(u==="async"){if(m=qa(a,Cc),m===void 0){let M=qa(a,Symbol.iterator),F=hm(a,"sync",M);return bx(F)}}else m=qa(a,Symbol.iterator);if(m===void 0)throw new TypeError("The object is not iterable");let S=N(m,a,[]);if(!r(S))throw new TypeError("The iterator method must return an object");let w=S.next;return{iterator:S,nextMethod:w,done:!1}}o(hm,"GetIterator");function Px(a){let u=N(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(Px,"IteratorNext");function Sx(a){return!!a.done}o(Sx,"IteratorComplete");function Ex(a){return a.value}o(Ex,"IteratorValue");function Tx(a){return!(typeof a!="number"||zt(a)||a<0)}o(Tx,"IsNonNegativeNumber");function gm(a){let u=mm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(gm,"CloneAsUint8Array");function $c(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o($c,"DequeueValue");function kc(a,u,m){if(!Tx(m)||m===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:m}),a._queueTotalSize+=m}o(kc,"EnqueueValueWithSize");function xx(a){return a._queue.peek().value}o(xx,"PeekQueueValue");function fn(a){a._queue=new W,a._queueTotalSize=0}o(fn,"ResetQueue");function ym(a){return a===DataView}o(ym,"isDataViewConstructor");function Ax(a){return ym(a.constructor)}o(Ax,"isDataView");function wx(a){return ym(a)?1:a.BYTES_PER_ELEMENT}o(wx,"arrayBufferViewElementSize");class Vn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Nc(this))throw jc("view");return this._view}respond(u){if(!Nc(this))throw jc("respond");if(qe(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(pn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Wa(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Nc(this))throw jc("respondWithNewView");if(qe(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))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");if(pn(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Za(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Vn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Vn.prototype.respond,"respond"),i(Vn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Vn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Hr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Hn(this))throw Pi("byobRequest");return Mc(this)}get desiredSize(){if(!Hn(this))throw Pi("desiredSize");return wm(this)}close(){if(!Hn(this))throw Pi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);bi(this)}enqueue(u){if(!Hn(this))throw Pi("enqueue");if(qe(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.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 m=this._controlledReadableByteStream._state;if(m!=="readable")throw new TypeError(`The stream (in ${m} state) is not in the readable state and cannot be enqueued to`);Ga(this,u)}error(u=void 0){if(!Hn(this))throw Pi("error");Yt(this,u)}[ee](u){_m(this),fn(this);let m=this._cancelAlgorithm(u);return Ha(this),m}[Y](u){let m=this._controlledReadableByteStream;if(this._queueTotalSize>0){Am(this,u);return}let S=this._autoAllocateChunkSize;if(S!==void 0){let w;try{w=new ArrayBuffer(S)}catch(F){u._errorSteps(F);return}let M={buffer:w,bufferByteLength:S,byteOffset:0,byteLength:S,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(m,u),Gn(this)}[Se](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(Hr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Hr.prototype.close,"close"),i(Hr.prototype.enqueue,"enqueue"),i(Hr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Hn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof Hr}o(Hn,"IsReadableByteStreamController");function Nc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Vn}o(Nc,"IsReadableStreamBYOBRequest");function Gn(a){if(!$x(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Gn(a)),null),S=>(Yt(a,S),null))}o(Gn,"ReadableByteStreamControllerCallPullIfNeeded");function _m(a){Dc(a),a._pendingPullIntos=new W}o(_m,"ReadableByteStreamControllerClearPendingPullIntos");function zc(a,u){let m=!1;a._state==="closed"&&(m=!0);let S=vm(u);u.readerType==="default"?O(a,S,m):Mx(a,S,m)}o(zc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function vm(a){let u=a.bytesFilled,m=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/m)}o(vm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Va(a,u,m,S){a._queue.push({buffer:u,byteOffset:m,byteLength:S}),a._queueTotalSize+=S}o(Va,"ReadableByteStreamControllerEnqueueChunkToQueue");function bm(a,u,m,S){let w;try{w=mm(u,m,m+S)}catch(M){throw Yt(a,M),M}Va(a,w,0,S)}o(bm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Pm(a,u){u.bytesFilled>0&&bm(a,u.buffer,u.byteOffset,u.bytesFilled),bo(a)}o(Pm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Sm(a,u){let m=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),S=u.bytesFilled+m,w=m,M=!1,F=S%u.elementSize,ne=S-F;ne>=u.minimumFill&&(w=ne-u.bytesFilled,M=!0);let he=a._queue;for(;w>0;){let le=he.peek(),Ee=Math.min(w,le.byteLength),Ce=u.byteOffset+u.bytesFilled;fm(u.buffer,Ce,le.buffer,le.byteOffset,Ee),le.byteLength===Ee?he.shift():(le.byteOffset+=Ee,le.byteLength-=Ee),a._queueTotalSize-=Ee,Em(a,Ee,u),w-=Ee}return M}o(Sm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Em(a,u,m){m.bytesFilled+=u}o(Em,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Tm(a){a._queueTotalSize===0&&a._closeRequested?(Ha(a),wi(a._controlledReadableByteStream)):Gn(a)}o(Tm,"ReadableByteStreamControllerHandleQueueDrain");function Dc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Dc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Uc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();Sm(a,u)&&(bo(a),zc(a._controlledReadableByteStream,u))}}o(Uc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function Ix(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let m=u._readRequests.shift();Am(a,m)}}o(Ix,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function Rx(a,u,m,S){let w=a._controlledReadableByteStream,M=u.constructor,F=wx(M),{byteOffset:ne,byteLength:he}=u,le=m*F,Ee;try{Ee=Vr(u.buffer)}catch(We){S._errorSteps(We);return}let Ce={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:ne,byteLength:he,bytesFilled:0,minimumFill:le,elementSize:F,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ce),Om(w,S);return}if(w._state==="closed"){let We=new M(Ce.buffer,Ce.byteOffset,0);S._closeSteps(We);return}if(a._queueTotalSize>0){if(Sm(a,Ce)){let We=vm(Ce);Tm(a),S._chunkSteps(We);return}if(a._closeRequested){let We=new TypeError("Insufficient bytes to fill elements in the given buffer");Yt(a,We),S._errorSteps(We);return}}a._pendingPullIntos.push(Ce),Om(w,S),Gn(a)}o(Rx,"ReadableByteStreamControllerPullInto");function Ox(a,u){u.readerType==="none"&&bo(a);let m=a._controlledReadableByteStream;if(Lc(m))for(;Cm(m)>0;){let S=bo(a);zc(m,S)}}o(Ox,"ReadableByteStreamControllerRespondInClosedState");function Cx(a,u,m){if(Em(a,u,m),m.readerType==="none"){Pm(a,m),Uc(a);return}if(m.bytesFilled<m.minimumFill)return;bo(a);let S=m.bytesFilled%m.elementSize;if(S>0){let w=m.byteOffset+m.bytesFilled;bm(a,m.buffer,w-S,S)}m.bytesFilled-=S,zc(a._controlledReadableByteStream,m),Uc(a)}o(Cx,"ReadableByteStreamControllerRespondInReadableState");function xm(a,u){let m=a._pendingPullIntos.peek();Dc(a),a._controlledReadableByteStream._state==="closed"?Ox(a,m):Cx(a,u,m),Gn(a)}o(xm,"ReadableByteStreamControllerRespondInternal");function bo(a){return a._pendingPullIntos.shift()}o(bo,"ReadableByteStreamControllerShiftPendingPullInto");function $x(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(z(u)&&U(u)>0||Lc(u)&&Cm(u)>0||wm(a)>0)}o($x,"ReadableByteStreamControllerShouldCallPull");function Ha(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ha,"ReadableByteStreamControllerClearAlgorithms");function bi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let m=a._pendingPullIntos.peek();if(m.bytesFilled%m.elementSize!==0){let S=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Yt(a,S),S}}Ha(a),wi(u)}}o(bi,"ReadableByteStreamControllerClose");function Ga(a,u){let m=a._controlledReadableByteStream;if(a._closeRequested||m._state!=="readable")return;let{buffer:S,byteOffset:w,byteLength:M}=u;if(pn(S))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let F=Vr(S);if(a._pendingPullIntos.length>0){let ne=a._pendingPullIntos.peek();if(pn(ne.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Dc(a),ne.buffer=Vr(ne.buffer),ne.readerType==="none"&&Pm(a,ne)}if(z(m))if(Ix(a),U(m)===0)Va(a,F,w,M);else{a._pendingPullIntos.length>0&&bo(a);let ne=new Uint8Array(F,w,M);O(m,ne,!1)}else Lc(m)?(Va(a,F,w,M),Uc(a)):Va(a,F,w,M);Gn(a)}o(Ga,"ReadableByteStreamControllerEnqueue");function Yt(a,u){let m=a._controlledReadableByteStream;m._state==="readable"&&(_m(a),fn(a),Ha(a),th(m,u))}o(Yt,"ReadableByteStreamControllerError");function Am(a,u){let m=a._queue.shift();a._queueTotalSize-=m.byteLength,Tm(a);let S=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);u._chunkSteps(S)}o(Am,"ReadableByteStreamControllerFillReadRequestFromQueue");function Mc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),m=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),S=Object.create(Vn.prototype);Nx(S,a,m),a._byobRequest=S}return a._byobRequest}o(Mc,"ReadableByteStreamControllerGetBYOBRequest");function wm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wm,"ReadableByteStreamControllerGetDesiredSize");function Wa(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(m.bytesFilled+u>m.byteLength)throw new RangeError("bytesWritten out of range")}m.buffer=Vr(m.buffer),xm(a,u)}o(Wa,"ReadableByteStreamControllerRespond");function Za(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(m.byteOffset+m.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(m.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(m.bytesFilled+u.byteLength>m.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let w=u.byteLength;m.buffer=Vr(u.buffer),xm(a,w)}o(Za,"ReadableByteStreamControllerRespondWithNewView");function Im(a,u,m,S,w,M,F){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,fn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,u._autoAllocateChunkSize=F,u._pendingPullIntos=new W,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,Gn(u),null),he=>(Yt(u,he),null))}o(Im,"SetUpReadableByteStreamController");function kx(a,u,m){let S=Object.create(Hr.prototype),w,M,F;u.start!==void 0?w=o(()=>u.start(S),"startAlgorithm"):w=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(S),"pullAlgorithm"):M=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?F=o(he=>u.cancel(he),"cancelAlgorithm"):F=o(()=>p(void 0),"cancelAlgorithm");let ne=u.autoAllocateChunkSize;if(ne===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Im(a,S,w,M,F,m,ne)}o(kx,"SetUpReadableByteStreamControllerFromUnderlyingSource");function Nx(a,u,m){a._associatedReadableByteStreamController=u,a._view=m}o(Nx,"SetUpReadableStreamBYOBRequest");function jc(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(jc,"byobRequestBrandCheckException");function Pi(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Pi,"byteStreamControllerBrandCheckException");function zx(a,u){tt(a,u);let m=a?.mode;return{mode:m===void 0?void 0:Dx(m,`${u} has member 'mode' that`)}}o(zx,"convertReaderOptions");function Dx(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(Dx,"convertReadableStreamReaderMode");function Ux(a,u){var m;tt(a,u);let S=(m=a?.min)!==null&&m!==void 0?m:1;return{min:R(S,`${u} has member 'min' that`)}}o(Ux,"convertByobReadOptions");function Rm(a){return new mn(a)}o(Rm,"AcquireReadableStreamBYOBReader");function Om(a,u){a._reader._readIntoRequests.push(u)}o(Om,"ReadableStreamAddReadIntoRequest");function Mx(a,u,m){let w=a._reader._readIntoRequests.shift();m?w._closeSteps(u):w._chunkSteps(u)}o(Mx,"ReadableStreamFulfillReadIntoRequest");function Cm(a){return a._reader._readIntoRequests.length}o(Cm,"ReadableStreamGetNumReadIntoRequests");function Lc(a){let u=a._reader;return!(u===void 0||!Wn(u))}o(Lc,"ReadableStreamHasBYOBReader");class mn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(qe(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Hn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");te(this,u),this._readIntoRequests=new W}get closed(){return Wn(this)?this._closedPromise:f(Ka("closed"))}cancel(u=void 0){return Wn(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ka("cancel"))}read(u,m={}){if(!Wn(this))return f(Ka("read"));if(!ArrayBuffer.isView(u))return f(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return f(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return f(new TypeError("view's buffer must have non-zero byteLength"));if(pn(u.buffer))return f(new TypeError("view's buffer has been detached"));let S;try{S=Ux(m,"options")}catch(le){return f(le)}let w=S.min;if(w===0)return f(new TypeError("options.min must be greater than 0"));if(Ax(u)){if(w>u.byteLength)return f(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(w>u.length)return f(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return f(J("read from"));let M,F,ne=l((le,Ee)=>{M=le,F=Ee});return $m(this,u,w,{_chunkSteps:o(le=>M({value:le,done:!1}),"_chunkSteps"),_closeSteps:o(le=>M({value:le,done:!0}),"_closeSteps"),_errorSteps:o(le=>F(le),"_errorSteps")}),ne}releaseLock(){if(!Wn(this))throw Ka("releaseLock");this._ownerReadableStream!==void 0&&jx(this)}}Object.defineProperties(mn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(mn.prototype.cancel,"cancel"),i(mn.prototype.read,"read"),i(mn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Wn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof mn}o(Wn,"IsReadableStreamBYOBReader");function $m(a,u,m,S){let w=a._ownerReadableStream;w._disturbed=!0,w._state==="errored"?S._errorSteps(w._storedError):Rx(w._readableStreamController,u,m,S)}o($m,"ReadableStreamBYOBReaderRead");function jx(a){B(a);let u=new TypeError("Reader was released");km(a,u)}o(jx,"ReadableStreamBYOBReaderRelease");function km(a,u){let m=a._readIntoRequests;a._readIntoRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(km,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Ka(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(Ka,"byobReaderBrandCheckException");function Si(a,u){let{highWaterMark:m}=a;if(m===void 0)return u;if(zt(m)||m<0)throw new RangeError("Invalid highWaterMark");return m}o(Si,"ExtractHighWaterMark");function Ja(a){let{size:u}=a;return u||(()=>1)}o(Ja,"ExtractSizeAlgorithm");function Ya(a,u){tt(a,u);let m=a?.highWaterMark,S=a?.size;return{highWaterMark:m===void 0?void 0:E(m),size:S===void 0?void 0:Lx(S,`${u} has member 'size' that`)}}o(Ya,"convertQueuingStrategy");function Lx(a,u){return it(a,u),m=>E(a(m))}o(Lx,"convertQueuingStrategySize");function Fx(a,u){tt(a,u);let m=a?.abort,S=a?.close,w=a?.start,M=a?.type,F=a?.write;return{abort:m===void 0?void 0:Bx(m,a,`${u} has member 'abort' that`),close:S===void 0?void 0:qx(S,a,`${u} has member 'close' that`),start:w===void 0?void 0:Vx(w,a,`${u} has member 'start' that`),write:F===void 0?void 0:Hx(F,a,`${u} has member 'write' that`),type:M}}o(Fx,"convertUnderlyingSink");function Bx(a,u,m){return it(a,m),S=>L(a,u,[S])}o(Bx,"convertUnderlyingSinkAbortCallback");function qx(a,u,m){return it(a,m),()=>L(a,u,[])}o(qx,"convertUnderlyingSinkCloseCallback");function Vx(a,u,m){return it(a,m),S=>N(a,u,[S])}o(Vx,"convertUnderlyingSinkStartCallback");function Hx(a,u,m){return it(a,m),(S,w)=>L(a,u,[S,w])}o(Hx,"convertUnderlyingSinkWriteCallback");function Nm(a,u){if(!Po(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Nm,"assertWritableStream");function Gx(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(Gx,"isAbortSignal");let Wx=typeof AbortController=="function";function Zx(){if(Wx)return new AbortController}o(Zx,"createAbortController");class hn{static{o(this,"WritableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Ya(m,"Second parameter"),w=Fx(u,"First parameter");if(Dm(this),w.type!==void 0)throw new RangeError("Invalid type is specified");let F=Ja(S),ne=Si(S,1);uA(this,w,ne,F)}get locked(){if(!Po(this))throw rs("locked");return So(this)}abort(u=void 0){return Po(this)?So(this)?f(new TypeError("Cannot abort a stream that already has a writer")):Xa(this,u):f(rs("abort"))}close(){return Po(this)?So(this)?f(new TypeError("Cannot close a stream that already has a writer")):Tr(this)?f(new TypeError("Cannot close an already-closing stream")):Um(this):f(rs("close"))}getWriter(){if(!Po(this))throw rs("getWriter");return zm(this)}}Object.defineProperties(hn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(hn.prototype.abort,"abort"),i(hn.prototype.close,"close"),i(hn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(hn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function zm(a){return new Gr(a)}o(zm,"AcquireWritableStreamDefaultWriter");function Kx(a,u,m,S,w=1,M=()=>1){let F=Object.create(hn.prototype);Dm(F);let ne=Object.create(Eo.prototype);return qm(F,ne,a,u,m,S,w,M),F}o(Kx,"CreateWritableStream");function Dm(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(Dm,"InitializeWritableStream");function Po(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof hn}o(Po,"IsWritableStream");function So(a){return a._writer!==void 0}o(So,"IsWritableStreamLocked");function Xa(a,u){var m;if(a._state==="closed"||a._state==="errored")return p(void 0);a._writableStreamController._abortReason=u,(m=a._writableStreamController._abortController)===null||m===void 0||m.abort(u);let S=a._state;if(S==="closed"||S==="errored")return p(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let w=!1;S==="erroring"&&(w=!0,u=void 0);let M=l((F,ne)=>{a._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:ne,_reason:u,_wasAlreadyErroring:w}});return a._pendingAbortRequest._promise=M,w||Bc(a,u),M}o(Xa,"WritableStreamAbort");function Um(a){let u=a._state;if(u==="closed"||u==="errored")return f(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let m=l((w,M)=>{let F={_resolve:w,_reject:M};a._closeRequest=F}),S=a._writer;return S!==void 0&&a._backpressure&&u==="writable"&&Jc(S),cA(a._writableStreamController),m}o(Um,"WritableStreamClose");function Jx(a){return l((m,S)=>{let w={_resolve:m,_reject:S};a._writeRequests.push(w)})}o(Jx,"WritableStreamAddWriteRequest");function Fc(a,u){if(a._state==="writable"){Bc(a,u);return}qc(a)}o(Fc,"WritableStreamDealWithRejection");function Bc(a,u){let m=a._writableStreamController;a._state="erroring",a._storedError=u;let S=a._writer;S!==void 0&&jm(S,u),!tA(a)&&m._started&&qc(a)}o(Bc,"WritableStreamStartErroring");function qc(a){a._state="errored",a._writableStreamController[Z]();let u=a._storedError;if(a._writeRequests.forEach(w=>{w._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){Qa(a);return}let m=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,m._wasAlreadyErroring){m._reject(u),Qa(a);return}let S=a._writableStreamController[G](m._reason);h(S,()=>(m._resolve(),Qa(a),null),w=>(m._reject(w),Qa(a),null))}o(qc,"WritableStreamFinishErroring");function Yx(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(Yx,"WritableStreamFinishInFlightWrite");function Xx(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,Fc(a,u)}o(Xx,"WritableStreamFinishInFlightWriteWithError");function Qx(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";let m=a._writer;m!==void 0&&Wm(m)}o(Qx,"WritableStreamFinishInFlightClose");function eA(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),Fc(a,u)}o(eA,"WritableStreamFinishInFlightCloseWithError");function Tr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Tr,"WritableStreamCloseQueuedOrInFlight");function tA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(tA,"WritableStreamHasOperationMarkedInFlight");function rA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(rA,"WritableStreamMarkCloseRequestInFlight");function nA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(nA,"WritableStreamMarkFirstWriteRequestInFlight");function Qa(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&Zc(u,a._storedError)}o(Qa,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Vc(a,u){let m=a._writer;m!==void 0&&u!==a._backpressure&&(u?gA(m):Jc(m)),a._backpressure=u}o(Vc,"WritableStreamUpdateBackpressure");class Gr{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(qe(u,1,"WritableStreamDefaultWriter"),Nm(u,"First parameter"),So(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let m=u._state;if(m==="writable")!Tr(u)&&u._backpressure?os(this):Zm(this),ns(this);else if(m==="erroring")Kc(this,u._storedError),ns(this);else if(m==="closed")Zm(this),mA(this);else{let S=u._storedError;Kc(this,S),Gm(this,S)}}get closed(){return Zn(this)?this._closedPromise:f(Kn("closed"))}get desiredSize(){if(!Zn(this))throw Kn("desiredSize");if(this._ownerWritableStream===void 0)throw Ti("desiredSize");return sA(this)}get ready(){return Zn(this)?this._readyPromise:f(Kn("ready"))}abort(u=void 0){return Zn(this)?this._ownerWritableStream===void 0?f(Ti("abort")):oA(this,u):f(Kn("abort"))}close(){if(!Zn(this))return f(Kn("close"));let u=this._ownerWritableStream;return u===void 0?f(Ti("close")):Tr(u)?f(new TypeError("Cannot close an already-closing stream")):Mm(this)}releaseLock(){if(!Zn(this))throw Kn("releaseLock");this._ownerWritableStream!==void 0&&Lm(this)}write(u=void 0){return Zn(this)?this._ownerWritableStream===void 0?f(Ti("write to")):Fm(this,u):f(Kn("write"))}}Object.defineProperties(Gr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Gr.prototype.abort,"abort"),i(Gr.prototype.close,"close"),i(Gr.prototype.releaseLock,"releaseLock"),i(Gr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Gr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Zn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof Gr}o(Zn,"IsWritableStreamDefaultWriter");function oA(a,u){let m=a._ownerWritableStream;return Xa(m,u)}o(oA,"WritableStreamDefaultWriterAbort");function Mm(a){let u=a._ownerWritableStream;return Um(u)}o(Mm,"WritableStreamDefaultWriterClose");function iA(a){let u=a._ownerWritableStream,m=u._state;return Tr(u)||m==="closed"?p(void 0):m==="errored"?f(u._storedError):Mm(a)}o(iA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function aA(a,u){a._closedPromiseState==="pending"?Zc(a,u):hA(a,u)}o(aA,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function jm(a,u){a._readyPromiseState==="pending"?Km(a,u):yA(a,u)}o(jm,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function sA(a){let u=a._ownerWritableStream,m=u._state;return m==="errored"||m==="erroring"?null:m==="closed"?0:Vm(u._writableStreamController)}o(sA,"WritableStreamDefaultWriterGetDesiredSize");function Lm(a){let u=a._ownerWritableStream,m=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");jm(a,m),aA(a,m),u._writer=void 0,a._ownerWritableStream=void 0}o(Lm,"WritableStreamDefaultWriterRelease");function Fm(a,u){let m=a._ownerWritableStream,S=m._writableStreamController,w=lA(S,u);if(m!==a._ownerWritableStream)return f(Ti("write to"));let M=m._state;if(M==="errored")return f(m._storedError);if(Tr(m)||M==="closed")return f(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return f(m._storedError);let F=Jx(m);return dA(S,u,w),F}o(Fm,"WritableStreamDefaultWriterWrite");let Bm={};class Eo{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Hc(this))throw Wc("abortReason");return this._abortReason}get signal(){if(!Hc(this))throw Wc("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!Hc(this))throw Wc("error");this._controlledWritableStream._state==="writable"&&Hm(this,u)}[G](u){let m=this._abortAlgorithm(u);return es(this),m}[Z](){fn(this)}}Object.defineProperties(Eo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Eo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Hc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Eo}o(Hc,"IsWritableStreamDefaultController");function qm(a,u,m,S,w,M,F,ne){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._abortReason=void 0,u._abortController=Zx(),u._started=!1,u._strategySizeAlgorithm=ne,u._strategyHWM=F,u._writeAlgorithm=S,u._closeAlgorithm=w,u._abortAlgorithm=M;let he=Gc(u);Vc(a,he);let le=m(),Ee=p(le);h(Ee,()=>(u._started=!0,ts(u),null),Ce=>(u._started=!0,Fc(a,Ce),null))}o(qm,"SetUpWritableStreamDefaultController");function uA(a,u,m,S){let w=Object.create(Eo.prototype),M,F,ne,he;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?F=o(le=>u.write(le,w),"writeAlgorithm"):F=o(()=>p(void 0),"writeAlgorithm"),u.close!==void 0?ne=o(()=>u.close(),"closeAlgorithm"):ne=o(()=>p(void 0),"closeAlgorithm"),u.abort!==void 0?he=o(le=>u.abort(le),"abortAlgorithm"):he=o(()=>p(void 0),"abortAlgorithm"),qm(a,w,M,F,ne,he,m,S)}o(uA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function es(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(es,"WritableStreamDefaultControllerClearAlgorithms");function cA(a){kc(a,Bm,0),ts(a)}o(cA,"WritableStreamDefaultControllerClose");function lA(a,u){try{return a._strategySizeAlgorithm(u)}catch(m){return Ei(a,m),1}}o(lA,"WritableStreamDefaultControllerGetChunkSize");function Vm(a){return a._strategyHWM-a._queueTotalSize}o(Vm,"WritableStreamDefaultControllerGetDesiredSize");function dA(a,u,m){try{kc(a,u,m)}catch(w){Ei(a,w);return}let S=a._controlledWritableStream;if(!Tr(S)&&S._state==="writable"){let w=Gc(a);Vc(S,w)}ts(a)}o(dA,"WritableStreamDefaultControllerWrite");function ts(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){qc(u);return}if(a._queue.length===0)return;let S=xx(a);S===Bm?pA(a):fA(a,S)}o(ts,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ei(a,u){a._controlledWritableStream._state==="writable"&&Hm(a,u)}o(Ei,"WritableStreamDefaultControllerErrorIfNeeded");function pA(a){let u=a._controlledWritableStream;rA(u),$c(a);let m=a._closeAlgorithm();es(a),h(m,()=>(Qx(u),null),S=>(eA(u,S),null))}o(pA,"WritableStreamDefaultControllerProcessClose");function fA(a,u){let m=a._controlledWritableStream;nA(m);let S=a._writeAlgorithm(u);h(S,()=>{Yx(m);let w=m._state;if($c(a),!Tr(m)&&w==="writable"){let M=Gc(a);Vc(m,M)}return ts(a),null},w=>(m._state==="writable"&&es(a),Xx(m,w),null))}o(fA,"WritableStreamDefaultControllerProcessWrite");function Gc(a){return Vm(a)<=0}o(Gc,"WritableStreamDefaultControllerGetBackpressure");function Hm(a,u){let m=a._controlledWritableStream;es(a),Bc(m,u)}o(Hm,"WritableStreamDefaultControllerError");function rs(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(rs,"streamBrandCheckException$2");function Wc(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(Wc,"defaultControllerBrandCheckException$2");function Kn(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(Kn,"defaultWriterBrandCheckException");function Ti(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ti,"defaultWriterLockException");function ns(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m,a._closedPromiseState="pending"})}o(ns,"defaultWriterClosedPromiseInitialize");function Gm(a,u){ns(a),Zc(a,u)}o(Gm,"defaultWriterClosedPromiseInitializeAsRejected");function mA(a){ns(a),Wm(a)}o(mA,"defaultWriterClosedPromiseInitializeAsResolved");function Zc(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(Zc,"defaultWriterClosedPromiseReject");function hA(a,u){Gm(a,u)}o(hA,"defaultWriterClosedPromiseResetToRejected");function Wm(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(Wm,"defaultWriterClosedPromiseResolve");function os(a){a._readyPromise=l((u,m)=>{a._readyPromise_resolve=u,a._readyPromise_reject=m}),a._readyPromiseState="pending"}o(os,"defaultWriterReadyPromiseInitialize");function Kc(a,u){os(a),Km(a,u)}o(Kc,"defaultWriterReadyPromiseInitializeAsRejected");function Zm(a){os(a),Jc(a)}o(Zm,"defaultWriterReadyPromiseInitializeAsResolved");function Km(a,u){a._readyPromise_reject!==void 0&&(P(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Km,"defaultWriterReadyPromiseReject");function gA(a){os(a)}o(gA,"defaultWriterReadyPromiseReset");function yA(a,u){Kc(a,u)}o(yA,"defaultWriterReadyPromiseResetToRejected");function Jc(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(Jc,"defaultWriterReadyPromiseResolve");function _A(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(_A,"getGlobals");let Yc=_A();function vA(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(vA,"isDOMExceptionConstructor");function bA(){let a=Yc?.DOMException;return vA(a)?a:void 0}o(bA,"getFromGlobal");function PA(){let a=o(function(m,S){this.message=m||"",this.name=S||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(PA,"createPolyfill");let SA=bA()||PA();function Jm(a,u,m,S,w,M){let F=j(a),ne=zm(u);a._disturbed=!0;let he=!1,le=p(void 0);return l((Ee,Ce)=>{let We;if(M!==void 0){if(We=o(()=>{let de=M.reason!==void 0?M.reason:new SA("Aborted","AbortError"),Ne=[];S||Ne.push(()=>u._state==="writable"?Xa(u,de):p(void 0)),w||Ne.push(()=>a._state==="readable"?lr(a,de):p(void 0)),It(()=>Promise.all(Ne.map(Ze=>Ze())),!0,de)},"abortAlgorithm"),M.aborted){We();return}M.addEventListener("abort",We)}function dr(){return l((de,Ne)=>{function Ze(Dt){Dt?de():_(wo(),Ze,Ne)}o(Ze,"next"),Ze(!1)})}o(dr,"pipeLoop");function wo(){return he?p(!0):_(ne._readyPromise,()=>l((de,Ne)=>{ue(F,{_chunkSteps:o(Ze=>{le=_(Fm(ne,Ze),void 0,e),de(!1)},"_chunkSteps"),_closeSteps:o(()=>de(!0),"_closeSteps"),_errorSteps:Ne})}))}if(o(wo,"pipeStep"),Zr(a,F._closedPromise,de=>(S?Xt(!0,de):It(()=>Xa(u,de),!0,de),null)),Zr(u,ne._closedPromise,de=>(w?Xt(!0,de):It(()=>lr(a,de),!0,de),null)),Tt(a,F._closedPromise,()=>(m?Xt():It(()=>iA(ne)),null)),Tr(u)||u._state==="closed"){let de=new TypeError("the destination writable stream closed before all data could be piped to it");w?Xt(!0,de):It(()=>lr(a,de),!0,de)}P(dr());function vn(){let de=le;return _(le,()=>de!==le?vn():void 0)}o(vn,"waitForWritesToFinish");function Zr(de,Ne,Ze){de._state==="errored"?Ze(de._storedError):y(Ne,Ze)}o(Zr,"isOrBecomesErrored");function Tt(de,Ne,Ze){de._state==="closed"?Ze():g(Ne,Ze)}o(Tt,"isOrBecomesClosed");function It(de,Ne,Ze){if(he)return;he=!0,u._state==="writable"&&!Tr(u)?g(vn(),Dt):Dt();function Dt(){return h(de(),()=>Kr(Ne,Ze),Io=>Kr(!0,Io)),null}o(Dt,"doTheRest")}o(It,"shutdownWithAction");function Xt(de,Ne){he||(he=!0,u._state==="writable"&&!Tr(u)?g(vn(),()=>Kr(de,Ne)):Kr(de,Ne))}o(Xt,"shutdown");function Kr(de,Ne){return Lm(ne),B(F),M!==void 0&&M.removeEventListener("abort",We),de?Ce(Ne):Ee(void 0),null}o(Kr,"finalize")})}o(Jm,"ReadableStreamPipeTo");class Wr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!is(this))throw ss("desiredSize");return Xc(this)}close(){if(!is(this))throw ss("close");if(!xo(this))throw new TypeError("The stream is not in a state that permits close");Jn(this)}enqueue(u=void 0){if(!is(this))throw ss("enqueue");if(!xo(this))throw new TypeError("The stream is not in a state that permits enqueue");return To(this,u)}error(u=void 0){if(!is(this))throw ss("error");cr(this,u)}[ee](u){fn(this);let m=this._cancelAlgorithm(u);return as(this),m}[Y](u){let m=this._controlledReadableStream;if(this._queue.length>0){let S=$c(this);this._closeRequested&&this._queue.length===0?(as(this),wi(m)):xi(this),u._chunkSteps(S)}else I(m,u),xi(this)}[Se](){}}Object.defineProperties(Wr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Wr.prototype.close,"close"),i(Wr.prototype.enqueue,"enqueue"),i(Wr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Wr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function is(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof Wr}o(is,"IsReadableStreamDefaultController");function xi(a){if(!Ym(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,xi(a)),null),S=>(cr(a,S),null))}o(xi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Ym(a){let u=a._controlledReadableStream;return!xo(a)||!a._started?!1:!!(yn(u)&&U(u)>0||Xc(a)>0)}o(Ym,"ReadableStreamDefaultControllerShouldCallPull");function as(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(as,"ReadableStreamDefaultControllerClearAlgorithms");function Jn(a){if(!xo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(as(a),wi(u))}o(Jn,"ReadableStreamDefaultControllerClose");function To(a,u){if(!xo(a))return;let m=a._controlledReadableStream;if(yn(m)&&U(m)>0)O(m,u,!1);else{let S;try{S=a._strategySizeAlgorithm(u)}catch(w){throw cr(a,w),w}try{kc(a,u,S)}catch(w){throw cr(a,w),w}}xi(a)}o(To,"ReadableStreamDefaultControllerEnqueue");function cr(a,u){let m=a._controlledReadableStream;m._state==="readable"&&(fn(a),as(a),th(m,u))}o(cr,"ReadableStreamDefaultControllerError");function Xc(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Xc,"ReadableStreamDefaultControllerGetDesiredSize");function EA(a){return!Ym(a)}o(EA,"ReadableStreamDefaultControllerHasBackpressure");function xo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(xo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Xm(a,u,m,S,w,M,F){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=F,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,xi(u),null),he=>(cr(u,he),null))}o(Xm,"SetUpReadableStreamDefaultController");function TA(a,u,m,S){let w=Object.create(Wr.prototype),M,F,ne;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?F=o(()=>u.pull(w),"pullAlgorithm"):F=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?ne=o(he=>u.cancel(he),"cancelAlgorithm"):ne=o(()=>p(void 0),"cancelAlgorithm"),Xm(a,w,M,F,ne,m,S)}o(TA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function ss(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(ss,"defaultControllerBrandCheckException$1");function xA(a,u){return Hn(a._readableStreamController)?wA(a):AA(a)}o(xA,"ReadableStreamTee");function AA(a,u){let m=j(a),S=!1,w=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(Tt=>{Ce=Tt});function dr(){return S?(w=!0,p(void 0)):(S=!0,ue(m,{_chunkSteps:o(It=>{x(()=>{w=!1;let Xt=It,Kr=It;M||To(le._readableStreamController,Xt),F||To(Ee._readableStreamController,Kr),S=!1,w&&dr()})},"_chunkSteps"),_closeSteps:o(()=>{S=!1,M||Jn(le._readableStreamController),F||Jn(Ee._readableStreamController),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{S=!1},"_errorSteps")}),p(void 0))}o(dr,"pullAlgorithm");function wo(Tt){if(M=!0,ne=Tt,F){let It=Ve([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(wo,"cancel1Algorithm");function vn(Tt){if(F=!0,he=Tt,M){let It=Ve([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(vn,"cancel2Algorithm");function Zr(){}return o(Zr,"startAlgorithm"),le=Ai(Zr,dr,wo),Ee=Ai(Zr,dr,vn),y(m._closedPromise,Tt=>(cr(le._readableStreamController,Tt),cr(Ee._readableStreamController,Tt),(!M||!F)&&Ce(void 0),null)),[le,Ee]}o(AA,"ReadableStreamDefaultTee");function wA(a){let u=j(a),m=!1,S=!1,w=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(de=>{Ce=de});function dr(de){y(de._closedPromise,Ne=>(de!==u||(Yt(le._readableStreamController,Ne),Yt(Ee._readableStreamController,Ne),(!M||!F)&&Ce(void 0)),null))}o(dr,"forwardReaderError");function wo(){Wn(u)&&(B(u),u=j(a),dr(u)),ue(u,{_chunkSteps:o(Ne=>{x(()=>{S=!1,w=!1;let Ze=Ne,Dt=Ne;if(!M&&!F)try{Dt=gm(Ne)}catch(Io){Yt(le._readableStreamController,Io),Yt(Ee._readableStreamController,Io),Ce(lr(a,Io));return}M||Ga(le._readableStreamController,Ze),F||Ga(Ee._readableStreamController,Dt),m=!1,S?Zr():w&&Tt()})},"_chunkSteps"),_closeSteps:o(()=>{m=!1,M||bi(le._readableStreamController),F||bi(Ee._readableStreamController),le._readableStreamController._pendingPullIntos.length>0&&Wa(le._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&Wa(Ee._readableStreamController,0),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(wo,"pullWithDefaultReader");function vn(de,Ne){ie(u)&&(B(u),u=Rm(a),dr(u));let Ze=Ne?Ee:le,Dt=Ne?le:Ee;$m(u,de,1,{_chunkSteps:o(Ro=>{x(()=>{S=!1,w=!1;let Oo=Ne?F:M;if(Ne?M:F)Oo||Za(Ze._readableStreamController,Ro);else{let mh;try{mh=gm(Ro)}catch(nl){Yt(Ze._readableStreamController,nl),Yt(Dt._readableStreamController,nl),Ce(lr(a,nl));return}Oo||Za(Ze._readableStreamController,Ro),Ga(Dt._readableStreamController,mh)}m=!1,S?Zr():w&&Tt()})},"_chunkSteps"),_closeSteps:o(Ro=>{m=!1;let Oo=Ne?F:M,hs=Ne?M:F;Oo||bi(Ze._readableStreamController),hs||bi(Dt._readableStreamController),Ro!==void 0&&(Oo||Za(Ze._readableStreamController,Ro),!hs&&Dt._readableStreamController._pendingPullIntos.length>0&&Wa(Dt._readableStreamController,0)),(!Oo||!hs)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(vn,"pullWithBYOBReader");function Zr(){if(m)return S=!0,p(void 0);m=!0;let de=Mc(le._readableStreamController);return de===null?wo():vn(de._view,!1),p(void 0)}o(Zr,"pull1Algorithm");function Tt(){if(m)return w=!0,p(void 0);m=!0;let de=Mc(Ee._readableStreamController);return de===null?wo():vn(de._view,!0),p(void 0)}o(Tt,"pull2Algorithm");function It(de){if(M=!0,ne=de,F){let Ne=Ve([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(It,"cancel1Algorithm");function Xt(de){if(F=!0,he=de,M){let Ne=Ve([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(Xt,"cancel2Algorithm");function Kr(){}return o(Kr,"startAlgorithm"),le=eh(Kr,Zr,It),Ee=eh(Kr,Tt,Xt),dr(u),[le,Ee]}o(wA,"ReadableByteStreamTee");function IA(a){return r(a)&&typeof a.getReader<"u"}o(IA,"isReadableStreamLike");function RA(a){return IA(a)?CA(a.getReader()):OA(a)}o(RA,"ReadableStreamFrom");function OA(a){let u,m=hm(a,"async"),S=e;function w(){let F;try{F=Px(m)}catch(he){return f(he)}let ne=p(F);return T(ne,he=>{if(!r(he))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Sx(he))Jn(u._readableStreamController);else{let Ee=Ex(he);To(u._readableStreamController,Ee)}})}o(w,"pullAlgorithm");function M(F){let ne=m.iterator,he;try{he=qa(ne,"return")}catch(Ce){return f(Ce)}if(he===void 0)return p(void 0);let le;try{le=N(he,ne,[F])}catch(Ce){return f(Ce)}let Ee=p(le);return T(Ee,Ce=>{if(!r(Ce))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=Ai(S,w,M,0),u}o(OA,"ReadableStreamFromIterable");function CA(a){let u,m=e;function S(){let M;try{M=a.read()}catch(F){return f(F)}return T(M,F=>{if(!r(F))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(F.done)Jn(u._readableStreamController);else{let ne=F.value;To(u._readableStreamController,ne)}})}o(S,"pullAlgorithm");function w(M){try{return p(a.cancel(M))}catch(F){return f(F)}}return o(w,"cancelAlgorithm"),u=Ai(m,S,w,0),u}o(CA,"ReadableStreamFromDefaultReader");function $A(a,u){tt(a,u);let m=a,S=m?.autoAllocateChunkSize,w=m?.cancel,M=m?.pull,F=m?.start,ne=m?.type;return{autoAllocateChunkSize:S===void 0?void 0:R(S,`${u} has member 'autoAllocateChunkSize' that`),cancel:w===void 0?void 0:kA(w,m,`${u} has member 'cancel' that`),pull:M===void 0?void 0:NA(M,m,`${u} has member 'pull' that`),start:F===void 0?void 0:zA(F,m,`${u} has member 'start' that`),type:ne===void 0?void 0:DA(ne,`${u} has member 'type' that`)}}o($A,"convertUnderlyingDefaultOrByteSource");function kA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(kA,"convertUnderlyingSourceCancelCallback");function NA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(NA,"convertUnderlyingSourcePullCallback");function zA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(zA,"convertUnderlyingSourceStartCallback");function DA(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(DA,"convertReadableStreamType");function UA(a,u){return tt(a,u),{preventCancel:!!a?.preventCancel}}o(UA,"convertIteratorOptions");function Qm(a,u){tt(a,u);let m=a?.preventAbort,S=a?.preventCancel,w=a?.preventClose,M=a?.signal;return M!==void 0&&MA(M,`${u} has member 'signal' that`),{preventAbort:!!m,preventCancel:!!S,preventClose:!!w,signal:M}}o(Qm,"convertPipeOptions");function MA(a,u){if(!Gx(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(MA,"assertAbortSignal");function jA(a,u){tt(a,u);let m=a?.readable;v(m,"readable","ReadableWritablePair"),$(m,`${u} has member 'readable' that`);let S=a?.writable;return v(S,"writable","ReadableWritablePair"),Nm(S,`${u} has member 'writable' that`),{readable:m,writable:S}}o(jA,"convertReadableWritablePair");class St{static{o(this,"ReadableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Ya(m,"Second parameter"),w=$A(u,"First parameter");if(Qc(this),w.type==="bytes"){if(S.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Si(S,0);kx(this,w,M)}else{let M=Ja(S),F=Si(S,1);TA(this,w,F,M)}}get locked(){if(!gn(this))throw Yn("locked");return yn(this)}cancel(u=void 0){return gn(this)?yn(this)?f(new TypeError("Cannot cancel a stream that already has a reader")):lr(this,u):f(Yn("cancel"))}getReader(u=void 0){if(!gn(this))throw Yn("getReader");return zx(u,"First parameter").mode===void 0?j(this):Rm(this)}pipeThrough(u,m={}){if(!gn(this))throw Yn("pipeThrough");qe(u,1,"pipeThrough");let S=jA(u,"First parameter"),w=Qm(m,"Second parameter");if(yn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(So(S.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=Jm(this,S.writable,w.preventClose,w.preventAbort,w.preventCancel,w.signal);return P(M),S.readable}pipeTo(u,m={}){if(!gn(this))return f(Yn("pipeTo"));if(u===void 0)return f("Parameter 1 is required in 'pipeTo'.");if(!Po(u))return f(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let S;try{S=Qm(m,"Second parameter")}catch(w){return f(w)}return yn(this)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):So(u)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jm(this,u,S.preventClose,S.preventAbort,S.preventCancel,S.signal)}tee(){if(!gn(this))throw Yn("tee");let u=xA(this);return Ve(u)}values(u=void 0){if(!gn(this))throw Yn("values");let m=UA(u,"First parameter");return yo(this,m.preventCancel)}[Cc](u){return this.values(u)}static from(u){return RA(u)}}Object.defineProperties(St,{from:{enumerable:!0}}),Object.defineProperties(St.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(St.from,"from"),i(St.prototype.cancel,"cancel"),i(St.prototype.getReader,"getReader"),i(St.prototype.pipeThrough,"pipeThrough"),i(St.prototype.pipeTo,"pipeTo"),i(St.prototype.tee,"tee"),i(St.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(St.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(St.prototype,Cc,{value:St.prototype.values,writable:!0,configurable:!0});function Ai(a,u,m,S=1,w=()=>1){let M=Object.create(St.prototype);Qc(M);let F=Object.create(Wr.prototype);return Xm(M,F,a,u,m,S,w),M}o(Ai,"CreateReadableStream");function eh(a,u,m){let S=Object.create(St.prototype);Qc(S);let w=Object.create(Hr.prototype);return Im(S,w,a,u,m,0,void 0),S}o(eh,"CreateReadableByteStream");function Qc(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Qc,"InitializeReadableStream");function gn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof St}o(gn,"IsReadableStream");function yn(a){return a._reader!==void 0}o(yn,"IsReadableStreamLocked");function lr(a,u){if(a._disturbed=!0,a._state==="closed")return p(void 0);if(a._state==="errored")return f(a._storedError);wi(a);let m=a._reader;if(m!==void 0&&Wn(m)){let w=m._readIntoRequests;m._readIntoRequests=new W,w.forEach(M=>{M._closeSteps(void 0)})}let S=a._readableStreamController[ee](u);return T(S,e)}o(lr,"ReadableStreamCancel");function wi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Be(u),ie(u))){let m=u._readRequests;u._readRequests=new W,m.forEach(S=>{S._closeSteps()})}}o(wi,"ReadableStreamClose");function th(a,u){a._state="errored",a._storedError=u;let m=a._reader;m!==void 0&&(Ae(m,u),ie(m)?Je(m,u):km(m,u))}o(th,"ReadableStreamError");function Yn(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(Yn,"streamBrandCheckException$1");function rh(a,u){tt(a,u);let m=a?.highWaterMark;return v(m,"highWaterMark","QueuingStrategyInit"),{highWaterMark:E(m)}}o(rh,"convertQueuingStrategyInit");let nh=o(a=>a.byteLength,"byteLengthSizeFunction");i(nh,"size");class us{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){qe(u,1,"ByteLengthQueuingStrategy"),u=rh(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!ih(this))throw oh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ih(this))throw oh("size");return nh}}Object.defineProperties(us.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(us.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function oh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(oh,"byteLengthBrandCheckException");function ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof us}o(ih,"IsByteLengthQueuingStrategy");let ah=o(()=>1,"countSizeFunction");i(ah,"size");class cs{static{o(this,"CountQueuingStrategy")}constructor(u){qe(u,1,"CountQueuingStrategy"),u=rh(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!uh(this))throw sh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!uh(this))throw sh("size");return ah}}Object.defineProperties(cs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function sh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(sh,"countBrandCheckException");function uh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof cs}o(uh,"IsCountQueuingStrategy");function LA(a,u){tt(a,u);let m=a?.cancel,S=a?.flush,w=a?.readableType,M=a?.start,F=a?.transform,ne=a?.writableType;return{cancel:m===void 0?void 0:VA(m,a,`${u} has member 'cancel' that`),flush:S===void 0?void 0:FA(S,a,`${u} has member 'flush' that`),readableType:w,start:M===void 0?void 0:BA(M,a,`${u} has member 'start' that`),transform:F===void 0?void 0:qA(F,a,`${u} has member 'transform' that`),writableType:ne}}o(LA,"convertTransformer");function FA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(FA,"convertTransformerFlushCallback");function BA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(BA,"convertTransformerStartCallback");function qA(a,u,m){return it(a,m),(S,w)=>L(a,u,[S,w])}o(qA,"convertTransformerTransformCallback");function VA(a,u,m){return it(a,m),S=>L(a,u,[S])}o(VA,"convertTransformerCancelCallback");class ls{static{o(this,"TransformStream")}constructor(u={},m={},S={}){u===void 0&&(u=null);let w=Ya(m,"Second parameter"),M=Ya(S,"Third parameter"),F=LA(u,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ne=Si(M,0),he=Ja(M),le=Si(w,1),Ee=Ja(w),Ce,We=l(dr=>{Ce=dr});HA(this,We,le,Ee,ne,he),WA(this,F),F.start!==void 0?Ce(F.start(this._transformStreamController)):Ce(void 0)}get readable(){if(!ch(this))throw fh("readable");return this._readable}get writable(){if(!ch(this))throw fh("writable");return this._writable}}Object.defineProperties(ls.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ls.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function HA(a,u,m,S,w,M){function F(){return u}o(F,"startAlgorithm");function ne(We){return JA(a,We)}o(ne,"writeAlgorithm");function he(We){return YA(a,We)}o(he,"abortAlgorithm");function le(){return XA(a)}o(le,"closeAlgorithm"),a._writable=Kx(F,ne,le,he,m,S);function Ee(){return QA(a)}o(Ee,"pullAlgorithm");function Ce(We){return ew(a,We)}o(Ce,"cancelAlgorithm"),a._readable=Ai(F,Ee,Ce,w,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ds(a,!0),a._transformStreamController=void 0}o(HA,"InitializeTransformStream");function ch(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof ls}o(ch,"IsTransformStream");function lh(a,u){cr(a._readable._readableStreamController,u),el(a,u)}o(lh,"TransformStreamError");function el(a,u){fs(a._transformStreamController),Ei(a._writable._writableStreamController,u),tl(a)}o(el,"TransformStreamErrorWritableAndUnblockWrite");function tl(a){a._backpressure&&ds(a,!1)}o(tl,"TransformStreamUnblockWrite");function ds(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=l(m=>{a._backpressureChangePromise_resolve=m}),a._backpressure=u}o(ds,"TransformStreamSetBackpressure");class _n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ps(this))throw ms("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return Xc(u)}enqueue(u=void 0){if(!ps(this))throw ms("enqueue");dh(this,u)}error(u=void 0){if(!ps(this))throw ms("error");ZA(this,u)}terminate(){if(!ps(this))throw ms("terminate");KA(this)}}Object.defineProperties(_n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(_n.prototype.enqueue,"enqueue"),i(_n.prototype.error,"error"),i(_n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ps(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof _n}o(ps,"IsTransformStreamDefaultController");function GA(a,u,m,S,w){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=m,u._flushAlgorithm=S,u._cancelAlgorithm=w,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(GA,"SetUpTransformStreamDefaultController");function WA(a,u){let m=Object.create(_n.prototype),S,w,M;u.transform!==void 0?S=o(F=>u.transform(F,m),"transformAlgorithm"):S=o(F=>{try{return dh(m,F),p(void 0)}catch(ne){return f(ne)}},"transformAlgorithm"),u.flush!==void 0?w=o(()=>u.flush(m),"flushAlgorithm"):w=o(()=>p(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(F=>u.cancel(F),"cancelAlgorithm"):M=o(()=>p(void 0),"cancelAlgorithm"),GA(a,m,S,w,M)}o(WA,"SetUpTransformStreamDefaultControllerFromTransformer");function fs(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(fs,"TransformStreamDefaultControllerClearAlgorithms");function dh(a,u){let m=a._controlledTransformStream,S=m._readable._readableStreamController;if(!xo(S))throw new TypeError("Readable side is not in a state that permits enqueue");try{To(S,u)}catch(M){throw el(m,M),m._readable._storedError}EA(S)!==m._backpressure&&ds(m,!0)}o(dh,"TransformStreamDefaultControllerEnqueue");function ZA(a,u){lh(a._controlledTransformStream,u)}o(ZA,"TransformStreamDefaultControllerError");function ph(a,u){let m=a._transformAlgorithm(u);return T(m,void 0,S=>{throw lh(a._controlledTransformStream,S),S})}o(ph,"TransformStreamDefaultControllerPerformTransform");function KA(a){let u=a._controlledTransformStream,m=u._readable._readableStreamController;Jn(m);let S=new TypeError("TransformStream terminated");el(u,S)}o(KA,"TransformStreamDefaultControllerTerminate");function JA(a,u){let m=a._transformStreamController;if(a._backpressure){let S=a._backpressureChangePromise;return T(S,()=>{let w=a._writable;if(w._state==="erroring")throw w._storedError;return ph(m,u)})}return ph(m,u)}o(JA,"TransformStreamDefaultSinkWriteAlgorithm");function YA(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._readable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let w=m._cancelAlgorithm(u);return fs(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(cr(S._readableStreamController,u),rl(m)),null),M=>(cr(S._readableStreamController,M),Ao(m,M),null)),m._finishPromise}o(YA,"TransformStreamDefaultSinkAbortAlgorithm");function XA(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let m=a._readable;u._finishPromise=l((w,M)=>{u._finishPromise_resolve=w,u._finishPromise_reject=M});let S=u._flushAlgorithm();return fs(u),h(S,()=>(m._state==="errored"?Ao(u,m._storedError):(Jn(m._readableStreamController),rl(u)),null),w=>(cr(m._readableStreamController,w),Ao(u,w),null)),u._finishPromise}o(XA,"TransformStreamDefaultSinkCloseAlgorithm");function QA(a){return ds(a,!1),a._backpressureChangePromise}o(QA,"TransformStreamDefaultSourcePullAlgorithm");function ew(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._writable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let w=m._cancelAlgorithm(u);return fs(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(Ei(S._writableStreamController,u),tl(a),rl(m)),null),M=>(Ei(S._writableStreamController,M),tl(a),Ao(m,M),null)),m._finishPromise}o(ew,"TransformStreamDefaultSourceCancelAlgorithm");function ms(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(ms,"defaultControllerBrandCheckException");function rl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(rl,"defaultControllerFinishPromiseResolve");function Ao(a,u){a._finishPromise_reject!==void 0&&(P(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Ao,"defaultControllerFinishPromiseReject");function fh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(fh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=us,t.CountQueuingStrategy=cs,t.ReadableByteStreamController=Hr,t.ReadableStream=St,t.ReadableStreamBYOBReader=mn,t.ReadableStreamBYOBRequest=Vn,t.ReadableStreamDefaultController=Wr,t.ReadableStreamDefaultReader=V,t.TransformStream=ls,t.TransformStreamDefaultController=_n,t.WritableStream=hn,t.WritableStreamDefaultController=Eo,t.WritableStreamDefaultWriter=Gr}))});var jb=k(()=>{if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,Mb())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Sd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,Lb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+Lb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var t5,Lb,Fb,N0,hr,na=gt(()=>{t5=ft(jb(),1);Lb=65536;o(Sd,"toIterator");Fb=class Ed{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof Ed?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Sd(this.#e,!1))r+=e.decode(n,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let n of Sd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Sd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),l=this.#e,p=[],f=0;for(let h of l){if(f>=d)break;let g=ArrayBuffer.isView(h)?h.byteLength:h.size;if(s&&g<=s)s-=g,c-=g;else{let y;ArrayBuffer.isView(h)?(y=h.subarray(s,Math.min(g,c)),f+=y.byteLength):(y=h.slice(s,Math.min(g,c)),f+=y.size),c-=g,p.push(y),s=0}}let _=new Ed([],{type:String(n).toLowerCase()});return _.#r=d,_.#e=p,_}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(Fb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});N0=Fb,hr=N0});var z0,D0,zn,Td=gt(()=>{na();z0=class extends hr{static{o(this,"File")}#e=0;#t="";constructor(e,r,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),n===null&&(n={});let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof hr&&/^(File)$/.test(e[Symbol.toStringTag])}},D0=z0,zn=D0});function Vb(t,e=hr){var r=`${Bb()}${Bb()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
|
-
Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+
|
|
13
|
+
`;let l=(0,Y0.parseProxyResponse)(i);i.write(`${d}\r
|
|
14
|
+
`);let{connect:f,buffered:p}=await l;if(e.emit("proxyConnect",f),this.emit("proxyConnect",f,e),f.statusCode===200)return e.once("socket",X0),r.secureEndpoint?(na("Upgrading socket connection to TLS"),Fb.connect({...qb(Bb(r),"host","path","port"),socket:i})):i;i.destroy();let _=new iu.Socket({writable:!1});return _.readable=!0,e.once("socket",h=>{na("Replaying proxy buffer for failed request"),(0,W0.default)(h.listenerCount("data")>0),h.push(p),h.push(null)}),_}};au.protocols=["http","https"];rr.HttpsProxyAgent=au;function X0(t){t.resume()}o(X0,"resume");function qb(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(qb,"omit")});function Q0(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let p=1;p<r.length;p++)r[p]==="base64"?i=!0:r[p]&&(c+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(n=r[p].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",l=unescape(t.substring(e+1)),f=Buffer.from(l,d);return f.type=s,f.typeFull=c,f.charset=n,f}var Wb,Zb=gt(()=>{o(Q0,"dataUriToBuffer");Wb=Q0});var Jb=k((su,Kb)=>{(function(t,e){typeof su=="object"&&typeof Kb<"u"?e(su):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(su,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function l(a){return new s(a)}o(l,"newPromise");function f(a){return l(u=>u(a))}o(f,"promiseResolvedWith");function p(a){return d(a)}o(p,"promiseRejectedWith");function _(a,u,m){return c.call(a,u,m)}o(_,"PerformPromiseThen");function h(a,u,m){_(_(a,u,m),void 0,n)}o(h,"uponPromise");function g(a,u){h(a,u)}o(g,"uponFulfillment");function y(a,u){h(a,void 0,u)}o(y,"uponRejection");function T(a,u,m){return _(a,u,m)}o(T,"transformPromiseWith");function P(a){_(a,void 0,n)}o(P,"setPromiseIsHandledToTrue");let x=o(a=>{if(typeof queueMicrotask=="function")x=queueMicrotask;else{let u=f(void 0);x=o(m=>_(u,m),"_queueMicrotask")}return x(a)},"_queueMicrotask");function N(a,u,m){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,m)}o(N,"reflectCall");function F(a,u,m){try{return f(N(a,u,m))}catch(S){return p(S)}}o(F,"promiseCall");let X=16384;class Z{static{o(this,"SimpleQueue")}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(u){let m=this._back,S=m;m._elements.length===X-1&&(S={_elements:[],_next:void 0}),m._elements.push(u),S!==m&&(this._back=S,m._next=S),++this._size}shift(){let u=this._front,m=u,S=this._cursor,w=S+1,M=u._elements,B=M[S];return w===X&&(m=u._next,w=0),--this._size,this._cursor=w,u!==m&&(this._front=m),M[S]=void 0,B}forEach(u){let m=this._cursor,S=this._front,w=S._elements;for(;(m!==w.length||S._next!==void 0)&&!(m===w.length&&(S=S._next,w=S._elements,m=0,w.length===0));)u(w[m]),++m}peek(){let u=this._front,m=this._cursor;return u._elements[m]}}let G=Symbol("[[AbortSteps]]"),Y=Symbol("[[ErrorSteps]]"),ee=Symbol("[[CancelSteps]]"),K=Symbol("[[PullSteps]]"),Oe=Symbol("[[ReleaseSteps]]");function te(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?W(a):u._state==="closed"?oe(a):re(a,u._storedError)}o(te,"ReadableStreamReaderGenericInitialize");function V(a,u){let m=a._ownerReadableStream;return lr(m,u)}o(V,"ReadableStreamReaderGenericCancel");function q(a){let u=a._ownerReadableStream;u._state==="readable"?Ie(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Ce(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Oe](),u._reader=void 0,a._ownerReadableStream=void 0}o(q,"ReadableStreamReaderGenericRelease");function J(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(J,"readerLockException");function W(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m})}o(W,"defaultReaderClosedPromiseInitialize");function re(a,u){W(a),Ie(a,u)}o(re,"defaultReaderClosedPromiseInitializeAsRejected");function oe(a){W(a),Be(a)}o(oe,"defaultReaderClosedPromiseInitializeAsResolved");function Ie(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ie,"defaultReaderClosedPromiseReject");function Ce(a,u){re(a,u)}o(Ce,"defaultReaderClosedPromiseResetToRejected");function Be(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Be,"defaultReaderClosedPromiseResolve");let Ge=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},ht=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function Q(a){return typeof a=="object"||typeof a=="function"}o(Q,"isDictionary");function rt(a,u){if(a!==void 0&&!Q(a))throw new TypeError(`${u} is not an object.`)}o(rt,"assertDictionary");function it(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(it,"assertFunction");function Nt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Nt,"isObject");function Fe(a,u){if(!Nt(a))throw new TypeError(`${u} is not an object.`)}o(Fe,"assertObject");function qe(a,u,m){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${m}'.`)}o(qe,"assertRequiredArgument");function b(a,u,m){if(a===void 0)throw new TypeError(`${u} is required in '${m}'.`)}o(b,"assertRequiredField");function E(a){return Number(a)}o(E,"convertUnrestrictedDouble");function A(a){return a===0?0:a}o(A,"censorNegativeZero");function D(a){return A(ht(a))}o(D,"integerPart");function R(a,u){let S=Number.MAX_SAFE_INTEGER,w=Number(a);if(w=A(w),!Ge(w))throw new TypeError(`${u} is not a finite number`);if(w=D(w),w<0||w>S)throw new TypeError(`${u} is outside the accepted range of 0 to ${S}, inclusive`);return!Ge(w)||w===0?0:w}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!gn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new H(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function C(a,u,m){let w=a._reader._readRequests.shift();m?w._closeSteps():w._chunkSteps(u)}o(C,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function z(a){let u=a._reader;return!(u===void 0||!ie(u))}o(z,"ReadableStreamHasDefaultReader");class H{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(qe(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");te(this,u),this._readRequests=new Z}get closed(){return ie(this)?this._closedPromise:p(Ye("closed"))}cancel(u=void 0){return ie(this)?this._ownerReadableStream===void 0?p(J("cancel")):V(this,u):p(Ye("cancel"))}read(){if(!ie(this))return p(Ye("read"));if(this._ownerReadableStream===void 0)return p(J("read from"));let u,m,S=l((M,B)=>{u=M,m=B});return ue(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>m(M),"_errorSteps")}),S}releaseLock(){if(!ie(this))throw Ye("releaseLock");this._ownerReadableStream!==void 0&&Ue(this)}}Object.defineProperties(H.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(H.prototype.cancel,"cancel"),i(H.prototype.read,"read"),i(H.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(H.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ie(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof H}o(ie,"IsReadableStreamDefaultReader");function ue(a,u){let m=a._ownerReadableStream;m._disturbed=!0,m._state==="closed"?u._closeSteps():m._state==="errored"?u._errorSteps(m._storedError):m._readableStreamController[K](u)}o(ue,"ReadableStreamDefaultReaderRead");function Ue(a){q(a);let u=new TypeError("Reader was released");Je(a,u)}o(Ue,"ReadableStreamDefaultReaderRelease");function Je(a,u){let m=a._readRequests;a._readRequests=new Z,m.forEach(S=>{S._errorSteps(u)})}o(Je,"ReadableStreamDefaultReaderErrorReadRequests");function Ye(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(Ye,"defaultReaderBrandCheckException");let De=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Le{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,m){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=m}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let m=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?T(this._ongoingPromise,m,m):m()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,m,S,w=l((B,ne)=>{m=B,S=ne});return ue(u,{_chunkSteps:o(B=>{this._ongoingPromise=void 0,x(()=>m({value:B,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,q(u),m({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(B=>{this._ongoingPromise=void 0,this._isFinished=!0,q(u),S(B)},"_errorSteps")}),w}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let m=this._reader;if(!this._preventCancel){let S=V(m,u);return q(m),T(S,()=>({value:u,done:!0}))}return q(m),f({value:u,done:!0})}}let dt={next(){return _o(this)?this._asyncIteratorImpl.next():p(vo("next"))},return(a){return _o(this)?this._asyncIteratorImpl.return(a):p(vo("return"))}};Object.setPrototypeOf(dt,De);function yo(a,u){let m=j(a),S=new Le(m,u),w=Object.create(dt);return w._asyncIteratorImpl=S,w}o(yo,"AcquireReadableStreamAsyncIterator");function _o(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof Le}catch{return!1}}o(_o,"IsReadableStreamAsyncIterator");function vo(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(vo,"streamAsyncIteratorBrandCheckException");let zt=Number.isNaN||function(a){return a!==a};var qr,St,pt;function Ve(a){return a.slice()}o(Ve,"CreateArrayFromList");function ym(a,u,m,S,w){new Uint8Array(a).set(new Uint8Array(m,S,w),u)}o(ym,"CopyDataBlockBytes");let Vr=o(a=>(typeof a.transfer=="function"?Vr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Vr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):Vr=o(u=>u,"TransferArrayBuffer"),Vr(a)),"TransferArrayBuffer"),pn=o(a=>(typeof a.detached=="boolean"?pn=o(u=>u.detached,"IsDetachedBuffer"):pn=o(u=>u.byteLength===0,"IsDetachedBuffer"),pn(a)),"IsDetachedBuffer");function _m(a,u,m){if(a.slice)return a.slice(u,m);let S=m-u,w=new ArrayBuffer(S);return ym(w,0,a,u,S),w}o(_m,"ArrayBufferSlice");function Va(a,u){let m=a[u];if(m!=null){if(typeof m!="function")throw new TypeError(`${String(u)} is not a function`);return m}}o(Va,"GetMethod");function $x(a){let u={[Symbol.iterator]:()=>a.iterator},m=(async function*(){return yield*u})(),S=m.next;return{iterator:m,nextMethod:S,done:!1}}o($x,"CreateAsyncFromSyncIterator");let kc=(pt=(qr=Symbol.asyncIterator)!==null&&qr!==void 0?qr:(St=Symbol.for)===null||St===void 0?void 0:St.call(Symbol,"Symbol.asyncIterator"))!==null&&pt!==void 0?pt:"@@asyncIterator";function vm(a,u="sync",m){if(m===void 0)if(u==="async"){if(m=Va(a,kc),m===void 0){let M=Va(a,Symbol.iterator),B=vm(a,"sync",M);return $x(B)}}else m=Va(a,Symbol.iterator);if(m===void 0)throw new TypeError("The object is not iterable");let S=N(m,a,[]);if(!r(S))throw new TypeError("The iterator method must return an object");let w=S.next;return{iterator:S,nextMethod:w,done:!1}}o(vm,"GetIterator");function kx(a){let u=N(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(kx,"IteratorNext");function Nx(a){return!!a.done}o(Nx,"IteratorComplete");function zx(a){return a.value}o(zx,"IteratorValue");function Dx(a){return!(typeof a!="number"||zt(a)||a<0)}o(Dx,"IsNonNegativeNumber");function bm(a){let u=_m(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(bm,"CloneAsUint8Array");function Nc(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(Nc,"DequeueValue");function zc(a,u,m){if(!Dx(m)||m===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:m}),a._queueTotalSize+=m}o(zc,"EnqueueValueWithSize");function Ux(a){return a._queue.peek().value}o(Ux,"PeekQueueValue");function fn(a){a._queue=new Z,a._queueTotalSize=0}o(fn,"ResetQueue");function Pm(a){return a===DataView}o(Pm,"isDataViewConstructor");function Mx(a){return Pm(a.constructor)}o(Mx,"isDataView");function jx(a){return Pm(a)?1:a.BYTES_PER_ELEMENT}o(jx,"arrayBufferViewElementSize");class Hn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Dc(this))throw Fc("view");return this._view}respond(u){if(!Dc(this))throw Fc("respond");if(qe(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(pn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Za(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Dc(this))throw Fc("respondWithNewView");if(qe(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))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");if(pn(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Ka(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Hn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Hn.prototype.respond,"respond"),i(Hn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Hr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Gn(this))throw Si("byobRequest");return Lc(this)}get desiredSize(){if(!Gn(this))throw Si("desiredSize");return Cm(this)}close(){if(!Gn(this))throw Si("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);Pi(this)}enqueue(u){if(!Gn(this))throw Si("enqueue");if(qe(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.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 m=this._controlledReadableByteStream._state;if(m!=="readable")throw new TypeError(`The stream (in ${m} state) is not in the readable state and cannot be enqueued to`);Wa(this,u)}error(u=void 0){if(!Gn(this))throw Si("error");Yt(this,u)}[ee](u){Sm(this),fn(this);let m=this._cancelAlgorithm(u);return Ga(this),m}[K](u){let m=this._controlledReadableByteStream;if(this._queueTotalSize>0){Om(this,u);return}let S=this._autoAllocateChunkSize;if(S!==void 0){let w;try{w=new ArrayBuffer(S)}catch(B){u._errorSteps(B);return}let M={buffer:w,bufferByteLength:S,byteOffset:0,byteLength:S,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(m,u),Wn(this)}[Oe](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new Z,this._pendingPullIntos.push(u)}}}Object.defineProperties(Hr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Hr.prototype.close,"close"),i(Hr.prototype.enqueue,"enqueue"),i(Hr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Gn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof Hr}o(Gn,"IsReadableByteStreamController");function Dc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Hn}o(Dc,"IsReadableStreamBYOBRequest");function Wn(a){if(!Vx(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Wn(a)),null),S=>(Yt(a,S),null))}o(Wn,"ReadableByteStreamControllerCallPullIfNeeded");function Sm(a){Mc(a),a._pendingPullIntos=new Z}o(Sm,"ReadableByteStreamControllerClearPendingPullIntos");function Uc(a,u){let m=!1;a._state==="closed"&&(m=!0);let S=Em(u);u.readerType==="default"?C(a,S,m):Jx(a,S,m)}o(Uc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Em(a){let u=a.bytesFilled,m=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/m)}o(Em,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Ha(a,u,m,S){a._queue.push({buffer:u,byteOffset:m,byteLength:S}),a._queueTotalSize+=S}o(Ha,"ReadableByteStreamControllerEnqueueChunkToQueue");function Tm(a,u,m,S){let w;try{w=_m(u,m,m+S)}catch(M){throw Yt(a,M),M}Ha(a,w,0,S)}o(Tm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function xm(a,u){u.bytesFilled>0&&Tm(a,u.buffer,u.byteOffset,u.bytesFilled),bo(a)}o(xm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Am(a,u){let m=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),S=u.bytesFilled+m,w=m,M=!1,B=S%u.elementSize,ne=S-B;ne>=u.minimumFill&&(w=ne-u.bytesFilled,M=!0);let ye=a._queue;for(;w>0;){let le=ye.peek(),xe=Math.min(w,le.byteLength),$e=u.byteOffset+u.bytesFilled;ym(u.buffer,$e,le.buffer,le.byteOffset,xe),le.byteLength===xe?ye.shift():(le.byteOffset+=xe,le.byteLength-=xe),a._queueTotalSize-=xe,wm(a,xe,u),w-=xe}return M}o(Am,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function wm(a,u,m){m.bytesFilled+=u}o(wm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Im(a){a._queueTotalSize===0&&a._closeRequested?(Ga(a),Ii(a._controlledReadableByteStream)):Wn(a)}o(Im,"ReadableByteStreamControllerHandleQueueDrain");function Mc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Mc,"ReadableByteStreamControllerInvalidateBYOBRequest");function jc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();Am(a,u)&&(bo(a),Uc(a._controlledReadableByteStream,u))}}o(jc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function Lx(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let m=u._readRequests.shift();Om(a,m)}}o(Lx,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function Fx(a,u,m,S){let w=a._controlledReadableByteStream,M=u.constructor,B=jx(M),{byteOffset:ne,byteLength:ye}=u,le=m*B,xe;try{xe=Vr(u.buffer)}catch(We){S._errorSteps(We);return}let $e={buffer:xe,bufferByteLength:xe.byteLength,byteOffset:ne,byteLength:ye,bytesFilled:0,minimumFill:le,elementSize:B,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push($e),Nm(w,S);return}if(w._state==="closed"){let We=new M($e.buffer,$e.byteOffset,0);S._closeSteps(We);return}if(a._queueTotalSize>0){if(Am(a,$e)){let We=Em($e);Im(a),S._chunkSteps(We);return}if(a._closeRequested){let We=new TypeError("Insufficient bytes to fill elements in the given buffer");Yt(a,We),S._errorSteps(We);return}}a._pendingPullIntos.push($e),Nm(w,S),Wn(a)}o(Fx,"ReadableByteStreamControllerPullInto");function Bx(a,u){u.readerType==="none"&&bo(a);let m=a._controlledReadableByteStream;if(Bc(m))for(;zm(m)>0;){let S=bo(a);Uc(m,S)}}o(Bx,"ReadableByteStreamControllerRespondInClosedState");function qx(a,u,m){if(wm(a,u,m),m.readerType==="none"){xm(a,m),jc(a);return}if(m.bytesFilled<m.minimumFill)return;bo(a);let S=m.bytesFilled%m.elementSize;if(S>0){let w=m.byteOffset+m.bytesFilled;Tm(a,m.buffer,w-S,S)}m.bytesFilled-=S,Uc(a._controlledReadableByteStream,m),jc(a)}o(qx,"ReadableByteStreamControllerRespondInReadableState");function Rm(a,u){let m=a._pendingPullIntos.peek();Mc(a),a._controlledReadableByteStream._state==="closed"?Bx(a,m):qx(a,u,m),Wn(a)}o(Rm,"ReadableByteStreamControllerRespondInternal");function bo(a){return a._pendingPullIntos.shift()}o(bo,"ReadableByteStreamControllerShiftPendingPullInto");function Vx(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(z(u)&&U(u)>0||Bc(u)&&zm(u)>0||Cm(a)>0)}o(Vx,"ReadableByteStreamControllerShouldCallPull");function Ga(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ga,"ReadableByteStreamControllerClearAlgorithms");function Pi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let m=a._pendingPullIntos.peek();if(m.bytesFilled%m.elementSize!==0){let S=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Yt(a,S),S}}Ga(a),Ii(u)}}o(Pi,"ReadableByteStreamControllerClose");function Wa(a,u){let m=a._controlledReadableByteStream;if(a._closeRequested||m._state!=="readable")return;let{buffer:S,byteOffset:w,byteLength:M}=u;if(pn(S))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let B=Vr(S);if(a._pendingPullIntos.length>0){let ne=a._pendingPullIntos.peek();if(pn(ne.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Mc(a),ne.buffer=Vr(ne.buffer),ne.readerType==="none"&&xm(a,ne)}if(z(m))if(Lx(a),U(m)===0)Ha(a,B,w,M);else{a._pendingPullIntos.length>0&&bo(a);let ne=new Uint8Array(B,w,M);C(m,ne,!1)}else Bc(m)?(Ha(a,B,w,M),jc(a)):Ha(a,B,w,M);Wn(a)}o(Wa,"ReadableByteStreamControllerEnqueue");function Yt(a,u){let m=a._controlledReadableByteStream;m._state==="readable"&&(Sm(a),fn(a),Ga(a),ih(m,u))}o(Yt,"ReadableByteStreamControllerError");function Om(a,u){let m=a._queue.shift();a._queueTotalSize-=m.byteLength,Im(a);let S=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);u._chunkSteps(S)}o(Om,"ReadableByteStreamControllerFillReadRequestFromQueue");function Lc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),m=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),S=Object.create(Hn.prototype);Gx(S,a,m),a._byobRequest=S}return a._byobRequest}o(Lc,"ReadableByteStreamControllerGetBYOBRequest");function Cm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Cm,"ReadableByteStreamControllerGetDesiredSize");function Za(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(m.bytesFilled+u>m.byteLength)throw new RangeError("bytesWritten out of range")}m.buffer=Vr(m.buffer),Rm(a,u)}o(Za,"ReadableByteStreamControllerRespond");function Ka(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(m.byteOffset+m.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(m.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(m.bytesFilled+u.byteLength>m.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let w=u.byteLength;m.buffer=Vr(u.buffer),Rm(a,w)}o(Ka,"ReadableByteStreamControllerRespondWithNewView");function $m(a,u,m,S,w,M,B){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,fn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,u._autoAllocateChunkSize=B,u._pendingPullIntos=new Z,a._readableStreamController=u;let ne=m();h(f(ne),()=>(u._started=!0,Wn(u),null),ye=>(Yt(u,ye),null))}o($m,"SetUpReadableByteStreamController");function Hx(a,u,m){let S=Object.create(Hr.prototype),w,M,B;u.start!==void 0?w=o(()=>u.start(S),"startAlgorithm"):w=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(S),"pullAlgorithm"):M=o(()=>f(void 0),"pullAlgorithm"),u.cancel!==void 0?B=o(ye=>u.cancel(ye),"cancelAlgorithm"):B=o(()=>f(void 0),"cancelAlgorithm");let ne=u.autoAllocateChunkSize;if(ne===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");$m(a,S,w,M,B,m,ne)}o(Hx,"SetUpReadableByteStreamControllerFromUnderlyingSource");function Gx(a,u,m){a._associatedReadableByteStreamController=u,a._view=m}o(Gx,"SetUpReadableStreamBYOBRequest");function Fc(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(Fc,"byobRequestBrandCheckException");function Si(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Si,"byteStreamControllerBrandCheckException");function Wx(a,u){rt(a,u);let m=a?.mode;return{mode:m===void 0?void 0:Zx(m,`${u} has member 'mode' that`)}}o(Wx,"convertReaderOptions");function Zx(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(Zx,"convertReadableStreamReaderMode");function Kx(a,u){var m;rt(a,u);let S=(m=a?.min)!==null&&m!==void 0?m:1;return{min:R(S,`${u} has member 'min' that`)}}o(Kx,"convertByobReadOptions");function km(a){return new mn(a)}o(km,"AcquireReadableStreamBYOBReader");function Nm(a,u){a._reader._readIntoRequests.push(u)}o(Nm,"ReadableStreamAddReadIntoRequest");function Jx(a,u,m){let w=a._reader._readIntoRequests.shift();m?w._closeSteps(u):w._chunkSteps(u)}o(Jx,"ReadableStreamFulfillReadIntoRequest");function zm(a){return a._reader._readIntoRequests.length}o(zm,"ReadableStreamGetNumReadIntoRequests");function Bc(a){let u=a._reader;return!(u===void 0||!Zn(u))}o(Bc,"ReadableStreamHasBYOBReader");class mn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(qe(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),yn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Gn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");te(this,u),this._readIntoRequests=new Z}get closed(){return Zn(this)?this._closedPromise:p(Ja("closed"))}cancel(u=void 0){return Zn(this)?this._ownerReadableStream===void 0?p(J("cancel")):V(this,u):p(Ja("cancel"))}read(u,m={}){if(!Zn(this))return p(Ja("read"));if(!ArrayBuffer.isView(u))return p(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return p(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return p(new TypeError("view's buffer must have non-zero byteLength"));if(pn(u.buffer))return p(new TypeError("view's buffer has been detached"));let S;try{S=Kx(m,"options")}catch(le){return p(le)}let w=S.min;if(w===0)return p(new TypeError("options.min must be greater than 0"));if(Mx(u)){if(w>u.byteLength)return p(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(w>u.length)return p(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return p(J("read from"));let M,B,ne=l((le,xe)=>{M=le,B=xe});return Dm(this,u,w,{_chunkSteps:o(le=>M({value:le,done:!1}),"_chunkSteps"),_closeSteps:o(le=>M({value:le,done:!0}),"_closeSteps"),_errorSteps:o(le=>B(le),"_errorSteps")}),ne}releaseLock(){if(!Zn(this))throw Ja("releaseLock");this._ownerReadableStream!==void 0&&Yx(this)}}Object.defineProperties(mn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(mn.prototype.cancel,"cancel"),i(mn.prototype.read,"read"),i(mn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Zn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof mn}o(Zn,"IsReadableStreamBYOBReader");function Dm(a,u,m,S){let w=a._ownerReadableStream;w._disturbed=!0,w._state==="errored"?S._errorSteps(w._storedError):Fx(w._readableStreamController,u,m,S)}o(Dm,"ReadableStreamBYOBReaderRead");function Yx(a){q(a);let u=new TypeError("Reader was released");Um(a,u)}o(Yx,"ReadableStreamBYOBReaderRelease");function Um(a,u){let m=a._readIntoRequests;a._readIntoRequests=new Z,m.forEach(S=>{S._errorSteps(u)})}o(Um,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Ja(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(Ja,"byobReaderBrandCheckException");function Ei(a,u){let{highWaterMark:m}=a;if(m===void 0)return u;if(zt(m)||m<0)throw new RangeError("Invalid highWaterMark");return m}o(Ei,"ExtractHighWaterMark");function Ya(a){let{size:u}=a;return u||(()=>1)}o(Ya,"ExtractSizeAlgorithm");function Xa(a,u){rt(a,u);let m=a?.highWaterMark,S=a?.size;return{highWaterMark:m===void 0?void 0:E(m),size:S===void 0?void 0:Xx(S,`${u} has member 'size' that`)}}o(Xa,"convertQueuingStrategy");function Xx(a,u){return it(a,u),m=>E(a(m))}o(Xx,"convertQueuingStrategySize");function Qx(a,u){rt(a,u);let m=a?.abort,S=a?.close,w=a?.start,M=a?.type,B=a?.write;return{abort:m===void 0?void 0:eA(m,a,`${u} has member 'abort' that`),close:S===void 0?void 0:tA(S,a,`${u} has member 'close' that`),start:w===void 0?void 0:rA(w,a,`${u} has member 'start' that`),write:B===void 0?void 0:nA(B,a,`${u} has member 'write' that`),type:M}}o(Qx,"convertUnderlyingSink");function eA(a,u,m){return it(a,m),S=>F(a,u,[S])}o(eA,"convertUnderlyingSinkAbortCallback");function tA(a,u,m){return it(a,m),()=>F(a,u,[])}o(tA,"convertUnderlyingSinkCloseCallback");function rA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(rA,"convertUnderlyingSinkStartCallback");function nA(a,u,m){return it(a,m),(S,w)=>F(a,u,[S,w])}o(nA,"convertUnderlyingSinkWriteCallback");function Mm(a,u){if(!Po(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Mm,"assertWritableStream");function oA(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(oA,"isAbortSignal");let iA=typeof AbortController=="function";function aA(){if(iA)return new AbortController}o(aA,"createAbortController");class hn{static{o(this,"WritableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Xa(m,"Second parameter"),w=Qx(u,"First parameter");if(Lm(this),w.type!==void 0)throw new RangeError("Invalid type is specified");let B=Ya(S),ne=Ei(S,1);bA(this,w,ne,B)}get locked(){if(!Po(this))throw ns("locked");return So(this)}abort(u=void 0){return Po(this)?So(this)?p(new TypeError("Cannot abort a stream that already has a writer")):Qa(this,u):p(ns("abort"))}close(){return Po(this)?So(this)?p(new TypeError("Cannot close a stream that already has a writer")):Tr(this)?p(new TypeError("Cannot close an already-closing stream")):Fm(this):p(ns("close"))}getWriter(){if(!Po(this))throw ns("getWriter");return jm(this)}}Object.defineProperties(hn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(hn.prototype.abort,"abort"),i(hn.prototype.close,"close"),i(hn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(hn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function jm(a){return new Gr(a)}o(jm,"AcquireWritableStreamDefaultWriter");function sA(a,u,m,S,w=1,M=()=>1){let B=Object.create(hn.prototype);Lm(B);let ne=Object.create(Eo.prototype);return Wm(B,ne,a,u,m,S,w,M),B}o(sA,"CreateWritableStream");function Lm(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new Z,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(Lm,"InitializeWritableStream");function Po(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof hn}o(Po,"IsWritableStream");function So(a){return a._writer!==void 0}o(So,"IsWritableStreamLocked");function Qa(a,u){var m;if(a._state==="closed"||a._state==="errored")return f(void 0);a._writableStreamController._abortReason=u,(m=a._writableStreamController._abortController)===null||m===void 0||m.abort(u);let S=a._state;if(S==="closed"||S==="errored")return f(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let w=!1;S==="erroring"&&(w=!0,u=void 0);let M=l((B,ne)=>{a._pendingAbortRequest={_promise:void 0,_resolve:B,_reject:ne,_reason:u,_wasAlreadyErroring:w}});return a._pendingAbortRequest._promise=M,w||Vc(a,u),M}o(Qa,"WritableStreamAbort");function Fm(a){let u=a._state;if(u==="closed"||u==="errored")return p(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let m=l((w,M)=>{let B={_resolve:w,_reject:M};a._closeRequest=B}),S=a._writer;return S!==void 0&&a._backpressure&&u==="writable"&&Xc(S),PA(a._writableStreamController),m}o(Fm,"WritableStreamClose");function uA(a){return l((m,S)=>{let w={_resolve:m,_reject:S};a._writeRequests.push(w)})}o(uA,"WritableStreamAddWriteRequest");function qc(a,u){if(a._state==="writable"){Vc(a,u);return}Hc(a)}o(qc,"WritableStreamDealWithRejection");function Vc(a,u){let m=a._writableStreamController;a._state="erroring",a._storedError=u;let S=a._writer;S!==void 0&&qm(S,u),!fA(a)&&m._started&&Hc(a)}o(Vc,"WritableStreamStartErroring");function Hc(a){a._state="errored",a._writableStreamController[Y]();let u=a._storedError;if(a._writeRequests.forEach(w=>{w._reject(u)}),a._writeRequests=new Z,a._pendingAbortRequest===void 0){es(a);return}let m=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,m._wasAlreadyErroring){m._reject(u),es(a);return}let S=a._writableStreamController[G](m._reason);h(S,()=>(m._resolve(),es(a),null),w=>(m._reject(w),es(a),null))}o(Hc,"WritableStreamFinishErroring");function cA(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(cA,"WritableStreamFinishInFlightWrite");function lA(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,qc(a,u)}o(lA,"WritableStreamFinishInFlightWriteWithError");function dA(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";let m=a._writer;m!==void 0&&Ym(m)}o(dA,"WritableStreamFinishInFlightClose");function pA(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),qc(a,u)}o(pA,"WritableStreamFinishInFlightCloseWithError");function Tr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Tr,"WritableStreamCloseQueuedOrInFlight");function fA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(fA,"WritableStreamHasOperationMarkedInFlight");function mA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(mA,"WritableStreamMarkCloseRequestInFlight");function hA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(hA,"WritableStreamMarkFirstWriteRequestInFlight");function es(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&Jc(u,a._storedError)}o(es,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Gc(a,u){let m=a._writer;m!==void 0&&u!==a._backpressure&&(u?IA(m):Xc(m)),a._backpressure=u}o(Gc,"WritableStreamUpdateBackpressure");class Gr{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(qe(u,1,"WritableStreamDefaultWriter"),Mm(u,"First parameter"),So(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let m=u._state;if(m==="writable")!Tr(u)&&u._backpressure?is(this):Xm(this),os(this);else if(m==="erroring")Yc(this,u._storedError),os(this);else if(m==="closed")Xm(this),AA(this);else{let S=u._storedError;Yc(this,S),Jm(this,S)}}get closed(){return Kn(this)?this._closedPromise:p(Jn("closed"))}get desiredSize(){if(!Kn(this))throw Jn("desiredSize");if(this._ownerWritableStream===void 0)throw xi("desiredSize");return vA(this)}get ready(){return Kn(this)?this._readyPromise:p(Jn("ready"))}abort(u=void 0){return Kn(this)?this._ownerWritableStream===void 0?p(xi("abort")):gA(this,u):p(Jn("abort"))}close(){if(!Kn(this))return p(Jn("close"));let u=this._ownerWritableStream;return u===void 0?p(xi("close")):Tr(u)?p(new TypeError("Cannot close an already-closing stream")):Bm(this)}releaseLock(){if(!Kn(this))throw Jn("releaseLock");this._ownerWritableStream!==void 0&&Vm(this)}write(u=void 0){return Kn(this)?this._ownerWritableStream===void 0?p(xi("write to")):Hm(this,u):p(Jn("write"))}}Object.defineProperties(Gr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Gr.prototype.abort,"abort"),i(Gr.prototype.close,"close"),i(Gr.prototype.releaseLock,"releaseLock"),i(Gr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Gr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Kn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof Gr}o(Kn,"IsWritableStreamDefaultWriter");function gA(a,u){let m=a._ownerWritableStream;return Qa(m,u)}o(gA,"WritableStreamDefaultWriterAbort");function Bm(a){let u=a._ownerWritableStream;return Fm(u)}o(Bm,"WritableStreamDefaultWriterClose");function yA(a){let u=a._ownerWritableStream,m=u._state;return Tr(u)||m==="closed"?f(void 0):m==="errored"?p(u._storedError):Bm(a)}o(yA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function _A(a,u){a._closedPromiseState==="pending"?Jc(a,u):wA(a,u)}o(_A,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function qm(a,u){a._readyPromiseState==="pending"?Qm(a,u):RA(a,u)}o(qm,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function vA(a){let u=a._ownerWritableStream,m=u._state;return m==="errored"||m==="erroring"?null:m==="closed"?0:Zm(u._writableStreamController)}o(vA,"WritableStreamDefaultWriterGetDesiredSize");function Vm(a){let u=a._ownerWritableStream,m=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");qm(a,m),_A(a,m),u._writer=void 0,a._ownerWritableStream=void 0}o(Vm,"WritableStreamDefaultWriterRelease");function Hm(a,u){let m=a._ownerWritableStream,S=m._writableStreamController,w=SA(S,u);if(m!==a._ownerWritableStream)return p(xi("write to"));let M=m._state;if(M==="errored")return p(m._storedError);if(Tr(m)||M==="closed")return p(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return p(m._storedError);let B=uA(m);return EA(S,u,w),B}o(Hm,"WritableStreamDefaultWriterWrite");let Gm={};class Eo{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Wc(this))throw Kc("abortReason");return this._abortReason}get signal(){if(!Wc(this))throw Kc("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!Wc(this))throw Kc("error");this._controlledWritableStream._state==="writable"&&Km(this,u)}[G](u){let m=this._abortAlgorithm(u);return ts(this),m}[Y](){fn(this)}}Object.defineProperties(Eo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Eo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Wc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Eo}o(Wc,"IsWritableStreamDefaultController");function Wm(a,u,m,S,w,M,B,ne){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._abortReason=void 0,u._abortController=aA(),u._started=!1,u._strategySizeAlgorithm=ne,u._strategyHWM=B,u._writeAlgorithm=S,u._closeAlgorithm=w,u._abortAlgorithm=M;let ye=Zc(u);Gc(a,ye);let le=m(),xe=f(le);h(xe,()=>(u._started=!0,rs(u),null),$e=>(u._started=!0,qc(a,$e),null))}o(Wm,"SetUpWritableStreamDefaultController");function bA(a,u,m,S){let w=Object.create(Eo.prototype),M,B,ne,ye;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?B=o(le=>u.write(le,w),"writeAlgorithm"):B=o(()=>f(void 0),"writeAlgorithm"),u.close!==void 0?ne=o(()=>u.close(),"closeAlgorithm"):ne=o(()=>f(void 0),"closeAlgorithm"),u.abort!==void 0?ye=o(le=>u.abort(le),"abortAlgorithm"):ye=o(()=>f(void 0),"abortAlgorithm"),Wm(a,w,M,B,ne,ye,m,S)}o(bA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function ts(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ts,"WritableStreamDefaultControllerClearAlgorithms");function PA(a){zc(a,Gm,0),rs(a)}o(PA,"WritableStreamDefaultControllerClose");function SA(a,u){try{return a._strategySizeAlgorithm(u)}catch(m){return Ti(a,m),1}}o(SA,"WritableStreamDefaultControllerGetChunkSize");function Zm(a){return a._strategyHWM-a._queueTotalSize}o(Zm,"WritableStreamDefaultControllerGetDesiredSize");function EA(a,u,m){try{zc(a,u,m)}catch(w){Ti(a,w);return}let S=a._controlledWritableStream;if(!Tr(S)&&S._state==="writable"){let w=Zc(a);Gc(S,w)}rs(a)}o(EA,"WritableStreamDefaultControllerWrite");function rs(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){Hc(u);return}if(a._queue.length===0)return;let S=Ux(a);S===Gm?TA(a):xA(a,S)}o(rs,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Ti(a,u){a._controlledWritableStream._state==="writable"&&Km(a,u)}o(Ti,"WritableStreamDefaultControllerErrorIfNeeded");function TA(a){let u=a._controlledWritableStream;mA(u),Nc(a);let m=a._closeAlgorithm();ts(a),h(m,()=>(dA(u),null),S=>(pA(u,S),null))}o(TA,"WritableStreamDefaultControllerProcessClose");function xA(a,u){let m=a._controlledWritableStream;hA(m);let S=a._writeAlgorithm(u);h(S,()=>{cA(m);let w=m._state;if(Nc(a),!Tr(m)&&w==="writable"){let M=Zc(a);Gc(m,M)}return rs(a),null},w=>(m._state==="writable"&&ts(a),lA(m,w),null))}o(xA,"WritableStreamDefaultControllerProcessWrite");function Zc(a){return Zm(a)<=0}o(Zc,"WritableStreamDefaultControllerGetBackpressure");function Km(a,u){let m=a._controlledWritableStream;ts(a),Vc(m,u)}o(Km,"WritableStreamDefaultControllerError");function ns(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(ns,"streamBrandCheckException$2");function Kc(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(Kc,"defaultControllerBrandCheckException$2");function Jn(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(Jn,"defaultWriterBrandCheckException");function xi(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(xi,"defaultWriterLockException");function os(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m,a._closedPromiseState="pending"})}o(os,"defaultWriterClosedPromiseInitialize");function Jm(a,u){os(a),Jc(a,u)}o(Jm,"defaultWriterClosedPromiseInitializeAsRejected");function AA(a){os(a),Ym(a)}o(AA,"defaultWriterClosedPromiseInitializeAsResolved");function Jc(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(Jc,"defaultWriterClosedPromiseReject");function wA(a,u){Jm(a,u)}o(wA,"defaultWriterClosedPromiseResetToRejected");function Ym(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(Ym,"defaultWriterClosedPromiseResolve");function is(a){a._readyPromise=l((u,m)=>{a._readyPromise_resolve=u,a._readyPromise_reject=m}),a._readyPromiseState="pending"}o(is,"defaultWriterReadyPromiseInitialize");function Yc(a,u){is(a),Qm(a,u)}o(Yc,"defaultWriterReadyPromiseInitializeAsRejected");function Xm(a){is(a),Xc(a)}o(Xm,"defaultWriterReadyPromiseInitializeAsResolved");function Qm(a,u){a._readyPromise_reject!==void 0&&(P(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Qm,"defaultWriterReadyPromiseReject");function IA(a){is(a)}o(IA,"defaultWriterReadyPromiseReset");function RA(a,u){Yc(a,u)}o(RA,"defaultWriterReadyPromiseResetToRejected");function Xc(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(Xc,"defaultWriterReadyPromiseResolve");function OA(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(OA,"getGlobals");let Qc=OA();function CA(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(CA,"isDOMExceptionConstructor");function $A(){let a=Qc?.DOMException;return CA(a)?a:void 0}o($A,"getFromGlobal");function kA(){let a=o(function(m,S){this.message=m||"",this.name=S||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(kA,"createPolyfill");let NA=$A()||kA();function eh(a,u,m,S,w,M){let B=j(a),ne=jm(u);a._disturbed=!0;let ye=!1,le=f(void 0);return l((xe,$e)=>{let We;if(M!==void 0){if(We=o(()=>{let pe=M.reason!==void 0?M.reason:new NA("Aborted","AbortError"),Ne=[];S||Ne.push(()=>u._state==="writable"?Qa(u,pe):f(void 0)),w||Ne.push(()=>a._state==="readable"?lr(a,pe):f(void 0)),It(()=>Promise.all(Ne.map(Ze=>Ze())),!0,pe)},"abortAlgorithm"),M.aborted){We();return}M.addEventListener("abort",We)}function dr(){return l((pe,Ne)=>{function Ze(Dt){Dt?pe():_(wo(),Ze,Ne)}o(Ze,"next"),Ze(!1)})}o(dr,"pipeLoop");function wo(){return ye?f(!0):_(ne._readyPromise,()=>l((pe,Ne)=>{ue(B,{_chunkSteps:o(Ze=>{le=_(Hm(ne,Ze),void 0,e),pe(!1)},"_chunkSteps"),_closeSteps:o(()=>pe(!0),"_closeSteps"),_errorSteps:Ne})}))}if(o(wo,"pipeStep"),Zr(a,B._closedPromise,pe=>(S?Xt(!0,pe):It(()=>Qa(u,pe),!0,pe),null)),Zr(u,ne._closedPromise,pe=>(w?Xt(!0,pe):It(()=>lr(a,pe),!0,pe),null)),xt(a,B._closedPromise,()=>(m?Xt():It(()=>yA(ne)),null)),Tr(u)||u._state==="closed"){let pe=new TypeError("the destination writable stream closed before all data could be piped to it");w?Xt(!0,pe):It(()=>lr(a,pe),!0,pe)}P(dr());function vn(){let pe=le;return _(le,()=>pe!==le?vn():void 0)}o(vn,"waitForWritesToFinish");function Zr(pe,Ne,Ze){pe._state==="errored"?Ze(pe._storedError):y(Ne,Ze)}o(Zr,"isOrBecomesErrored");function xt(pe,Ne,Ze){pe._state==="closed"?Ze():g(Ne,Ze)}o(xt,"isOrBecomesClosed");function It(pe,Ne,Ze){if(ye)return;ye=!0,u._state==="writable"&&!Tr(u)?g(vn(),Dt):Dt();function Dt(){return h(pe(),()=>Kr(Ne,Ze),Io=>Kr(!0,Io)),null}o(Dt,"doTheRest")}o(It,"shutdownWithAction");function Xt(pe,Ne){ye||(ye=!0,u._state==="writable"&&!Tr(u)?g(vn(),()=>Kr(pe,Ne)):Kr(pe,Ne))}o(Xt,"shutdown");function Kr(pe,Ne){return Vm(ne),q(B),M!==void 0&&M.removeEventListener("abort",We),pe?$e(Ne):xe(void 0),null}o(Kr,"finalize")})}o(eh,"ReadableStreamPipeTo");class Wr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!as(this))throw us("desiredSize");return el(this)}close(){if(!as(this))throw us("close");if(!xo(this))throw new TypeError("The stream is not in a state that permits close");Yn(this)}enqueue(u=void 0){if(!as(this))throw us("enqueue");if(!xo(this))throw new TypeError("The stream is not in a state that permits enqueue");return To(this,u)}error(u=void 0){if(!as(this))throw us("error");cr(this,u)}[ee](u){fn(this);let m=this._cancelAlgorithm(u);return ss(this),m}[K](u){let m=this._controlledReadableStream;if(this._queue.length>0){let S=Nc(this);this._closeRequested&&this._queue.length===0?(ss(this),Ii(m)):Ai(this),u._chunkSteps(S)}else I(m,u),Ai(this)}[Oe](){}}Object.defineProperties(Wr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Wr.prototype.close,"close"),i(Wr.prototype.enqueue,"enqueue"),i(Wr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Wr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function as(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof Wr}o(as,"IsReadableStreamDefaultController");function Ai(a){if(!th(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Ai(a)),null),S=>(cr(a,S),null))}o(Ai,"ReadableStreamDefaultControllerCallPullIfNeeded");function th(a){let u=a._controlledReadableStream;return!xo(a)||!a._started?!1:!!(yn(u)&&U(u)>0||el(a)>0)}o(th,"ReadableStreamDefaultControllerShouldCallPull");function ss(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ss,"ReadableStreamDefaultControllerClearAlgorithms");function Yn(a){if(!xo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(ss(a),Ii(u))}o(Yn,"ReadableStreamDefaultControllerClose");function To(a,u){if(!xo(a))return;let m=a._controlledReadableStream;if(yn(m)&&U(m)>0)C(m,u,!1);else{let S;try{S=a._strategySizeAlgorithm(u)}catch(w){throw cr(a,w),w}try{zc(a,u,S)}catch(w){throw cr(a,w),w}}Ai(a)}o(To,"ReadableStreamDefaultControllerEnqueue");function cr(a,u){let m=a._controlledReadableStream;m._state==="readable"&&(fn(a),ss(a),ih(m,u))}o(cr,"ReadableStreamDefaultControllerError");function el(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(el,"ReadableStreamDefaultControllerGetDesiredSize");function zA(a){return!th(a)}o(zA,"ReadableStreamDefaultControllerHasBackpressure");function xo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(xo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function rh(a,u,m,S,w,M,B){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,fn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=B,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=w,a._readableStreamController=u;let ne=m();h(f(ne),()=>(u._started=!0,Ai(u),null),ye=>(cr(u,ye),null))}o(rh,"SetUpReadableStreamDefaultController");function DA(a,u,m,S){let w=Object.create(Wr.prototype),M,B,ne;u.start!==void 0?M=o(()=>u.start(w),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?B=o(()=>u.pull(w),"pullAlgorithm"):B=o(()=>f(void 0),"pullAlgorithm"),u.cancel!==void 0?ne=o(ye=>u.cancel(ye),"cancelAlgorithm"):ne=o(()=>f(void 0),"cancelAlgorithm"),rh(a,w,M,B,ne,m,S)}o(DA,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function us(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(us,"defaultControllerBrandCheckException$1");function UA(a,u){return Gn(a._readableStreamController)?jA(a):MA(a)}o(UA,"ReadableStreamTee");function MA(a,u){let m=j(a),S=!1,w=!1,M=!1,B=!1,ne,ye,le,xe,$e,We=l(xt=>{$e=xt});function dr(){return S?(w=!0,f(void 0)):(S=!0,ue(m,{_chunkSteps:o(It=>{x(()=>{w=!1;let Xt=It,Kr=It;M||To(le._readableStreamController,Xt),B||To(xe._readableStreamController,Kr),S=!1,w&&dr()})},"_chunkSteps"),_closeSteps:o(()=>{S=!1,M||Yn(le._readableStreamController),B||Yn(xe._readableStreamController),(!M||!B)&&$e(void 0)},"_closeSteps"),_errorSteps:o(()=>{S=!1},"_errorSteps")}),f(void 0))}o(dr,"pullAlgorithm");function wo(xt){if(M=!0,ne=xt,B){let It=Ve([ne,ye]),Xt=lr(a,It);$e(Xt)}return We}o(wo,"cancel1Algorithm");function vn(xt){if(B=!0,ye=xt,M){let It=Ve([ne,ye]),Xt=lr(a,It);$e(Xt)}return We}o(vn,"cancel2Algorithm");function Zr(){}return o(Zr,"startAlgorithm"),le=wi(Zr,dr,wo),xe=wi(Zr,dr,vn),y(m._closedPromise,xt=>(cr(le._readableStreamController,xt),cr(xe._readableStreamController,xt),(!M||!B)&&$e(void 0),null)),[le,xe]}o(MA,"ReadableStreamDefaultTee");function jA(a){let u=j(a),m=!1,S=!1,w=!1,M=!1,B=!1,ne,ye,le,xe,$e,We=l(pe=>{$e=pe});function dr(pe){y(pe._closedPromise,Ne=>(pe!==u||(Yt(le._readableStreamController,Ne),Yt(xe._readableStreamController,Ne),(!M||!B)&&$e(void 0)),null))}o(dr,"forwardReaderError");function wo(){Zn(u)&&(q(u),u=j(a),dr(u)),ue(u,{_chunkSteps:o(Ne=>{x(()=>{S=!1,w=!1;let Ze=Ne,Dt=Ne;if(!M&&!B)try{Dt=bm(Ne)}catch(Io){Yt(le._readableStreamController,Io),Yt(xe._readableStreamController,Io),$e(lr(a,Io));return}M||Wa(le._readableStreamController,Ze),B||Wa(xe._readableStreamController,Dt),m=!1,S?Zr():w&&xt()})},"_chunkSteps"),_closeSteps:o(()=>{m=!1,M||Pi(le._readableStreamController),B||Pi(xe._readableStreamController),le._readableStreamController._pendingPullIntos.length>0&&Za(le._readableStreamController,0),xe._readableStreamController._pendingPullIntos.length>0&&Za(xe._readableStreamController,0),(!M||!B)&&$e(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(wo,"pullWithDefaultReader");function vn(pe,Ne){ie(u)&&(q(u),u=km(a),dr(u));let Ze=Ne?xe:le,Dt=Ne?le:xe;Dm(u,pe,1,{_chunkSteps:o(Ro=>{x(()=>{S=!1,w=!1;let Oo=Ne?B:M;if(Ne?M:B)Oo||Ka(Ze._readableStreamController,Ro);else{let _h;try{_h=bm(Ro)}catch(il){Yt(Ze._readableStreamController,il),Yt(Dt._readableStreamController,il),$e(lr(a,il));return}Oo||Ka(Ze._readableStreamController,Ro),Wa(Dt._readableStreamController,_h)}m=!1,S?Zr():w&&xt()})},"_chunkSteps"),_closeSteps:o(Ro=>{m=!1;let Oo=Ne?B:M,gs=Ne?M:B;Oo||Pi(Ze._readableStreamController),gs||Pi(Dt._readableStreamController),Ro!==void 0&&(Oo||Ka(Ze._readableStreamController,Ro),!gs&&Dt._readableStreamController._pendingPullIntos.length>0&&Za(Dt._readableStreamController,0)),(!Oo||!gs)&&$e(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(vn,"pullWithBYOBReader");function Zr(){if(m)return S=!0,f(void 0);m=!0;let pe=Lc(le._readableStreamController);return pe===null?wo():vn(pe._view,!1),f(void 0)}o(Zr,"pull1Algorithm");function xt(){if(m)return w=!0,f(void 0);m=!0;let pe=Lc(xe._readableStreamController);return pe===null?wo():vn(pe._view,!0),f(void 0)}o(xt,"pull2Algorithm");function It(pe){if(M=!0,ne=pe,B){let Ne=Ve([ne,ye]),Ze=lr(a,Ne);$e(Ze)}return We}o(It,"cancel1Algorithm");function Xt(pe){if(B=!0,ye=pe,M){let Ne=Ve([ne,ye]),Ze=lr(a,Ne);$e(Ze)}return We}o(Xt,"cancel2Algorithm");function Kr(){}return o(Kr,"startAlgorithm"),le=oh(Kr,Zr,It),xe=oh(Kr,xt,Xt),dr(u),[le,xe]}o(jA,"ReadableByteStreamTee");function LA(a){return r(a)&&typeof a.getReader<"u"}o(LA,"isReadableStreamLike");function FA(a){return LA(a)?qA(a.getReader()):BA(a)}o(FA,"ReadableStreamFrom");function BA(a){let u,m=vm(a,"async"),S=e;function w(){let B;try{B=kx(m)}catch(ye){return p(ye)}let ne=f(B);return T(ne,ye=>{if(!r(ye))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(Nx(ye))Yn(u._readableStreamController);else{let xe=zx(ye);To(u._readableStreamController,xe)}})}o(w,"pullAlgorithm");function M(B){let ne=m.iterator,ye;try{ye=Va(ne,"return")}catch($e){return p($e)}if(ye===void 0)return f(void 0);let le;try{le=N(ye,ne,[B])}catch($e){return p($e)}let xe=f(le);return T(xe,$e=>{if(!r($e))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=wi(S,w,M,0),u}o(BA,"ReadableStreamFromIterable");function qA(a){let u,m=e;function S(){let M;try{M=a.read()}catch(B){return p(B)}return T(M,B=>{if(!r(B))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(B.done)Yn(u._readableStreamController);else{let ne=B.value;To(u._readableStreamController,ne)}})}o(S,"pullAlgorithm");function w(M){try{return f(a.cancel(M))}catch(B){return p(B)}}return o(w,"cancelAlgorithm"),u=wi(m,S,w,0),u}o(qA,"ReadableStreamFromDefaultReader");function VA(a,u){rt(a,u);let m=a,S=m?.autoAllocateChunkSize,w=m?.cancel,M=m?.pull,B=m?.start,ne=m?.type;return{autoAllocateChunkSize:S===void 0?void 0:R(S,`${u} has member 'autoAllocateChunkSize' that`),cancel:w===void 0?void 0:HA(w,m,`${u} has member 'cancel' that`),pull:M===void 0?void 0:GA(M,m,`${u} has member 'pull' that`),start:B===void 0?void 0:WA(B,m,`${u} has member 'start' that`),type:ne===void 0?void 0:ZA(ne,`${u} has member 'type' that`)}}o(VA,"convertUnderlyingDefaultOrByteSource");function HA(a,u,m){return it(a,m),S=>F(a,u,[S])}o(HA,"convertUnderlyingSourceCancelCallback");function GA(a,u,m){return it(a,m),S=>F(a,u,[S])}o(GA,"convertUnderlyingSourcePullCallback");function WA(a,u,m){return it(a,m),S=>N(a,u,[S])}o(WA,"convertUnderlyingSourceStartCallback");function ZA(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(ZA,"convertReadableStreamType");function KA(a,u){return rt(a,u),{preventCancel:!!a?.preventCancel}}o(KA,"convertIteratorOptions");function nh(a,u){rt(a,u);let m=a?.preventAbort,S=a?.preventCancel,w=a?.preventClose,M=a?.signal;return M!==void 0&&JA(M,`${u} has member 'signal' that`),{preventAbort:!!m,preventCancel:!!S,preventClose:!!w,signal:M}}o(nh,"convertPipeOptions");function JA(a,u){if(!oA(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(JA,"assertAbortSignal");function YA(a,u){rt(a,u);let m=a?.readable;b(m,"readable","ReadableWritablePair"),$(m,`${u} has member 'readable' that`);let S=a?.writable;return b(S,"writable","ReadableWritablePair"),Mm(S,`${u} has member 'writable' that`),{readable:m,writable:S}}o(YA,"convertReadableWritablePair");class Et{static{o(this,"ReadableStream")}constructor(u={},m={}){u===void 0?u=null:Fe(u,"First parameter");let S=Xa(m,"Second parameter"),w=VA(u,"First parameter");if(tl(this),w.type==="bytes"){if(S.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Ei(S,0);Hx(this,w,M)}else{let M=Ya(S),B=Ei(S,1);DA(this,w,B,M)}}get locked(){if(!gn(this))throw Xn("locked");return yn(this)}cancel(u=void 0){return gn(this)?yn(this)?p(new TypeError("Cannot cancel a stream that already has a reader")):lr(this,u):p(Xn("cancel"))}getReader(u=void 0){if(!gn(this))throw Xn("getReader");return Wx(u,"First parameter").mode===void 0?j(this):km(this)}pipeThrough(u,m={}){if(!gn(this))throw Xn("pipeThrough");qe(u,1,"pipeThrough");let S=YA(u,"First parameter"),w=nh(m,"Second parameter");if(yn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(So(S.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=eh(this,S.writable,w.preventClose,w.preventAbort,w.preventCancel,w.signal);return P(M),S.readable}pipeTo(u,m={}){if(!gn(this))return p(Xn("pipeTo"));if(u===void 0)return p("Parameter 1 is required in 'pipeTo'.");if(!Po(u))return p(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let S;try{S=nh(m,"Second parameter")}catch(w){return p(w)}return yn(this)?p(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):So(u)?p(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):eh(this,u,S.preventClose,S.preventAbort,S.preventCancel,S.signal)}tee(){if(!gn(this))throw Xn("tee");let u=UA(this);return Ve(u)}values(u=void 0){if(!gn(this))throw Xn("values");let m=KA(u,"First parameter");return yo(this,m.preventCancel)}[kc](u){return this.values(u)}static from(u){return FA(u)}}Object.defineProperties(Et,{from:{enumerable:!0}}),Object.defineProperties(Et.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Et.from,"from"),i(Et.prototype.cancel,"cancel"),i(Et.prototype.getReader,"getReader"),i(Et.prototype.pipeThrough,"pipeThrough"),i(Et.prototype.pipeTo,"pipeTo"),i(Et.prototype.tee,"tee"),i(Et.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Et.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Et.prototype,kc,{value:Et.prototype.values,writable:!0,configurable:!0});function wi(a,u,m,S=1,w=()=>1){let M=Object.create(Et.prototype);tl(M);let B=Object.create(Wr.prototype);return rh(M,B,a,u,m,S,w),M}o(wi,"CreateReadableStream");function oh(a,u,m){let S=Object.create(Et.prototype);tl(S);let w=Object.create(Hr.prototype);return $m(S,w,a,u,m,0,void 0),S}o(oh,"CreateReadableByteStream");function tl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(tl,"InitializeReadableStream");function gn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Et}o(gn,"IsReadableStream");function yn(a){return a._reader!==void 0}o(yn,"IsReadableStreamLocked");function lr(a,u){if(a._disturbed=!0,a._state==="closed")return f(void 0);if(a._state==="errored")return p(a._storedError);Ii(a);let m=a._reader;if(m!==void 0&&Zn(m)){let w=m._readIntoRequests;m._readIntoRequests=new Z,w.forEach(M=>{M._closeSteps(void 0)})}let S=a._readableStreamController[ee](u);return T(S,e)}o(lr,"ReadableStreamCancel");function Ii(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Be(u),ie(u))){let m=u._readRequests;u._readRequests=new Z,m.forEach(S=>{S._closeSteps()})}}o(Ii,"ReadableStreamClose");function ih(a,u){a._state="errored",a._storedError=u;let m=a._reader;m!==void 0&&(Ie(m,u),ie(m)?Je(m,u):Um(m,u))}o(ih,"ReadableStreamError");function Xn(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(Xn,"streamBrandCheckException$1");function ah(a,u){rt(a,u);let m=a?.highWaterMark;return b(m,"highWaterMark","QueuingStrategyInit"),{highWaterMark:E(m)}}o(ah,"convertQueuingStrategyInit");let sh=o(a=>a.byteLength,"byteLengthSizeFunction");i(sh,"size");class cs{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){qe(u,1,"ByteLengthQueuingStrategy"),u=ah(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!ch(this))throw uh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ch(this))throw uh("size");return sh}}Object.defineProperties(cs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cs.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function uh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(uh,"byteLengthBrandCheckException");function ch(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof cs}o(ch,"IsByteLengthQueuingStrategy");let lh=o(()=>1,"countSizeFunction");i(lh,"size");class ls{static{o(this,"CountQueuingStrategy")}constructor(u){qe(u,1,"CountQueuingStrategy"),u=ah(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!ph(this))throw dh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!ph(this))throw dh("size");return lh}}Object.defineProperties(ls.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ls.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function dh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(dh,"countBrandCheckException");function ph(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof ls}o(ph,"IsCountQueuingStrategy");function XA(a,u){rt(a,u);let m=a?.cancel,S=a?.flush,w=a?.readableType,M=a?.start,B=a?.transform,ne=a?.writableType;return{cancel:m===void 0?void 0:rw(m,a,`${u} has member 'cancel' that`),flush:S===void 0?void 0:QA(S,a,`${u} has member 'flush' that`),readableType:w,start:M===void 0?void 0:ew(M,a,`${u} has member 'start' that`),transform:B===void 0?void 0:tw(B,a,`${u} has member 'transform' that`),writableType:ne}}o(XA,"convertTransformer");function QA(a,u,m){return it(a,m),S=>F(a,u,[S])}o(QA,"convertTransformerFlushCallback");function ew(a,u,m){return it(a,m),S=>N(a,u,[S])}o(ew,"convertTransformerStartCallback");function tw(a,u,m){return it(a,m),(S,w)=>F(a,u,[S,w])}o(tw,"convertTransformerTransformCallback");function rw(a,u,m){return it(a,m),S=>F(a,u,[S])}o(rw,"convertTransformerCancelCallback");class ds{static{o(this,"TransformStream")}constructor(u={},m={},S={}){u===void 0&&(u=null);let w=Xa(m,"Second parameter"),M=Xa(S,"Third parameter"),B=XA(u,"First parameter");if(B.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(B.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ne=Ei(M,0),ye=Ya(M),le=Ei(w,1),xe=Ya(w),$e,We=l(dr=>{$e=dr});nw(this,We,le,xe,ne,ye),iw(this,B),B.start!==void 0?$e(B.start(this._transformStreamController)):$e(void 0)}get readable(){if(!fh(this))throw yh("readable");return this._readable}get writable(){if(!fh(this))throw yh("writable");return this._writable}}Object.defineProperties(ds.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ds.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function nw(a,u,m,S,w,M){function B(){return u}o(B,"startAlgorithm");function ne(We){return uw(a,We)}o(ne,"writeAlgorithm");function ye(We){return cw(a,We)}o(ye,"abortAlgorithm");function le(){return lw(a)}o(le,"closeAlgorithm"),a._writable=sA(B,ne,le,ye,m,S);function xe(){return dw(a)}o(xe,"pullAlgorithm");function $e(We){return pw(a,We)}o($e,"cancelAlgorithm"),a._readable=wi(B,xe,$e,w,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ps(a,!0),a._transformStreamController=void 0}o(nw,"InitializeTransformStream");function fh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof ds}o(fh,"IsTransformStream");function mh(a,u){cr(a._readable._readableStreamController,u),rl(a,u)}o(mh,"TransformStreamError");function rl(a,u){ms(a._transformStreamController),Ti(a._writable._writableStreamController,u),nl(a)}o(rl,"TransformStreamErrorWritableAndUnblockWrite");function nl(a){a._backpressure&&ps(a,!1)}o(nl,"TransformStreamUnblockWrite");function ps(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=l(m=>{a._backpressureChangePromise_resolve=m}),a._backpressure=u}o(ps,"TransformStreamSetBackpressure");class _n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!fs(this))throw hs("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return el(u)}enqueue(u=void 0){if(!fs(this))throw hs("enqueue");hh(this,u)}error(u=void 0){if(!fs(this))throw hs("error");aw(this,u)}terminate(){if(!fs(this))throw hs("terminate");sw(this)}}Object.defineProperties(_n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(_n.prototype.enqueue,"enqueue"),i(_n.prototype.error,"error"),i(_n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function fs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof _n}o(fs,"IsTransformStreamDefaultController");function ow(a,u,m,S,w){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=m,u._flushAlgorithm=S,u._cancelAlgorithm=w,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(ow,"SetUpTransformStreamDefaultController");function iw(a,u){let m=Object.create(_n.prototype),S,w,M;u.transform!==void 0?S=o(B=>u.transform(B,m),"transformAlgorithm"):S=o(B=>{try{return hh(m,B),f(void 0)}catch(ne){return p(ne)}},"transformAlgorithm"),u.flush!==void 0?w=o(()=>u.flush(m),"flushAlgorithm"):w=o(()=>f(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(B=>u.cancel(B),"cancelAlgorithm"):M=o(()=>f(void 0),"cancelAlgorithm"),ow(a,m,S,w,M)}o(iw,"SetUpTransformStreamDefaultControllerFromTransformer");function ms(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(ms,"TransformStreamDefaultControllerClearAlgorithms");function hh(a,u){let m=a._controlledTransformStream,S=m._readable._readableStreamController;if(!xo(S))throw new TypeError("Readable side is not in a state that permits enqueue");try{To(S,u)}catch(M){throw rl(m,M),m._readable._storedError}zA(S)!==m._backpressure&&ps(m,!0)}o(hh,"TransformStreamDefaultControllerEnqueue");function aw(a,u){mh(a._controlledTransformStream,u)}o(aw,"TransformStreamDefaultControllerError");function gh(a,u){let m=a._transformAlgorithm(u);return T(m,void 0,S=>{throw mh(a._controlledTransformStream,S),S})}o(gh,"TransformStreamDefaultControllerPerformTransform");function sw(a){let u=a._controlledTransformStream,m=u._readable._readableStreamController;Yn(m);let S=new TypeError("TransformStream terminated");rl(u,S)}o(sw,"TransformStreamDefaultControllerTerminate");function uw(a,u){let m=a._transformStreamController;if(a._backpressure){let S=a._backpressureChangePromise;return T(S,()=>{let w=a._writable;if(w._state==="erroring")throw w._storedError;return gh(m,u)})}return gh(m,u)}o(uw,"TransformStreamDefaultSinkWriteAlgorithm");function cw(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._readable;m._finishPromise=l((M,B)=>{m._finishPromise_resolve=M,m._finishPromise_reject=B});let w=m._cancelAlgorithm(u);return ms(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(cr(S._readableStreamController,u),ol(m)),null),M=>(cr(S._readableStreamController,M),Ao(m,M),null)),m._finishPromise}o(cw,"TransformStreamDefaultSinkAbortAlgorithm");function lw(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let m=a._readable;u._finishPromise=l((w,M)=>{u._finishPromise_resolve=w,u._finishPromise_reject=M});let S=u._flushAlgorithm();return ms(u),h(S,()=>(m._state==="errored"?Ao(u,m._storedError):(Yn(m._readableStreamController),ol(u)),null),w=>(cr(m._readableStreamController,w),Ao(u,w),null)),u._finishPromise}o(lw,"TransformStreamDefaultSinkCloseAlgorithm");function dw(a){return ps(a,!1),a._backpressureChangePromise}o(dw,"TransformStreamDefaultSourcePullAlgorithm");function pw(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._writable;m._finishPromise=l((M,B)=>{m._finishPromise_resolve=M,m._finishPromise_reject=B});let w=m._cancelAlgorithm(u);return ms(m),h(w,()=>(S._state==="errored"?Ao(m,S._storedError):(Ti(S._writableStreamController,u),nl(a),ol(m)),null),M=>(Ti(S._writableStreamController,M),nl(a),Ao(m,M),null)),m._finishPromise}o(pw,"TransformStreamDefaultSourceCancelAlgorithm");function hs(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(hs,"defaultControllerBrandCheckException");function ol(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(ol,"defaultControllerFinishPromiseResolve");function Ao(a,u){a._finishPromise_reject!==void 0&&(P(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Ao,"defaultControllerFinishPromiseReject");function yh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(yh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=cs,t.CountQueuingStrategy=ls,t.ReadableByteStreamController=Hr,t.ReadableStream=Et,t.ReadableStreamBYOBReader=mn,t.ReadableStreamBYOBRequest=Hn,t.ReadableStreamDefaultController=Wr,t.ReadableStreamDefaultReader=H,t.TransformStream=ds,t.TransformStreamDefaultController=_n,t.WritableStream=hn,t.WritableStreamDefaultController=Eo,t.WritableStreamDefaultWriter=Gr}))});var Yb=k(()=>{if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,Jb())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Ad(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,Xb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+Xb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var j5,Xb,Qb,e$,hr,oa=gt(()=>{j5=ft(Yb(),1);Xb=65536;o(Ad,"toIterator");Qb=class wd{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof wd?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Ad(this.#e,!1))r+=e.decode(n,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let n of Ad(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Ad(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),l=this.#e,f=[],p=0;for(let h of l){if(p>=d)break;let g=ArrayBuffer.isView(h)?h.byteLength:h.size;if(s&&g<=s)s-=g,c-=g;else{let y;ArrayBuffer.isView(h)?(y=h.subarray(s,Math.min(g,c)),p+=y.byteLength):(y=h.slice(s,Math.min(g,c)),p+=y.size),c-=g,f.push(y),s=0}}let _=new wd([],{type:String(n).toLowerCase()});return _.#r=d,_.#e=f,_}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(Qb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});e$=Qb,hr=e$});var t$,r$,Dn,Id=gt(()=>{oa();t$=class extends hr{static{o(this,"File")}#e=0;#t="";constructor(e,r,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),n===null&&(n={});let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof hr&&/^(File)$/.test(e[Symbol.toStringTag])}},r$=t$,Dn=r$});function rP(t,e=hr){var r=`${eP()}${eP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
|
+
Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+Rd(c)+`"\r
|
|
16
16
|
\r
|
|
17
17
|
${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
18
18
|
`)}\r
|
|
19
|
-
`):n.push(i+
|
|
19
|
+
`):n.push(i+Rd(c)+`"; filename="${Rd(s.name,1)}"\r
|
|
20
20
|
Content-Type: ${s.type||"application/octet-stream"}\r
|
|
21
21
|
\r
|
|
22
22
|
`,s,`\r
|
|
23
|
-
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var
|
|
24
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),no=o((t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},"x"),
|
|
25
|
-
--`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ke.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:l,state:p,flags:f}=this,_=this.boundary.length,h=_-1,g=e.length,y,T,P=o(X=>{this[X+"Mark"]=r},"mark"),x=o(X=>{delete this[X+"Mark"]},"clear"),N=o((X,W,G,Z)=>{(W===void 0||W!==G)&&this[X](Z&&Z.subarray(W,G))},"callback"),L=o((X,W)=>{let G=X+"Mark";G in this&&(W?(N(X,this[G],r,e),delete this[G]):(N(X,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(y=e[r],p){case Ke.START_BOUNDARY:if(l===c.length-2){if(y===aa)f|=Un.LAST_BOUNDARY;else if(y!==pu)return;l++;break}else if(l-1===c.length-2){if(f&Un.LAST_BOUNDARY&&y===aa)p=Ke.END,f=0;else if(!(f&Un.LAST_BOUNDARY)&&y===du)l=0,N("onPartBegin"),p=Ke.HEADER_FIELD_START;else return;break}y!==c[l+2]&&(l=-2),y===c[l+2]&&l++;break;case Ke.HEADER_FIELD_START:p=Ke.HEADER_FIELD,P("onHeaderField"),l=0;case Ke.HEADER_FIELD:if(y===pu){x("onHeaderField"),p=Ke.HEADERS_ALMOST_DONE;break}if(l++,y===aa)break;if(y===F0){if(l===1)return;L("onHeaderField",!0),p=Ke.HEADER_VALUE_START;break}if(T=V0(y),T<B0||T>q0)return;break;case Ke.HEADER_VALUE_START:if(y===L0)break;P("onHeaderValue"),p=Ke.HEADER_VALUE;case Ke.HEADER_VALUE:y===pu&&(L("onHeaderValue",!0),N("onHeaderEnd"),p=Ke.HEADER_VALUE_ALMOST_DONE);break;case Ke.HEADER_VALUE_ALMOST_DONE:if(y!==du)return;p=Ke.HEADER_FIELD_START;break;case Ke.HEADERS_ALMOST_DONE:if(y!==du)return;N("onHeadersEnd"),p=Ke.PART_DATA_START;break;case Ke.PART_DATA_START:p=Ke.PART_DATA,P("onPartData");case Ke.PART_DATA:if(i=l,l===0){for(r+=h;r<g&&!(e[r]in d);)r+=_;r-=h,y=e[r]}if(l<c.length)c[l]===y?(l===0&&L("onPartData",!0),l++):l=0;else if(l===c.length)l++,y===pu?f|=Un.PART_BOUNDARY:y===aa?f|=Un.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(f&Un.PART_BOUNDARY){if(l=0,y===du){f&=~Un.PART_BOUNDARY,N("onPartEnd"),N("onPartBegin"),p=Ke.HEADER_FIELD_START;break}}else f&Un.LAST_BOUNDARY&&y===aa?(N("onPartEnd"),p=Ke.END,f=0):l=0;if(l>0)s[l-1]=y;else if(i>0){let X=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);N("onPartData",0,i,X),i=0,P("onPartData"),r--}break;case Ke.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=l,this.state=p,this.flags=f}end(){if(this.state===Ke.HEADER_FIELD_START&&this.index===0||this.state===Ke.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ke.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(H0,"_fileName");o(G0,"toFormData")});async function Cd(t){if(t[$t].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[$t].disturbed=!0,t[$t].error)throw t[$t].error;let{body:e}=t;if(e===null)return Lt.Buffer.alloc(0);if(!(e instanceof nr.default))return Lt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new At(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof rn?i:new At(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Lt.Buffer.from(r.join("")):Lt.Buffer.concat(r,n)}catch(i){throw new At(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new At(`Premature close of server response while trying to fetch ${t.url}`)}var nr,nn,Lt,W0,$t,Or,Ko,Z0,fu,sP,uP,mu=gt(()=>{nr=ft(require("node:stream"),1),nn=require("node:util"),Lt=require("node:buffer");na();au();Ad();su();cu();W0=(0,nn.promisify)(nr.default.pipeline),$t=Symbol("Body internals"),Or=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:wd(e)?e=Lt.Buffer.from(e.toString()):ia(e)||Lt.Buffer.isBuffer(e)||(nn.types.isAnyArrayBuffer(e)?e=Lt.Buffer.from(e):ArrayBuffer.isView(e)?e=Lt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof nr.default||(e instanceof Dn?(e=Vb(e),n=e.type.split("=")[1]):e=Lt.Buffer.from(String(e))));let i=e;Lt.Buffer.isBuffer(e)?i=nr.default.Readable.from(e):ia(e)&&(i=nr.default.Readable.from(e.stream())),this[$t]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof nr.default&&e.on("error",s=>{let c=s instanceof rn?s:new At(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[$t].error=c})}get body(){return this[$t].stream}get bodyUsed(){return this[$t].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Cd(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new Dn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(aP(),iP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[$t].body&&this[$t].body.type||"",r=await this.arrayBuffer();return new hr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Cd(this);return new TextDecoder().decode(e)}buffer(){return Cd(this)}};Or.prototype.buffer=(0,nn.deprecate)(Or.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Or.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,nn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Cd,"consumeBody");Ko=o((t,e)=>{let r,n,{body:i}=t[$t];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof nr.default&&typeof i.getBoundary!="function"&&(r=new nr.PassThrough({highWaterMark:e}),n=new nr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[$t].stream=r,i=n),i},"clone"),Z0=(0,nn.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),fu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":wd(t)?"application/x-www-form-urlencoded;charset=UTF-8":ia(t)?t.type||null:Lt.Buffer.isBuffer(t)||nn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Dn?`multipart/form-data; boundary=${e[$t].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Z0(t)}`:t instanceof nr.default?null:"text/plain;charset=UTF-8","extractContentType"),sP=o(t=>{let{body:e}=t[$t];return e===null?0:ia(e)?e.size:Lt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),uP=o(async(t,{body:e})=>{e===null?t.end():await W0(e,t)},"writeToStream")});function cP(t=[]){return new kt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return hu(e),kd(e,String(r)),!0}catch{return!1}}))}var $d,sa,hu,kd,kt,gu=gt(()=>{$d=require("node:util"),sa=ft(require("node:http"),1),hu=typeof sa.default.validateHeaderName=="function"?sa.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},kd=typeof sa.default.validateHeaderValue=="function"?sa.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},kt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!$d.types.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||$d.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(hu(n),kd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(hu(c),kd(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(hu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(kt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(cP,"fromRawHeaders")});var K0,ua,Nd=gt(()=>{K0=new Set([301,302,303,307,308]),ua=o(t=>K0.has(t),"isRedirect")});var gr,Ft,lP=gt(()=>{gu();mu();Nd();gr=Symbol("Response internals"),Ft=class t extends Or{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new kt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=fu(e,this);s&&i.append("Content-Type",s)}this[gr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[gr].type}get url(){return this[gr].url||""}get status(){return this[gr].status}get ok(){return this[gr].status>=200&&this[gr].status<300}get redirected(){return this[gr].counter>0}get statusText(){return this[gr].statusText}get headers(){return this[gr].headers}get highWaterMark(){return this[gr].highWaterMark}clone(){return new t(Ko(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!ua(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[gr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new kt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Ft.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var dP,pP=gt(()=>{dP=o(t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""},"getSearch")});function fP(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function yP(t){if(!hP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function J0(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,mP.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Jo(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:J0(t)}function _P(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=fP(i),c=fP(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return Jo(s)&&!Jo(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:Jo(s)&&!Jo(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return Jo(s)&&!Jo(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function vP(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&hP.has(n)&&(r=n);return r}var mP,hP,gP,zd=gt(()=>{mP=require("node:net");o(fP,"stripURLForUseAsAReferrer");hP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),gP="strict-origin-when-cross-origin";o(yP,"validateReferrerPolicy");o(J0,"isOriginPotentiallyTrustworthy");o(Jo,"isUrlPotentiallyTrustworthy");o(_P,"determineRequestsReferrer");o(vP,"parseReferrerPolicyFromHeader")});var bP,PP,bt,ca,Y0,Mn,SP,EP=gt(()=>{bP=require("node:url"),PP=require("node:util");gu();mu();cu();pP();zd();bt=Symbol("Request internals"),ca=o(t=>typeof t=="object"&&typeof t[bt]=="object","isRequest"),Y0=(0,PP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Mn=class t extends Or{static{o(this,"Request")}constructor(e,r={}){let n;if(ca(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!ca(r)&&"data"in r&&Y0(),(r.body!=null||ca(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:ca(e)&&e.body!==null?Ko(e):null;super(s,{size:r.size||e.size||0});let c=new kt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let p=fu(s,this);p&&c.set("Content-Type",p)}let d=ca(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!Hb(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let l=r.referrer==null?e.referrer:r.referrer;if(l==="")l="no-referrer";else if(l){let p=new URL(l);l=/^about:(\/\/)?client$/.test(p)?"client":p}else l=void 0;this[bt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:l},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[bt].method}get url(){return(0,bP.format)(this[bt].parsedURL)}get headers(){return this[bt].headers}get redirect(){return this[bt].redirect}get signal(){return this[bt].signal}get referrer(){if(this[bt].referrer==="no-referrer")return"";if(this[bt].referrer==="client")return"about:client";if(this[bt].referrer)return this[bt].referrer.toString()}get referrerPolicy(){return this[bt].referrerPolicy}set referrerPolicy(e){this[bt].referrerPolicy=yP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Mn.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});SP=o(t=>{let{parsedURL:e}=t[bt],r=new kt(t[bt].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=sP(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=gP),t.referrer&&t.referrer!=="no-referrer"?t[bt].referrer=_P(t):t[bt].referrer="no-referrer",t[bt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let s=dP(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var la,TP=gt(()=>{su();la=class extends rn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var wP={};gs(wP,{AbortError:()=>la,Blob:()=>hr,FetchError:()=>At,File:()=>zn,FormData:()=>Dn,Headers:()=>kt,Request:()=>Mn,Response:()=>Ft,blobFrom:()=>Qb,blobFromSync:()=>Xb,default:()=>Dd,fileFrom:()=>eP,fileFromSync:()=>tP,isRedirect:()=>ua});async function Dd(t,e){return new Promise((r,n)=>{let i=new Mn(t,e),{parsedURL:s,options:c}=SP(i);if(!X0.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let y=zb(i.url),T=new Ft(y,{headers:{"Content-Type":y.typeFull}});r(T);return}let d=(s.protocol==="https:"?AP.default:xP.default).request,{signal:l}=i,p=null,f=o(()=>{let y=new la("The operation was aborted.");n(y),i.body&&i.body instanceof Bt.default.Readable&&i.body.destroy(y),!(!p||!p.body)&&p.body.emit("error",y)},"abort");if(l&&l.aborted){f();return}let _=o(()=>{f(),g()},"abortAndFinalize"),h=d(s.toString(),c);l&&l.addEventListener("abort",_);let g=o(()=>{h.abort(),l&&l.removeEventListener("abort",_)},"finalize");h.on("error",y=>{n(new At(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),g()}),Q0(h,y=>{p&&p.body&&p.body.destroy(y)}),process.version<"v14"&&h.on("socket",y=>{let T;y.prependListener("end",()=>{T=y._eventsCount}),y.prependListener("close",P=>{if(p&&T<y._eventsCount&&!P){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",x)}})}),h.on("response",y=>{h.setTimeout(0);let T=cP(y.rawHeaders);if(ua(y.statusCode)){let X=T.get("Location"),W=null;try{W=X===null?null:new URL(X,i.url)}catch{if(i.redirect!=="manual"){n(new At(`uri requested responds with an invalid redirect URL: ${X}`,"invalid-redirect")),g();return}}switch(i.redirect){case"error":n(new At(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),g();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new At(`maximum redirect reached at: ${i.url}`,"max-redirect")),g();return}let G={headers:new kt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Ko(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Gb(i.url,W)||!Wb(i.url,W))for(let ee of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(ee);if(y.statusCode!==303&&i.body&&e.body instanceof Bt.default.Readable){n(new At("Cannot follow redirect with body being a readable stream","unsupported-redirect")),g();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let Z=vP(T);Z&&(G.referrerPolicy=Z),r(Dd(new Mn(W,G))),g();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&y.once("end",()=>{l.removeEventListener("abort",_)});let P=(0,Bt.pipeline)(y,new Bt.PassThrough,X=>{X&&n(X)});process.version<"v12.10"&&y.on("aborted",_);let x={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:T,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},N=T.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||N===null||y.statusCode===204||y.statusCode===304){p=new Ft(P,x),r(p);return}let L={flush:ao.default.Z_SYNC_FLUSH,finishFlush:ao.default.Z_SYNC_FLUSH};if(N==="gzip"||N==="x-gzip"){P=(0,Bt.pipeline)(P,ao.default.createGunzip(L),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}if(N==="deflate"||N==="x-deflate"){let X=(0,Bt.pipeline)(y,new Bt.PassThrough,W=>{W&&n(W)});X.once("data",W=>{(W[0]&15)===8?P=(0,Bt.pipeline)(P,ao.default.createInflate(),G=>{G&&n(G)}):P=(0,Bt.pipeline)(P,ao.default.createInflateRaw(),G=>{G&&n(G)}),p=new Ft(P,x),r(p)}),X.once("end",()=>{p||(p=new Ft(P,x),r(p))});return}if(N==="br"){P=(0,Bt.pipeline)(P,ao.default.createBrotliDecompress(),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}p=new Ft(P,x),r(p)}),uP(h,i).catch(n)})}function Q0(t,e){let r=da.Buffer.from(`0\r
|
|
23
|
+
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var ia,n$,o$,eP,i$,tP,Rd,no,Un,uu=gt(()=>{oa();Id();({toStringTag:ia,iterator:n$,hasInstance:o$}=Symbol),eP=Math.random,i$="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),tP=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[ia])?[(r=r!==void 0?r+"":e[ia]=="File"?e.name:"blob",t),e.name!==r||e[ia]=="blob"?new Dn([e],r,e):e]:[t,e+""]),"f"),Rd=o((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
|
|
24
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),no=o((t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},"x"),Un=class{static{o(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[ia](){return"FormData"}[n$](){return this.entries()}static[o$](e){return e&&typeof e=="object"&&e[ia]==="FormData"&&!i$.some(r=>typeof e[r]!="function")}append(...e){no("append",arguments,2),this.#e.push(tP(...e))}delete(e){no("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){no("get",arguments,1),e+="";for(var r=this.#e,n=r.length,i=0;i<n;i++)if(r[i][0]===e)return r[i][1];return null}getAll(e,r){return no("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return no("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){no("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){no("set",arguments,2);var r=[],n=!0;e=tP(...e),this.#e.forEach(i=>{i[0]===e[0]?n&&(n=!r.push(e)):r.push(i)}),n&&r.push(e),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}};o(rP,"formDataToBlob")});var rn,cu=gt(()=>{rn=class extends Error{static{o(this,"FetchBaseError")}constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var At,Od=gt(()=>{cu();At=class extends rn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var lu,Cd,aa,nP,oP,iP,du=gt(()=>{lu=Symbol.toStringTag,Cd=o(t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[lu]==="URLSearchParams","isURLSearchParameters"),aa=o(t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[lu]),"isBlob"),nP=o(t=>typeof t=="object"&&(t[lu]==="AbortSignal"||t[lu]==="EventTarget"),"isAbortSignal"),oP=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),iP=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var sP=k((o9,aP)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}aP.exports=globalThis.DOMException});var oo,uP,cP,$d,lP,dP,pP,fP,mP,hP,pu,kd=gt(()=>{oo=require("node:fs"),uP=require("node:path"),cP=ft(sP(),1);Id();oa();({stat:$d}=oo.promises),lP=o((t,e)=>mP((0,oo.statSync)(t),t,e),"blobFromSync"),dP=o((t,e)=>$d(t).then(r=>mP(r,t,e)),"blobFrom"),pP=o((t,e)=>$d(t).then(r=>hP(r,t,e)),"fileFrom"),fP=o((t,e)=>hP((0,oo.statSync)(t),t,e),"fileFromSync"),mP=o((t,e,r="")=>new hr([new pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),hP=o((t,e,r="")=>new Dn([new pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,uP.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),pu=class t{static{o(this,"BlobDataItem")}#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new t({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await $d(this.#e);if(e>this.lastModified)throw new cP.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,oo.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var yP={};ys(yP,{toFormData:()=>p$});function d$(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),n}async function p$(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let n=new Nd(r[1]||r[2]),i,s,c,d,l,f,p=[],_=new Un,h=o(x=>{c+=P.decode(x,{stream:!0})},"onPartData"),g=o(x=>{p.push(x)},"appendToFile"),y=o(()=>{let x=new Dn(p,f,{type:l});_.append(d,x)},"appendFileToFormData"),T=o(()=>{_.append(d,c)},"appendEntryToFormData"),P=new TextDecoder("utf-8");P.decode(),n.onPartBegin=function(){n.onPartData=h,n.onPartEnd=T,i="",s="",c="",d="",l="",f=null,p.length=0},n.onHeaderField=function(x){i+=P.decode(x,{stream:!0})},n.onHeaderValue=function(x){s+=P.decode(x,{stream:!0})},n.onHeaderEnd=function(){if(s+=P.decode(),i=i.toLowerCase(),i==="content-disposition"){let x=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);x&&(d=x[2]||x[3]||""),f=d$(s),f&&(n.onPartData=g,n.onPartEnd=y)}else i==="content-type"&&(l=s);s="",i=""};for await(let x of t)n.write(x);return n.end(),_}var Rr,Ke,gP,Mn,fu,mu,a$,sa,s$,u$,c$,l$,io,Nd,_P=gt(()=>{kd();uu();Rr=0,Ke={START_BOUNDARY:Rr++,HEADER_FIELD_START:Rr++,HEADER_FIELD:Rr++,HEADER_VALUE_START:Rr++,HEADER_VALUE:Rr++,HEADER_VALUE_ALMOST_DONE:Rr++,HEADERS_ALMOST_DONE:Rr++,PART_DATA_START:Rr++,PART_DATA:Rr++,END:Rr++},gP=1,Mn={PART_BOUNDARY:gP,LAST_BOUNDARY:gP*=2},fu=10,mu=13,a$=32,sa=45,s$=58,u$=97,c$=122,l$=o(t=>t|32,"lower"),io=o(()=>{},"noop"),Nd=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=io,this.onHeaderField=io,this.onHeadersEnd=io,this.onHeaderValue=io,this.onPartBegin=io,this.onPartData=io,this.onPartEnd=io,this.boundaryChars={},e=`\r
|
|
25
|
+
--`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ke.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:l,state:f,flags:p}=this,_=this.boundary.length,h=_-1,g=e.length,y,T,P=o(X=>{this[X+"Mark"]=r},"mark"),x=o(X=>{delete this[X+"Mark"]},"clear"),N=o((X,Z,G,Y)=>{(Z===void 0||Z!==G)&&this[X](Y&&Y.subarray(Z,G))},"callback"),F=o((X,Z)=>{let G=X+"Mark";G in this&&(Z?(N(X,this[G],r,e),delete this[G]):(N(X,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(y=e[r],f){case Ke.START_BOUNDARY:if(l===c.length-2){if(y===sa)p|=Mn.LAST_BOUNDARY;else if(y!==mu)return;l++;break}else if(l-1===c.length-2){if(p&Mn.LAST_BOUNDARY&&y===sa)f=Ke.END,p=0;else if(!(p&Mn.LAST_BOUNDARY)&&y===fu)l=0,N("onPartBegin"),f=Ke.HEADER_FIELD_START;else return;break}y!==c[l+2]&&(l=-2),y===c[l+2]&&l++;break;case Ke.HEADER_FIELD_START:f=Ke.HEADER_FIELD,P("onHeaderField"),l=0;case Ke.HEADER_FIELD:if(y===mu){x("onHeaderField"),f=Ke.HEADERS_ALMOST_DONE;break}if(l++,y===sa)break;if(y===s$){if(l===1)return;F("onHeaderField",!0),f=Ke.HEADER_VALUE_START;break}if(T=l$(y),T<u$||T>c$)return;break;case Ke.HEADER_VALUE_START:if(y===a$)break;P("onHeaderValue"),f=Ke.HEADER_VALUE;case Ke.HEADER_VALUE:y===mu&&(F("onHeaderValue",!0),N("onHeaderEnd"),f=Ke.HEADER_VALUE_ALMOST_DONE);break;case Ke.HEADER_VALUE_ALMOST_DONE:if(y!==fu)return;f=Ke.HEADER_FIELD_START;break;case Ke.HEADERS_ALMOST_DONE:if(y!==fu)return;N("onHeadersEnd"),f=Ke.PART_DATA_START;break;case Ke.PART_DATA_START:f=Ke.PART_DATA,P("onPartData");case Ke.PART_DATA:if(i=l,l===0){for(r+=h;r<g&&!(e[r]in d);)r+=_;r-=h,y=e[r]}if(l<c.length)c[l]===y?(l===0&&F("onPartData",!0),l++):l=0;else if(l===c.length)l++,y===mu?p|=Mn.PART_BOUNDARY:y===sa?p|=Mn.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(p&Mn.PART_BOUNDARY){if(l=0,y===fu){p&=~Mn.PART_BOUNDARY,N("onPartEnd"),N("onPartBegin"),f=Ke.HEADER_FIELD_START;break}}else p&Mn.LAST_BOUNDARY&&y===sa?(N("onPartEnd"),f=Ke.END,p=0):l=0;if(l>0)s[l-1]=y;else if(i>0){let X=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);N("onPartData",0,i,X),i=0,P("onPartData"),r--}break;case Ke.END:break;default:throw new Error(`Unexpected state entered: ${f}`)}F("onHeaderField"),F("onHeaderValue"),F("onPartData"),this.index=l,this.state=f,this.flags=p}end(){if(this.state===Ke.HEADER_FIELD_START&&this.index===0||this.state===Ke.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ke.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(d$,"_fileName");o(p$,"toFormData")});async function zd(t){if(t[$t].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[$t].disturbed=!0,t[$t].error)throw t[$t].error;let{body:e}=t;if(e===null)return Lt.Buffer.alloc(0);if(!(e instanceof nr.default))return Lt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new At(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof rn?i:new At(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Lt.Buffer.from(r.join("")):Lt.Buffer.concat(r,n)}catch(i){throw new At(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new At(`Premature close of server response while trying to fetch ${t.url}`)}var nr,nn,Lt,f$,$t,Or,Jo,m$,hu,vP,bP,gu=gt(()=>{nr=ft(require("node:stream"),1),nn=require("node:util"),Lt=require("node:buffer");oa();uu();Od();cu();du();f$=(0,nn.promisify)(nr.default.pipeline),$t=Symbol("Body internals"),Or=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Cd(e)?e=Lt.Buffer.from(e.toString()):aa(e)||Lt.Buffer.isBuffer(e)||(nn.types.isAnyArrayBuffer(e)?e=Lt.Buffer.from(e):ArrayBuffer.isView(e)?e=Lt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof nr.default||(e instanceof Un?(e=rP(e),n=e.type.split("=")[1]):e=Lt.Buffer.from(String(e))));let i=e;Lt.Buffer.isBuffer(e)?i=nr.default.Readable.from(e):aa(e)&&(i=nr.default.Readable.from(e.stream())),this[$t]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof nr.default&&e.on("error",s=>{let c=s instanceof rn?s:new At(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[$t].error=c})}get body(){return this[$t].stream}get bodyUsed(){return this[$t].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await zd(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new Un,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(_P(),yP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[$t].body&&this[$t].body.type||"",r=await this.arrayBuffer();return new hr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await zd(this);return new TextDecoder().decode(e)}buffer(){return zd(this)}};Or.prototype.buffer=(0,nn.deprecate)(Or.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Or.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,nn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(zd,"consumeBody");Jo=o((t,e)=>{let r,n,{body:i}=t[$t];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof nr.default&&typeof i.getBoundary!="function"&&(r=new nr.PassThrough({highWaterMark:e}),n=new nr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[$t].stream=r,i=n),i},"clone"),m$=(0,nn.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),hu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Cd(t)?"application/x-www-form-urlencoded;charset=UTF-8":aa(t)?t.type||null:Lt.Buffer.isBuffer(t)||nn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Un?`multipart/form-data; boundary=${e[$t].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${m$(t)}`:t instanceof nr.default?null:"text/plain;charset=UTF-8","extractContentType"),vP=o(t=>{let{body:e}=t[$t];return e===null?0:aa(e)?e.size:Lt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),bP=o(async(t,{body:e})=>{e===null?t.end():await f$(e,t)},"writeToStream")});function PP(t=[]){return new kt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return yu(e),Ud(e,String(r)),!0}catch{return!1}}))}var Dd,ua,yu,Ud,kt,_u=gt(()=>{Dd=require("node:util"),ua=ft(require("node:http"),1),yu=typeof ua.default.validateHeaderName=="function"?ua.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},Ud=typeof ua.default.validateHeaderValue=="function"?ua.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},kt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!Dd.types.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||Dd.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(yu(n),Ud(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(yu(c),Ud(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(yu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(kt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(PP,"fromRawHeaders")});var h$,ca,Md=gt(()=>{h$=new Set([301,302,303,307,308]),ca=o(t=>h$.has(t),"isRedirect")});var gr,Ft,SP=gt(()=>{_u();gu();Md();gr=Symbol("Response internals"),Ft=class t extends Or{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new kt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=hu(e,this);s&&i.append("Content-Type",s)}this[gr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[gr].type}get url(){return this[gr].url||""}get status(){return this[gr].status}get ok(){return this[gr].status>=200&&this[gr].status<300}get redirected(){return this[gr].counter>0}get statusText(){return this[gr].statusText}get headers(){return this[gr].headers}get highWaterMark(){return this[gr].highWaterMark}clone(){return new t(Jo(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!ca(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[gr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new kt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Ft.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var EP,TP=gt(()=>{EP=o(t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""},"getSearch")});function xP(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function RP(t){if(!wP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function g$(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,AP.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Yo(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:g$(t)}function OP(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=xP(i),c=xP(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return Yo(s)&&!Yo(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:Yo(s)&&!Yo(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return Yo(s)&&!Yo(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function CP(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&wP.has(n)&&(r=n);return r}var AP,wP,IP,jd=gt(()=>{AP=require("node:net");o(xP,"stripURLForUseAsAReferrer");wP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),IP="strict-origin-when-cross-origin";o(RP,"validateReferrerPolicy");o(g$,"isOriginPotentiallyTrustworthy");o(Yo,"isUrlPotentiallyTrustworthy");o(OP,"determineRequestsReferrer");o(CP,"parseReferrerPolicyFromHeader")});var $P,kP,Pt,la,y$,jn,NP,zP=gt(()=>{$P=require("node:url"),kP=require("node:util");_u();gu();du();TP();jd();Pt=Symbol("Request internals"),la=o(t=>typeof t=="object"&&typeof t[Pt]=="object","isRequest"),y$=(0,kP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),jn=class t extends Or{static{o(this,"Request")}constructor(e,r={}){let n;if(la(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!la(r)&&"data"in r&&y$(),(r.body!=null||la(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:la(e)&&e.body!==null?Jo(e):null;super(s,{size:r.size||e.size||0});let c=new kt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let f=hu(s,this);f&&c.set("Content-Type",f)}let d=la(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!nP(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let l=r.referrer==null?e.referrer:r.referrer;if(l==="")l="no-referrer";else if(l){let f=new URL(l);l=/^about:(\/\/)?client$/.test(f)?"client":f}else l=void 0;this[Pt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:l},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[Pt].method}get url(){return(0,$P.format)(this[Pt].parsedURL)}get headers(){return this[Pt].headers}get redirect(){return this[Pt].redirect}get signal(){return this[Pt].signal}get referrer(){if(this[Pt].referrer==="no-referrer")return"";if(this[Pt].referrer==="client")return"about:client";if(this[Pt].referrer)return this[Pt].referrer.toString()}get referrerPolicy(){return this[Pt].referrerPolicy}set referrerPolicy(e){this[Pt].referrerPolicy=RP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(jn.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});NP=o(t=>{let{parsedURL:e}=t[Pt],r=new kt(t[Pt].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=vP(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=IP),t.referrer&&t.referrer!=="no-referrer"?t[Pt].referrer=OP(t):t[Pt].referrer="no-referrer",t[Pt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let s=EP(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var da,DP=gt(()=>{cu();da=class extends rn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var jP={};ys(jP,{AbortError:()=>da,Blob:()=>hr,FetchError:()=>At,File:()=>Dn,FormData:()=>Un,Headers:()=>kt,Request:()=>jn,Response:()=>Ft,blobFrom:()=>dP,blobFromSync:()=>lP,default:()=>Ld,fileFrom:()=>pP,fileFromSync:()=>fP,isRedirect:()=>ca});async function Ld(t,e){return new Promise((r,n)=>{let i=new jn(t,e),{parsedURL:s,options:c}=NP(i);if(!_$.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let y=Wb(i.url),T=new Ft(y,{headers:{"Content-Type":y.typeFull}});r(T);return}let d=(s.protocol==="https:"?MP.default:UP.default).request,{signal:l}=i,f=null,p=o(()=>{let y=new da("The operation was aborted.");n(y),i.body&&i.body instanceof Bt.default.Readable&&i.body.destroy(y),!(!f||!f.body)&&f.body.emit("error",y)},"abort");if(l&&l.aborted){p();return}let _=o(()=>{p(),g()},"abortAndFinalize"),h=d(s.toString(),c);l&&l.addEventListener("abort",_);let g=o(()=>{h.abort(),l&&l.removeEventListener("abort",_)},"finalize");h.on("error",y=>{n(new At(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),g()}),v$(h,y=>{f&&f.body&&f.body.destroy(y)}),process.version<"v14"&&h.on("socket",y=>{let T;y.prependListener("end",()=>{T=y._eventsCount}),y.prependListener("close",P=>{if(f&&T<y._eventsCount&&!P){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",f.body.emit("error",x)}})}),h.on("response",y=>{h.setTimeout(0);let T=PP(y.rawHeaders);if(ca(y.statusCode)){let X=T.get("Location"),Z=null;try{Z=X===null?null:new URL(X,i.url)}catch{if(i.redirect!=="manual"){n(new At(`uri requested responds with an invalid redirect URL: ${X}`,"invalid-redirect")),g();return}}switch(i.redirect){case"error":n(new At(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),g();return;case"manual":break;case"follow":{if(Z===null)break;if(i.counter>=i.follow){n(new At(`maximum redirect reached at: ${i.url}`,"max-redirect")),g();return}let G={headers:new kt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Jo(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!oP(i.url,Z)||!iP(i.url,Z))for(let ee of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(ee);if(y.statusCode!==303&&i.body&&e.body instanceof Bt.default.Readable){n(new At("Cannot follow redirect with body being a readable stream","unsupported-redirect")),g();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let Y=CP(T);Y&&(G.referrerPolicy=Y),r(Ld(new jn(Z,G))),g();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&y.once("end",()=>{l.removeEventListener("abort",_)});let P=(0,Bt.pipeline)(y,new Bt.PassThrough,X=>{X&&n(X)});process.version<"v12.10"&&y.on("aborted",_);let x={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:T,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},N=T.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||N===null||y.statusCode===204||y.statusCode===304){f=new Ft(P,x),r(f);return}let F={flush:ao.default.Z_SYNC_FLUSH,finishFlush:ao.default.Z_SYNC_FLUSH};if(N==="gzip"||N==="x-gzip"){P=(0,Bt.pipeline)(P,ao.default.createGunzip(F),X=>{X&&n(X)}),f=new Ft(P,x),r(f);return}if(N==="deflate"||N==="x-deflate"){let X=(0,Bt.pipeline)(y,new Bt.PassThrough,Z=>{Z&&n(Z)});X.once("data",Z=>{(Z[0]&15)===8?P=(0,Bt.pipeline)(P,ao.default.createInflate(),G=>{G&&n(G)}):P=(0,Bt.pipeline)(P,ao.default.createInflateRaw(),G=>{G&&n(G)}),f=new Ft(P,x),r(f)}),X.once("end",()=>{f||(f=new Ft(P,x),r(f))});return}if(N==="br"){P=(0,Bt.pipeline)(P,ao.default.createBrotliDecompress(),X=>{X&&n(X)}),f=new Ft(P,x),r(f);return}f=new Ft(P,x),r(f)}),bP(h,i).catch(n)})}function v$(t,e){let r=pa.Buffer.from(`0\r
|
|
26
26
|
\r
|
|
27
|
-
`),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let
|
|
27
|
+
`),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let f=new Error("Premature close");f.code="ERR_STREAM_PREMATURE_CLOSE",e(f)}},"onSocketClose"),l=o(f=>{i=pa.Buffer.compare(f.slice(-5),r)===0,!i&&s&&(i=pa.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&pa.Buffer.compare(f.slice(-2),r.slice(3))===0),s=f},"onData");c.prependListener("close",d),c.on("data",l),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",l)})})}var UP,MP,ao,Bt,pa,_$,LP=gt(()=>{UP=ft(require("node:http"),1),MP=ft(require("node:https"),1),ao=ft(require("node:zlib"),1),Bt=ft(require("node:stream"),1),pa=require("node:buffer");Zb();gu();SP();_u();zP();Od();DP();Md();uu();du();jd();kd();_$=new Set(["data:","http:","https:"]);o(Ld,"fetch");o(v$,"fixResponseChunkedTransferBadEnding")});var qP=k(Qo=>{"use strict";var b$=Qo&&Qo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Xo;Object.defineProperty(Qo,"__esModule",{value:!0});Qo.Gaxios=void 0;var P$=b$(ra()),S$=require("https"),so=gd(),E$=Pb(),FP=require("stream"),BP=vd(),T$=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),x$=204,vu=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new BP.GaxiosInterceptorManager,response:new BP.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Xo.mergeHeaders(s,r.headers),n&&Xo.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await Xo.#u(),n={...e};delete n.data;let i=await r(e.url,n),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let s of r.data)i.push(s);r.data=i.toString()}let n=so.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new so.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof so.GaxiosError?n=r:r instanceof Error?n=new so.GaxiosError(r.message,e,void 0,r):n=new so.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,E$.getRetryConfig)(n);if(i&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===x$)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new so.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let c of s)i.push(c.trim());for(let c of i)if(c instanceof RegExp){if(c.test(n.toString()))return!1}else if(c instanceof URL){if(c.origin===n.origin)return!1}else if(c.startsWith("*.")||c.startsWith(".")){let d=c.replace(/^\*\./,".");if(n.hostname.endsWith(d))return!1}else if(c===n.origin||c===n.hostname||c===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);Xo.mergeHeaders(r,e.headers);let n=(0,P$.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let c=n.paramsSerializer(n.params);c.startsWith("?")&&(c=c.slice(1));let d=n.url.toString().includes("?")?"&":"?";n.url=n.url+d+c}else{let c=n.url instanceof URL?n.url:new URL(n.url);for(let[d,l]of new URLSearchParams(n.params))c.searchParams.append(d,l);n.url=c}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof FP.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let c=await T$();r.set("content-type",`multipart/related; boundary=${c}`),n.body=FP.Readable.from(this.getMultipartRequest(n.multipart,c))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let c=await Xo.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new c(s,{cert:n.cert,key:n.key}),this.agentCache.set(s,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new S$.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=so.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
|
|
28
28
|
Content-Type: ${s}\r
|
|
29
29
|
\r
|
|
30
30
|
`,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
|
|
31
|
-
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>ft(Nb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(IP(),wP))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};Xo.Gaxios=yu;Yo=yu});var st=k(wt=>{"use strict";var a$=wt&&wt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s$=wt&&wt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a$(e,t,r)};Object.defineProperty(wt,"__esModule",{value:!0});wt.instance=wt.Gaxios=wt.GaxiosError=void 0;wt.request=c$;var $P=CP();Object.defineProperty(wt,"Gaxios",{enumerable:!0,get:o(function(){return $P.Gaxios},"get")});var u$=pd();Object.defineProperty(wt,"GaxiosError",{enumerable:!0,get:o(function(){return u$.GaxiosError},"get")});s$(hd(),wt);wt.instance=new $P.Gaxios;async function c$(t){return wt.instance.request(t)}o(c$,"request")});var Ud=k((kP,_u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,l=14,p=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,h=1e9;function g(W){var G,Z,ee,Y=Q.prototype={constructor:Q,toString:null,valueOf:null},Se=new Q(1),te=20,q=4,B=-7,J=21,K=-1e7,re=1e7,oe=!1,Ae=1,Oe=0,Be={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ge="0123456789abcdefghijklmnopqrstuvwxyz",ht=!0;function Q(v,E){var A,D,R,$,j,I,O,U,z=this;if(!(z instanceof Q))return new Q(v,E);if(E==null){if(v&&v._isBigNumber===!0){z.s=v.s,!v.c||v.e>re?z.c=z.e=null:v.e<K?z.c=[z.e=0]:(z.e=v.e,z.c=v.c.slice());return}if((I=typeof v=="number")&&v*0==0){if(z.s=1/v<0?(v=-v,-1):1,v===~~v){for($=0,j=v;j>=10;j/=10,$++);$>re?z.c=z.e=null:(z.e=$,z.c=[v]);return}U=String(v)}else{if(!r.test(U=String(v)))return ee(z,U,I);z.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(x(E,2,Ge.length,"Base"),E==10&&ht)return z=new Q(v),Fe(z,te+z.e+1,q);if(U=String(v),I=typeof v=="number"){if(v*0!=0)return ee(z,U,I,E);if(z.s=1/v<0?(U=U.slice(1),-1):1,Q.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+v)}else z.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(A=Ge.slice(0,E),$=j=0,O=U.length;j<O;j++)if(A.indexOf(D=U.charAt(j))<0){if(D=="."){if(j>$){$=O;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return ee(z,String(v),I,E)}I=!1,U=Z(U,E,10,z.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(O=U.length;U.charCodeAt(--O)===48;);if(U=U.slice(j,++O)){if(O-=j,I&&Q.DEBUG&&O>15&&(v>p||v!==i(v)))throw Error(c+z.s*v);if(($=$-j-1)>re)z.c=z.e=null;else if($<K)z.c=[z.e=0];else{if(z.e=$,z.c=[],j=($+1)%l,$<0&&(j+=l),j<O){for(j&&z.c.push(+U.slice(0,j)),O-=l;j<O;)z.c.push(+U.slice(j,j+=l));j=l-(U=U.slice(j)).length}else j-=O;for(;j--;U+="0");z.c.push(+U)}}else z.c=[z.e=0]}o(Q,"BigNumber"),Q.clone=g,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(v){var E,A;if(v!=null)if(typeof v=="object"){if(v.hasOwnProperty(E="DECIMAL_PLACES")&&(A=v[E],x(A,0,h,E),te=A),v.hasOwnProperty(E="ROUNDING_MODE")&&(A=v[E],x(A,0,8,E),q=A),v.hasOwnProperty(E="EXPONENTIAL_AT")&&(A=v[E],A&&A.pop?(x(A[0],-h,0,E),x(A[1],0,h,E),B=A[0],J=A[1]):(x(A,-h,h,E),B=-(J=A<0?-A:A))),v.hasOwnProperty(E="RANGE"))if(A=v[E],A&&A.pop)x(A[0],-h,-1,E),x(A[1],1,h,E),K=A[0],re=A[1];else if(x(A,-h,h,E),A)K=-(re=A<0?-A:A);else throw Error(s+E+" cannot be zero: "+A);if(v.hasOwnProperty(E="CRYPTO"))if(A=v[E],A===!!A)if(A)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))oe=A;else throw oe=!A,Error(s+"crypto unavailable");else oe=A;else throw Error(s+E+" not true or false: "+A);if(v.hasOwnProperty(E="MODULO_MODE")&&(A=v[E],x(A,0,9,E),Ae=A),v.hasOwnProperty(E="POW_PRECISION")&&(A=v[E],x(A,0,h,E),Oe=A),v.hasOwnProperty(E="FORMAT"))if(A=v[E],typeof A=="object")Be=A;else throw Error(s+E+" not an object: "+A);if(v.hasOwnProperty(E="ALPHABET"))if(A=v[E],typeof A=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(A))ht=A.slice(0,10)=="0123456789",Ge=A;else throw Error(s+E+" invalid: "+A)}else throw Error(s+"Object expected: "+v);return{DECIMAL_PLACES:te,ROUNDING_MODE:q,EXPONENTIAL_AT:[B,J],RANGE:[K,re],CRYPTO:oe,MODULO_MODE:Ae,POW_PRECISION:Oe,FORMAT:Be,ALPHABET:Ge}},Q.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!Q.DEBUG)return!0;var E,A,D=v.c,R=v.e,$=v.s;e:if({}.toString.call(D)=="[object Array]"){if(($===1||$===-1)&&R>=-h&&R<=h&&R===i(R)){if(D[0]===0){if(R===0&&D.length===1)return!0;break e}if(E=(R+1)%l,E<1&&(E+=l),String(D[0]).length==E){for(E=0;E<D.length;E++)if(A=D[E],A<0||A>=d||A!==i(A))break e;if(A!==0)return!0}}}else if(D===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+v)},Q.maximum=Q.max=function(){return it(arguments,-1)},Q.minimum=Q.min=function(){return it(arguments,1)},Q.random=(function(){var v=9007199254740992,E=Math.random()*v&2097151?function(){return i(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(A){var D,R,$,j,I,O=0,U=[],z=new Q(Se);if(A==null?A=te:x(A,0,h),j=n(A/l),oe)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=D[O]*131072+(D[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),D[O]=R[0],D[O+1]=R[1]):(U.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(j*=7);O<j;)I=(D[O]&31)*281474976710656+D[O+1]*1099511627776+D[O+2]*4294967296+D[O+3]*16777216+(D[O+4]<<16)+(D[O+5]<<8)+D[O+6],I>=9e15?crypto.randomBytes(7).copy(D,O):(U.push(I%1e14),O+=7);O=j/7}else throw oe=!1,Error(s+"crypto unavailable");if(!oe)for(;O<j;)I=E(),I<9e15&&(U[O++]=I%1e14);for(j=U[--O],A%=l,j&&A&&(I=f[l-A],U[O]=i(j/I)*I);U[O]===0;U.pop(),O--);if(O<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=l);for(O=1,I=U[0];I>=10;I/=10,O++);O<l&&($-=l-O)}return z.e=$,z.c=U,z}})(),Q.sum=function(){for(var v=1,E=arguments,A=new Q(E[0]);v<E.length;)A=A.plus(E[v++]);return A},Z=(function(){var v="0123456789";function E(A,D,R,$){for(var j,I=[0],O,U=0,z=A.length;U<z;){for(O=I.length;O--;I[O]*=D);for(I[0]+=$.indexOf(A.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(E,"toBaseOut"),function(A,D,R,$,j){var I,O,U,z,V,ie,ue,De,Je=A.indexOf("."),Ye=te,ze=q;for(Je>=0&&(z=Oe,Oe=0,A=A.replace(".",""),De=new Q(D),ie=De.pow(A.length-Je),Oe=z,De.c=E(X(T(ie.c),ie.e,"0"),10,R,v),De.e=De.c.length),ue=E(A,D,R,j?(I=Ge,v):(I=v,Ge)),U=z=ue.length;ue[--z]==0;ue.pop());if(!ue[0])return I.charAt(0);if(Je<0?--U:(ie.c=ue,ie.e=U,ie.s=$,ie=G(ie,De,Ye,ze,R),ue=ie.c,V=ie.r,U=ie.e),O=U+Ye+1,Je=ue[O],z=R/2,V=V||O<0||ue[O+1]!=null,V=ze<4?(Je!=null||V)&&(ze==0||ze==(ie.s<0?3:2)):Je>z||Je==z&&(ze==4||V||ze==6&&ue[O-1]&1||ze==(ie.s<0?8:7)),O<1||!ue[0])A=V?X(I.charAt(1),-Ye,I.charAt(0)):I.charAt(0);else{if(ue.length=O,V)for(--R;++ue[--O]>R;)ue[O]=0,O||(++U,ue=[1].concat(ue));for(z=ue.length;!ue[--z];);for(Je=0,A="";Je<=z;A+=I.charAt(ue[Je++]));A=X(A,U,I.charAt(0))}return A}})(),G=(function(){function v(D,R,$){var j,I,O,U,z=0,V=D.length,ie=R%_,ue=R/_|0;for(D=D.slice();V--;)O=D[V]%_,U=D[V]/_|0,j=ue*O+U*ie,I=ie*O+j%_*_+z,z=(I/$|0)+(j/_|0)+ue*U,D[V]=I%$;return z&&(D=[z].concat(D)),D}o(v,"multiply");function E(D,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(D[I]!=R[I]){O=D[I]>R[I]?1:-1;break}return O}o(E,"compare");function A(D,R,$,j){for(var I=0;$--;)D[$]-=I,I=D[$]<R[$]?1:0,D[$]=I*j+D[$]-R[$];for(;!D[0]&&D.length>1;D.splice(0,1));}return o(A,"subtract"),function(D,R,$,j,I){var O,U,z,V,ie,ue,De,Je,Ye,ze,Le,dt,yo,_o,vo,zt,qr,Pt=D.s==R.s?1:-1,pt=D.c,Ve=R.c;if(!pt||!pt[0]||!Ve||!Ve[0])return new Q(!D.s||!R.s||(pt?Ve&&pt[0]==Ve[0]:!Ve)?NaN:pt&&pt[0]==0||!Ve?Pt*0:Pt/0);for(Je=new Q(Pt),Ye=Je.c=[],U=D.e-R.e,Pt=$+U+1,I||(I=d,U=y(D.e/l)-y(R.e/l),Pt=Pt/l|0),z=0;Ve[z]==(pt[z]||0);z++);if(Ve[z]>(pt[z]||0)&&U--,Pt<0)Ye.push(1),V=!0;else{for(_o=pt.length,zt=Ve.length,z=0,Pt+=2,ie=i(I/(Ve[0]+1)),ie>1&&(Ve=v(Ve,ie,I),pt=v(pt,ie,I),zt=Ve.length,_o=pt.length),yo=zt,ze=pt.slice(0,zt),Le=ze.length;Le<zt;ze[Le++]=0);qr=Ve.slice(),qr=[0].concat(qr),vo=Ve[0],Ve[1]>=I/2&&vo++;do{if(ie=0,O=E(Ve,ze,zt,Le),O<0){if(dt=ze[0],zt!=Le&&(dt=dt*I+(ze[1]||0)),ie=i(dt/vo),ie>1)for(ie>=I&&(ie=I-1),ue=v(Ve,ie,I),De=ue.length,Le=ze.length;E(ue,ze,De,Le)==1;)ie--,A(ue,zt<De?qr:Ve,De,I),De=ue.length,O=1;else ie==0&&(O=ie=1),ue=Ve.slice(),De=ue.length;if(De<Le&&(ue=[0].concat(ue)),A(ze,ue,Le,I),Le=ze.length,O==-1)for(;E(Ve,ze,zt,Le)<1;)ie++,A(ze,zt<Le?qr:Ve,Le,I),Le=ze.length}else O===0&&(ie++,ze=[0]);Ye[z++]=ie,ze[0]?ze[Le++]=pt[yo]||0:(ze=[pt[yo]],Le=1)}while((yo++<_o||ze[0]!=null)&&Pt--);V=ze[0]!=null,Ye[0]||Ye.splice(0,1)}if(I==d){for(z=1,Pt=Ye[0];Pt>=10;Pt/=10,z++);Fe(Je,$+(Je.e=z+U*l-1)+1,j,V)}else Je.e=U,Je.r=+V;return Je}})();function tt(v,E,A,D){var R,$,j,I,O;if(A==null?A=q:x(A,0,8),!v.c)return v.toString();if(R=v.c[0],j=v.e,E==null)O=T(v.c),O=D==1||D==2&&(j<=B||j>=J)?L(O,j):X(O,j,"0");else if(v=Fe(new Q(v),E,A),$=v.e,O=T(v.c),I=O.length,D==1||D==2&&(E<=$||$<=B)){for(;I<E;O+="0",I++);O=L(O,$)}else if(E-=j+(D===2&&$>j),O=X(O,$,"0"),$+1>I){if(--E>0)for(O+=".";E--;O+="0");}else if(E+=$-I,E>0)for($+1==I&&(O+=".");E--;O+="0");return v.s<0&&R?"-"+O:O}o(tt,"format");function it(v,E){for(var A,D,R=1,$=new Q(v[0]);R<v.length;R++)D=new Q(v[R]),(!D.s||(A=P($,D))===E||A===0&&$.s===E)&&($=D);return $}o(it,"maxOrMin");function Nt(v,E,A){for(var D=1,R=E.length;!E[--R];E.pop());for(R=E[0];R>=10;R/=10,D++);return(A=D+A*l-1)>re?v.c=v.e=null:A<K?v.c=[v.e=0]:(v.e=A,v.c=E),v}o(Nt,"normalise"),ee=(function(){var v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,A=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var U,z=I?j:j.replace(R,"");if(D.test(z))$.s=isNaN(z)?null:z<0?-1:1;else{if(!I&&(z=z.replace(v,function(V,ie,ue){return U=(ue=ue.toLowerCase())=="x"?16:ue=="b"?2:8,!O||O==U?ie:V}),O&&(U=O,z=z.replace(E,"$1").replace(A,"0.$1")),j!=z))return new Q(z,U);if(Q.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function Fe(v,E,A,D){var R,$,j,I,O,U,z,V=v.c,ie=f;if(V){e:{for(R=1,I=V[0];I>=10;I/=10,R++);if($=E-R,$<0)$+=l,j=E,O=V[U=0],z=i(O/ie[R-j-1]%10);else if(U=n(($+1)/l),U>=V.length)if(D){for(;V.length<=U;V.push(0));O=z=0,R=1,$%=l,j=$-l+1}else break e;else{for(O=I=V[U],R=1;I>=10;I/=10,R++);$%=l,j=$-l+R,z=j<0?0:i(O/ie[R-j-1]%10)}if(D=D||E<0||V[U+1]!=null||(j<0?O:O%ie[R-j-1]),D=A<4?(z||D)&&(A==0||A==(v.s<0?3:2)):z>5||z==5&&(A==4||D||A==6&&($>0?j>0?O/ie[R-j]:0:V[U-1])%10&1||A==(v.s<0?8:7)),E<1||!V[0])return V.length=0,D?(E-=v.e+1,V[0]=ie[(l-E%l)%l],v.e=-E||0):V[0]=v.e=0,v;if($==0?(V.length=U,I=1,U--):(V.length=U+1,I=ie[l-$],V[U]=j>0?i(O/ie[R-j]%ie[j])*I:0),D)for(;;)if(U==0){for($=1,j=V[0];j>=10;j/=10,$++);for(j=V[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(v.e++,V[0]==d&&(V[0]=1));break}else{if(V[U]+=I,V[U]!=d)break;V[U--]=0,I=1}for($=V.length;V[--$]===0;V.pop());}v.e>re?v.c=v.e=null:v.e<K&&(v.c=[v.e=0])}return v}o(Fe,"round");function qe(v){var E,A=v.e;return A===null?v.toString():(E=T(v.c),E=A<=B||A>=J?L(E,A):X(E,A,"0"),v.s<0?"-"+E:E)}return o(qe,"valueOf"),Y.absoluteValue=Y.abs=function(){var v=new Q(this);return v.s<0&&(v.s=1),v},Y.comparedTo=function(v,E){return P(this,new Q(v,E))},Y.decimalPlaces=Y.dp=function(v,E){var A,D,R,$=this;if(v!=null)return x(v,0,h),E==null?E=q:x(E,0,8),Fe(new Q($),v+$.e+1,E);if(!(A=$.c))return null;if(D=((R=A.length-1)-y(this.e/l))*l,R=A[R])for(;R%10==0;R/=10,D--);return D<0&&(D=0),D},Y.dividedBy=Y.div=function(v,E){return G(this,new Q(v,E),te,q)},Y.dividedToIntegerBy=Y.idiv=function(v,E){return G(this,new Q(v,E),0,1)},Y.exponentiatedBy=Y.pow=function(v,E){var A,D,R,$,j,I,O,U,z,V=this;if(v=new Q(v),v.c&&!v.isInteger())throw Error(s+"Exponent not an integer: "+qe(v));if(E!=null&&(E=new Q(E)),I=v.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!v.c||!v.c[0])return z=new Q(Math.pow(+qe(V),I?v.s*(2-N(v)):+qe(v))),E?z.mod(E):z;if(O=v.s<0,E){if(E.c?!E.c[0]:!E.s)return new Q(NaN);D=!O&&V.isInteger()&&E.isInteger(),D&&(V=V.mod(E))}else{if(v.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||I&&V.c[1]>=24e7:V.c[0]<8e13||I&&V.c[0]<=9999975e7)))return $=V.s<0&&N(v)?-0:0,V.e>-1&&($=1/$),new Q(O?1/$:$);Oe&&($=n(Oe/l+2))}for(I?(A=new Q(.5),O&&(v.s=1),U=N(v)):(R=Math.abs(+qe(v)),U=R%2),z=new Q(Se);;){if(U){if(z=z.times(V),!z.c)break;$?z.c.length>$&&(z.c.length=$):D&&(z=z.mod(E))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(v=v.times(A),Fe(v,v.e+1,1),v.e>14)U=N(v);else{if(R=+qe(v),R===0)break;U=R%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):D&&(V=V.mod(E))}return D?z:(O&&(z=Se.div(z)),E?z.mod(E):$?Fe(z,Oe,q,j):z)},Y.integerValue=function(v){var E=new Q(this);return v==null?v=q:x(v,0,8),Fe(E,E.e+1,v)},Y.isEqualTo=Y.eq=function(v,E){return P(this,new Q(v,E))===0},Y.isFinite=function(){return!!this.c},Y.isGreaterThan=Y.gt=function(v,E){return P(this,new Q(v,E))>0},Y.isGreaterThanOrEqualTo=Y.gte=function(v,E){return(E=P(this,new Q(v,E)))===1||E===0},Y.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},Y.isLessThan=Y.lt=function(v,E){return P(this,new Q(v,E))<0},Y.isLessThanOrEqualTo=Y.lte=function(v,E){return(E=P(this,new Q(v,E)))===-1||E===0},Y.isNaN=function(){return!this.s},Y.isNegative=function(){return this.s<0},Y.isPositive=function(){return this.s>0},Y.isZero=function(){return!!this.c&&this.c[0]==0},Y.minus=function(v,E){var A,D,R,$,j=this,I=j.s;if(v=new Q(v,E),E=v.s,!I||!E)return new Q(NaN);if(I!=E)return v.s=-E,j.plus(v);var O=j.e/l,U=v.e/l,z=j.c,V=v.c;if(!O||!U){if(!z||!V)return z?(v.s=-E,v):new Q(V?j:NaN);if(!z[0]||!V[0])return V[0]?(v.s=-E,v):new Q(z[0]?j:q==3?-0:0)}if(O=y(O),U=y(U),z=z.slice(),I=O-U){for(($=I<0)?(I=-I,R=z):(U=O,R=V),R.reverse(),E=I;E--;R.push(0));R.reverse()}else for(D=($=(I=z.length)<(E=V.length))?I:E,I=E=0;E<D;E++)if(z[E]!=V[E]){$=z[E]<V[E];break}if($&&(R=z,z=V,V=R,v.s=-v.s),E=(D=V.length)-(A=z.length),E>0)for(;E--;z[A++]=0);for(E=d-1;D>I;){if(z[--D]<V[D]){for(A=D;A&&!z[--A];z[A]=E);--z[A],z[D]+=d}z[D]-=V[D]}for(;z[0]==0;z.splice(0,1),--U);return z[0]?Nt(v,z,U):(v.s=q==3?-1:1,v.c=[v.e=0],v)},Y.modulo=Y.mod=function(v,E){var A,D,R=this;return v=new Q(v,E),!R.c||!v.s||v.c&&!v.c[0]?new Q(NaN):!v.c||R.c&&!R.c[0]?new Q(R):(Ae==9?(D=v.s,v.s=1,A=G(R,v,0,3),v.s=D,A.s*=D):A=G(R,v,0,Ae),v=R.minus(A.times(v)),!v.c[0]&&Ae==1&&(v.s=R.s),v)},Y.multipliedBy=Y.times=function(v,E){var A,D,R,$,j,I,O,U,z,V,ie,ue,De,Je,Ye,ze=this,Le=ze.c,dt=(v=new Q(v,E)).c;if(!Le||!dt||!Le[0]||!dt[0])return!ze.s||!v.s||Le&&!Le[0]&&!dt||dt&&!dt[0]&&!Le?v.c=v.e=v.s=null:(v.s*=ze.s,!Le||!dt?v.c=v.e=null:(v.c=[0],v.e=0)),v;for(D=y(ze.e/l)+y(v.e/l),v.s*=ze.s,O=Le.length,V=dt.length,O<V&&(De=Le,Le=dt,dt=De,R=O,O=V,V=R),R=O+V,De=[];R--;De.push(0));for(Je=d,Ye=_,R=V;--R>=0;){for(A=0,ie=dt[R]%Ye,ue=dt[R]/Ye|0,j=O,$=R+j;$>R;)U=Le[--j]%Ye,z=Le[j]/Ye|0,I=ue*U+z*ie,U=ie*U+I%Ye*Ye+De[$]+A,A=(U/Je|0)+(I/Ye|0)+ue*z,De[$--]=U%Je;De[$]=A}return A?++D:De.splice(0,1),Nt(v,De,D)},Y.negated=function(){var v=new Q(this);return v.s=-v.s||null,v},Y.plus=function(v,E){var A,D=this,R=D.s;if(v=new Q(v,E),E=v.s,!R||!E)return new Q(NaN);if(R!=E)return v.s=-E,D.minus(v);var $=D.e/l,j=v.e/l,I=D.c,O=v.c;if(!$||!j){if(!I||!O)return new Q(R/0);if(!I[0]||!O[0])return O[0]?v:new Q(I[0]?D:R*0)}if($=y($),j=y(j),I=I.slice(),R=$-j){for(R>0?(j=$,A=O):(R=-R,A=I),A.reverse();R--;A.push(0));A.reverse()}for(R=I.length,E=O.length,R-E<0&&(A=O,O=I,I=A,E=R),R=0;E;)R=(I[--E]=I[E]+O[E]+R)/d|0,I[E]=d===I[E]?0:I[E]%d;return R&&(I=[R].concat(I),++j),Nt(v,I,j)},Y.precision=Y.sd=function(v,E){var A,D,R,$=this;if(v!=null&&v!==!!v)return x(v,1,h),E==null?E=q:x(E,0,8),Fe(new Q($),v,E);if(!(A=$.c))return null;if(R=A.length-1,D=R*l+1,R=A[R]){for(;R%10==0;R/=10,D--);for(R=A[0];R>=10;R/=10,D++);}return v&&$.e+1>D&&(D=$.e+1),D},Y.shiftedBy=function(v){return x(v,-p,p),this.times("1e"+v)},Y.squareRoot=Y.sqrt=function(){var v,E,A,D,R,$=this,j=$.c,I=$.s,O=$.e,U=te+4,z=new Q("0.5");if(I!==1||!j||!j[0])return new Q(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+qe($)),I==0||I==1/0?(E=T(j),(E.length+O)%2==0&&(E+="0"),I=Math.sqrt(+E),O=y((O+1)/2)-(O<0||O%2),I==1/0?E="5e"+O:(E=I.toExponential(),E=E.slice(0,E.indexOf("e")+1)+O),A=new Q(E)):A=new Q(I+""),A.c[0]){for(O=A.e,I=O+U,I<3&&(I=0);;)if(R=A,A=z.times(R.plus(G($,R,U,1))),T(R.c).slice(0,I)===(E=T(A.c)).slice(0,I))if(A.e<O&&--I,E=E.slice(I-3,I+1),E=="9999"||!D&&E=="4999"){if(!D&&(Fe(R,R.e+te+2,0),R.times(R).eq($))){A=R;break}U+=4,I+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Fe(A,A.e+te+2,1),v=!A.times(A).eq($));break}}return Fe(A,A.e+te+1,q,v)},Y.toExponential=function(v,E){return v!=null&&(x(v,0,h),v++),tt(this,v,E,1)},Y.toFixed=function(v,E){return v!=null&&(x(v,0,h),v=v+this.e+1),tt(this,v,E)},Y.toFormat=function(v,E,A){var D,R=this;if(A==null)v!=null&&E&&typeof E=="object"?(A=E,E=null):v&&typeof v=="object"?(A=v,v=E=null):A=Be;else if(typeof A!="object")throw Error(s+"Argument not an object: "+A);if(D=R.toFixed(v,E),R.c){var $,j=D.split("."),I=+A.groupSize,O=+A.secondaryGroupSize,U=A.groupSeparator||"",z=j[0],V=j[1],ie=R.s<0,ue=ie?z.slice(1):z,De=ue.length;if(O&&($=I,I=O,O=$,De-=$),I>0&&De>0){for($=De%I||I,z=ue.substr(0,$);$<De;$+=I)z+=U+ue.substr($,I);O>0&&(z+=U+ue.slice($)),ie&&(z="-"+z)}D=V?z+(A.decimalSeparator||"")+((O=+A.fractionGroupSize)?V.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(A.fractionGroupSeparator||"")):V):z}return(A.prefix||"")+D+(A.suffix||"")},Y.toFraction=function(v){var E,A,D,R,$,j,I,O,U,z,V,ie,ue=this,De=ue.c;if(v!=null&&(I=new Q(v),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Se)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+qe(I));if(!De)return new Q(ue);for(E=new Q(Se),U=A=new Q(Se),D=O=new Q(Se),ie=T(De),$=E.e=ie.length-ue.e-1,E.c[0]=f[(j=$%l)<0?l+j:j],v=!v||I.comparedTo(E)>0?$>0?E:U:I,j=re,re=1/0,I=new Q(ie),O.c[0]=0;z=G(I,E,0,1),R=A.plus(z.times(D)),R.comparedTo(v)!=1;)A=D,D=R,U=O.plus(z.times(R=U)),O=R,E=I.minus(z.times(R=E)),I=R;return R=G(v.minus(A),D,0,1),O=O.plus(R.times(U)),A=A.plus(R.times(D)),O.s=U.s=ue.s,$=$*2,V=G(U,D,$,q).minus(ue).abs().comparedTo(G(O,A,$,q).minus(ue).abs())<1?[U,D]:[O,A],re=j,V},Y.toNumber=function(){return+qe(this)},Y.toPrecision=function(v,E){return v!=null&&x(v,1,h),tt(this,v,E,2)},Y.toString=function(v){var E,A=this,D=A.s,R=A.e;return R===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(v==null?E=R<=B||R>=J?L(T(A.c),R):X(T(A.c),R,"0"):v===10&&ht?(A=Fe(new Q(A),te+R+1,q),E=X(T(A.c),A.e,"0")):(x(v,2,Ge.length,"Base"),E=Z(X(T(A.c),R,"0"),10,v,D,!0)),D<0&&A.c[0]&&(E="-"+E)),E},Y.valueOf=Y.toJSON=function(){return qe(this)},Y._isBigNumber=!0,W!=null&&Q.set(W),Q}o(g,"clone");function y(W){var G=W|0;return W>0||W===G?G:G-1}o(y,"bitFloor");function T(W){for(var G,Z,ee=1,Y=W.length,Se=W[0]+"";ee<Y;){for(G=W[ee++]+"",Z=l-G.length;Z--;G="0"+G);Se+=G}for(Y=Se.length;Se.charCodeAt(--Y)===48;);return Se.slice(0,Y+1||1)}o(T,"coeffToString");function P(W,G){var Z,ee,Y=W.c,Se=G.c,te=W.s,q=G.s,B=W.e,J=G.e;if(!te||!q)return null;if(Z=Y&&!Y[0],ee=Se&&!Se[0],Z||ee)return Z?ee?0:-q:te;if(te!=q)return te;if(Z=te<0,ee=B==J,!Y||!Se)return ee?0:!Y^Z?1:-1;if(!ee)return B>J^Z?1:-1;for(q=(B=Y.length)<(J=Se.length)?B:J,te=0;te<q;te++)if(Y[te]!=Se[te])return Y[te]>Se[te]^Z?1:-1;return B==J?0:B>J^Z?1:-1}o(P,"compare");function x(W,G,Z,ee){if(W<G||W>Z||W!==i(W))throw Error(s+(ee||"Argument")+(typeof W=="number"?W<G||W>Z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(x,"intCheck");function N(W){var G=W.c.length-1;return y(W.e/l)==G&&W.c[G]%2!=0}o(N,"isOdd");function L(W,G){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(G<0?"e":"e+")+G}o(L,"toExponential");function X(W,G,Z){var ee,Y;if(G<0){for(Y=Z+".";++G;Y+=Z);W=Y+W}else if(ee=W.length,++G>ee){for(Y=Z,G-=ee;--G;Y+=Z);W+=Y}else G<ee&&(W=W.slice(0,G)+"."+W.slice(G));return W}o(X,"toFixedPoint"),e=g(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof _u<"u"&&_u.exports?_u.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(kP)});var UP=k((S9,DP)=>{var NP=Ud(),zP=DP.exports;(function(){"use strict";function t(p){return p<10?"0"+p:p}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(p){return r.lastIndex=0,r.test(p)?'"'+p.replace(r,function(f){var _=s[f];return typeof _=="string"?_:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+p+'"'}o(d,"quote");function l(p,f){var _,h,g,y,T=n,P,x=f[p],N=x!=null&&(x instanceof NP||NP.isBigNumber(x));switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(p)),typeof c=="function"&&(x=c.call(f,p,x)),typeof x){case"string":return N?x:d(x);case"number":return isFinite(x)?String(x):"null";case"boolean":case"null":case"bigint":return String(x);case"object":if(!x)return"null";if(n+=i,P=[],Object.prototype.toString.apply(x)==="[object Array]"){for(y=x.length,_=0;_<y;_+=1)P[_]=l(_,x)||"null";return g=P.length===0?"[]":n?`[
|
|
31
|
+
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>ft(Gb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(LP(),jP))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};Qo.Gaxios=vu;Xo=vu});var st=k(wt=>{"use strict";var A$=wt&&wt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w$=wt&&wt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A$(e,t,r)};Object.defineProperty(wt,"__esModule",{value:!0});wt.instance=wt.Gaxios=wt.GaxiosError=void 0;wt.request=R$;var VP=qP();Object.defineProperty(wt,"Gaxios",{enumerable:!0,get:o(function(){return VP.Gaxios},"get")});var I$=gd();Object.defineProperty(wt,"GaxiosError",{enumerable:!0,get:o(function(){return I$.GaxiosError},"get")});w$(vd(),wt);wt.instance=new VP.Gaxios;async function R$(t){return wt.instance.request(t)}o(R$,"request")});var Fd=k((HP,bu)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,l=14,f=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,h=1e9;function g(Z){var G,Y,ee,K=Q.prototype={constructor:Q,toString:null,valueOf:null},Oe=new Q(1),te=20,V=4,q=-7,J=21,W=-1e7,re=1e7,oe=!1,Ie=1,Ce=0,Be={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ge="0123456789abcdefghijklmnopqrstuvwxyz",ht=!0;function Q(b,E){var A,D,R,$,j,I,C,U,z=this;if(!(z instanceof Q))return new Q(b,E);if(E==null){if(b&&b._isBigNumber===!0){z.s=b.s,!b.c||b.e>re?z.c=z.e=null:b.e<W?z.c=[z.e=0]:(z.e=b.e,z.c=b.c.slice());return}if((I=typeof b=="number")&&b*0==0){if(z.s=1/b<0?(b=-b,-1):1,b===~~b){for($=0,j=b;j>=10;j/=10,$++);$>re?z.c=z.e=null:(z.e=$,z.c=[b]);return}U=String(b)}else{if(!r.test(U=String(b)))return ee(z,U,I);z.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(x(E,2,Ge.length,"Base"),E==10&&ht)return z=new Q(b),Fe(z,te+z.e+1,V);if(U=String(b),I=typeof b=="number"){if(b*0!=0)return ee(z,U,I,E);if(z.s=1/b<0?(U=U.slice(1),-1):1,Q.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+b)}else z.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(A=Ge.slice(0,E),$=j=0,C=U.length;j<C;j++)if(A.indexOf(D=U.charAt(j))<0){if(D=="."){if(j>$){$=C;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return ee(z,String(b),I,E)}I=!1,U=Y(U,E,10,z.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(C=U.length;U.charCodeAt(--C)===48;);if(U=U.slice(j,++C)){if(C-=j,I&&Q.DEBUG&&C>15&&(b>f||b!==i(b)))throw Error(c+z.s*b);if(($=$-j-1)>re)z.c=z.e=null;else if($<W)z.c=[z.e=0];else{if(z.e=$,z.c=[],j=($+1)%l,$<0&&(j+=l),j<C){for(j&&z.c.push(+U.slice(0,j)),C-=l;j<C;)z.c.push(+U.slice(j,j+=l));j=l-(U=U.slice(j)).length}else j-=C;for(;j--;U+="0");z.c.push(+U)}}else z.c=[z.e=0]}o(Q,"BigNumber"),Q.clone=g,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(b){var E,A;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(E="DECIMAL_PLACES")&&(A=b[E],x(A,0,h,E),te=A),b.hasOwnProperty(E="ROUNDING_MODE")&&(A=b[E],x(A,0,8,E),V=A),b.hasOwnProperty(E="EXPONENTIAL_AT")&&(A=b[E],A&&A.pop?(x(A[0],-h,0,E),x(A[1],0,h,E),q=A[0],J=A[1]):(x(A,-h,h,E),q=-(J=A<0?-A:A))),b.hasOwnProperty(E="RANGE"))if(A=b[E],A&&A.pop)x(A[0],-h,-1,E),x(A[1],1,h,E),W=A[0],re=A[1];else if(x(A,-h,h,E),A)W=-(re=A<0?-A:A);else throw Error(s+E+" cannot be zero: "+A);if(b.hasOwnProperty(E="CRYPTO"))if(A=b[E],A===!!A)if(A)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))oe=A;else throw oe=!A,Error(s+"crypto unavailable");else oe=A;else throw Error(s+E+" not true or false: "+A);if(b.hasOwnProperty(E="MODULO_MODE")&&(A=b[E],x(A,0,9,E),Ie=A),b.hasOwnProperty(E="POW_PRECISION")&&(A=b[E],x(A,0,h,E),Ce=A),b.hasOwnProperty(E="FORMAT"))if(A=b[E],typeof A=="object")Be=A;else throw Error(s+E+" not an object: "+A);if(b.hasOwnProperty(E="ALPHABET"))if(A=b[E],typeof A=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(A))ht=A.slice(0,10)=="0123456789",Ge=A;else throw Error(s+E+" invalid: "+A)}else throw Error(s+"Object expected: "+b);return{DECIMAL_PLACES:te,ROUNDING_MODE:V,EXPONENTIAL_AT:[q,J],RANGE:[W,re],CRYPTO:oe,MODULO_MODE:Ie,POW_PRECISION:Ce,FORMAT:Be,ALPHABET:Ge}},Q.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!Q.DEBUG)return!0;var E,A,D=b.c,R=b.e,$=b.s;e:if({}.toString.call(D)=="[object Array]"){if(($===1||$===-1)&&R>=-h&&R<=h&&R===i(R)){if(D[0]===0){if(R===0&&D.length===1)return!0;break e}if(E=(R+1)%l,E<1&&(E+=l),String(D[0]).length==E){for(E=0;E<D.length;E++)if(A=D[E],A<0||A>=d||A!==i(A))break e;if(A!==0)return!0}}}else if(D===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+b)},Q.maximum=Q.max=function(){return it(arguments,-1)},Q.minimum=Q.min=function(){return it(arguments,1)},Q.random=(function(){var b=9007199254740992,E=Math.random()*b&2097151?function(){return i(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(A){var D,R,$,j,I,C=0,U=[],z=new Q(Oe);if(A==null?A=te:x(A,0,h),j=n(A/l),oe)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(j*=2));C<j;)I=D[C]*131072+(D[C+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),D[C]=R[0],D[C+1]=R[1]):(U.push(I%1e14),C+=2);C=j/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(j*=7);C<j;)I=(D[C]&31)*281474976710656+D[C+1]*1099511627776+D[C+2]*4294967296+D[C+3]*16777216+(D[C+4]<<16)+(D[C+5]<<8)+D[C+6],I>=9e15?crypto.randomBytes(7).copy(D,C):(U.push(I%1e14),C+=7);C=j/7}else throw oe=!1,Error(s+"crypto unavailable");if(!oe)for(;C<j;)I=E(),I<9e15&&(U[C++]=I%1e14);for(j=U[--C],A%=l,j&&A&&(I=p[l-A],U[C]=i(j/I)*I);U[C]===0;U.pop(),C--);if(C<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=l);for(C=1,I=U[0];I>=10;I/=10,C++);C<l&&($-=l-C)}return z.e=$,z.c=U,z}})(),Q.sum=function(){for(var b=1,E=arguments,A=new Q(E[0]);b<E.length;)A=A.plus(E[b++]);return A},Y=(function(){var b="0123456789";function E(A,D,R,$){for(var j,I=[0],C,U=0,z=A.length;U<z;){for(C=I.length;C--;I[C]*=D);for(I[0]+=$.indexOf(A.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(E,"toBaseOut"),function(A,D,R,$,j){var I,C,U,z,H,ie,ue,Ue,Je=A.indexOf("."),Ye=te,De=V;for(Je>=0&&(z=Ce,Ce=0,A=A.replace(".",""),Ue=new Q(D),ie=Ue.pow(A.length-Je),Ce=z,Ue.c=E(X(T(ie.c),ie.e,"0"),10,R,b),Ue.e=Ue.c.length),ue=E(A,D,R,j?(I=Ge,b):(I=b,Ge)),U=z=ue.length;ue[--z]==0;ue.pop());if(!ue[0])return I.charAt(0);if(Je<0?--U:(ie.c=ue,ie.e=U,ie.s=$,ie=G(ie,Ue,Ye,De,R),ue=ie.c,H=ie.r,U=ie.e),C=U+Ye+1,Je=ue[C],z=R/2,H=H||C<0||ue[C+1]!=null,H=De<4?(Je!=null||H)&&(De==0||De==(ie.s<0?3:2)):Je>z||Je==z&&(De==4||H||De==6&&ue[C-1]&1||De==(ie.s<0?8:7)),C<1||!ue[0])A=H?X(I.charAt(1),-Ye,I.charAt(0)):I.charAt(0);else{if(ue.length=C,H)for(--R;++ue[--C]>R;)ue[C]=0,C||(++U,ue=[1].concat(ue));for(z=ue.length;!ue[--z];);for(Je=0,A="";Je<=z;A+=I.charAt(ue[Je++]));A=X(A,U,I.charAt(0))}return A}})(),G=(function(){function b(D,R,$){var j,I,C,U,z=0,H=D.length,ie=R%_,ue=R/_|0;for(D=D.slice();H--;)C=D[H]%_,U=D[H]/_|0,j=ue*C+U*ie,I=ie*C+j%_*_+z,z=(I/$|0)+(j/_|0)+ue*U,D[H]=I%$;return z&&(D=[z].concat(D)),D}o(b,"multiply");function E(D,R,$,j){var I,C;if($!=j)C=$>j?1:-1;else for(I=C=0;I<$;I++)if(D[I]!=R[I]){C=D[I]>R[I]?1:-1;break}return C}o(E,"compare");function A(D,R,$,j){for(var I=0;$--;)D[$]-=I,I=D[$]<R[$]?1:0,D[$]=I*j+D[$]-R[$];for(;!D[0]&&D.length>1;D.splice(0,1));}return o(A,"subtract"),function(D,R,$,j,I){var C,U,z,H,ie,ue,Ue,Je,Ye,De,Le,dt,yo,_o,vo,zt,qr,St=D.s==R.s?1:-1,pt=D.c,Ve=R.c;if(!pt||!pt[0]||!Ve||!Ve[0])return new Q(!D.s||!R.s||(pt?Ve&&pt[0]==Ve[0]:!Ve)?NaN:pt&&pt[0]==0||!Ve?St*0:St/0);for(Je=new Q(St),Ye=Je.c=[],U=D.e-R.e,St=$+U+1,I||(I=d,U=y(D.e/l)-y(R.e/l),St=St/l|0),z=0;Ve[z]==(pt[z]||0);z++);if(Ve[z]>(pt[z]||0)&&U--,St<0)Ye.push(1),H=!0;else{for(_o=pt.length,zt=Ve.length,z=0,St+=2,ie=i(I/(Ve[0]+1)),ie>1&&(Ve=b(Ve,ie,I),pt=b(pt,ie,I),zt=Ve.length,_o=pt.length),yo=zt,De=pt.slice(0,zt),Le=De.length;Le<zt;De[Le++]=0);qr=Ve.slice(),qr=[0].concat(qr),vo=Ve[0],Ve[1]>=I/2&&vo++;do{if(ie=0,C=E(Ve,De,zt,Le),C<0){if(dt=De[0],zt!=Le&&(dt=dt*I+(De[1]||0)),ie=i(dt/vo),ie>1)for(ie>=I&&(ie=I-1),ue=b(Ve,ie,I),Ue=ue.length,Le=De.length;E(ue,De,Ue,Le)==1;)ie--,A(ue,zt<Ue?qr:Ve,Ue,I),Ue=ue.length,C=1;else ie==0&&(C=ie=1),ue=Ve.slice(),Ue=ue.length;if(Ue<Le&&(ue=[0].concat(ue)),A(De,ue,Le,I),Le=De.length,C==-1)for(;E(Ve,De,zt,Le)<1;)ie++,A(De,zt<Le?qr:Ve,Le,I),Le=De.length}else C===0&&(ie++,De=[0]);Ye[z++]=ie,De[0]?De[Le++]=pt[yo]||0:(De=[pt[yo]],Le=1)}while((yo++<_o||De[0]!=null)&&St--);H=De[0]!=null,Ye[0]||Ye.splice(0,1)}if(I==d){for(z=1,St=Ye[0];St>=10;St/=10,z++);Fe(Je,$+(Je.e=z+U*l-1)+1,j,H)}else Je.e=U,Je.r=+H;return Je}})();function rt(b,E,A,D){var R,$,j,I,C;if(A==null?A=V:x(A,0,8),!b.c)return b.toString();if(R=b.c[0],j=b.e,E==null)C=T(b.c),C=D==1||D==2&&(j<=q||j>=J)?F(C,j):X(C,j,"0");else if(b=Fe(new Q(b),E,A),$=b.e,C=T(b.c),I=C.length,D==1||D==2&&(E<=$||$<=q)){for(;I<E;C+="0",I++);C=F(C,$)}else if(E-=j+(D===2&&$>j),C=X(C,$,"0"),$+1>I){if(--E>0)for(C+=".";E--;C+="0");}else if(E+=$-I,E>0)for($+1==I&&(C+=".");E--;C+="0");return b.s<0&&R?"-"+C:C}o(rt,"format");function it(b,E){for(var A,D,R=1,$=new Q(b[0]);R<b.length;R++)D=new Q(b[R]),(!D.s||(A=P($,D))===E||A===0&&$.s===E)&&($=D);return $}o(it,"maxOrMin");function Nt(b,E,A){for(var D=1,R=E.length;!E[--R];E.pop());for(R=E[0];R>=10;R/=10,D++);return(A=D+A*l-1)>re?b.c=b.e=null:A<W?b.c=[b.e=0]:(b.e=A,b.c=E),b}o(Nt,"normalise"),ee=(function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,A=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,C){var U,z=I?j:j.replace(R,"");if(D.test(z))$.s=isNaN(z)?null:z<0?-1:1;else{if(!I&&(z=z.replace(b,function(H,ie,ue){return U=(ue=ue.toLowerCase())=="x"?16:ue=="b"?2:8,!C||C==U?ie:H}),C&&(U=C,z=z.replace(E,"$1").replace(A,"0.$1")),j!=z))return new Q(z,U);if(Q.DEBUG)throw Error(s+"Not a"+(C?" base "+C:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function Fe(b,E,A,D){var R,$,j,I,C,U,z,H=b.c,ie=p;if(H){e:{for(R=1,I=H[0];I>=10;I/=10,R++);if($=E-R,$<0)$+=l,j=E,C=H[U=0],z=i(C/ie[R-j-1]%10);else if(U=n(($+1)/l),U>=H.length)if(D){for(;H.length<=U;H.push(0));C=z=0,R=1,$%=l,j=$-l+1}else break e;else{for(C=I=H[U],R=1;I>=10;I/=10,R++);$%=l,j=$-l+R,z=j<0?0:i(C/ie[R-j-1]%10)}if(D=D||E<0||H[U+1]!=null||(j<0?C:C%ie[R-j-1]),D=A<4?(z||D)&&(A==0||A==(b.s<0?3:2)):z>5||z==5&&(A==4||D||A==6&&($>0?j>0?C/ie[R-j]:0:H[U-1])%10&1||A==(b.s<0?8:7)),E<1||!H[0])return H.length=0,D?(E-=b.e+1,H[0]=ie[(l-E%l)%l],b.e=-E||0):H[0]=b.e=0,b;if($==0?(H.length=U,I=1,U--):(H.length=U+1,I=ie[l-$],H[U]=j>0?i(C/ie[R-j]%ie[j])*I:0),D)for(;;)if(U==0){for($=1,j=H[0];j>=10;j/=10,$++);for(j=H[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(b.e++,H[0]==d&&(H[0]=1));break}else{if(H[U]+=I,H[U]!=d)break;H[U--]=0,I=1}for($=H.length;H[--$]===0;H.pop());}b.e>re?b.c=b.e=null:b.e<W&&(b.c=[b.e=0])}return b}o(Fe,"round");function qe(b){var E,A=b.e;return A===null?b.toString():(E=T(b.c),E=A<=q||A>=J?F(E,A):X(E,A,"0"),b.s<0?"-"+E:E)}return o(qe,"valueOf"),K.absoluteValue=K.abs=function(){var b=new Q(this);return b.s<0&&(b.s=1),b},K.comparedTo=function(b,E){return P(this,new Q(b,E))},K.decimalPlaces=K.dp=function(b,E){var A,D,R,$=this;if(b!=null)return x(b,0,h),E==null?E=V:x(E,0,8),Fe(new Q($),b+$.e+1,E);if(!(A=$.c))return null;if(D=((R=A.length-1)-y(this.e/l))*l,R=A[R])for(;R%10==0;R/=10,D--);return D<0&&(D=0),D},K.dividedBy=K.div=function(b,E){return G(this,new Q(b,E),te,V)},K.dividedToIntegerBy=K.idiv=function(b,E){return G(this,new Q(b,E),0,1)},K.exponentiatedBy=K.pow=function(b,E){var A,D,R,$,j,I,C,U,z,H=this;if(b=new Q(b),b.c&&!b.isInteger())throw Error(s+"Exponent not an integer: "+qe(b));if(E!=null&&(E=new Q(E)),I=b.e>14,!H.c||!H.c[0]||H.c[0]==1&&!H.e&&H.c.length==1||!b.c||!b.c[0])return z=new Q(Math.pow(+qe(H),I?b.s*(2-N(b)):+qe(b))),E?z.mod(E):z;if(C=b.s<0,E){if(E.c?!E.c[0]:!E.s)return new Q(NaN);D=!C&&H.isInteger()&&E.isInteger(),D&&(H=H.mod(E))}else{if(b.e>9&&(H.e>0||H.e<-1||(H.e==0?H.c[0]>1||I&&H.c[1]>=24e7:H.c[0]<8e13||I&&H.c[0]<=9999975e7)))return $=H.s<0&&N(b)?-0:0,H.e>-1&&($=1/$),new Q(C?1/$:$);Ce&&($=n(Ce/l+2))}for(I?(A=new Q(.5),C&&(b.s=1),U=N(b)):(R=Math.abs(+qe(b)),U=R%2),z=new Q(Oe);;){if(U){if(z=z.times(H),!z.c)break;$?z.c.length>$&&(z.c.length=$):D&&(z=z.mod(E))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(b=b.times(A),Fe(b,b.e+1,1),b.e>14)U=N(b);else{if(R=+qe(b),R===0)break;U=R%2}H=H.times(H),$?H.c&&H.c.length>$&&(H.c.length=$):D&&(H=H.mod(E))}return D?z:(C&&(z=Oe.div(z)),E?z.mod(E):$?Fe(z,Ce,V,j):z)},K.integerValue=function(b){var E=new Q(this);return b==null?b=V:x(b,0,8),Fe(E,E.e+1,b)},K.isEqualTo=K.eq=function(b,E){return P(this,new Q(b,E))===0},K.isFinite=function(){return!!this.c},K.isGreaterThan=K.gt=function(b,E){return P(this,new Q(b,E))>0},K.isGreaterThanOrEqualTo=K.gte=function(b,E){return(E=P(this,new Q(b,E)))===1||E===0},K.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},K.isLessThan=K.lt=function(b,E){return P(this,new Q(b,E))<0},K.isLessThanOrEqualTo=K.lte=function(b,E){return(E=P(this,new Q(b,E)))===-1||E===0},K.isNaN=function(){return!this.s},K.isNegative=function(){return this.s<0},K.isPositive=function(){return this.s>0},K.isZero=function(){return!!this.c&&this.c[0]==0},K.minus=function(b,E){var A,D,R,$,j=this,I=j.s;if(b=new Q(b,E),E=b.s,!I||!E)return new Q(NaN);if(I!=E)return b.s=-E,j.plus(b);var C=j.e/l,U=b.e/l,z=j.c,H=b.c;if(!C||!U){if(!z||!H)return z?(b.s=-E,b):new Q(H?j:NaN);if(!z[0]||!H[0])return H[0]?(b.s=-E,b):new Q(z[0]?j:V==3?-0:0)}if(C=y(C),U=y(U),z=z.slice(),I=C-U){for(($=I<0)?(I=-I,R=z):(U=C,R=H),R.reverse(),E=I;E--;R.push(0));R.reverse()}else for(D=($=(I=z.length)<(E=H.length))?I:E,I=E=0;E<D;E++)if(z[E]!=H[E]){$=z[E]<H[E];break}if($&&(R=z,z=H,H=R,b.s=-b.s),E=(D=H.length)-(A=z.length),E>0)for(;E--;z[A++]=0);for(E=d-1;D>I;){if(z[--D]<H[D]){for(A=D;A&&!z[--A];z[A]=E);--z[A],z[D]+=d}z[D]-=H[D]}for(;z[0]==0;z.splice(0,1),--U);return z[0]?Nt(b,z,U):(b.s=V==3?-1:1,b.c=[b.e=0],b)},K.modulo=K.mod=function(b,E){var A,D,R=this;return b=new Q(b,E),!R.c||!b.s||b.c&&!b.c[0]?new Q(NaN):!b.c||R.c&&!R.c[0]?new Q(R):(Ie==9?(D=b.s,b.s=1,A=G(R,b,0,3),b.s=D,A.s*=D):A=G(R,b,0,Ie),b=R.minus(A.times(b)),!b.c[0]&&Ie==1&&(b.s=R.s),b)},K.multipliedBy=K.times=function(b,E){var A,D,R,$,j,I,C,U,z,H,ie,ue,Ue,Je,Ye,De=this,Le=De.c,dt=(b=new Q(b,E)).c;if(!Le||!dt||!Le[0]||!dt[0])return!De.s||!b.s||Le&&!Le[0]&&!dt||dt&&!dt[0]&&!Le?b.c=b.e=b.s=null:(b.s*=De.s,!Le||!dt?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(D=y(De.e/l)+y(b.e/l),b.s*=De.s,C=Le.length,H=dt.length,C<H&&(Ue=Le,Le=dt,dt=Ue,R=C,C=H,H=R),R=C+H,Ue=[];R--;Ue.push(0));for(Je=d,Ye=_,R=H;--R>=0;){for(A=0,ie=dt[R]%Ye,ue=dt[R]/Ye|0,j=C,$=R+j;$>R;)U=Le[--j]%Ye,z=Le[j]/Ye|0,I=ue*U+z*ie,U=ie*U+I%Ye*Ye+Ue[$]+A,A=(U/Je|0)+(I/Ye|0)+ue*z,Ue[$--]=U%Je;Ue[$]=A}return A?++D:Ue.splice(0,1),Nt(b,Ue,D)},K.negated=function(){var b=new Q(this);return b.s=-b.s||null,b},K.plus=function(b,E){var A,D=this,R=D.s;if(b=new Q(b,E),E=b.s,!R||!E)return new Q(NaN);if(R!=E)return b.s=-E,D.minus(b);var $=D.e/l,j=b.e/l,I=D.c,C=b.c;if(!$||!j){if(!I||!C)return new Q(R/0);if(!I[0]||!C[0])return C[0]?b:new Q(I[0]?D:R*0)}if($=y($),j=y(j),I=I.slice(),R=$-j){for(R>0?(j=$,A=C):(R=-R,A=I),A.reverse();R--;A.push(0));A.reverse()}for(R=I.length,E=C.length,R-E<0&&(A=C,C=I,I=A,E=R),R=0;E;)R=(I[--E]=I[E]+C[E]+R)/d|0,I[E]=d===I[E]?0:I[E]%d;return R&&(I=[R].concat(I),++j),Nt(b,I,j)},K.precision=K.sd=function(b,E){var A,D,R,$=this;if(b!=null&&b!==!!b)return x(b,1,h),E==null?E=V:x(E,0,8),Fe(new Q($),b,E);if(!(A=$.c))return null;if(R=A.length-1,D=R*l+1,R=A[R]){for(;R%10==0;R/=10,D--);for(R=A[0];R>=10;R/=10,D++);}return b&&$.e+1>D&&(D=$.e+1),D},K.shiftedBy=function(b){return x(b,-f,f),this.times("1e"+b)},K.squareRoot=K.sqrt=function(){var b,E,A,D,R,$=this,j=$.c,I=$.s,C=$.e,U=te+4,z=new Q("0.5");if(I!==1||!j||!j[0])return new Q(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+qe($)),I==0||I==1/0?(E=T(j),(E.length+C)%2==0&&(E+="0"),I=Math.sqrt(+E),C=y((C+1)/2)-(C<0||C%2),I==1/0?E="5e"+C:(E=I.toExponential(),E=E.slice(0,E.indexOf("e")+1)+C),A=new Q(E)):A=new Q(I+""),A.c[0]){for(C=A.e,I=C+U,I<3&&(I=0);;)if(R=A,A=z.times(R.plus(G($,R,U,1))),T(R.c).slice(0,I)===(E=T(A.c)).slice(0,I))if(A.e<C&&--I,E=E.slice(I-3,I+1),E=="9999"||!D&&E=="4999"){if(!D&&(Fe(R,R.e+te+2,0),R.times(R).eq($))){A=R;break}U+=4,I+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Fe(A,A.e+te+2,1),b=!A.times(A).eq($));break}}return Fe(A,A.e+te+1,V,b)},K.toExponential=function(b,E){return b!=null&&(x(b,0,h),b++),rt(this,b,E,1)},K.toFixed=function(b,E){return b!=null&&(x(b,0,h),b=b+this.e+1),rt(this,b,E)},K.toFormat=function(b,E,A){var D,R=this;if(A==null)b!=null&&E&&typeof E=="object"?(A=E,E=null):b&&typeof b=="object"?(A=b,b=E=null):A=Be;else if(typeof A!="object")throw Error(s+"Argument not an object: "+A);if(D=R.toFixed(b,E),R.c){var $,j=D.split("."),I=+A.groupSize,C=+A.secondaryGroupSize,U=A.groupSeparator||"",z=j[0],H=j[1],ie=R.s<0,ue=ie?z.slice(1):z,Ue=ue.length;if(C&&($=I,I=C,C=$,Ue-=$),I>0&&Ue>0){for($=Ue%I||I,z=ue.substr(0,$);$<Ue;$+=I)z+=U+ue.substr($,I);C>0&&(z+=U+ue.slice($)),ie&&(z="-"+z)}D=H?z+(A.decimalSeparator||"")+((C=+A.fractionGroupSize)?H.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(A.fractionGroupSeparator||"")):H):z}return(A.prefix||"")+D+(A.suffix||"")},K.toFraction=function(b){var E,A,D,R,$,j,I,C,U,z,H,ie,ue=this,Ue=ue.c;if(b!=null&&(I=new Q(b),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Oe)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+qe(I));if(!Ue)return new Q(ue);for(E=new Q(Oe),U=A=new Q(Oe),D=C=new Q(Oe),ie=T(Ue),$=E.e=ie.length-ue.e-1,E.c[0]=p[(j=$%l)<0?l+j:j],b=!b||I.comparedTo(E)>0?$>0?E:U:I,j=re,re=1/0,I=new Q(ie),C.c[0]=0;z=G(I,E,0,1),R=A.plus(z.times(D)),R.comparedTo(b)!=1;)A=D,D=R,U=C.plus(z.times(R=U)),C=R,E=I.minus(z.times(R=E)),I=R;return R=G(b.minus(A),D,0,1),C=C.plus(R.times(U)),A=A.plus(R.times(D)),C.s=U.s=ue.s,$=$*2,H=G(U,D,$,V).minus(ue).abs().comparedTo(G(C,A,$,V).minus(ue).abs())<1?[U,D]:[C,A],re=j,H},K.toNumber=function(){return+qe(this)},K.toPrecision=function(b,E){return b!=null&&x(b,1,h),rt(this,b,E,2)},K.toString=function(b){var E,A=this,D=A.s,R=A.e;return R===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(b==null?E=R<=q||R>=J?F(T(A.c),R):X(T(A.c),R,"0"):b===10&&ht?(A=Fe(new Q(A),te+R+1,V),E=X(T(A.c),A.e,"0")):(x(b,2,Ge.length,"Base"),E=Y(X(T(A.c),R,"0"),10,b,D,!0)),D<0&&A.c[0]&&(E="-"+E)),E},K.valueOf=K.toJSON=function(){return qe(this)},K._isBigNumber=!0,Z!=null&&Q.set(Z),Q}o(g,"clone");function y(Z){var G=Z|0;return Z>0||Z===G?G:G-1}o(y,"bitFloor");function T(Z){for(var G,Y,ee=1,K=Z.length,Oe=Z[0]+"";ee<K;){for(G=Z[ee++]+"",Y=l-G.length;Y--;G="0"+G);Oe+=G}for(K=Oe.length;Oe.charCodeAt(--K)===48;);return Oe.slice(0,K+1||1)}o(T,"coeffToString");function P(Z,G){var Y,ee,K=Z.c,Oe=G.c,te=Z.s,V=G.s,q=Z.e,J=G.e;if(!te||!V)return null;if(Y=K&&!K[0],ee=Oe&&!Oe[0],Y||ee)return Y?ee?0:-V:te;if(te!=V)return te;if(Y=te<0,ee=q==J,!K||!Oe)return ee?0:!K^Y?1:-1;if(!ee)return q>J^Y?1:-1;for(V=(q=K.length)<(J=Oe.length)?q:J,te=0;te<V;te++)if(K[te]!=Oe[te])return K[te]>Oe[te]^Y?1:-1;return q==J?0:q>J^Y?1:-1}o(P,"compare");function x(Z,G,Y,ee){if(Z<G||Z>Y||Z!==i(Z))throw Error(s+(ee||"Argument")+(typeof Z=="number"?Z<G||Z>Y?" out of range: ":" not an integer: ":" not a primitive number: ")+String(Z))}o(x,"intCheck");function N(Z){var G=Z.c.length-1;return y(Z.e/l)==G&&Z.c[G]%2!=0}o(N,"isOdd");function F(Z,G){return(Z.length>1?Z.charAt(0)+"."+Z.slice(1):Z)+(G<0?"e":"e+")+G}o(F,"toExponential");function X(Z,G,Y){var ee,K;if(G<0){for(K=Y+".";++G;K+=Y);Z=K+Z}else if(ee=Z.length,++G>ee){for(K=Y,G-=ee;--G;K+=Y);Z+=K}else G<ee&&(Z=Z.slice(0,G)+"."+Z.slice(G));return Z}o(X,"toFixedPoint"),e=g(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof bu<"u"&&bu.exports?bu.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(HP)});var KP=k((aY,ZP)=>{var GP=Fd(),WP=ZP.exports;(function(){"use strict";function t(f){return f<10?"0"+f:f}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(f){return r.lastIndex=0,r.test(f)?'"'+f.replace(r,function(p){var _=s[p];return typeof _=="string"?_:"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}o(d,"quote");function l(f,p){var _,h,g,y,T=n,P,x=p[f],N=x!=null&&(x instanceof GP||GP.isBigNumber(x));switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(f)),typeof c=="function"&&(x=c.call(p,f,x)),typeof x){case"string":return N?x:d(x);case"number":return isFinite(x)?String(x):"null";case"boolean":case"null":case"bigint":return String(x);case"object":if(!x)return"null";if(n+=i,P=[],Object.prototype.toString.apply(x)==="[object Array]"){for(y=x.length,_=0;_<y;_+=1)P[_]=l(_,x)||"null";return g=P.length===0?"[]":n?`[
|
|
32
32
|
`+n+P.join(`,
|
|
33
33
|
`+n)+`
|
|
34
|
-
`+T+"]":"["+P.join(",")+"]",n=T,g}if(c&&typeof c=="object")for(y=c.length,_=0;_<y;_+=1)typeof c[_]=="string"&&(h=c[_],g=l(h,x),g&&P.push(d(h)+(n?": ":":")+g));else Object.keys(x).forEach(function(
|
|
34
|
+
`+T+"]":"["+P.join(",")+"]",n=T,g}if(c&&typeof c=="object")for(y=c.length,_=0;_<y;_+=1)typeof c[_]=="string"&&(h=c[_],g=l(h,x),g&&P.push(d(h)+(n?": ":":")+g));else Object.keys(x).forEach(function(F){var X=l(F,x);X&&P.push(d(F)+(n?": ":":")+X)});return g=P.length===0?"{}":n?`{
|
|
35
35
|
`+n+P.join(`,
|
|
36
36
|
`+n)+`
|
|
37
|
-
`+T+"}":"{"+P.join(",")+"}",n=T,g}}o(l,"str"),typeof
|
|
38
|
-
`,r:"\r",t:" "},s,c=o(function(T){throw{name:"SyntaxError",message:T,at:r,text:s}},"error"),d=o(function(T){return T&&T!==n&&c("Expected '"+T+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),l=o(function(){var T,P="";for(n==="-"&&(P="-",d("-"));n>="0"&&n<="9";)P+=n,d();if(n===".")for(P+=".";d()&&n>="0"&&n<="9";)P+=n;if(n==="e"||n==="E")for(P+=n,d(),(n==="-"||n==="+")&&(P+=n,d());n>="0"&&n<="9";)P+=n,d();if(T=+P,!isFinite(T))c("Bad number");else return vu==null&&(vu=Ud()),P.length>15?e.storeAsString?P:e.useNativeBigInt?BigInt(P):new vu(P):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(T):new vu(T):T},"number"),p=o(function(){var T,P,x="",N;if(n==='"')for(var L=r;d();){if(n==='"')return r-1>L&&(x+=s.substring(L,r-1)),d(),x;if(n==="\\"){if(r-1>L&&(x+=s.substring(L,r-1)),d(),n==="u"){for(N=0,P=0;P<4&&(T=parseInt(d(),16),!!isFinite(T));P+=1)N=N*16+T;x+=String.fromCharCode(N)}else if(typeof i[n]=="string")x+=i[n];else break;L=r}}c("Bad string")},"string"),f=o(function(){for(;n&&n<=" ";)d()},"white"),_=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),h,g=o(function(){var T=[];if(n==="["){if(d("["),f(),n==="]")return d("]"),T;for(;n;){if(T.push(h()),f(),n==="]")return d("]"),T;d(","),f()}}c("Bad array")},"array"),y=o(function(){var T,P=Object.create(null);if(n==="{"){if(d("{"),f(),n==="}")return d("}"),P;for(;n;){if(T=p(),f(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(P,T)&&c('Duplicate key "'+T+'"'),l$.test(T)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?h():P[T]=h():d$.test(T)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?h():P[T]=h():P[T]=h(),f(),n==="}")return d("}"),P;d(","),f()}}c("Bad object")},"object");return h=o(function(){switch(f(),n){case"{":return y();case"[":return g();case'"':return p();case"-":return l();default:return n>="0"&&n<="9"?l():_()}},"value"),function(T,P){var x;return s=T+"",r=0,n=" ",x=h(),f(),n&&c("Syntax error"),typeof P=="function"?o((function N(L,X){var W,G,Z=L[X];return Z&&typeof Z=="object"&&Object.keys(Z).forEach(function(ee){G=N(Z,ee),G!==void 0?Z[ee]=G:delete Z[ee]}),P.call(L,X,Z)}),"walk")({"":x},""):x}},"json_parse");MP.exports=p$});var BP=k((A9,bu)=>{var LP=UP().stringify,FP=jP();bu.exports=function(t){return{parse:FP(t),stringify:LP}};bu.exports.parse=FP();bu.exports.stringify=LP});var Md=k(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.GCE_LINUX_BIOS_PATHS=void 0;yr.isGoogleCloudServerless=HP;yr.isGoogleComputeEngineLinux=GP;yr.isGoogleComputeEngineMACAddress=WP;yr.isGoogleComputeEngine=ZP;yr.detectGCPResidency=m$;var qP=require("fs"),VP=require("os");yr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var f$=/^42:01/;function HP(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(HP,"isGoogleCloudServerless");function GP(){if((0,VP.platform)()!=="linux")return!1;try{(0,qP.statSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,qP.readFileSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(GP,"isGoogleComputeEngineLinux");function WP(){let t=(0,VP.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(f$.test(r))return!0}return!1}o(WP,"isGoogleComputeEngineMACAddress");function ZP(){return GP()||WP()}o(ZP,"isGoogleComputeEngine");function m$(){return HP()||ZP()}o(m$,"detectGCPResidency")});var KP=k(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.Colours=void 0;var Et=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Pu.Colours=Et;Et.enabled=!1;Et.reset="";Et.bright="";Et.dim="";Et.red="";Et.green="";Et.yellow="";Et.blue="";Et.magenta="";Et.cyan="";Et.white="";Et.grey="";Et.refresh()});var QP=k(He=>{"use strict";var h$=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g$=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JP=He&&He.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&h$(r,e,n[i]);return g$(r,e),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.env=He.DebugLogBackendBase=He.placeholder=He.AdhocDebugLogger=He.LogSeverity=void 0;He.getNodeBackend=Ld;He.getDebugBackend=_$;He.getStructuredBackend=v$;He.setBackend=b$;He.log=XP;var y$=require("events"),pa=JP(require("process")),YP=JP(require("util")),qt=KP(),_r;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(_r||(He.LogSeverity=_r={}));var fa=class extends y$.EventEmitter{static{o(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:o((n,i)=>this.on(n,i),"on")}),this.func.debug=(...n)=>this.invokeSeverity(_r.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(_r.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(_r.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(_r.ERROR,...n),this.func.sublog=n=>XP(n,this.func)}invoke(e,...r){if(this.upstream)try{this.upstream(e,...r)}catch{}try{this.emit("log",e,r)}catch{}}invokeSeverity(e,...r){this.invoke({severity:e},...r)}};He.AdhocDebugLogger=fa;He.placeholder=new fa("",()=>{}).func;var Qo=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=pa.env[He.env.nodeEnables])!==null&&e!==void 0?e:"*";r==="all"&&(r="*"),this.filters=r.split(",")}log(e,r,...n){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(r,...n)}catch(i){console.error(i)}}};He.DebugLogBackendBase=Qo;var jd=class extends Qo{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${qt.Colours.green}${e}${qt.Colours.reset}`,c=`${qt.Colours.yellow}${pa.pid}${qt.Colours.reset}`,d;switch(r.severity){case _r.ERROR:d=`${qt.Colours.red}${r.severity}${qt.Colours.reset}`;break;case _r.INFO:d=`${qt.Colours.magenta}${r.severity}${qt.Colours.reset}`;break;case _r.WARNING:d=`${qt.Colours.yellow}${r.severity}${qt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:_r.DEFAULT;break}let l=YP.formatWithOptions({colors:qt.Colours.enabled},...n),p=Object.assign({},r);delete p.severity;let f=Object.getOwnPropertyNames(p).length?JSON.stringify(p):"",_=f?`${qt.Colours.grey}${f}${qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,l,f?` ${_}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Ld(){return new jd}o(Ld,"getNodeBackend");var Fd=class extends Qo{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=pa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";pa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function _$(t){return new Fd(t)}o(_$,"getDebugBackend");var Bd=class extends Qo{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:_r.INFO,l=Object.assign({severity:d,message:YP.format(...s)},i),p=JSON.stringify(l);n?n(i,p):console.log("%s",p)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function v$(t){return new Bd(t)}o(v$,"getStructuredBackend");He.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var qd=new Map,Vt;function b$(t){Vt=t,qd.clear()}o(b$,"setBackend");function XP(t,e){if(!Vt&&!pa.env[He.env.nodeEnables]||!t)return He.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=qd.get(t);if(r)return r.func;if(Vt===null)return He.placeholder;Vt===void 0&&(Vt=Ld());let n=(()=>{let i;return new fa(t,(c,...d)=>{if(i!==Vt){if(Vt===null)return;Vt===void 0&&(Vt=Ld()),i=Vt}Vt?.log(t,c,...d)})})();return qd.set(t,n),n.func}o(XP,"log")});var Vd=k(uo=>{"use strict";var P$=uo&&uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S$=uo&&uo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P$(e,t,r)};Object.defineProperty(uo,"__esModule",{value:!0});S$(QP(),uo)});var ha=k(fe=>{"use strict";var tS=fe&&fe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E$=fe&&fe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T$=fe&&fe.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&tS(r,e,n[i]);return E$(r,e),r}})(),x$=fe&&fe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tS(e,t,r)};Object.defineProperty(fe,"__esModule",{value:!0});fe.gcpResidencyCache=fe.METADATA_SERVER_DETECTION=fe.HEADERS=fe.HEADER_VALUE=fe.HEADER_NAME=fe.SECONDARY_HOST_ADDRESS=fe.HOST_ADDRESS=fe.BASE_PATH=void 0;fe.instance=C$;fe.project=$$;fe.universe=k$;fe.bulk=N$;fe.isAvailable=D$;fe.resetIsAvailableCache=U$;fe.getGCPResidency=Wd;fe.setGCPResidency=rS;fe.requestTimeout=nS;var Hd=st(),A$=BP(),w$=Md(),I$=T$(Vd());fe.BASE_PATH="/computeMetadata/v1";fe.HOST_ADDRESS="http://169.254.169.254";fe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";fe.HEADER_NAME="Metadata-Flavor";fe.HEADER_VALUE="Google";fe.HEADERS=Object.freeze({[fe.HEADER_NAME]:fe.HEADER_VALUE});var eS=I$.log("gcp-metadata");fe.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function Gd(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||fe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(fe.BASE_PATH,t).href}o(Gd,"getBaseUrl");function R$(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}o(R$,"validate");async function ma(t,e={},r=3,n=!1){let i=new Headers(fe.HEADERS),s="",c={};if(typeof t=="object"){let _=t;new Headers(_.headers).forEach((h,g)=>i.set(g,h)),s=_.metadataKey,c=_.params||c,r=_.noResponseRetries||r,n=_.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(R$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((_,h)=>i.set(h,_)),c=e.params||c);let d=n?O$:Hd.request,l={url:`${Gd()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:nS()};eS.info("instance request %j",l);let p=await d(l);eS.info("instance metadata is %s",p.data);let f=p.headers.get(fe.HEADER_NAME);if(f!==fe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${fe.HEADER_NAME} header. Expected '${fe.HEADER_VALUE}', got ${f?`'${f}'`:"no header"}`);if(typeof p.data=="string")try{return A$.parse(p.data)}catch{}return p.data}o(ma,"metadataAccessor");async function O$(t){let e={...t,url:t.url?.toString().replace(Gd(),Gd(fe.SECONDARY_HOST_ADDRESS))},r=(0,Hd.request)(t),n=(0,Hd.request)(e);return Promise.any([r,n])}o(O$,"fastFailMetadataRequest");function C$(t){return ma("instance",t)}o(C$,"instance");function $$(t){return ma("project",t)}o($$,"project");function k$(t){return ma("universe",t)}o(k$,"universe");async function N$(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ma(r),i=r.metadataKey;e[i]=n})())),e}o(N$,"bulk");function z$(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(z$,"detectGCPAvailableRetries");var Su;async function D$(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in fe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(fe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return Wd();case"ping-only":}}try{return Su===void 0&&(Su=ma("instance",void 0,z$(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Su,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(D$,"isAvailable");function U$(){Su=void 0}o(U$,"resetIsAvailableCache");fe.gcpResidencyCache=null;function Wd(){return fe.gcpResidencyCache===null&&rS(),fe.gcpResidencyCache}o(Wd,"getGCPResidency");function rS(t=null){fe.gcpResidencyCache=t!==null?t:(0,w$.detectGCPResidency)()}o(rS,"setGCPResidency");function nS(){return Wd()?0:3e3}o(nS,"requestTimeout");x$(Md(),fe)});var aS=k(Eu=>{"use strict";Eu.byteLength=j$;Eu.toByteArray=F$;Eu.fromByteArray=V$;var Cr=[],or=[],M$=typeof Uint8Array<"u"?Uint8Array:Array,Zd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(co=0,oS=Zd.length;co<oS;++co)Cr[co]=Zd[co],or[Zd.charCodeAt(co)]=co;var co,oS;or[45]=62;or[95]=63;function iS(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o(iS,"getLens");function j$(t){var e=iS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(j$,"byteLength");function L$(t,e,r){return(e+r)*3/4-r}o(L$,"_byteLength");function F$(t){var e,r=iS(t),n=r[0],i=r[1],s=new M$(L$(t,n,i)),c=0,d=i>0?n-4:n,l;for(l=0;l<d;l+=4)e=or[t.charCodeAt(l)]<<18|or[t.charCodeAt(l+1)]<<12|or[t.charCodeAt(l+2)]<<6|or[t.charCodeAt(l+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=or[t.charCodeAt(l)]<<2|or[t.charCodeAt(l+1)]>>4,s[c++]=e&255),i===1&&(e=or[t.charCodeAt(l)]<<10|or[t.charCodeAt(l+1)]<<4|or[t.charCodeAt(l+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(F$,"toByteArray");function B$(t){return Cr[t>>18&63]+Cr[t>>12&63]+Cr[t>>6&63]+Cr[t&63]}o(B$,"tripletToBase64");function q$(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(B$(n));return i.join("")}o(q$,"encodeChunk");function V$(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(q$(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Cr[e>>2]+Cr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Cr[e>>10]+Cr[e>>4&63]+Cr[e<<2&63]+"=")),i.join("")}o(V$,"fromByteArray")});var Jd=k(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.fromArrayBufferToHex=H$;function H$(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(H$,"fromArrayBufferToHex")});var sS=k(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.BrowserCrypto=void 0;var ei=aS(),G$=Jd(),Yd=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return ei.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ei.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=ei.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return ei.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=ei.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ei.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,G$.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Tu.BrowserCrypto=Yd});var uS=k(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.NodeCrypto=void 0;var ti=require("crypto"),Xd=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ti.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ti.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ti.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ti.createSign("RSA-SHA256");return n.update(r),n.end(),n.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return ti.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:Z$(e);return W$(ti.createHmac("sha256",n).update(r).digest())}};xu.NodeCrypto=Xd;function W$(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(W$,"toArrayBuffer");function Z$(t){return Buffer.from(t)}o(Z$,"toBuffer")});var ga=k(on=>{"use strict";var K$=on&&on.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J$=on&&on.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K$(e,t,r)};Object.defineProperty(on,"__esModule",{value:!0});on.createCrypto=Q$;on.hasBrowserCrypto=cS;var Y$=sS(),X$=uS();J$(Jd(),on);function Q$(){return cS()?new Y$.BrowserCrypto:new X$.NodeCrypto}o(Q$,"createCrypto");function cS(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(cS,"hasBrowserCrypto")});var ri=k((Qd,dS)=>{var Au=require("buffer"),$r=Au.Buffer;function lS(t,e){for(var r in t)e[r]=t[r]}o(lS,"copyProps");$r.from&&$r.alloc&&$r.allocUnsafe&&$r.allocUnsafeSlow?dS.exports=Au:(lS(Au,Qd),Qd.Buffer=lo);function lo(t,e,r){return $r(t,e,r)}o(lo,"SafeBuffer");lo.prototype=Object.create($r.prototype);lS($r,lo);lo.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return $r(t,e,r)};lo.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=$r(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};lo.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return $r(t)};lo.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Au.SlowBuffer(t)}});var fS=k((Z9,pS)=>{"use strict";function ep(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(ep,"getParamSize");var ek={ES256:ep(256),ES384:ep(384),ES512:ep(521)};function tk(t){var e=ek[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(tk,"getParamBytesForAlg");pS.exports=tk});var tp=k((J9,vS)=>{"use strict";var wu=ri().Buffer,hS=fS(),Iu=128,gS=0,rk=32,nk=16,ok=2,yS=nk|rk|gS<<6,Ru=ok|gS<<6;function ik(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(ik,"base64Url");function _S(t){if(wu.isBuffer(t))return t;if(typeof t=="string")return wu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(_S,"signatureAsBuffer");function ak(t,e){t=_S(t);var r=hS(e),n=r+1,i=t.length,s=0;if(t[s++]!==yS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Iu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Ru)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var l=s;if(s+=d,t[s++]!==Ru)throw new Error('Could not find expected "int" for "s"');var p=t[s++];if(i-s!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(i-s)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=s;if(s+=p,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var _=r-d,h=r-p,g=wu.allocUnsafe(_+d+h+p);for(s=0;s<_;++s)g[s]=0;t.copy(g,s,l+Math.max(-_,0),l+d),s=r;for(var y=s;s<y+h;++s)g[s]=0;return t.copy(g,s,f+Math.max(-h,0),f+p),g=g.toString("base64"),g=ik(g),g}o(ak,"derToJose");function mS(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Iu;return i&&--n,n}o(mS,"countPadding");function sk(t,e){t=_S(t);var r=hS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=mS(t,0,r),s=mS(t,r,t.length),c=r-i,d=r-s,l=2+c+1+1+d,p=l<Iu,f=wu.allocUnsafe((p?2:3)+l),_=0;return f[_++]=yS,p?f[_++]=l:(f[_++]=Iu|1,f[_++]=l&255),f[_++]=Ru,f[_++]=c,i<0?(f[_++]=0,_+=t.copy(f,_,0,r)):_+=t.copy(f,_,i,r),f[_++]=Ru,f[_++]=d,s<0?(f[_++]=0,t.copy(f,_,r)):t.copy(f,_,r+s),f}o(sk,"joseToDer");vS.exports={derToJose:ak,joseToDer:sk}});var vr=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.LRUCache=void 0;an.snakeToCamel=PS;an.originalOrCamelOptions=dk;an.removeUndefinedValuesInObject=pk;an.isValidFile=fk;an.getWellKnownCertificateConfigFileLocation=mk;var uk=require("fs"),ck=require("os"),rp=require("path"),lk="certificate_config.json",bS="gcloud";function PS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(PS,"snakeToCamel");function dk(t){function e(r){let n=t||{};return n[r]??n[PS(r)]}return o(e,"get"),{get:e}}o(dk,"originalOrCamelOptions");var np=class{static{o(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,r){this.#e.delete(e),this.#e.set(e,{value:r,lastAccessed:Date.now()})}set(e,r){this.#t(e,r),this.#r()}get(e){let r=this.#e.get(e);if(r)return this.#t(e,r.value),this.#r(),r.value}#r(){let e=this.maxAge?Date.now()-this.maxAge:0,r=this.#e.entries().next();for(;!r.done&&(this.#e.size>this.capacity||r.value[1].lastAccessed<e);)this.#e.delete(r.value[0]),r=this.#e.entries().next()}};an.LRUCache=np;function pk(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(pk,"removeUndefinedValuesInObject");async function fk(t){try{return(await uk.promises.lstat(t)).isFile()}catch{return!1}}o(fk,"isValidFile");function mk(){let t=process.env.CLOUDSDK_CONFIG||(hk()?rp.join(process.env.APPDATA||"",bS):rp.join(process.env.HOME||"",".config",bS));return rp.join(t,lk)}o(mk,"getWellKnownCertificateConfigFileLocation");function hk(){return ck.platform().startsWith("win")}o(hk,"_isWindows")});var SS=k((eY,gk)=>{gk.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var op=k(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.USER_AGENT=jn.PRODUCT_NAME=jn.pkg=void 0;var ES=SS();jn.pkg=ES;var TS="google-api-nodejs-client";jn.PRODUCT_NAME=TS;var yk=`${TS}/${ES.version}`;jn.USER_AGENT=yk});var Ht=k(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AuthClient=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=br.DEFAULT_UNIVERSE=void 0;var _k=require("events"),ip=st(),vk=vr(),bk=Vd(),ap=op();br.DEFAULT_UNIVERSE="googleapis.com";br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var sp=class t extends _k.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=br.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,vk.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??br.DEFAULT_UNIVERSE,this.transporter=e.transporter??new ip.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&ip.Gaxios.mergeHeaders(s,r.headers),n&&ip.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,bk.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${ap.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${ap.USER_AGENT}`):e.headers.set("User-Agent",ap.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};br.AuthClient=sp});var cp=k(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.LoginTicket=void 0;var up=class{static{o(this,"LoginTicket")}envelope;payload;constructor(e,r){this.envelope=e,this.payload=r}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};Ou.LoginTicket=up});var po=k(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.OAuth2Client=kr.ClientAuthentication=kr.CertificateFormat=kr.CodeChallengeMethod=void 0;var xS=st(),Pk=require("querystring"),Sk=require("stream"),Ek=tp(),AS=vr(),lp=ga(),ni=Ht(),Tk=cp(),wS;(function(t){t.Plain="plain",t.S256="S256"})(wS||(kr.CodeChallengeMethod=wS={}));var sn;(function(t){t.PEM="PEM",t.JWK="JWK"})(sn||(kr.CertificateFormat=sn={}));var ya;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(ya||(kr.ClientAuthentication=ya={}));var dp=class t extends ni.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=sn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||ya.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+Pk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,lp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===ya.ClientSecretBasic){let l=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${l.toString("base64")}`)}this.clientAuthentication===ya.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,AS.removeUndefinedValuesInObject)(i)),headers:n};ni.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,AS.removeUndefinedValuesInObject)(n))};ni.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof xS.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let l=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(l)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let l=d;throw l.response&&(l.response.status===403||l.response.status===404)&&(l.message=`Could not refresh access token: ${l.message}`),l}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ni.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=xS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,l=i.config.data instanceof Sk.Readable,p=s===401||s===403;if(!r&&p&&!l&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&p&&!l&&d){let f=await this.processAndValidateRefreshHandler();return f?.access_token&&this.setCredentials(f),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,lp.hasBrowserCrypto)()?sn.JWK:sn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case sn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case sn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let p={...t.RETRY_CONFIG,url:i};ni.AuthClient.setMethodName(p,"getFederatedSignonCertsAsync"),n=await this.transporter.request(p)}catch(p){throw p instanceof Error&&(p.message=`Failed to retrieve verification certificates: ${p.message}`),p}let s=n?.headers.get("cache-control"),c=-1;if(s){let p=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;p&&(c=Number(p)*1e3)}let d={};switch(r){case sn.PEM:d=n.data;break;case sn.JWK:for(let p of n.data.keys)d[p.kid]=p;break;default:throw new Error(`Unsupported certificate format ${r}`)}let l=new Date;return this.certificateExpiry=c===-1?null:new Date(l.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ni.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,lp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let l=d[0]+"."+d[1],p=d[2],f,_;try{f=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token envelope: ${d[0]}': ${L.message}`),L}if(!f)throw new Error("Can't parse token envelope: "+d[0]);try{_=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token payload '${d[0]}`),L}if(!_)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,f.kid))throw new Error("No pem found for envelope: "+JSON.stringify(f));let h=r[f.kid];if(f.alg==="ES256"&&(p=Ek.joseToDer(p,"ES256").toString("base64")),!await c.verify(h,l,p))throw new Error("Invalid token signature: "+e);if(!_.iat)throw new Error("No issue time in token: "+JSON.stringify(_));if(!_.exp)throw new Error("No expiration time in token: "+JSON.stringify(_));let y=Number(_.iat);if(isNaN(y))throw new Error("iat field using invalid format");let T=Number(_.exp);if(isNaN(T))throw new Error("exp field using invalid format");let P=new Date().getTime()/1e3;if(T>=P+s)throw new Error("Expiration time too far in future: "+JSON.stringify(_));let x=y-t.CLOCK_SKEW_SECS_,N=T+t.CLOCK_SKEW_SECS_;if(P<x)throw new Error("Token used too early, "+P+" < "+x+": "+JSON.stringify(_));if(P>N)throw new Error("Token used too late, "+P+" > "+N+": "+JSON.stringify(_));if(i&&i.indexOf(_.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+_.iss);if(typeof n<"u"&&n!==null){let L=_.aud,X=!1;if(n.constructor===Array?X=n.indexOf(L)>-1:X=L===n,!X)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new Tk.LoginTicket(f,_)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};kr.OAuth2Client=dp});var fp=k(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.Compute=void 0;var xk=st(),IS=ha(),Ak=po(),pp=class extends Ak.OAuth2Client{static{o(this,"Compute")}serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,r;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),r=await IS.instance(i)}catch(i){throw i instanceof xk.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let n=r;return r&&r.expires_in&&(n.expiry_date=new Date().getTime()+r.expires_in*1e3,delete n.expires_in),this.emit("tokens",n),{tokens:n,res:null}}async fetchIdToken(e){let r=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,n;try{let i={property:r};n=await IS.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return n}wrapError(e){let r=e.response;r&&r.status&&(e.status=r.status,r.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:r.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};Cu.Compute=pp});var hp=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.IdTokenClient=void 0;var wk=po(),mp=class extends wk.OAuth2Client{static{o(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let r=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:r,expiry_date:this.getIdTokenExpiryDate(r)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let r=e.split(".")[1];if(r)return JSON.parse(Buffer.from(r,"base64").toString("ascii")).exp*1e3}};$u.IdTokenClient=mp});var gp=k(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.GCPEnv=void 0;oi.clear=Ik;oi.getEnv=Rk;var RS=ha(),Nr;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(Nr||(oi.GCPEnv=Nr={}));var _a;function Ik(){_a=void 0}o(Ik,"clear");async function Rk(){return _a||(_a=Ok(),_a)}o(Rk,"getEnv");async function Ok(){let t=Nr.NONE;return Ck()?t=Nr.APP_ENGINE:$k()?t=Nr.CLOUD_FUNCTIONS:await Dk()?await zk()?t=Nr.KUBERNETES_ENGINE:kk()?t=Nr.CLOUD_RUN:Nk()?t=Nr.CLOUD_RUN_JOBS:t=Nr.COMPUTE_ENGINE:t=Nr.NONE,t}o(Ok,"getEnvMemoized");function Ck(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(Ck,"isAppEngine");function $k(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o($k,"isCloudFunction");function kk(){return!!process.env.K_CONFIGURATION}o(kk,"isCloudRun");function Nk(){return!!process.env.CLOUD_RUN_JOB}o(Nk,"isCloudRunJob");async function zk(){try{return await RS.instance("attributes/cluster-name"),!0}catch{return!1}}o(zk,"isKubernetesEngine");async function Dk(){return RS.isAvailable()}o(Dk,"isComputeEngine")});var yp=k((mY,OS)=>{var ku=ri().Buffer,Uk=require("stream"),Mk=require("util");function Nu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=ku.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=ku.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Nu,"DataStream");Mk.inherits(Nu,Uk);Nu.prototype.write=o(function(e){this.buffer=ku.concat([this.buffer,ku.from(e)]),this.emit("data",e)},"write");Nu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");OS.exports=Nu});var $S=k((gY,CS)=>{"use strict";var va=require("buffer").Buffer,_p=require("buffer").SlowBuffer;CS.exports=zu;function zu(t,e){if(!va.isBuffer(t)||!va.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o(zu,"bufferEq");zu.install=function(){va.prototype.equal=_p.prototype.equal=o(function(e){return zu(this,e)},"equal")};var jk=va.prototype.equal,Lk=_p.prototype.equal;zu.restore=function(){va.prototype.equal=jk,_p.prototype.equal=Lk}});var Sp=k((_Y,FS)=>{var ai=ri().Buffer,ir=require("crypto"),NS=tp(),kS=require("util"),Fk=`"%s" is not a valid algorithm.
|
|
37
|
+
`+T+"}":"{"+P.join(",")+"}",n=T,g}}o(l,"str"),typeof WP.stringify!="function"&&(WP.stringify=function(f,p,_){var h;if(n="",i="",typeof _=="number")for(h=0;h<_;h+=1)i+=" ";else typeof _=="string"&&(i=_);if(c=p,p&&typeof p!="function"&&(typeof p!="object"||typeof p.length!="number"))throw new Error("JSON.stringify");return l("",{"":f})})})()});var YP=k((uY,JP)=>{var Pu=null,O$=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,C$=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,$$=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
38
|
+
`,r:"\r",t:" "},s,c=o(function(T){throw{name:"SyntaxError",message:T,at:r,text:s}},"error"),d=o(function(T){return T&&T!==n&&c("Expected '"+T+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),l=o(function(){var T,P="";for(n==="-"&&(P="-",d("-"));n>="0"&&n<="9";)P+=n,d();if(n===".")for(P+=".";d()&&n>="0"&&n<="9";)P+=n;if(n==="e"||n==="E")for(P+=n,d(),(n==="-"||n==="+")&&(P+=n,d());n>="0"&&n<="9";)P+=n,d();if(T=+P,!isFinite(T))c("Bad number");else return Pu==null&&(Pu=Fd()),P.length>15?e.storeAsString?P:e.useNativeBigInt?BigInt(P):new Pu(P):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(T):new Pu(T):T},"number"),f=o(function(){var T,P,x="",N;if(n==='"')for(var F=r;d();){if(n==='"')return r-1>F&&(x+=s.substring(F,r-1)),d(),x;if(n==="\\"){if(r-1>F&&(x+=s.substring(F,r-1)),d(),n==="u"){for(N=0,P=0;P<4&&(T=parseInt(d(),16),!!isFinite(T));P+=1)N=N*16+T;x+=String.fromCharCode(N)}else if(typeof i[n]=="string")x+=i[n];else break;F=r}}c("Bad string")},"string"),p=o(function(){for(;n&&n<=" ";)d()},"white"),_=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),h,g=o(function(){var T=[];if(n==="["){if(d("["),p(),n==="]")return d("]"),T;for(;n;){if(T.push(h()),p(),n==="]")return d("]"),T;d(","),p()}}c("Bad array")},"array"),y=o(function(){var T,P=Object.create(null);if(n==="{"){if(d("{"),p(),n==="}")return d("}"),P;for(;n;){if(T=f(),p(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(P,T)&&c('Duplicate key "'+T+'"'),O$.test(T)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?h():P[T]=h():C$.test(T)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?h():P[T]=h():P[T]=h(),p(),n==="}")return d("}"),P;d(","),p()}}c("Bad object")},"object");return h=o(function(){switch(p(),n){case"{":return y();case"[":return g();case'"':return f();case"-":return l();default:return n>="0"&&n<="9"?l():_()}},"value"),function(T,P){var x;return s=T+"",r=0,n=" ",x=h(),p(),n&&c("Syntax error"),typeof P=="function"?o((function N(F,X){var Z,G,Y=F[X];return Y&&typeof Y=="object"&&Object.keys(Y).forEach(function(ee){G=N(Y,ee),G!==void 0?Y[ee]=G:delete Y[ee]}),P.call(F,X,Y)}),"walk")({"":x},""):x}},"json_parse");JP.exports=$$});var eS=k((lY,Su)=>{var XP=KP().stringify,QP=YP();Su.exports=function(t){return{parse:QP(t),stringify:XP}};Su.exports.parse=QP();Su.exports.stringify=XP});var Bd=k(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.GCE_LINUX_BIOS_PATHS=void 0;yr.isGoogleCloudServerless=nS;yr.isGoogleComputeEngineLinux=oS;yr.isGoogleComputeEngineMACAddress=iS;yr.isGoogleComputeEngine=aS;yr.detectGCPResidency=N$;var tS=require("fs"),rS=require("os");yr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var k$=/^42:01/;function nS(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(nS,"isGoogleCloudServerless");function oS(){if((0,rS.platform)()!=="linux")return!1;try{(0,tS.statSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,tS.readFileSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(oS,"isGoogleComputeEngineLinux");function iS(){let t=(0,rS.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(k$.test(r))return!0}return!1}o(iS,"isGoogleComputeEngineMACAddress");function aS(){return oS()||iS()}o(aS,"isGoogleComputeEngine");function N$(){return nS()||aS()}o(N$,"detectGCPResidency")});var sS=k(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Colours=void 0;var Tt=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Eu.Colours=Tt;Tt.enabled=!1;Tt.reset="";Tt.bright="";Tt.dim="";Tt.red="";Tt.green="";Tt.yellow="";Tt.blue="";Tt.magenta="";Tt.cyan="";Tt.white="";Tt.grey="";Tt.refresh()});var dS=k(He=>{"use strict";var z$=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D$=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uS=He&&He.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&z$(r,e,n[i]);return D$(r,e),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.env=He.DebugLogBackendBase=He.placeholder=He.AdhocDebugLogger=He.LogSeverity=void 0;He.getNodeBackend=Vd;He.getDebugBackend=M$;He.getStructuredBackend=j$;He.setBackend=L$;He.log=lS;var U$=require("events"),fa=uS(require("process")),cS=uS(require("util")),qt=sS(),_r;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(_r||(He.LogSeverity=_r={}));var ma=class extends U$.EventEmitter{static{o(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:o((n,i)=>this.on(n,i),"on")}),this.func.debug=(...n)=>this.invokeSeverity(_r.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(_r.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(_r.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(_r.ERROR,...n),this.func.sublog=n=>lS(n,this.func)}invoke(e,...r){if(this.upstream)try{this.upstream(e,...r)}catch{}try{this.emit("log",e,r)}catch{}}invokeSeverity(e,...r){this.invoke({severity:e},...r)}};He.AdhocDebugLogger=ma;He.placeholder=new ma("",()=>{}).func;var ei=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=fa.env[He.env.nodeEnables])!==null&&e!==void 0?e:"*";r==="all"&&(r="*"),this.filters=r.split(",")}log(e,r,...n){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(r,...n)}catch(i){console.error(i)}}};He.DebugLogBackendBase=ei;var qd=class extends ei{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${qt.Colours.green}${e}${qt.Colours.reset}`,c=`${qt.Colours.yellow}${fa.pid}${qt.Colours.reset}`,d;switch(r.severity){case _r.ERROR:d=`${qt.Colours.red}${r.severity}${qt.Colours.reset}`;break;case _r.INFO:d=`${qt.Colours.magenta}${r.severity}${qt.Colours.reset}`;break;case _r.WARNING:d=`${qt.Colours.yellow}${r.severity}${qt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:_r.DEFAULT;break}let l=cS.formatWithOptions({colors:qt.Colours.enabled},...n),f=Object.assign({},r);delete f.severity;let p=Object.getOwnPropertyNames(f).length?JSON.stringify(f):"",_=p?`${qt.Colours.grey}${p}${qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,l,p?` ${_}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Vd(){return new qd}o(Vd,"getNodeBackend");var Hd=class extends ei{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=fa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";fa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function M$(t){return new Hd(t)}o(M$,"getDebugBackend");var Gd=class extends ei{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:_r.INFO,l=Object.assign({severity:d,message:cS.format(...s)},i),f=JSON.stringify(l);n?n(i,f):console.log("%s",f)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function j$(t){return new Gd(t)}o(j$,"getStructuredBackend");He.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var Wd=new Map,Vt;function L$(t){Vt=t,Wd.clear()}o(L$,"setBackend");function lS(t,e){if(!Vt&&!fa.env[He.env.nodeEnables]||!t)return He.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=Wd.get(t);if(r)return r.func;if(Vt===null)return He.placeholder;Vt===void 0&&(Vt=Vd());let n=(()=>{let i;return new ma(t,(c,...d)=>{if(i!==Vt){if(Vt===null)return;Vt===void 0&&(Vt=Vd()),i=Vt}Vt?.log(t,c,...d)})})();return Wd.set(t,n),n.func}o(lS,"log")});var Zd=k(uo=>{"use strict";var F$=uo&&uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B$=uo&&uo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&F$(e,t,r)};Object.defineProperty(uo,"__esModule",{value:!0});B$(dS(),uo)});var ga=k(fe=>{"use strict";var fS=fe&&fe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q$=fe&&fe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V$=fe&&fe.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&fS(r,e,n[i]);return q$(r,e),r}})(),H$=fe&&fe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fS(e,t,r)};Object.defineProperty(fe,"__esModule",{value:!0});fe.gcpResidencyCache=fe.METADATA_SERVER_DETECTION=fe.HEADERS=fe.HEADER_VALUE=fe.HEADER_NAME=fe.SECONDARY_HOST_ADDRESS=fe.HOST_ADDRESS=fe.BASE_PATH=void 0;fe.instance=Y$;fe.project=X$;fe.universe=Q$;fe.bulk=ek;fe.isAvailable=rk;fe.resetIsAvailableCache=nk;fe.getGCPResidency=Yd;fe.setGCPResidency=mS;fe.requestTimeout=hS;var Kd=st(),G$=eS(),W$=Bd(),Z$=V$(Zd());fe.BASE_PATH="/computeMetadata/v1";fe.HOST_ADDRESS="http://169.254.169.254";fe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";fe.HEADER_NAME="Metadata-Flavor";fe.HEADER_VALUE="Google";fe.HEADERS=Object.freeze({[fe.HEADER_NAME]:fe.HEADER_VALUE});var pS=Z$.log("gcp-metadata");fe.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function Jd(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||fe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(fe.BASE_PATH,t).href}o(Jd,"getBaseUrl");function K$(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}o(K$,"validate");async function ha(t,e={},r=3,n=!1){let i=new Headers(fe.HEADERS),s="",c={};if(typeof t=="object"){let _=t;new Headers(_.headers).forEach((h,g)=>i.set(g,h)),s=_.metadataKey,c=_.params||c,r=_.noResponseRetries||r,n=_.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(K$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((_,h)=>i.set(h,_)),c=e.params||c);let d=n?J$:Kd.request,l={url:`${Jd()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:hS()};pS.info("instance request %j",l);let f=await d(l);pS.info("instance metadata is %s",f.data);let p=f.headers.get(fe.HEADER_NAME);if(p!==fe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${fe.HEADER_NAME} header. Expected '${fe.HEADER_VALUE}', got ${p?`'${p}'`:"no header"}`);if(typeof f.data=="string")try{return G$.parse(f.data)}catch{}return f.data}o(ha,"metadataAccessor");async function J$(t){let e={...t,url:t.url?.toString().replace(Jd(),Jd(fe.SECONDARY_HOST_ADDRESS))},r=(0,Kd.request)(t),n=(0,Kd.request)(e);return Promise.any([r,n])}o(J$,"fastFailMetadataRequest");function Y$(t){return ha("instance",t)}o(Y$,"instance");function X$(t){return ha("project",t)}o(X$,"project");function Q$(t){return ha("universe",t)}o(Q$,"universe");async function ek(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ha(r),i=r.metadataKey;e[i]=n})())),e}o(ek,"bulk");function tk(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(tk,"detectGCPAvailableRetries");var Tu;async function rk(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in fe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(fe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return Yd();case"ping-only":}}try{return Tu===void 0&&(Tu=ha("instance",void 0,tk(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Tu,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(rk,"isAvailable");function nk(){Tu=void 0}o(nk,"resetIsAvailableCache");fe.gcpResidencyCache=null;function Yd(){return fe.gcpResidencyCache===null&&mS(),fe.gcpResidencyCache}o(Yd,"getGCPResidency");function mS(t=null){fe.gcpResidencyCache=t!==null?t:(0,W$.detectGCPResidency)()}o(mS,"setGCPResidency");function hS(){return Yd()?0:3e3}o(hS,"requestTimeout");H$(Bd(),fe)});var _S=k(xu=>{"use strict";xu.byteLength=ik;xu.toByteArray=sk;xu.fromByteArray=lk;var Cr=[],or=[],ok=typeof Uint8Array<"u"?Uint8Array:Array,Xd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(co=0,gS=Xd.length;co<gS;++co)Cr[co]=Xd[co],or[Xd.charCodeAt(co)]=co;var co,gS;or[45]=62;or[95]=63;function yS(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o(yS,"getLens");function ik(t){var e=yS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(ik,"byteLength");function ak(t,e,r){return(e+r)*3/4-r}o(ak,"_byteLength");function sk(t){var e,r=yS(t),n=r[0],i=r[1],s=new ok(ak(t,n,i)),c=0,d=i>0?n-4:n,l;for(l=0;l<d;l+=4)e=or[t.charCodeAt(l)]<<18|or[t.charCodeAt(l+1)]<<12|or[t.charCodeAt(l+2)]<<6|or[t.charCodeAt(l+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=or[t.charCodeAt(l)]<<2|or[t.charCodeAt(l+1)]>>4,s[c++]=e&255),i===1&&(e=or[t.charCodeAt(l)]<<10|or[t.charCodeAt(l+1)]<<4|or[t.charCodeAt(l+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(sk,"toByteArray");function uk(t){return Cr[t>>18&63]+Cr[t>>12&63]+Cr[t>>6&63]+Cr[t&63]}o(uk,"tripletToBase64");function ck(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(uk(n));return i.join("")}o(ck,"encodeChunk");function lk(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(ck(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Cr[e>>2]+Cr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Cr[e>>10]+Cr[e>>4&63]+Cr[e<<2&63]+"=")),i.join("")}o(lk,"fromByteArray")});var ep=k(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.fromArrayBufferToHex=dk;function dk(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(dk,"fromArrayBufferToHex")});var vS=k(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.BrowserCrypto=void 0;var ti=_S(),pk=ep(),tp=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return ti.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ti.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=ti.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return ti.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=ti.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ti.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,pk.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Au.BrowserCrypto=tp});var bS=k(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.NodeCrypto=void 0;var ri=require("crypto"),rp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ri.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ri.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ri.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ri.createSign("RSA-SHA256");return n.update(r),n.end(),n.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return ri.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:mk(e);return fk(ri.createHmac("sha256",n).update(r).digest())}};wu.NodeCrypto=rp;function fk(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(fk,"toArrayBuffer");function mk(t){return Buffer.from(t)}o(mk,"toBuffer")});var ya=k(on=>{"use strict";var hk=on&&on.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gk=on&&on.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hk(e,t,r)};Object.defineProperty(on,"__esModule",{value:!0});on.createCrypto=vk;on.hasBrowserCrypto=PS;var yk=vS(),_k=bS();gk(ep(),on);function vk(){return PS()?new yk.BrowserCrypto:new _k.NodeCrypto}o(vk,"createCrypto");function PS(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(PS,"hasBrowserCrypto")});var ni=k((np,ES)=>{var Iu=require("buffer"),$r=Iu.Buffer;function SS(t,e){for(var r in t)e[r]=t[r]}o(SS,"copyProps");$r.from&&$r.alloc&&$r.allocUnsafe&&$r.allocUnsafeSlow?ES.exports=Iu:(SS(Iu,np),np.Buffer=lo);function lo(t,e,r){return $r(t,e,r)}o(lo,"SafeBuffer");lo.prototype=Object.create($r.prototype);SS($r,lo);lo.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return $r(t,e,r)};lo.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=$r(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};lo.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return $r(t)};lo.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Iu.SlowBuffer(t)}});var xS=k(($Y,TS)=>{"use strict";function op(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(op,"getParamSize");var bk={ES256:op(256),ES384:op(384),ES512:op(521)};function Pk(t){var e=bk[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(Pk,"getParamBytesForAlg");TS.exports=Pk});var ip=k((NY,CS)=>{"use strict";var Ru=ni().Buffer,wS=xS(),Ou=128,IS=0,Sk=32,Ek=16,Tk=2,RS=Ek|Sk|IS<<6,Cu=Tk|IS<<6;function xk(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(xk,"base64Url");function OS(t){if(Ru.isBuffer(t))return t;if(typeof t=="string")return Ru.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(OS,"signatureAsBuffer");function Ak(t,e){t=OS(t);var r=wS(e),n=r+1,i=t.length,s=0;if(t[s++]!==RS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Ou|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Cu)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var l=s;if(s+=d,t[s++]!==Cu)throw new Error('Could not find expected "int" for "s"');var f=t[s++];if(i-s!==f)throw new Error('"s" specified length of "'+f+'", expected "'+(i-s)+'"');if(n<f)throw new Error('"s" specified length of "'+f+'", max of "'+n+'" is acceptable');var p=s;if(s+=f,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var _=r-d,h=r-f,g=Ru.allocUnsafe(_+d+h+f);for(s=0;s<_;++s)g[s]=0;t.copy(g,s,l+Math.max(-_,0),l+d),s=r;for(var y=s;s<y+h;++s)g[s]=0;return t.copy(g,s,p+Math.max(-h,0),p+f),g=g.toString("base64"),g=xk(g),g}o(Ak,"derToJose");function AS(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Ou;return i&&--n,n}o(AS,"countPadding");function wk(t,e){t=OS(t);var r=wS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=AS(t,0,r),s=AS(t,r,t.length),c=r-i,d=r-s,l=2+c+1+1+d,f=l<Ou,p=Ru.allocUnsafe((f?2:3)+l),_=0;return p[_++]=RS,f?p[_++]=l:(p[_++]=Ou|1,p[_++]=l&255),p[_++]=Cu,p[_++]=c,i<0?(p[_++]=0,_+=t.copy(p,_,0,r)):_+=t.copy(p,_,i,r),p[_++]=Cu,p[_++]=d,s<0?(p[_++]=0,t.copy(p,_,r)):t.copy(p,_,r+s),p}o(wk,"joseToDer");CS.exports={derToJose:Ak,joseToDer:wk}});var vr=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.LRUCache=void 0;an.snakeToCamel=kS;an.originalOrCamelOptions=Ck;an.removeUndefinedValuesInObject=$k;an.isValidFile=kk;an.getWellKnownCertificateConfigFileLocation=Nk;var Ik=require("fs"),Rk=require("os"),ap=require("path"),Ok="certificate_config.json",$S="gcloud";function kS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(kS,"snakeToCamel");function Ck(t){function e(r){let n=t||{};return n[r]??n[kS(r)]}return o(e,"get"),{get:e}}o(Ck,"originalOrCamelOptions");var sp=class{static{o(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,r){this.#e.delete(e),this.#e.set(e,{value:r,lastAccessed:Date.now()})}set(e,r){this.#t(e,r),this.#r()}get(e){let r=this.#e.get(e);if(r)return this.#t(e,r.value),this.#r(),r.value}#r(){let e=this.maxAge?Date.now()-this.maxAge:0,r=this.#e.entries().next();for(;!r.done&&(this.#e.size>this.capacity||r.value[1].lastAccessed<e);)this.#e.delete(r.value[0]),r=this.#e.entries().next()}};an.LRUCache=sp;function $k(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o($k,"removeUndefinedValuesInObject");async function kk(t){try{return(await Ik.promises.lstat(t)).isFile()}catch{return!1}}o(kk,"isValidFile");function Nk(){let t=process.env.CLOUDSDK_CONFIG||(zk()?ap.join(process.env.APPDATA||"",$S):ap.join(process.env.HOME||"",".config",$S));return ap.join(t,Ok)}o(Nk,"getWellKnownCertificateConfigFileLocation");function zk(){return Rk.platform().startsWith("win")}o(zk,"_isWindows")});var NS=k((MY,Dk)=>{Dk.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var up=k(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.USER_AGENT=Ln.PRODUCT_NAME=Ln.pkg=void 0;var zS=NS();Ln.pkg=zS;var DS="google-api-nodejs-client";Ln.PRODUCT_NAME=DS;var Uk=`${DS}/${zS.version}`;Ln.USER_AGENT=Uk});var Ht=k(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AuthClient=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=br.DEFAULT_UNIVERSE=void 0;var Mk=require("events"),cp=st(),jk=vr(),Lk=Zd(),lp=up();br.DEFAULT_UNIVERSE="googleapis.com";br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var dp=class t extends Mk.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=br.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,jk.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??br.DEFAULT_UNIVERSE,this.transporter=e.transporter??new cp.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&cp.Gaxios.mergeHeaders(s,r.headers),n&&cp.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,Lk.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${lp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${lp.USER_AGENT}`):e.headers.set("User-Agent",lp.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};br.AuthClient=dp});var fp=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.LoginTicket=void 0;var pp=class{static{o(this,"LoginTicket")}envelope;payload;constructor(e,r){this.envelope=e,this.payload=r}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};$u.LoginTicket=pp});var po=k(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.OAuth2Client=kr.ClientAuthentication=kr.CertificateFormat=kr.CodeChallengeMethod=void 0;var US=st(),Fk=require("querystring"),Bk=require("stream"),qk=ip(),MS=vr(),mp=ya(),oi=Ht(),Vk=fp(),jS;(function(t){t.Plain="plain",t.S256="S256"})(jS||(kr.CodeChallengeMethod=jS={}));var sn;(function(t){t.PEM="PEM",t.JWK="JWK"})(sn||(kr.CertificateFormat=sn={}));var _a;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(_a||(kr.ClientAuthentication=_a={}));var hp=class t extends oi.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=sn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||_a.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+Fk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,mp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===_a.ClientSecretBasic){let l=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${l.toString("base64")}`)}this.clientAuthentication===_a.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,MS.removeUndefinedValuesInObject)(i)),headers:n};oi.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,MS.removeUndefinedValuesInObject)(n))};oi.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof US.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let l=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(l)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let l=d;throw l.response&&(l.response.status===403||l.response.status===404)&&(l.message=`Could not refresh access token: ${l.message}`),l}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(oi.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=US.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,l=i.config.data instanceof Bk.Readable,f=s===401||s===403;if(!r&&f&&!l&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&f&&!l&&d){let p=await this.processAndValidateRefreshHandler();return p?.access_token&&this.setCredentials(p),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,mp.hasBrowserCrypto)()?sn.JWK:sn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case sn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case sn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let f={...t.RETRY_CONFIG,url:i};oi.AuthClient.setMethodName(f,"getFederatedSignonCertsAsync"),n=await this.transporter.request(f)}catch(f){throw f instanceof Error&&(f.message=`Failed to retrieve verification certificates: ${f.message}`),f}let s=n?.headers.get("cache-control"),c=-1;if(s){let f=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;f&&(c=Number(f)*1e3)}let d={};switch(r){case sn.PEM:d=n.data;break;case sn.JWK:for(let f of n.data.keys)d[f.kid]=f;break;default:throw new Error(`Unsupported certificate format ${r}`)}let l=new Date;return this.certificateExpiry=c===-1?null:new Date(l.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};oi.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,mp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let l=d[0]+"."+d[1],f=d[2],p,_;try{p=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(F){throw F instanceof Error&&(F.message=`Can't parse token envelope: ${d[0]}': ${F.message}`),F}if(!p)throw new Error("Can't parse token envelope: "+d[0]);try{_=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(F){throw F instanceof Error&&(F.message=`Can't parse token payload '${d[0]}`),F}if(!_)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,p.kid))throw new Error("No pem found for envelope: "+JSON.stringify(p));let h=r[p.kid];if(p.alg==="ES256"&&(f=qk.joseToDer(f,"ES256").toString("base64")),!await c.verify(h,l,f))throw new Error("Invalid token signature: "+e);if(!_.iat)throw new Error("No issue time in token: "+JSON.stringify(_));if(!_.exp)throw new Error("No expiration time in token: "+JSON.stringify(_));let y=Number(_.iat);if(isNaN(y))throw new Error("iat field using invalid format");let T=Number(_.exp);if(isNaN(T))throw new Error("exp field using invalid format");let P=new Date().getTime()/1e3;if(T>=P+s)throw new Error("Expiration time too far in future: "+JSON.stringify(_));let x=y-t.CLOCK_SKEW_SECS_,N=T+t.CLOCK_SKEW_SECS_;if(P<x)throw new Error("Token used too early, "+P+" < "+x+": "+JSON.stringify(_));if(P>N)throw new Error("Token used too late, "+P+" > "+N+": "+JSON.stringify(_));if(i&&i.indexOf(_.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+_.iss);if(typeof n<"u"&&n!==null){let F=_.aud,X=!1;if(n.constructor===Array?X=n.indexOf(F)>-1:X=F===n,!X)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new Vk.LoginTicket(p,_)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};kr.OAuth2Client=hp});var yp=k(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.Compute=void 0;var Hk=st(),LS=ga(),Gk=po(),gp=class extends Gk.OAuth2Client{static{o(this,"Compute")}serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,r;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),r=await LS.instance(i)}catch(i){throw i instanceof Hk.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let n=r;return r&&r.expires_in&&(n.expiry_date=new Date().getTime()+r.expires_in*1e3,delete n.expires_in),this.emit("tokens",n),{tokens:n,res:null}}async fetchIdToken(e){let r=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,n;try{let i={property:r};n=await LS.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return n}wrapError(e){let r=e.response;r&&r.status&&(e.status=r.status,r.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:r.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};ku.Compute=gp});var vp=k(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.IdTokenClient=void 0;var Wk=po(),_p=class extends Wk.OAuth2Client{static{o(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let r=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:r,expiry_date:this.getIdTokenExpiryDate(r)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let r=e.split(".")[1];if(r)return JSON.parse(Buffer.from(r,"base64").toString("ascii")).exp*1e3}};Nu.IdTokenClient=_p});var bp=k(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.GCPEnv=void 0;ii.clear=Zk;ii.getEnv=Kk;var FS=ga(),Nr;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(Nr||(ii.GCPEnv=Nr={}));var va;function Zk(){va=void 0}o(Zk,"clear");async function Kk(){return va||(va=Jk(),va)}o(Kk,"getEnv");async function Jk(){let t=Nr.NONE;return Yk()?t=Nr.APP_ENGINE:Xk()?t=Nr.CLOUD_FUNCTIONS:await rN()?await tN()?t=Nr.KUBERNETES_ENGINE:Qk()?t=Nr.CLOUD_RUN:eN()?t=Nr.CLOUD_RUN_JOBS:t=Nr.COMPUTE_ENGINE:t=Nr.NONE,t}o(Jk,"getEnvMemoized");function Yk(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(Yk,"isAppEngine");function Xk(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(Xk,"isCloudFunction");function Qk(){return!!process.env.K_CONFIGURATION}o(Qk,"isCloudRun");function eN(){return!!process.env.CLOUD_RUN_JOB}o(eN,"isCloudRunJob");async function tN(){try{return await FS.instance("attributes/cluster-name"),!0}catch{return!1}}o(tN,"isKubernetesEngine");async function rN(){return FS.isAvailable()}o(rN,"isComputeEngine")});var Pp=k((XY,BS)=>{var zu=ni().Buffer,nN=require("stream"),oN=require("util");function Du(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=zu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=zu.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Du,"DataStream");oN.inherits(Du,nN);Du.prototype.write=o(function(e){this.buffer=zu.concat([this.buffer,zu.from(e)]),this.emit("data",e)},"write");Du.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");BS.exports=Du});var VS=k((eX,qS)=>{"use strict";var ba=require("buffer").Buffer,Sp=require("buffer").SlowBuffer;qS.exports=Uu;function Uu(t,e){if(!ba.isBuffer(t)||!ba.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o(Uu,"bufferEq");Uu.install=function(){ba.prototype.equal=Sp.prototype.equal=o(function(e){return Uu(this,e)},"equal")};var iN=ba.prototype.equal,aN=Sp.prototype.equal;Uu.restore=function(){ba.prototype.equal=iN,Sp.prototype.equal=aN}});var Ap=k((rX,QS)=>{var si=ni().Buffer,ir=require("crypto"),GS=ip(),HS=require("util"),sN=`"%s" is not a valid algorithm.
|
|
39
39
|
Supported algorithms are:
|
|
40
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ba="secret must be a string or buffer",ii="key must be a string or a buffer",Bk="key must be a string, a buffer or an object",bp=typeof ir.createPublicKey=="function";bp&&(ii+=" or a KeyObject",ba+="or a KeyObject");function zS(t){if(!ai.isBuffer(t)&&typeof t!="string"&&(!bp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Pr(ii)}o(zS,"checkIsPublicKey");function DS(t){if(!ai.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Pr(Bk)}o(DS,"checkIsPrivateKey");function qk(t){if(!ai.isBuffer(t)){if(typeof t=="string")return t;if(!bp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Pr(ba)}}o(qk,"checkIsSecretKey");function Pp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Pp,"fromBase64");function US(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}o(US,"toBase64");function Pr(t){var e=[].slice.call(arguments,1),r=kS.format.bind(kS,t).apply(null,e);return new TypeError(r)}o(Pr,"typeError");function Vk(t){return ai.isBuffer(t)||typeof t=="string"}o(Vk,"bufferOrString");function Pa(t){return Vk(t)||(t=JSON.stringify(t)),t}o(Pa,"normalizeInput");function MS(t){return o(function(r,n){qk(n),r=Pa(r);var i=ir.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Pp(s)},"sign")}o(MS,"createHmacSigner");var vp,Hk="timingSafeEqual"in ir?o(function(e,r){return e.byteLength!==r.byteLength?!1:ir.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return vp||(vp=$S()),vp(e,r)},"timingSafeEqual");function Gk(t){return o(function(r,n,i){var s=MS(t)(r,i);return Hk(ai.from(n),ai.from(s))},"verify")}o(Gk,"createHmacVerifier");function jS(t){return o(function(r,n){DS(n),r=Pa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Pp(s)},"sign")}o(jS,"createKeySigner");function LS(t){return o(function(r,n,i){zS(i),r=Pa(r),n=US(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(LS,"createKeyVerifier");function Wk(t){return o(function(r,n){DS(n),r=Pa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Pp(s)},"sign")}o(Wk,"createPSSKeySigner");function Zk(t){return o(function(r,n,i){zS(i),r=Pa(r),n=US(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(Zk,"createPSSKeyVerifier");function Kk(t){var e=jS(t);return o(function(){var n=e.apply(null,arguments);return n=NS.derToJose(n,"ES"+t),n},"sign")}o(Kk,"createECDSASigner");function Jk(t){var e=LS(t);return o(function(n,i,s){i=NS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(Jk,"createECDSAVerifer");function Yk(){return o(function(){return""},"sign")}o(Yk,"createNoneSigner");function Xk(){return o(function(e,r){return r===""},"verify")}o(Xk,"createNoneVerifier");FS.exports=o(function(e){var r={hs:MS,rs:jS,ps:Wk,es:Kk,none:Yk},n={hs:Gk,rs:LS,ps:Zk,es:Jk,none:Xk},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Pr(Fk,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var Ep=k((bY,BS)=>{var Qk=require("buffer").Buffer;BS.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||Qk.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var ZS=k((SY,WS)=>{var eN=ri().Buffer,qS=yp(),tN=Sp(),rN=require("stream"),VS=Ep(),Tp=require("util");function HS(t,e){return eN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(HS,"base64url");function nN(t,e,r){r=r||"utf8";var n=HS(VS(t),"binary"),i=HS(VS(e),r);return Tp.format("%s.%s",n,i)}o(nN,"jwsSecuredInput");function GS(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=tN(e.alg),c=nN(e,r,i),d=s.sign(c,n);return Tp.format("%s.%s",c,d)}o(GS,"jwsSign");function Du(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new qS(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new qS(t.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))}o(Du,"SignStream");Tp.inherits(Du,rN);Du.prototype.sign=o(function(){try{var e=GS({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");Du.sign=GS;WS.exports=Du});var oE=k((TY,nE)=>{var JS=ri().Buffer,KS=yp(),oN=Sp(),iN=require("stream"),YS=Ep(),aN=require("util"),sN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function uN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(uN,"isObject");function cN(t){if(uN(t))return t;try{return JSON.parse(t)}catch{return}}o(cN,"safeJsonParse");function XS(t){var e=t.split(".",1)[0];return cN(JS.from(e,"base64").toString("binary"))}o(XS,"headerFromJWS");function lN(t){return t.split(".",2).join(".")}o(lN,"securedInputFromJWS");function QS(t){return t.split(".")[2]}o(QS,"signatureFromJWS");function dN(t,e){e=e||"utf8";var r=t.split(".")[1];return JS.from(r,"base64").toString(e)}o(dN,"payloadFromJWS");function eE(t){return sN.test(t)&&!!XS(t)}o(eE,"isValidJws");function tE(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=YS(t);var i=QS(t),s=lN(t),c=oN(e);return c.verify(s,i,r)}o(tE,"jwsVerify");function rE(t,e){if(e=e||{},t=YS(t),!eE(t))return null;var r=XS(t);if(!r)return null;var n=dN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:QS(t)}}o(rE,"jwsDecode");function si(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new KS(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new KS(t.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))}o(si,"VerifyStream");aN.inherits(si,iN);si.prototype.verify=o(function(){try{var e=tE(this.signature.buffer,this.algorithm,this.key.buffer),r=rE(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");si.decode=rE;si.isValid=eE;si.verify=tE;nE.exports=si});var xp=k(Ln=>{var iE=ZS(),Uu=oE(),pN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ln.ALGORITHMS=pN;Ln.sign=iE.sign;Ln.verify=Uu.verify;Ln.decode=Uu.decode;Ln.isValid=Uu.isValid;Ln.createSign=o(function(e){return new iE(e)},"createSign");Ln.createVerify=o(function(e){return new Uu(e)},"createVerify")});var bE=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.GoogleToken=void 0;var aE=Mu(require("fs")),fN=st(),mN=Mu(xp()),hN=Mu(require("path")),gN=require("util");function Mu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Mu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,l,p={__proto__:null,default:s};if(s===null||un(s)!="object"&&typeof s!="function")return p;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,p)}for(var f in s)f!=="default"&&{}.hasOwnProperty.call(s,f)&&((l=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,f))&&(l.get||l.set)?d(p,f,l):p[f]=s[f]);return p},"_interopRequireWildcard"))(t,e)}o(Mu,"_interopRequireWildcard");function un(t){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un(t)}o(un,"_typeof");function yN(t,e){hE(t,e),e.add(t)}o(yN,"_classPrivateMethodInitSpec");function _N(t,e,r){hE(t,e),e.set(t,r)}o(_N,"_classPrivateFieldInitSpec");function hE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(hE,"_checkPrivateRedeclaration");function sE(t,e,r){return t.set(Sr(t,e),r),r}o(sE,"_classPrivateFieldSet");function uE(t,e){return t.get(Sr(t,e))}o(uE,"_classPrivateFieldGet");function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}o(Sr,"_assertClassBrand");function cE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_E(n.key),n)}}o(cE,"_defineProperties");function gE(t,e,r){return e&&cE(t.prototype,e),r&&cE(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(gE,"_createClass");function yE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(yE,"_classCallCheck");function vN(t,e,r){return e=xa(e),bN(t,Cp()?Reflect.construct(e,r||[],xa(t).constructor):e.apply(t,r))}o(vN,"_callSuper");function bN(t,e){if(e&&(un(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PN(t)}o(bN,"_possibleConstructorReturn");function PN(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(PN,"_assertThisInitialized");function SN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ta(t,e)}o(SN,"_inherits");function Ap(t){var e=typeof Map=="function"?new Map:void 0;return Ap=o(function(n){if(n===null||!TN(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return EN(n,arguments,xa(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ta(i,n)},"_wrapNativeSuper"),Ap(t)}o(Ap,"_wrapNativeSuper");function EN(t,e,r){if(Cp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Ta(i,r.prototype),i}o(EN,"_construct");function Cp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Cp,"_isNativeReflectConstruct");function TN(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(TN,"_isNativeFunction");function Ta(t,e){return Ta=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ta(t,e)}o(Ta,"_setPrototypeOf");function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xa(t)}o(xa,"_getPrototypeOf");function Gt(t,e,r){return(e=_E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Gt,"_defineProperty");function _E(t){var e=xN(t,"string");return un(e)=="symbol"?e:e+""}o(_E,"_toPropertyKey");function xN(t,e){if(un(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(xN,"_toPrimitive");function Zt(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,y,T,P){var x=y&&y.prototype instanceof d?y:d,N=Object.create(x.prototype);return Wt(N,"_invoke",(function(L,X,W){var G,Z,ee,Y=0,Se=W||[],te=!1,q={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(K,re){return G=K,Z=0,ee=t,q.n=re,c},"d")};function B(J,K){for(Z=J,ee=K,e=0;!te&&Y&&!re&&e<Se.length;e++){var re,oe=Se[e],Ae=q.p,Oe=oe[2];J>3?(re=Oe===K)&&(ee=oe[(Z=oe[4])?5:(Z=3,3)],oe[4]=oe[5]=t):oe[0]<=Ae&&((re=J<2&&Ae<oe[1])?(Z=0,q.v=K,q.n=oe[1]):Ae<Oe&&(re=J<3||oe[0]>K||K>Oe)&&(oe[4]=J,oe[5]=K,q.n=Oe,Z=0))}if(re||J>1)return c;throw te=!0,K}return o(B,"d"),function(J,K,re){if(Y>1)throw TypeError("Generator is already running");for(te&&K===1&&B(K,re),Z=K,ee=re;(e=Z<2?t:ee)||!te;){G||(Z?Z<3?(Z>1&&(q.n=-1),B(Z,ee)):q.n=ee:q.v=ee);try{if(Y=2,G){if(Z||(J="next"),e=G[J]){if(!(e=e.call(G,ee)))throw TypeError("iterator result is not an object");if(!e.done)return e;ee=e.value,Z<2&&(Z=0)}else Z===1&&(e=G.return)&&e.call(G),Z<2&&(ee=TypeError("The iterator does not provide a '"+J+"' method"),Z=1);G=t}else if((e=(te=q.n<0)?ee:L.call(X,q))!==c)break}catch(oe){G=t,Z=1,ee=oe}finally{Y=1}}return{value:e,done:te}}})(g,T,P),!0),N}o(s,"i");var c={};function d(){}o(d,"Generator");function l(){}o(l,"GeneratorFunction");function p(){}o(p,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Wt(e={},n,function(){return this}),e),_=p.prototype=d.prototype=Object.create(f);function h(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,p):(g.__proto__=p,Wt(g,i,"GeneratorFunction")),g.prototype=Object.create(_),g}return o(h,"f"),l.prototype=p,Wt(_,"constructor",p),Wt(p,"constructor",l),l.displayName="GeneratorFunction",Wt(p,i,"GeneratorFunction"),Wt(_),Wt(_,i,"Generator"),Wt(_,n,function(){return this}),Wt(_,"toString",function(){return"[object Generator]"}),(Zt=o(function(){return{w:s,m:h}},"_regenerator"))()}o(Zt,"_regenerator");function Wt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Wt=o(function(c,d,l,p){if(d)i?i(c,d,{value:l,enumerable:!p,configurable:!p,writable:!p}):c[d]=l;else{var f=o(function(h,g){Wt(c,h,function(y){return this._invoke(h,g,y)})},"o");f("next",0),f("throw",1),f("return",2)}},"_regeneratorDefine"),Wt(t,e,r,n)}o(Wt,"_regeneratorDefine2");function lE(t,e,r,n,i,s,c){try{var d=t[s](c),l=d.value}catch(p){return void r(p)}d.done?e(l):Promise.resolve(l).then(n,i)}o(lE,"asyncGeneratorStep");function ui(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(l){lE(s,n,i,c,d,"next",l)}o(c,"_next");function d(l){lE(s,n,i,c,d,"throw",l)}o(d,"_throw"),c(void 0)})}}o(ui,"_asyncToGenerator");var dE=aE.readFile?(0,gN.promisify)(aE.readFile):ui(Zt().m(o(function t(){return Zt().w(function(e){for(;;)switch(e.n){case 0:throw new Ea("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),pE="https://oauth2.googleapis.com/token",AN="https://oauth2.googleapis.com/revoke?token=",Ea=(function(t){function e(r,n){var i;return yE(this,e),i=vN(this,e,[r]),Gt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),SN(e,t),gE(e)})(Ap(Error)),Sa=new WeakMap,zr=new WeakSet,IY=ju.GoogleToken=(function(){function t(e){yE(this,t),yN(this,zr),Gt(this,"expiresAt",void 0),Gt(this,"key",void 0),Gt(this,"keyFile",void 0),Gt(this,"iss",void 0),Gt(this,"sub",void 0),Gt(this,"scope",void 0),Gt(this,"rawToken",void 0),Gt(this,"tokenExpires",void 0),Gt(this,"email",void 0),Gt(this,"additionalClaims",void 0),Gt(this,"eagerRefreshThresholdMillis",void 0),Gt(this,"transporter",{request:o(function(n){return(0,fN.request)(n)},"request")}),_N(this,Sa,void 0),Sr(zr,this,vE).call(this,e)}return o(t,"GoogleToken"),gE(t,[{key:"accessToken",get:o(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:o(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:o(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:o(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:o(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:o(function(){var r,n=new Date().getTime(),i=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+i:!0},"isTokenExpiring")},{key:"getToken",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(un(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Sr(zr,this,fE).call(this,n).then(function(s){return i(null,s)},r);return}return Sr(zr,this,fE).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=ui(Zt().m(o(function n(i){var s,c,d,l,p,f,_;return Zt().w(function(h){for(;;)switch(h.n){case 0:s=hN.extname(i),_=s,h.n=_===".json"?1:_===".der"||_===".crt"||_===".pem"?4:_===".p12"||_===".pfx"?6:7;break;case 1:return h.n=2,dE(i,"utf8");case 2:if(c=h.v,d=JSON.parse(c),l=d.private_key,p=d.client_email,!(!l||!p)){h.n=3;break}throw new Ea("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return h.a(2,{privateKey:l,clientEmail:p});case 4:return h.n=5,dE(i,"utf8");case 5:return f=h.v,h.a(2,{privateKey:f});case 6:throw new Ea("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");case 7:throw new Ea("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return h.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return o(r,"getCredentials"),r})()},{key:"revokeToken",value:o(function(r){if(r){Sr(zr,this,mE).call(this).then(function(){return r()},r);return}return Sr(zr,this,mE).call(this)},"revokeToken")}])})();function fE(t){return wp.apply(this,arguments)}o(fE,"_getTokenAsync");function wp(){return wp=ui(Zt().m(o(function t(e){return Zt().w(function(r){for(;;)switch(r.n){case 0:if(!(uE(Sa,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,uE(Sa,this));case 1:return r.p=1,r.n=2,sE(Sa,this,Sr(zr,this,wN).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,sE(Sa,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),wp.apply(this,arguments)}o(wp,"_getTokenAsync2");function wN(t){return Ip.apply(this,arguments)}o(wN,"_getTokenAsyncInner");function Ip(){return Ip=ui(Zt().m(o(function t(e){var r;return Zt().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Sr(zr,this,IN).call(this);case 4:return n.a(2,Sr(zr,this,RN).call(this))}},t,this)},"_callee4"))),Ip.apply(this,arguments)}o(Ip,"_getTokenAsyncInner2");function IN(){if(!this.iss)throw new Ea("email is required.","MISSING_CREDENTIALS")}o(IN,"_ensureEmail");function mE(){return Rp.apply(this,arguments)}o(mE,"_revokeTokenAsync");function Rp(){return Rp=ui(Zt().m(o(function t(){var e;return Zt().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=AN+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Sr(zr,this,vE).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims});case 3:return r.a(2)}},t,this)},"_callee5"))),Rp.apply(this,arguments)}o(Rp,"_revokeTokenAsync2");function vE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.keyFile=t.keyFile,this.key=t.key,this.rawToken=void 0,this.iss=t.email||t.iss,this.sub=t.sub,this.additionalClaims=t.additionalClaims,un(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(vE,"_configure");function RN(){return Op.apply(this,arguments)}o(RN,"_requestToken");function Op(){return Op=ui(Zt().m(o(function t(){var e,r,n,i,s,c,d,l,p,f;return Zt().w(function(_){for(;;)switch(_.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:pE,exp:e+3600,iat:e,sub:this.sub},r),i=mN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),_.p=1,_.n=2,this.transporter.request({method:"POST",url:pE,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=_.v,this.rawToken=s.data,this.expiresAt=s.data.expires_in===null||s.data.expires_in===void 0?void 0:(e+s.data.expires_in)*1e3,_.a(2,this.rawToken);case 3:throw _.p=3,f=_.v,this.rawToken=void 0,this.tokenExpires=void 0,l=f.response&&(c=f.response)!==null&&c!==void 0&&c.data?(d=f.response)===null||d===void 0?void 0:d.data:{},l.error&&(p=l.error_description?": ".concat(l.error_description):"",f.message="".concat(l.error).concat(p)),f;case 4:return _.a(2)}},t,this,[[1,3]])},"_callee6"))),Op.apply(this,arguments)}o(Op,"_requestToken2")});var kp=k(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.JWTAccess=void 0;var ON=xp(),CN=vr(),PE={alg:"RS256",typ:"JWT"},$p=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new CN.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),l=t.getExpirationTime(d),p;if(Array.isArray(n)&&(n=n.join(" ")),n?p={iss:this.email,sub:this.email,scope:n,exp:l,iat:d}:p={iss:this.email,sub:this.email,aud:e,exp:l,iat:d},r){for(let y in p)if(r[y])throw new Error(`The '${y}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let f=this.keyId?{...PE,kid:this.keyId}:PE,_=Object.assign(p,r),h=ON.sign({header:f,payload:_,secret:this.key}),g=new Headers({authorization:`Bearer ${h}`});return this.cache.set(i,{expiration:l*1e3,headers:g}),g}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Lu.JWTAccess=$p});var zp=k(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.JWT=void 0;var SE=bE(),$N=kp(),kN=po(),Fu=Ht(),Np=class t extends kN.OAuth2Client{static{o(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let r=new t(this);return r.scopes=e,r}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let r=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==Fu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Fu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Fu.DEFAULT_UNIVERSE}`);if(!this.apiKey&&r)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:n}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${n.id_token}`}))}}else{this.access||(this.access=new $N.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let i=this.useJWTAccessWithScope||this.universeDomain!==Fu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new SE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await r.getToken({forceRefresh:!0}),!r.idToken)throw new Error("Unknown error: Failed to fetch ID token");return r.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(r=>e(null,r),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),n={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",n),{res:null,tokens:n}}createGToken(){return this.gtoken||(this.gtoken=new SE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Bu.JWT=Np});var Up=k(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.UserRefreshClient=ci.USER_REFRESH_ACCOUNT_TYPE=void 0;var NN=po(),zN=Ht();ci.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Dp=class t extends NN.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return zN.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};ci.UserRefreshClient=Dp});var jp=k(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.Impersonated=li.IMPERSONATED_ACCOUNT_TYPE=void 0;var EE=po(),DN=st(),UN=vr();li.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Mp=class t extends EE.OAuth2Client{static{o(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new EE.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,UN.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof DN.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};li.Impersonated=Mp});var Fp=k(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.OAuthClientAuthHandler=void 0;Aa.getErrorFromOAuthErrorResponse=LN;var di=st(),MN=ga(),jN=["PUT","POST","PATCH"],Lp=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,MN.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new di.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new di.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=di.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=di.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=di.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);di.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!jN.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Aa.OAuthClientAuthHandler=Lp;function LN(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(l=>{l!=="message"&&Object.defineProperty(c,l,{value:e[l],writable:!1,enumerable:!0})})}return c}o(LN,"getErrorFromOAuthErrorResponse")});var Vu=k(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.StsCredentials=void 0;var FN=st(),BN=Ht(),TE=Fp(),qN=vr(),Bp=class t extends TE.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,qN.removeUndefinedValuesInObject)(i))};BN.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof FN.GaxiosError&&c.response?(0,TE.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};qu.StsCredentials=Bp});var Fn=k(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseExternalAccountClient=ar.CLOUD_RESOURCE_MANAGER=ar.EXTERNAL_ACCOUNT_TYPE=ar.EXPIRATION_TIME_OFFSET=void 0;var VN=st(),HN=require("stream"),qp=Ht(),GN=Vu(),xE=vr(),WN=op(),ZN="urn:ietf:params:oauth:grant-type:token-exchange",KN="urn:ietf:params:oauth:token-type:access_token",Vp="https://www.googleapis.com/auth/cloud-platform",JN=3600;ar.EXPIRATION_TIME_OFFSET=300*1e3;ar.EXTERNAL_ACCOUNT_TYPE="external_account";ar.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var YN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",XN="https://sts.{universeDomain}/v1/token",Hp=class t extends qp.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,xE.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==ar.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${ar.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??XN.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),l=r.get("service_account_impersonation_url"),p=r.get("service_account_impersonation"),f=(0,xE.originalOrCamelOptions)(p).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new GN.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[Vp],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let _=new RegExp(YN);if(this.workforcePoolUserProject&&!this.audience.match(_))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=l,this.serviceAccountImpersonationLifetime=f,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=JN),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let r=await this.getRequestHeaders(),n={...t.RETRY_CONFIG,headers:r,url:`${this.cloudResourceManagerURL.toString()}${e}`};qp.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=VN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof HN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:ZN,audience:this.audience,requestedTokenType:KN,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[Vp]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};qp.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[Vp]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${WN.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};ar.BaseExternalAccountClient=Hp});var AE=k(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.FileSubjectTokenSupplier=void 0;var Wp=require("util"),Zp=require("fs"),QN=(0,Wp.promisify)(Zp.readFile??(()=>{})),ez=(0,Wp.promisify)(Zp.realpath??(()=>{})),tz=(0,Wp.promisify)(Zp.lstat??(()=>{})),Gp=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await ez(e),!(await tz(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r,n=await QN(e,{encoding:"utf8"});if(this.formatType==="text"?r=n:this.formatType==="json"&&this.subjectTokenFieldName&&(r=JSON.parse(n)[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source file");return r}};Hu.FileSubjectTokenSupplier=Gp});var wE=k(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.UrlSubjectTokenSupplier=void 0;var rz=Ht(),Kp=class{static{o(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let r={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};rz.AuthClient.setMethodName(r,"getSubjectToken");let n;if(this.formatType==="text"?n=(await e.transporter.request(r)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(n=(await e.transporter.request(r)).data[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source URL");return n}};Gu.UrlSubjectTokenSupplier=Kp});var IE=k(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CertificateSubjectTokenSupplier=Kt.InvalidConfigurationError=Kt.CertificateSourceUnavailableError=Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Wu=vr(),Zu=require("fs"),Ku=require("crypto"),nz=require("https");Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Dr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};Kt.CertificateSourceUnavailableError=Dr;var sr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};Kt.InvalidConfigurationError=sr;var Jp=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new sr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new sr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new sr("Cannot create mTLS Agent with missing certificate or key");return new nz.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:r}=await this.#t();return{cert:this.cert,key:this.key}=await this.#r(e,r),await this.#n(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,Wu.isValidFile)(e))return e;throw new Dr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Wu.isValidFile)(r))return r;throw new Dr(`Path from environment variable "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Wu.getWellKnownCertificateConfigFileLocation)();if(await(0,Wu.isValidFile)(n))return n;throw new Dr(`Could not find certificate configuration file. Searched override path, the "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await Zu.promises.readFile(e,"utf8")}catch{throw new Dr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new sr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof sr?n:new sr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await Zu.promises.readFile(e),new Ku.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await Zu.promises.readFile(r),(0,Ku.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new Ku.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await Zu.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((l,p)=>{try{return new Ku.X509Certificate(l)}catch(f){let _=f instanceof Error?f.message:String(f);throw new sr(`Failed to parse certificate at index ${p} in trust chain file ${this.trustChainPath}: ${_}`)}}),c=s.findIndex(l=>r.raw.equals(l.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new sr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(l=>l.raw.toString("base64")))}catch(n){if(n instanceof sr)throw n;let i=n instanceof Error?n.message:String(n);throw new Dr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};Kt.CertificateSubjectTokenSupplier=Jp});var Qp=k(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.IdentityPoolClient=void 0;var oz=Fn(),Yp=vr(),iz=AE(),az=wE(),RE=IE(),sz=Vu(),OE=st(),Xp=class t extends oz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Yp.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,Yp.originalOrCamelOptions)(n),c=(0,Yp.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",l=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!l)throw new Error("Missing subject_token_field_name for JSON credential_source format");let p=s.get("file"),f=s.get("url"),_=s.get("certificate"),h=s.get("headers");if(p&&f||f&&_||p&&_)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(p)this.credentialSourceType="file",this.subjectTokenSupplier=new iz.FileSubjectTokenSupplier({filePath:p,formatType:d,subjectTokenFieldName:l});else if(f)this.credentialSourceType="url",this.subjectTokenSupplier=new az.UrlSubjectTokenSupplier({url:f,formatType:d,subjectTokenFieldName:l,headers:h,additionalGaxiosOptions:t.RETRY_CONFIG});else if(_){this.credentialSourceType="certificate";let g=new RE.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:_.use_default_certificate_config,certificateConfigLocation:_.certificate_config_location,trustChainPath:_.trust_chain_path});this.subjectTokenSupplier=g}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof RE.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new sz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new OE.Gaxios({agent:r})}),this.transporter=new OE.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};Ju.IdentityPoolClient=Xp});var tf=k(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.AwsRequestSigner=void 0;var Yu=st(),$E=ga(),CE="AWS4-HMAC-SHA256",uz="aws4_request",ef=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,$E.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),l=new URL(n);if(typeof s!="string"&&s!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${s}`);let p=await lz({crypto:this.crypto,host:l.host,canonicalUri:l.pathname,canonicalQuerystring:l.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),f=Yu.Gaxios.mergeHeaders(p.amzDate?{"x-amz-date":p.amzDate}:{},{authorization:p.authorizationHeader,host:l.host},c||{});d.token&&Yu.Gaxios.mergeHeaders(f,{"x-amz-security-token":d.token});let _={url:n,method:i,headers:f};return s!==void 0&&(_.body=s),_}};Xu.AwsRequestSigner=ef;async function wa(t,e,r){return await t.signWithHmacSha256(e,r)}o(wa,"sign");async function cz(t,e,r,n,i){let s=await wa(t,`AWS4${e}`,r),c=await wa(t,s,n),d=await wa(t,c,i);return await wa(t,d,"aws4_request")}o(cz,"getSigningKey");async function lz(t){let e=Yu.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=Yu.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),l="",p=[...d.keys()].sort();p.forEach(N=>{l+=`${N}:${d.get(N)}
|
|
41
|
-
`});let f
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Pa="secret must be a string or buffer",ai="key must be a string or a buffer",uN="key must be a string, a buffer or an object",Tp=typeof ir.createPublicKey=="function";Tp&&(ai+=" or a KeyObject",Pa+="or a KeyObject");function WS(t){if(!si.isBuffer(t)&&typeof t!="string"&&(!Tp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Pr(ai)}o(WS,"checkIsPublicKey");function ZS(t){if(!si.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Pr(uN)}o(ZS,"checkIsPrivateKey");function cN(t){if(!si.isBuffer(t)){if(typeof t=="string")return t;if(!Tp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Pr(Pa)}}o(cN,"checkIsSecretKey");function xp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(xp,"fromBase64");function KS(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}o(KS,"toBase64");function Pr(t){var e=[].slice.call(arguments,1),r=HS.format.bind(HS,t).apply(null,e);return new TypeError(r)}o(Pr,"typeError");function lN(t){return si.isBuffer(t)||typeof t=="string"}o(lN,"bufferOrString");function Sa(t){return lN(t)||(t=JSON.stringify(t)),t}o(Sa,"normalizeInput");function JS(t){return o(function(r,n){cN(n),r=Sa(r);var i=ir.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return xp(s)},"sign")}o(JS,"createHmacSigner");var Ep,dN="timingSafeEqual"in ir?o(function(e,r){return e.byteLength!==r.byteLength?!1:ir.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Ep||(Ep=VS()),Ep(e,r)},"timingSafeEqual");function pN(t){return o(function(r,n,i){var s=JS(t)(r,i);return dN(si.from(n),si.from(s))},"verify")}o(pN,"createHmacVerifier");function YS(t){return o(function(r,n){ZS(n),r=Sa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return xp(s)},"sign")}o(YS,"createKeySigner");function XS(t){return o(function(r,n,i){WS(i),r=Sa(r),n=KS(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(XS,"createKeyVerifier");function fN(t){return o(function(r,n){ZS(n),r=Sa(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return xp(s)},"sign")}o(fN,"createPSSKeySigner");function mN(t){return o(function(r,n,i){WS(i),r=Sa(r),n=KS(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(mN,"createPSSKeyVerifier");function hN(t){var e=YS(t);return o(function(){var n=e.apply(null,arguments);return n=GS.derToJose(n,"ES"+t),n},"sign")}o(hN,"createECDSASigner");function gN(t){var e=XS(t);return o(function(n,i,s){i=GS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(gN,"createECDSAVerifer");function yN(){return o(function(){return""},"sign")}o(yN,"createNoneSigner");function _N(){return o(function(e,r){return r===""},"verify")}o(_N,"createNoneVerifier");QS.exports=o(function(e){var r={hs:JS,rs:YS,ps:fN,es:hN,none:yN},n={hs:pN,rs:XS,ps:mN,es:gN,none:_N},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Pr(sN,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var wp=k((oX,eE)=>{var vN=require("buffer").Buffer;eE.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||vN.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var aE=k((aX,iE)=>{var bN=ni().Buffer,tE=Pp(),PN=Ap(),SN=require("stream"),rE=wp(),Ip=require("util");function nE(t,e){return bN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(nE,"base64url");function EN(t,e,r){r=r||"utf8";var n=nE(rE(t),"binary"),i=nE(rE(e),r);return Ip.format("%s.%s",n,i)}o(EN,"jwsSecuredInput");function oE(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=PN(e.alg),c=EN(e,r,i),d=s.sign(c,n);return Ip.format("%s.%s",c,d)}o(oE,"jwsSign");function Mu(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new tE(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new tE(t.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))}o(Mu,"SignStream");Ip.inherits(Mu,SN);Mu.prototype.sign=o(function(){try{var e=oE({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");Mu.sign=oE;iE.exports=Mu});var gE=k((uX,hE)=>{var uE=ni().Buffer,sE=Pp(),TN=Ap(),xN=require("stream"),cE=wp(),AN=require("util"),wN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function IN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(IN,"isObject");function RN(t){if(IN(t))return t;try{return JSON.parse(t)}catch{return}}o(RN,"safeJsonParse");function lE(t){var e=t.split(".",1)[0];return RN(uE.from(e,"base64").toString("binary"))}o(lE,"headerFromJWS");function ON(t){return t.split(".",2).join(".")}o(ON,"securedInputFromJWS");function dE(t){return t.split(".")[2]}o(dE,"signatureFromJWS");function CN(t,e){e=e||"utf8";var r=t.split(".")[1];return uE.from(r,"base64").toString(e)}o(CN,"payloadFromJWS");function pE(t){return wN.test(t)&&!!lE(t)}o(pE,"isValidJws");function fE(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=cE(t);var i=dE(t),s=ON(t),c=TN(e);return c.verify(s,i,r)}o(fE,"jwsVerify");function mE(t,e){if(e=e||{},t=cE(t),!pE(t))return null;var r=lE(t);if(!r)return null;var n=CN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:dE(t)}}o(mE,"jwsDecode");function ui(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new sE(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new sE(t.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))}o(ui,"VerifyStream");AN.inherits(ui,xN);ui.prototype.verify=o(function(){try{var e=fE(this.signature.buffer,this.algorithm,this.key.buffer),r=mE(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");ui.decode=mE;ui.isValid=pE;ui.verify=fE;hE.exports=ui});var Rp=k(Fn=>{var yE=aE(),ju=gE(),$N=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Fn.ALGORITHMS=$N;Fn.sign=yE.sign;Fn.verify=ju.verify;Fn.decode=ju.decode;Fn.isValid=ju.isValid;Fn.createSign=o(function(e){return new yE(e)},"createSign");Fn.createVerify=o(function(e){return new ju(e)},"createVerify")});var $E=k(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.GoogleToken=void 0;var _E=Lu(require("fs")),kN=st(),NN=Lu(Rp()),zN=Lu(require("path")),DN=require("util");function Lu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Lu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,l,f={__proto__:null,default:s};if(s===null||un(s)!="object"&&typeof s!="function")return f;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,f)}for(var p in s)p!=="default"&&{}.hasOwnProperty.call(s,p)&&((l=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,p))&&(l.get||l.set)?d(f,p,l):f[p]=s[p]);return f},"_interopRequireWildcard"))(t,e)}o(Lu,"_interopRequireWildcard");function un(t){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un(t)}o(un,"_typeof");function UN(t,e){wE(t,e),e.add(t)}o(UN,"_classPrivateMethodInitSpec");function MN(t,e,r){wE(t,e),e.set(t,r)}o(MN,"_classPrivateFieldInitSpec");function wE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(wE,"_checkPrivateRedeclaration");function vE(t,e,r){return t.set(Sr(t,e),r),r}o(vE,"_classPrivateFieldSet");function bE(t,e){return t.get(Sr(t,e))}o(bE,"_classPrivateFieldGet");function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}o(Sr,"_assertClassBrand");function PE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,OE(n.key),n)}}o(PE,"_defineProperties");function IE(t,e,r){return e&&PE(t.prototype,e),r&&PE(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(IE,"_createClass");function RE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(RE,"_classCallCheck");function jN(t,e,r){return e=Aa(e),LN(t,zp()?Reflect.construct(e,r||[],Aa(t).constructor):e.apply(t,r))}o(jN,"_callSuper");function LN(t,e){if(e&&(un(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FN(t)}o(LN,"_possibleConstructorReturn");function FN(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(FN,"_assertThisInitialized");function BN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xa(t,e)}o(BN,"_inherits");function Op(t){var e=typeof Map=="function"?new Map:void 0;return Op=o(function(n){if(n===null||!VN(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return qN(n,arguments,Aa(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xa(i,n)},"_wrapNativeSuper"),Op(t)}o(Op,"_wrapNativeSuper");function qN(t,e,r){if(zp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&xa(i,r.prototype),i}o(qN,"_construct");function zp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(zp,"_isNativeReflectConstruct");function VN(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(VN,"_isNativeFunction");function xa(t,e){return xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},xa(t,e)}o(xa,"_setPrototypeOf");function Aa(t){return Aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Aa(t)}o(Aa,"_getPrototypeOf");function Gt(t,e,r){return(e=OE(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Gt,"_defineProperty");function OE(t){var e=HN(t,"string");return un(e)=="symbol"?e:e+""}o(OE,"_toPropertyKey");function HN(t,e){if(un(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(HN,"_toPrimitive");function Zt(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,y,T,P){var x=y&&y.prototype instanceof d?y:d,N=Object.create(x.prototype);return Wt(N,"_invoke",(function(F,X,Z){var G,Y,ee,K=0,Oe=Z||[],te=!1,V={p:0,n:0,v:t,a:q,f:q.bind(t,4),d:o(function(W,re){return G=W,Y=0,ee=t,V.n=re,c},"d")};function q(J,W){for(Y=J,ee=W,e=0;!te&&K&&!re&&e<Oe.length;e++){var re,oe=Oe[e],Ie=V.p,Ce=oe[2];J>3?(re=Ce===W)&&(ee=oe[(Y=oe[4])?5:(Y=3,3)],oe[4]=oe[5]=t):oe[0]<=Ie&&((re=J<2&&Ie<oe[1])?(Y=0,V.v=W,V.n=oe[1]):Ie<Ce&&(re=J<3||oe[0]>W||W>Ce)&&(oe[4]=J,oe[5]=W,V.n=Ce,Y=0))}if(re||J>1)return c;throw te=!0,W}return o(q,"d"),function(J,W,re){if(K>1)throw TypeError("Generator is already running");for(te&&W===1&&q(W,re),Y=W,ee=re;(e=Y<2?t:ee)||!te;){G||(Y?Y<3?(Y>1&&(V.n=-1),q(Y,ee)):V.n=ee:V.v=ee);try{if(K=2,G){if(Y||(J="next"),e=G[J]){if(!(e=e.call(G,ee)))throw TypeError("iterator result is not an object");if(!e.done)return e;ee=e.value,Y<2&&(Y=0)}else Y===1&&(e=G.return)&&e.call(G),Y<2&&(ee=TypeError("The iterator does not provide a '"+J+"' method"),Y=1);G=t}else if((e=(te=V.n<0)?ee:F.call(X,V))!==c)break}catch(oe){G=t,Y=1,ee=oe}finally{K=1}}return{value:e,done:te}}})(g,T,P),!0),N}o(s,"i");var c={};function d(){}o(d,"Generator");function l(){}o(l,"GeneratorFunction");function f(){}o(f,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(Wt(e={},n,function(){return this}),e),_=f.prototype=d.prototype=Object.create(p);function h(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,f):(g.__proto__=f,Wt(g,i,"GeneratorFunction")),g.prototype=Object.create(_),g}return o(h,"f"),l.prototype=f,Wt(_,"constructor",f),Wt(f,"constructor",l),l.displayName="GeneratorFunction",Wt(f,i,"GeneratorFunction"),Wt(_),Wt(_,i,"Generator"),Wt(_,n,function(){return this}),Wt(_,"toString",function(){return"[object Generator]"}),(Zt=o(function(){return{w:s,m:h}},"_regenerator"))()}o(Zt,"_regenerator");function Wt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Wt=o(function(c,d,l,f){if(d)i?i(c,d,{value:l,enumerable:!f,configurable:!f,writable:!f}):c[d]=l;else{var p=o(function(h,g){Wt(c,h,function(y){return this._invoke(h,g,y)})},"o");p("next",0),p("throw",1),p("return",2)}},"_regeneratorDefine"),Wt(t,e,r,n)}o(Wt,"_regeneratorDefine2");function SE(t,e,r,n,i,s,c){try{var d=t[s](c),l=d.value}catch(f){return void r(f)}d.done?e(l):Promise.resolve(l).then(n,i)}o(SE,"asyncGeneratorStep");function ci(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(l){SE(s,n,i,c,d,"next",l)}o(c,"_next");function d(l){SE(s,n,i,c,d,"throw",l)}o(d,"_throw"),c(void 0)})}}o(ci,"_asyncToGenerator");var EE=_E.readFile?(0,DN.promisify)(_E.readFile):ci(Zt().m(o(function t(){return Zt().w(function(e){for(;;)switch(e.n){case 0:throw new Ta("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),TE="https://oauth2.googleapis.com/token",GN="https://oauth2.googleapis.com/revoke?token=",Ta=(function(t){function e(r,n){var i;return RE(this,e),i=jN(this,e,[r]),Gt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),BN(e,t),IE(e)})(Op(Error)),Ea=new WeakMap,zr=new WeakSet,pX=Fu.GoogleToken=(function(){function t(e){RE(this,t),UN(this,zr),Gt(this,"expiresAt",void 0),Gt(this,"key",void 0),Gt(this,"keyFile",void 0),Gt(this,"iss",void 0),Gt(this,"sub",void 0),Gt(this,"scope",void 0),Gt(this,"rawToken",void 0),Gt(this,"tokenExpires",void 0),Gt(this,"email",void 0),Gt(this,"additionalClaims",void 0),Gt(this,"eagerRefreshThresholdMillis",void 0),Gt(this,"transporter",{request:o(function(n){return(0,kN.request)(n)},"request")}),MN(this,Ea,void 0),Sr(zr,this,CE).call(this,e)}return o(t,"GoogleToken"),IE(t,[{key:"accessToken",get:o(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:o(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:o(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:o(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:o(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:o(function(){var r,n=new Date().getTime(),i=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+i:!0},"isTokenExpiring")},{key:"getToken",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(un(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Sr(zr,this,xE).call(this,n).then(function(s){return i(null,s)},r);return}return Sr(zr,this,xE).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=ci(Zt().m(o(function n(i){var s,c,d,l,f,p,_;return Zt().w(function(h){for(;;)switch(h.n){case 0:s=zN.extname(i),_=s,h.n=_===".json"?1:_===".der"||_===".crt"||_===".pem"?4:_===".p12"||_===".pfx"?6:7;break;case 1:return h.n=2,EE(i,"utf8");case 2:if(c=h.v,d=JSON.parse(c),l=d.private_key,f=d.client_email,!(!l||!f)){h.n=3;break}throw new Ta("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return h.a(2,{privateKey:l,clientEmail:f});case 4:return h.n=5,EE(i,"utf8");case 5:return p=h.v,h.a(2,{privateKey:p});case 6:throw new Ta("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");case 7:throw new Ta("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return h.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return o(r,"getCredentials"),r})()},{key:"revokeToken",value:o(function(r){if(r){Sr(zr,this,AE).call(this).then(function(){return r()},r);return}return Sr(zr,this,AE).call(this)},"revokeToken")}])})();function xE(t){return Cp.apply(this,arguments)}o(xE,"_getTokenAsync");function Cp(){return Cp=ci(Zt().m(o(function t(e){return Zt().w(function(r){for(;;)switch(r.n){case 0:if(!(bE(Ea,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,bE(Ea,this));case 1:return r.p=1,r.n=2,vE(Ea,this,Sr(zr,this,WN).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,vE(Ea,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Cp.apply(this,arguments)}o(Cp,"_getTokenAsync2");function WN(t){return $p.apply(this,arguments)}o(WN,"_getTokenAsyncInner");function $p(){return $p=ci(Zt().m(o(function t(e){var r;return Zt().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Sr(zr,this,ZN).call(this);case 4:return n.a(2,Sr(zr,this,KN).call(this))}},t,this)},"_callee4"))),$p.apply(this,arguments)}o($p,"_getTokenAsyncInner2");function ZN(){if(!this.iss)throw new Ta("email is required.","MISSING_CREDENTIALS")}o(ZN,"_ensureEmail");function AE(){return kp.apply(this,arguments)}o(AE,"_revokeTokenAsync");function kp(){return kp=ci(Zt().m(o(function t(){var e;return Zt().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=GN+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Sr(zr,this,CE).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims});case 3:return r.a(2)}},t,this)},"_callee5"))),kp.apply(this,arguments)}o(kp,"_revokeTokenAsync2");function CE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.keyFile=t.keyFile,this.key=t.key,this.rawToken=void 0,this.iss=t.email||t.iss,this.sub=t.sub,this.additionalClaims=t.additionalClaims,un(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(CE,"_configure");function KN(){return Np.apply(this,arguments)}o(KN,"_requestToken");function Np(){return Np=ci(Zt().m(o(function t(){var e,r,n,i,s,c,d,l,f,p;return Zt().w(function(_){for(;;)switch(_.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:TE,exp:e+3600,iat:e,sub:this.sub},r),i=NN.sign({header:{alg:"RS256"},payload:n,secret:this.key}),_.p=1,_.n=2,this.transporter.request({method:"POST",url:TE,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=_.v,this.rawToken=s.data,this.expiresAt=s.data.expires_in===null||s.data.expires_in===void 0?void 0:(e+s.data.expires_in)*1e3,_.a(2,this.rawToken);case 3:throw _.p=3,p=_.v,this.rawToken=void 0,this.tokenExpires=void 0,l=p.response&&(c=p.response)!==null&&c!==void 0&&c.data?(d=p.response)===null||d===void 0?void 0:d.data:{},l.error&&(f=l.error_description?": ".concat(l.error_description):"",p.message="".concat(l.error).concat(f)),p;case 4:return _.a(2)}},t,this,[[1,3]])},"_callee6"))),Np.apply(this,arguments)}o(Np,"_requestToken2")});var Up=k(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.JWTAccess=void 0;var JN=Rp(),YN=vr(),kE={alg:"RS256",typ:"JWT"},Dp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new YN.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),l=t.getExpirationTime(d),f;if(Array.isArray(n)&&(n=n.join(" ")),n?f={iss:this.email,sub:this.email,scope:n,exp:l,iat:d}:f={iss:this.email,sub:this.email,aud:e,exp:l,iat:d},r){for(let y in f)if(r[y])throw new Error(`The '${y}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let p=this.keyId?{...kE,kid:this.keyId}:kE,_=Object.assign(f,r),h=JN.sign({header:p,payload:_,secret:this.key}),g=new Headers({authorization:`Bearer ${h}`});return this.cache.set(i,{expiration:l*1e3,headers:g}),g}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Bu.JWTAccess=Dp});var jp=k(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.JWT=void 0;var NE=$E(),XN=Up(),QN=po(),qu=Ht(),Mp=class t extends QN.OAuth2Client{static{o(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let r=new t(this);return r.scopes=e,r}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let r=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==qu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==qu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${qu.DEFAULT_UNIVERSE}`);if(!this.apiKey&&r)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:n}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${n.id_token}`}))}}else{this.access||(this.access=new XN.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let i=this.useJWTAccessWithScope||this.universeDomain!==qu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new NE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await r.getToken({forceRefresh:!0}),!r.idToken)throw new Error("Unknown error: Failed to fetch ID token");return r.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(r=>e(null,r),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),n={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",n),{res:null,tokens:n}}createGToken(){return this.gtoken||(this.gtoken=new NE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Vu.JWT=Mp});var Fp=k(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.UserRefreshClient=li.USER_REFRESH_ACCOUNT_TYPE=void 0;var ez=po(),tz=Ht();li.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Lp=class t extends ez.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return tz.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};li.UserRefreshClient=Lp});var qp=k(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.Impersonated=di.IMPERSONATED_ACCOUNT_TYPE=void 0;var zE=po(),rz=st(),nz=vr();di.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Bp=class t extends zE.OAuth2Client{static{o(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new zE.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,nz.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof rz.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};di.Impersonated=Bp});var Hp=k(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.OAuthClientAuthHandler=void 0;wa.getErrorFromOAuthErrorResponse=az;var pi=st(),oz=ya(),iz=["PUT","POST","PATCH"],Vp=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,oz.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new pi.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new pi.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=pi.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=pi.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=pi.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);pi.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!iz.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};wa.OAuthClientAuthHandler=Vp;function az(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(l=>{l!=="message"&&Object.defineProperty(c,l,{value:e[l],writable:!1,enumerable:!0})})}return c}o(az,"getErrorFromOAuthErrorResponse")});var Gu=k(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.StsCredentials=void 0;var sz=st(),uz=Ht(),DE=Hp(),cz=vr(),Gp=class t extends DE.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,cz.removeUndefinedValuesInObject)(i))};uz.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof sz.GaxiosError&&c.response?(0,DE.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};Hu.StsCredentials=Gp});var Bn=k(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseExternalAccountClient=ar.CLOUD_RESOURCE_MANAGER=ar.EXTERNAL_ACCOUNT_TYPE=ar.EXPIRATION_TIME_OFFSET=void 0;var lz=st(),dz=require("stream"),Wp=Ht(),pz=Gu(),UE=vr(),fz=up(),mz="urn:ietf:params:oauth:grant-type:token-exchange",hz="urn:ietf:params:oauth:token-type:access_token",Zp="https://www.googleapis.com/auth/cloud-platform",gz=3600;ar.EXPIRATION_TIME_OFFSET=300*1e3;ar.EXTERNAL_ACCOUNT_TYPE="external_account";ar.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var yz="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",_z="https://sts.{universeDomain}/v1/token",Kp=class t extends Wp.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,UE.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==ar.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${ar.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??_z.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),l=r.get("service_account_impersonation_url"),f=r.get("service_account_impersonation"),p=(0,UE.originalOrCamelOptions)(f).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new pz.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[Zp],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let _=new RegExp(yz);if(this.workforcePoolUserProject&&!this.audience.match(_))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=l,this.serviceAccountImpersonationLifetime=p,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=gz),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let r=await this.getRequestHeaders(),n={...t.RETRY_CONFIG,headers:r,url:`${this.cloudResourceManagerURL.toString()}${e}`};Wp.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=lz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof dz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:mz,audience:this.audience,requestedTokenType:hz,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[Zp]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};Wp.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[Zp]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${fz.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};ar.BaseExternalAccountClient=Kp});var ME=k(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.FileSubjectTokenSupplier=void 0;var Yp=require("util"),Xp=require("fs"),vz=(0,Yp.promisify)(Xp.readFile??(()=>{})),bz=(0,Yp.promisify)(Xp.realpath??(()=>{})),Pz=(0,Yp.promisify)(Xp.lstat??(()=>{})),Jp=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await bz(e),!(await Pz(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r,n=await vz(e,{encoding:"utf8"});if(this.formatType==="text"?r=n:this.formatType==="json"&&this.subjectTokenFieldName&&(r=JSON.parse(n)[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source file");return r}};Wu.FileSubjectTokenSupplier=Jp});var jE=k(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.UrlSubjectTokenSupplier=void 0;var Sz=Ht(),Qp=class{static{o(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let r={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};Sz.AuthClient.setMethodName(r,"getSubjectToken");let n;if(this.formatType==="text"?n=(await e.transporter.request(r)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(n=(await e.transporter.request(r)).data[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source URL");return n}};Zu.UrlSubjectTokenSupplier=Qp});var LE=k(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CertificateSubjectTokenSupplier=Kt.InvalidConfigurationError=Kt.CertificateSourceUnavailableError=Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Ku=vr(),Ju=require("fs"),Yu=require("crypto"),Ez=require("https");Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Dr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};Kt.CertificateSourceUnavailableError=Dr;var sr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};Kt.InvalidConfigurationError=sr;var ef=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new sr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new sr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new sr("Cannot create mTLS Agent with missing certificate or key");return new Ez.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:r}=await this.#t();return{cert:this.cert,key:this.key}=await this.#r(e,r),await this.#n(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,Ku.isValidFile)(e))return e;throw new Dr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Ku.isValidFile)(r))return r;throw new Dr(`Path from environment variable "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Ku.getWellKnownCertificateConfigFileLocation)();if(await(0,Ku.isValidFile)(n))return n;throw new Dr(`Could not find certificate configuration file. Searched override path, the "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await Ju.promises.readFile(e,"utf8")}catch{throw new Dr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new sr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof sr?n:new sr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await Ju.promises.readFile(e),new Yu.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await Ju.promises.readFile(r),(0,Yu.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Dr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new Yu.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await Ju.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((l,f)=>{try{return new Yu.X509Certificate(l)}catch(p){let _=p instanceof Error?p.message:String(p);throw new sr(`Failed to parse certificate at index ${f} in trust chain file ${this.trustChainPath}: ${_}`)}}),c=s.findIndex(l=>r.raw.equals(l.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new sr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(l=>l.raw.toString("base64")))}catch(n){if(n instanceof sr)throw n;let i=n instanceof Error?n.message:String(n);throw new Dr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};Kt.CertificateSubjectTokenSupplier=ef});var nf=k(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.IdentityPoolClient=void 0;var Tz=Bn(),tf=vr(),xz=ME(),Az=jE(),FE=LE(),wz=Gu(),BE=st(),rf=class t extends Tz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,tf.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,tf.originalOrCamelOptions)(n),c=(0,tf.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",l=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!l)throw new Error("Missing subject_token_field_name for JSON credential_source format");let f=s.get("file"),p=s.get("url"),_=s.get("certificate"),h=s.get("headers");if(f&&p||p&&_||f&&_)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(f)this.credentialSourceType="file",this.subjectTokenSupplier=new xz.FileSubjectTokenSupplier({filePath:f,formatType:d,subjectTokenFieldName:l});else if(p)this.credentialSourceType="url",this.subjectTokenSupplier=new Az.UrlSubjectTokenSupplier({url:p,formatType:d,subjectTokenFieldName:l,headers:h,additionalGaxiosOptions:t.RETRY_CONFIG});else if(_){this.credentialSourceType="certificate";let g=new FE.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:_.use_default_certificate_config,certificateConfigLocation:_.certificate_config_location,trustChainPath:_.trust_chain_path});this.subjectTokenSupplier=g}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof FE.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new wz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new BE.Gaxios({agent:r})}),this.transporter=new BE.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};Xu.IdentityPoolClient=rf});var af=k(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.AwsRequestSigner=void 0;var Qu=st(),VE=ya(),qE="AWS4-HMAC-SHA256",Iz="aws4_request",of=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,VE.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),l=new URL(n);if(typeof s!="string"&&s!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${s}`);let f=await Oz({crypto:this.crypto,host:l.host,canonicalUri:l.pathname,canonicalQuerystring:l.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),p=Qu.Gaxios.mergeHeaders(f.amzDate?{"x-amz-date":f.amzDate}:{},{authorization:f.authorizationHeader,host:l.host},c||{});d.token&&Qu.Gaxios.mergeHeaders(p,{"x-amz-security-token":d.token});let _={url:n,method:i,headers:p};return s!==void 0&&(_.body=s),_}};ec.AwsRequestSigner=of;async function Ia(t,e,r){return await t.signWithHmacSha256(e,r)}o(Ia,"sign");async function Rz(t,e,r,n,i){let s=await Ia(t,`AWS4${e}`,r),c=await Ia(t,s,n),d=await Ia(t,c,i);return await Ia(t,d,"aws4_request")}o(Rz,"getSigningKey");async function Oz(t){let e=Qu.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=Qu.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),l="",f=[...d.keys()].sort();f.forEach(N=>{l+=`${N}:${d.get(N)}
|
|
41
|
+
`});let p=f.join(";"),_=await t.crypto.sha256DigestHex(r),h=`${t.method.toUpperCase()}
|
|
42
42
|
${t.canonicalUri}
|
|
43
43
|
${t.canonicalQuerystring}
|
|
44
44
|
${l}
|
|
45
|
-
${
|
|
46
|
-
${_}`,g=`${c}/${t.region}/${n}/${
|
|
45
|
+
${p}
|
|
46
|
+
${_}`,g=`${c}/${t.region}/${n}/${Iz}`,y=`${qE}
|
|
47
47
|
${s}
|
|
48
48
|
${g}
|
|
49
|
-
`+await t.crypto.sha256DigestHex(h),T=await cz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),P=await wa(t.crypto,T,y),x=`${CE} Credential=${t.securityCredentials.accessKeyId}/${g}, SignedHeaders=${f}, Signature=${(0,$E.fromArrayBufferToHex)(P)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:x,canonicalQuerystring:t.canonicalQuerystring}}o(lz,"generateAuthenticationHeaderMap")});var kE=k(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.DefaultAwsSecurityCredentialsSupplier=void 0;var Qu=Ht(),rf=class{static{o(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#n)return this.#n;let r=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let n={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:r};Qu.AuthClient.setMethodName(n,"getAwsRegion");let i=await e.transporter.request(n);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#o)return this.#o;let r=new Headers;this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let n=await this.#t(r,e.transporter),i=await this.#r(n,r,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return Qu.AuthClient.setMethodName(r,"#getImdsV2SessionToken"),(await e.request(r)).data}async#t(e,r){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let n={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",headers:e};return Qu.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return Qu.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await n.request(i)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#o(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};ec.DefaultAwsSecurityCredentialsSupplier=rf});var of=k(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.AwsClient=void 0;var dz=tf(),pz=Fn(),fz=kE(),NE=vr(),mz=st(),nf=class t extends pz.BaseExternalAccountClient{static{o(this,"AwsClient")}environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let r=(0,NE.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,NE.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),l=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new fz.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:l}),this.regionalCredVerificationUrl=s.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new dz.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),r=[];return mz.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};tc.AwsClient=nf});var lf=k(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.InvalidSubjectTokenError=lt.InvalidMessageFieldError=lt.InvalidCodeFieldError=lt.InvalidTokenTypeFieldError=lt.InvalidExpirationTimeFieldError=lt.InvalidSuccessFieldError=lt.InvalidVersionFieldError=lt.ExecutableResponseError=lt.ExecutableResponse=void 0;var rc="urn:ietf:params:oauth:token-type:saml2",af="urn:ietf:params:oauth:token-type:id_token",sf="urn:ietf:params:oauth:token-type:jwt",uf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new nc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new oc("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==rc&&this.tokenType!==af&&this.tokenType!==sf)throw new ic(`Executable response must contain a 'token_type' field when successful and it must be one of ${af}, ${sf}, or ${rc}.`);if(this.tokenType===rc){if(!e.saml_response)throw new Ia(`Executable response must contain a 'saml_response' field when token_type=${rc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ia(`Executable response must contain a 'id_token' field when token_type=${af} or ${sf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new ac("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new sc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};lt.ExecutableResponse=uf;var Ur=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};lt.ExecutableResponseError=Ur;var nc=class extends Ur{static{o(this,"InvalidVersionFieldError")}};lt.InvalidVersionFieldError=nc;var oc=class extends Ur{static{o(this,"InvalidSuccessFieldError")}};lt.InvalidSuccessFieldError=oc;var cf=class extends Ur{static{o(this,"InvalidExpirationTimeFieldError")}};lt.InvalidExpirationTimeFieldError=cf;var ic=class extends Ur{static{o(this,"InvalidTokenTypeFieldError")}};lt.InvalidTokenTypeFieldError=ic;var ac=class extends Ur{static{o(this,"InvalidCodeFieldError")}};lt.InvalidCodeFieldError=ac;var sc=class extends Ur{static{o(this,"InvalidMessageFieldError")}};lt.InvalidMessageFieldError=sc;var Ia=class extends Ur{static{o(this,"InvalidSubjectTokenError")}};lt.InvalidSubjectTokenError=Ia});var ff=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.PluggableAuthHandler=pi.ExecutableError=void 0;var fo=lf(),hz=require("child_process"),df=require("fs"),uc=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};pi.ExecutableError=uc;var pf=class t{static{o(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{let i=hz.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let l=JSON.parse(s),p=new fo.ExecutableResponse(l);return r(p)}catch(l){return l instanceof fo.ExecutableResponseError?n(l):n(new fo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new uc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await df.promises.realpath(this.outputFile)}catch{return}if(!(await df.promises.lstat(e)).isFile())return;let r=await df.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new fo.ExecutableResponse(n).isValid()?new fo.ExecutableResponse(n):void 0}catch(n){throw n instanceof fo.ExecutableResponseError?n:new fo.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){let r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let n=0;n<r.length;n++)r[n][0]==='"'&&r[n].slice(-1)==='"'&&(r[n]=r[n].slice(1,-1));return r}};pi.PluggableAuthHandler=pf});var hf=k(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.PluggableAuthClient=fi.ExecutableError=void 0;var gz=Fn(),yz=lf(),zE=ff(),_z=ff();Object.defineProperty(fi,"ExecutableError",{enumerable:!0,get:o(function(){return _z.ExecutableError},"get")});var vz=30*1e3,DE=5*1e3,UE=120*1e3,bz="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",ME=1,mf=class extends gz.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=vz;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<DE||this.timeoutMillis>UE)throw new Error(`Timeout must be between ${DE} and ${UE} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new zE.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[bz]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let n=this.getServiceAccountEmail();n&&r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n),e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>ME)throw new Error(`Version of executable is not currently supported, maximum supported version is ${ME}.`);if(!e.success)throw new zE.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new yz.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};fi.PluggableAuthClient=mf});var yf=k(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.ExternalAccountClient=void 0;var Pz=Fn(),Sz=Qp(),Ez=of(),Tz=hf(),gf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===Pz.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new Ez.AwsClient(e):e.credential_source?.executable?new Tz.PluggableAuthClient(e):new Sz.IdentityPoolClient(e):null}};cc.ExternalAccountClient=gf});var bf=k(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.ExternalAccountAuthorizedUserClient=mi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var LE=Ht(),jE=Fp(),FE=st(),xz=require("stream"),Az=Fn();mi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var wz="https://sts.{universeDomain}/v1/oauthtoken",_f=class t extends jE.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,r){let n={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:r,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})};LE.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof FE.GaxiosError&&i.response?(0,jE.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},vf=class extends LE.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let r={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new _f({tokenRefreshEndpoint:e.token_url??wz.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=Az.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=FE.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof xz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};mi.ExternalAccountAuthorizedUserClient=vf});var HE=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GoogleAuth=Er.GoogleAuthExceptionMessages=void 0;var Iz=require("child_process"),Ra=require("fs"),Rz=st(),Oa=ha(),Oz=require("os"),Pf=require("path"),Cz=ga(),$z=fp(),kz=hp(),Nz=gp(),hi=zp(),BE=Up(),gi=jp(),zz=yf(),Ca=Fn(),Sf=Ht(),qE=bf(),VE=vr();Er.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment.
|
|
49
|
+
`+await t.crypto.sha256DigestHex(h),T=await Rz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),P=await Ia(t.crypto,T,y),x=`${qE} Credential=${t.securityCredentials.accessKeyId}/${g}, SignedHeaders=${p}, Signature=${(0,VE.fromArrayBufferToHex)(P)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:x,canonicalQuerystring:t.canonicalQuerystring}}o(Oz,"generateAuthenticationHeaderMap")});var HE=k(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.DefaultAwsSecurityCredentialsSupplier=void 0;var tc=Ht(),sf=class{static{o(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#n)return this.#n;let r=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let n={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:r};tc.AuthClient.setMethodName(n,"getAwsRegion");let i=await e.transporter.request(n);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#o)return this.#o;let r=new Headers;this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let n=await this.#t(r,e.transporter),i=await this.#r(n,r,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return tc.AuthClient.setMethodName(r,"#getImdsV2SessionToken"),(await e.request(r)).data}async#t(e,r){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let n={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",headers:e};return tc.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return tc.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await n.request(i)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#o(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};rc.DefaultAwsSecurityCredentialsSupplier=sf});var cf=k(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.AwsClient=void 0;var Cz=af(),$z=Bn(),kz=HE(),GE=vr(),Nz=st(),uf=class t extends $z.BaseExternalAccountClient{static{o(this,"AwsClient")}environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let r=(0,GE.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,GE.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),l=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new kz.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:l}),this.regionalCredVerificationUrl=s.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new Cz.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),r=[];return Nz.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};nc.AwsClient=uf});var mf=k(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.InvalidSubjectTokenError=lt.InvalidMessageFieldError=lt.InvalidCodeFieldError=lt.InvalidTokenTypeFieldError=lt.InvalidExpirationTimeFieldError=lt.InvalidSuccessFieldError=lt.InvalidVersionFieldError=lt.ExecutableResponseError=lt.ExecutableResponse=void 0;var oc="urn:ietf:params:oauth:token-type:saml2",lf="urn:ietf:params:oauth:token-type:id_token",df="urn:ietf:params:oauth:token-type:jwt",pf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new ic("Executable response must contain a 'version' field.");if(e.success===void 0)throw new ac("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==oc&&this.tokenType!==lf&&this.tokenType!==df)throw new sc(`Executable response must contain a 'token_type' field when successful and it must be one of ${lf}, ${df}, or ${oc}.`);if(this.tokenType===oc){if(!e.saml_response)throw new Ra(`Executable response must contain a 'saml_response' field when token_type=${oc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ra(`Executable response must contain a 'id_token' field when token_type=${lf} or ${df}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new uc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new cc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};lt.ExecutableResponse=pf;var Ur=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};lt.ExecutableResponseError=Ur;var ic=class extends Ur{static{o(this,"InvalidVersionFieldError")}};lt.InvalidVersionFieldError=ic;var ac=class extends Ur{static{o(this,"InvalidSuccessFieldError")}};lt.InvalidSuccessFieldError=ac;var ff=class extends Ur{static{o(this,"InvalidExpirationTimeFieldError")}};lt.InvalidExpirationTimeFieldError=ff;var sc=class extends Ur{static{o(this,"InvalidTokenTypeFieldError")}};lt.InvalidTokenTypeFieldError=sc;var uc=class extends Ur{static{o(this,"InvalidCodeFieldError")}};lt.InvalidCodeFieldError=uc;var cc=class extends Ur{static{o(this,"InvalidMessageFieldError")}};lt.InvalidMessageFieldError=cc;var Ra=class extends Ur{static{o(this,"InvalidSubjectTokenError")}};lt.InvalidSubjectTokenError=Ra});var yf=k(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.PluggableAuthHandler=fi.ExecutableError=void 0;var fo=mf(),zz=require("child_process"),hf=require("fs"),lc=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};fi.ExecutableError=lc;var gf=class t{static{o(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{let i=zz.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let l=JSON.parse(s),f=new fo.ExecutableResponse(l);return r(f)}catch(l){return l instanceof fo.ExecutableResponseError?n(l):n(new fo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new lc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await hf.promises.realpath(this.outputFile)}catch{return}if(!(await hf.promises.lstat(e)).isFile())return;let r=await hf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new fo.ExecutableResponse(n).isValid()?new fo.ExecutableResponse(n):void 0}catch(n){throw n instanceof fo.ExecutableResponseError?n:new fo.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){let r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let n=0;n<r.length;n++)r[n][0]==='"'&&r[n].slice(-1)==='"'&&(r[n]=r[n].slice(1,-1));return r}};fi.PluggableAuthHandler=gf});var vf=k(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.PluggableAuthClient=mi.ExecutableError=void 0;var Dz=Bn(),Uz=mf(),WE=yf(),Mz=yf();Object.defineProperty(mi,"ExecutableError",{enumerable:!0,get:o(function(){return Mz.ExecutableError},"get")});var jz=30*1e3,ZE=5*1e3,KE=120*1e3,Lz="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",JE=1,_f=class extends Dz.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=jz;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<ZE||this.timeoutMillis>KE)throw new Error(`Timeout must be between ${ZE} and ${KE} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new WE.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[Lz]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let n=this.getServiceAccountEmail();n&&r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n),e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>JE)throw new Error(`Version of executable is not currently supported, maximum supported version is ${JE}.`);if(!e.success)throw new WE.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new Uz.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};mi.PluggableAuthClient=_f});var Pf=k(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.ExternalAccountClient=void 0;var Fz=Bn(),Bz=nf(),qz=cf(),Vz=vf(),bf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===Fz.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new qz.AwsClient(e):e.credential_source?.executable?new Vz.PluggableAuthClient(e):new Bz.IdentityPoolClient(e):null}};dc.ExternalAccountClient=bf});var Tf=k(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.ExternalAccountAuthorizedUserClient=hi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var XE=Ht(),YE=Hp(),QE=st(),Hz=require("stream"),Gz=Bn();hi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var Wz="https://sts.{universeDomain}/v1/oauthtoken",Sf=class t extends YE.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,r){let n={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:r,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})};XE.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof QE.GaxiosError&&i.response?(0,YE.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Ef=class extends XE.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let r={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new Sf({tokenRefreshEndpoint:e.token_url??Wz.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=Gz.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=QE.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof Hz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};hi.ExternalAccountAuthorizedUserClient=Ef});var nT=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GoogleAuth=Er.GoogleAuthExceptionMessages=void 0;var Zz=require("child_process"),Oa=require("fs"),Kz=st(),Ca=ga(),Jz=require("os"),xf=require("path"),Yz=ya(),Xz=yp(),Qz=vp(),eD=bp(),gi=jp(),eT=Fp(),yi=qp(),tD=Pf(),$a=Bn(),Af=Ht(),tT=Tf(),rT=vr();Er.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment.
|
|
50
50
|
To learn more about authentication and Google APIs, visit:
|
|
51
51
|
https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment.
|
|
52
52
|
To learn more about authentication and Google APIs, visit:
|
|
53
53
|
https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment.
|
|
54
54
|
To learn more about Universe Domain retrieval, visit:
|
|
55
|
-
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Ef=class{static{o(this,"GoogleAuth")}checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Er.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(r=>e(null,r),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await Oa.universe("universe-domain"),e||=Sf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Sf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,VE.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Sf.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof hi.JWT?r.scopes=this.scopes:r instanceof Ca.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof hi.JWT?r.scopes=this.scopes:r instanceof Ca.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new $z.Compute(e));throw new Error(Er.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,r=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let n=await this.getProjectIdOptional();return r&&(e.quotaProjectId=r),this.cachedCredential=e,{credential:e,projectId:n}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=Oa.getGCPResidency()||await Oa.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=Pf.join(i,".config"))}return r&&(r=Pf.join(r,"gcloud","application_default_credentials.json"),Ra.existsSync(r)||(r=null)),r?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=Ra.realpathSync(e),!Ra.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Ra.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==gi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${gi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new gi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,VE.originalOrCamelOptions)(r).get("universe_domain");return e.type===BE.USER_REFRESH_ACCOUNT_TYPE?(n=new BE.UserRefreshClient(r),n.fromJSON(e)):e.type===gi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ca.EXTERNAL_ACCOUNT_TYPE?(n=zz.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===qE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new qE.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new hi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new hi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new hi.JWT({...r,apiKey:e})}_isWindows(){let e=Oz.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,Iz.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==Ca.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Oa.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(r=>e(null,r),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof gi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ca.BaseExternalAccountClient){let r=e.getServiceAccountEmail();if(r)return{client_email:r,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[r,n]=await Promise.all([Oa.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Er.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#r();try{return await this.#e}finally{this.#e=null}}async#r(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=Pf.resolve(this.keyFilename),r=Ra.createReadStream(e);return await this.fromStreamAsync(r,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:r}=await this.#t(e);return r}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let r=await this.getClient();if(!("fetchIdToken"in r))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new kz.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let r=e.url,i=await(await this.getClient()).getRequestHeaders(r);return e.headers=Rz.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,Nz.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof gi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,Cz.createCrypto)();if(n instanceof hi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Er.GoogleAuth=Ef});var GE=k(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.IAMAuth=void 0;var Tf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};lc.IAMAuth=Tf});var WE=k(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DownscopedClient=Mr.EXPIRATION_TIME_OFFSET=Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var Dz=st(),Uz=require("stream"),xf=Ht(),Mz=Vu(),jz="urn:ietf:params:oauth:grant-type:token-exchange",Lz="urn:ietf:params:oauth:token-type:access_token",Fz="urn:ietf:params:oauth:token-type:access_token";Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Mr.EXPIRATION_TIME_OFFSET=300*1e3;var Af=class extends xf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof xf.AuthClient?{}:e),e instanceof xf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let n of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(n.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new Mz.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=Dz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof Uz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:jz,requestedTokenType:Lz,subjectToken:e,subjectTokenType:Fz},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Mr.DownscopedClient=Af});var ZE=k(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.PassThroughClient=void 0;var Bz=Ht(),wf=class extends Bz.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};dc.PassThroughClient=wf});var $a=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.GoogleAuth=se.auth=se.PassThroughClient=se.ExternalAccountAuthorizedUserClient=se.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=se.ExecutableError=se.PluggableAuthClient=se.DownscopedClient=se.BaseExternalAccountClient=se.ExternalAccountClient=se.IdentityPoolClient=se.AwsRequestSigner=se.AwsClient=se.UserRefreshClient=se.LoginTicket=se.ClientAuthentication=se.OAuth2Client=se.CodeChallengeMethod=se.Impersonated=se.JWT=se.JWTAccess=se.IdTokenClient=se.IAMAuth=se.GCPEnv=se.Compute=se.DEFAULT_UNIVERSE=se.AuthClient=se.gaxios=se.gcpMetadata=void 0;var KE=HE();Object.defineProperty(se,"GoogleAuth",{enumerable:!0,get:o(function(){return KE.GoogleAuth},"get")});se.gcpMetadata=ha();se.gaxios=st();var JE=Ht();Object.defineProperty(se,"AuthClient",{enumerable:!0,get:o(function(){return JE.AuthClient},"get")});Object.defineProperty(se,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return JE.DEFAULT_UNIVERSE},"get")});var qz=fp();Object.defineProperty(se,"Compute",{enumerable:!0,get:o(function(){return qz.Compute},"get")});var Vz=gp();Object.defineProperty(se,"GCPEnv",{enumerable:!0,get:o(function(){return Vz.GCPEnv},"get")});var Hz=GE();Object.defineProperty(se,"IAMAuth",{enumerable:!0,get:o(function(){return Hz.IAMAuth},"get")});var Gz=hp();Object.defineProperty(se,"IdTokenClient",{enumerable:!0,get:o(function(){return Gz.IdTokenClient},"get")});var Wz=kp();Object.defineProperty(se,"JWTAccess",{enumerable:!0,get:o(function(){return Wz.JWTAccess},"get")});var Zz=zp();Object.defineProperty(se,"JWT",{enumerable:!0,get:o(function(){return Zz.JWT},"get")});var Kz=jp();Object.defineProperty(se,"Impersonated",{enumerable:!0,get:o(function(){return Kz.Impersonated},"get")});var If=po();Object.defineProperty(se,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return If.CodeChallengeMethod},"get")});Object.defineProperty(se,"OAuth2Client",{enumerable:!0,get:o(function(){return If.OAuth2Client},"get")});Object.defineProperty(se,"ClientAuthentication",{enumerable:!0,get:o(function(){return If.ClientAuthentication},"get")});var Jz=cp();Object.defineProperty(se,"LoginTicket",{enumerable:!0,get:o(function(){return Jz.LoginTicket},"get")});var Yz=Up();Object.defineProperty(se,"UserRefreshClient",{enumerable:!0,get:o(function(){return Yz.UserRefreshClient},"get")});var Xz=of();Object.defineProperty(se,"AwsClient",{enumerable:!0,get:o(function(){return Xz.AwsClient},"get")});var Qz=tf();Object.defineProperty(se,"AwsRequestSigner",{enumerable:!0,get:o(function(){return Qz.AwsRequestSigner},"get")});var eD=Qp();Object.defineProperty(se,"IdentityPoolClient",{enumerable:!0,get:o(function(){return eD.IdentityPoolClient},"get")});var tD=yf();Object.defineProperty(se,"ExternalAccountClient",{enumerable:!0,get:o(function(){return tD.ExternalAccountClient},"get")});var rD=Fn();Object.defineProperty(se,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return rD.BaseExternalAccountClient},"get")});var nD=WE();Object.defineProperty(se,"DownscopedClient",{enumerable:!0,get:o(function(){return nD.DownscopedClient},"get")});var YE=hf();Object.defineProperty(se,"PluggableAuthClient",{enumerable:!0,get:o(function(){return YE.PluggableAuthClient},"get")});Object.defineProperty(se,"ExecutableError",{enumerable:!0,get:o(function(){return YE.ExecutableError},"get")});var XE=bf();Object.defineProperty(se,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return XE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(se,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return XE.ExternalAccountAuthorizedUserClient},"get")});var oD=ZE();Object.defineProperty(se,"PassThroughClient",{enumerable:!0,get:o(function(){return oD.PassThroughClient},"get")});var iD=new KE.GoogleAuth;se.auth=iD});var QE=k(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.getAPI=aD;function aD(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(aD,"getAPI")});var tT=k((wX,eT)=>{eT.exports=require("util").inspect});var Ua=k((IX,PT)=>{var jf=typeof Map=="function"&&Map.prototype,Of=Object.getOwnPropertyDescriptor&&jf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fc=jf&&Of&&typeof Of.get=="function"?Of.get:null,rT=jf&&Map.prototype.forEach,Lf=typeof Set=="function"&&Set.prototype,Cf=Object.getOwnPropertyDescriptor&&Lf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,mc=Lf&&Cf&&typeof Cf.get=="function"?Cf.get:null,nT=Lf&&Set.prototype.forEach,sD=typeof WeakMap=="function"&&WeakMap.prototype,Na=sD?WeakMap.prototype.has:null,uD=typeof WeakSet=="function"&&WeakSet.prototype,za=uD?WeakSet.prototype.has:null,cD=typeof WeakRef=="function"&&WeakRef.prototype,oT=cD?WeakRef.prototype.deref:null,lD=Boolean.prototype.valueOf,dD=Object.prototype.toString,pD=Function.prototype.toString,fD=String.prototype.match,Ff=String.prototype.slice,Bn=String.prototype.replace,mD=String.prototype.toUpperCase,iT=String.prototype.toLowerCase,mT=RegExp.prototype.test,aT=Array.prototype.concat,jr=Array.prototype.join,hD=Array.prototype.slice,sT=Math.floor,Nf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$f=Object.getOwnPropertySymbols,zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Da=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yi||!0)?Symbol.toStringTag:null,hT=Object.prototype.propertyIsEnumerable,uT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function cT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||mT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-sT(-t):sT(t);if(n!==t){var i=String(n),s=Ff.call(e,i.length+1);return Bn.call(i,r,"$&_")+"."+Bn.call(Bn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Bn.call(e,r,"$&_")}o(cT,"addNumericSeparator");var Df=tT(),lT=Df.custom,dT=_T(lT)?lT:null,gT={__proto__:null,double:'"',single:"'"},gD={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};PT.exports=o(function t(e,r,n,i){var s=r||{};if(cn(s,"quoteStyle")&&!cn(gT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(cn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=cn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(cn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(cn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return bT(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return d?cT(e,l):l}if(typeof e=="bigint"){var p=String(e)+"n";return d?cT(e,p):p}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return Uf(e)?"[Array]":"[Object]";var _=ND(s,n);if(typeof i>"u")i=[];else if(vT(i,e)>=0)return"[Circular]";function h(B,J,K){if(J&&(i=hD.call(i),i.push(J)),K){var re={depth:s.depth};return cn(s,"quoteStyle")&&(re.quoteStyle=s.quoteStyle),t(B,re,n+1,i)}return t(B,s,n+1,i)}if(o(h,"inspect"),typeof e=="function"&&!pT(e)){var g=xD(e),y=pc(e,h);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+jr.call(y,", ")+" }":"")}if(_T(e)){var T=yi?Bn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):zf.call(e);return typeof e=="object"&&!yi?ka(T):T}if(CD(e)){for(var P="<"+iT.call(String(e.nodeName)),x=e.attributes||[],N=0;N<x.length;N++)P+=" "+x[N].name+"="+yT(yD(x[N].value),"double",s);return P+=">",e.childNodes&&e.childNodes.length&&(P+="..."),P+="</"+iT.call(String(e.nodeName))+">",P}if(Uf(e)){if(e.length===0)return"[]";var L=pc(e,h);return _&&!kD(L)?"["+Mf(L,_)+"]":"[ "+jr.call(L,", ")+" ]"}if(vD(e)){var X=pc(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!hT.call(e,"cause")?"{ ["+String(e)+"] "+jr.call(aT.call("[cause]: "+h(e.cause),X),", ")+" }":X.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+jr.call(X,", ")+" }"}if(typeof e=="object"&&c){if(dT&&typeof e[dT]=="function"&&Df)return Df(e,{depth:f-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(AD(e)){var W=[];return rT&&rT.call(e,function(B,J){W.push(h(J,e,!0)+" => "+h(B,e))}),fT("Map",fc.call(e),W,_)}if(RD(e)){var G=[];return nT&&nT.call(e,function(B){G.push(h(B,e))}),fT("Set",mc.call(e),G,_)}if(wD(e))return kf("WeakMap");if(OD(e))return kf("WeakSet");if(ID(e))return kf("WeakRef");if(PD(e))return ka(h(Number(e)));if(ED(e))return ka(h(Nf.call(e)));if(SD(e))return ka(lD.call(e));if(bD(e))return ka(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!_D(e)&&!pT(e)){var Z=pc(e,h),ee=uT?uT(e)===Object.prototype:e instanceof Object||e.constructor===Object,Y=e instanceof Object?"":"null prototype",Se=!ee&&Da&&Object(e)===e&&Da in e?Ff.call(qn(e),8,-1):Y?"Object":"",te=ee||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=te+(Se||Y?"["+jr.call(aT.call([],Se||[],Y||[]),": ")+"] ":"");return Z.length===0?q+"{}":_?q+"{"+Mf(Z,_)+"}":q+"{ "+jr.call(Z,", ")+" }"}return String(e)},"inspect_");function yT(t,e,r){var n=r.quoteStyle||e,i=gT[n];return i+t+i}o(yT,"wrapQuotes");function yD(t){return Bn.call(String(t),/"/g,""")}o(yD,"quote");function mo(t){return!Da||!(typeof t=="object"&&(Da in t||typeof t[Da]<"u"))}o(mo,"canTrustToString");function Uf(t){return qn(t)==="[object Array]"&&mo(t)}o(Uf,"isArray");function _D(t){return qn(t)==="[object Date]"&&mo(t)}o(_D,"isDate");function pT(t){return qn(t)==="[object RegExp]"&&mo(t)}o(pT,"isRegExp");function vD(t){return qn(t)==="[object Error]"&&mo(t)}o(vD,"isError");function bD(t){return qn(t)==="[object String]"&&mo(t)}o(bD,"isString");function PD(t){return qn(t)==="[object Number]"&&mo(t)}o(PD,"isNumber");function SD(t){return qn(t)==="[object Boolean]"&&mo(t)}o(SD,"isBoolean");function _T(t){if(yi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!zf)return!1;try{return zf.call(t),!0}catch{}return!1}o(_T,"isSymbol");function ED(t){if(!t||typeof t!="object"||!Nf)return!1;try{return Nf.call(t),!0}catch{}return!1}o(ED,"isBigInt");var TD=Object.prototype.hasOwnProperty||function(t){return t in this};function cn(t,e){return TD.call(t,e)}o(cn,"has");function qn(t){return dD.call(t)}o(qn,"toStr");function xD(t){if(t.name)return t.name;var e=fD.call(pD.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(xD,"nameOf");function vT(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}o(vT,"indexOf");function AD(t){if(!fc||!t||typeof t!="object")return!1;try{fc.call(t);try{mc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(AD,"isMap");function wD(t){if(!Na||!t||typeof t!="object")return!1;try{Na.call(t,Na);try{za.call(t,za)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(wD,"isWeakMap");function ID(t){if(!oT||!t||typeof t!="object")return!1;try{return oT.call(t),!0}catch{}return!1}o(ID,"isWeakRef");function RD(t){if(!mc||!t||typeof t!="object")return!1;try{mc.call(t);try{fc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(RD,"isSet");function OD(t){if(!za||!t||typeof t!="object")return!1;try{za.call(t,za);try{Na.call(t,Na)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(OD,"isWeakSet");function CD(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(CD,"isElement");function bT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return bT(Ff.call(t,0,e.maxStringLength),e)+n}var i=gD[e.quoteStyle||"single"];i.lastIndex=0;var s=Bn.call(Bn.call(t,i,"\\$1"),/[\x00-\x1f]/g,$D);return yT(s,"single",e)}o(bT,"inspectString");function $D(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+mD.call(e.toString(16))}o($D,"lowbyte");function ka(t){return"Object("+t+")"}o(ka,"markBoxed");function kf(t){return t+" { ? }"}o(kf,"weakCollectionOf");function fT(t,e,r,n){var i=n?Mf(r,n):jr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(fT,"collectionOf");function kD(t){for(var e=0;e<t.length;e++)if(vT(t[e],`
|
|
56
|
-
`)>=0)return!1;return!0}o(
|
|
55
|
+
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var wf=class{static{o(this,"GoogleAuth")}checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Er.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(r=>e(null,r),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await Ca.universe("universe-domain"),e||=Af.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Af.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,rT.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Af.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof gi.JWT?r.scopes=this.scopes:r instanceof $a.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof gi.JWT?r.scopes=this.scopes:r instanceof $a.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new Xz.Compute(e));throw new Error(Er.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,r=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let n=await this.getProjectIdOptional();return r&&(e.quotaProjectId=r),this.cachedCredential=e,{credential:e,projectId:n}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=Ca.getGCPResidency()||await Ca.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=xf.join(i,".config"))}return r&&(r=xf.join(r,"gcloud","application_default_credentials.json"),Oa.existsSync(r)||(r=null)),r?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=Oa.realpathSync(e),!Oa.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Oa.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==yi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${yi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new yi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,rT.originalOrCamelOptions)(r).get("universe_domain");return e.type===eT.USER_REFRESH_ACCOUNT_TYPE?(n=new eT.UserRefreshClient(r),n.fromJSON(e)):e.type===yi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===$a.EXTERNAL_ACCOUNT_TYPE?(n=tD.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===tT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new tT.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new gi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new gi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new gi.JWT({...r,apiKey:e})}_isWindows(){let e=Jz.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,Zz.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==$a.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Ca.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(r=>e(null,r),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof yi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof $a.BaseExternalAccountClient){let r=e.getServiceAccountEmail();if(r)return{client_email:r,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[r,n]=await Promise.all([Ca.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Er.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#r();try{return await this.#e}finally{this.#e=null}}async#r(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=xf.resolve(this.keyFilename),r=Oa.createReadStream(e);return await this.fromStreamAsync(r,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:r}=await this.#t(e);return r}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let r=await this.getClient();if(!("fetchIdToken"in r))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new Qz.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let r=e.url,i=await(await this.getClient()).getRequestHeaders(r);return e.headers=Kz.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,eD.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof yi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,Yz.createCrypto)();if(n instanceof gi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Er.GoogleAuth=wf});var oT=k(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.IAMAuth=void 0;var If=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};pc.IAMAuth=If});var iT=k(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DownscopedClient=Mr.EXPIRATION_TIME_OFFSET=Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var rD=st(),nD=require("stream"),Rf=Ht(),oD=Gu(),iD="urn:ietf:params:oauth:grant-type:token-exchange",aD="urn:ietf:params:oauth:token-type:access_token",sD="urn:ietf:params:oauth:token-type:access_token";Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Mr.EXPIRATION_TIME_OFFSET=300*1e3;var Of=class extends Rf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Rf.AuthClient?{}:e),e instanceof Rf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Mr.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let n of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(n.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new oD.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=rD.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof nD.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:iD,requestedTokenType:aD,subjectToken:e,subjectTokenType:sD},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Mr.DownscopedClient=Of});var aT=k(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.PassThroughClient=void 0;var uD=Ht(),Cf=class extends uD.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};fc.PassThroughClient=Cf});var ka=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.GoogleAuth=se.auth=se.PassThroughClient=se.ExternalAccountAuthorizedUserClient=se.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=se.ExecutableError=se.PluggableAuthClient=se.DownscopedClient=se.BaseExternalAccountClient=se.ExternalAccountClient=se.IdentityPoolClient=se.AwsRequestSigner=se.AwsClient=se.UserRefreshClient=se.LoginTicket=se.ClientAuthentication=se.OAuth2Client=se.CodeChallengeMethod=se.Impersonated=se.JWT=se.JWTAccess=se.IdTokenClient=se.IAMAuth=se.GCPEnv=se.Compute=se.DEFAULT_UNIVERSE=se.AuthClient=se.gaxios=se.gcpMetadata=void 0;var sT=nT();Object.defineProperty(se,"GoogleAuth",{enumerable:!0,get:o(function(){return sT.GoogleAuth},"get")});se.gcpMetadata=ga();se.gaxios=st();var uT=Ht();Object.defineProperty(se,"AuthClient",{enumerable:!0,get:o(function(){return uT.AuthClient},"get")});Object.defineProperty(se,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return uT.DEFAULT_UNIVERSE},"get")});var cD=yp();Object.defineProperty(se,"Compute",{enumerable:!0,get:o(function(){return cD.Compute},"get")});var lD=bp();Object.defineProperty(se,"GCPEnv",{enumerable:!0,get:o(function(){return lD.GCPEnv},"get")});var dD=oT();Object.defineProperty(se,"IAMAuth",{enumerable:!0,get:o(function(){return dD.IAMAuth},"get")});var pD=vp();Object.defineProperty(se,"IdTokenClient",{enumerable:!0,get:o(function(){return pD.IdTokenClient},"get")});var fD=Up();Object.defineProperty(se,"JWTAccess",{enumerable:!0,get:o(function(){return fD.JWTAccess},"get")});var mD=jp();Object.defineProperty(se,"JWT",{enumerable:!0,get:o(function(){return mD.JWT},"get")});var hD=qp();Object.defineProperty(se,"Impersonated",{enumerable:!0,get:o(function(){return hD.Impersonated},"get")});var $f=po();Object.defineProperty(se,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return $f.CodeChallengeMethod},"get")});Object.defineProperty(se,"OAuth2Client",{enumerable:!0,get:o(function(){return $f.OAuth2Client},"get")});Object.defineProperty(se,"ClientAuthentication",{enumerable:!0,get:o(function(){return $f.ClientAuthentication},"get")});var gD=fp();Object.defineProperty(se,"LoginTicket",{enumerable:!0,get:o(function(){return gD.LoginTicket},"get")});var yD=Fp();Object.defineProperty(se,"UserRefreshClient",{enumerable:!0,get:o(function(){return yD.UserRefreshClient},"get")});var _D=cf();Object.defineProperty(se,"AwsClient",{enumerable:!0,get:o(function(){return _D.AwsClient},"get")});var vD=af();Object.defineProperty(se,"AwsRequestSigner",{enumerable:!0,get:o(function(){return vD.AwsRequestSigner},"get")});var bD=nf();Object.defineProperty(se,"IdentityPoolClient",{enumerable:!0,get:o(function(){return bD.IdentityPoolClient},"get")});var PD=Pf();Object.defineProperty(se,"ExternalAccountClient",{enumerable:!0,get:o(function(){return PD.ExternalAccountClient},"get")});var SD=Bn();Object.defineProperty(se,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return SD.BaseExternalAccountClient},"get")});var ED=iT();Object.defineProperty(se,"DownscopedClient",{enumerable:!0,get:o(function(){return ED.DownscopedClient},"get")});var cT=vf();Object.defineProperty(se,"PluggableAuthClient",{enumerable:!0,get:o(function(){return cT.PluggableAuthClient},"get")});Object.defineProperty(se,"ExecutableError",{enumerable:!0,get:o(function(){return cT.ExecutableError},"get")});var lT=Tf();Object.defineProperty(se,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return lT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(se,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return lT.ExternalAccountAuthorizedUserClient},"get")});var TD=aT();Object.defineProperty(se,"PassThroughClient",{enumerable:!0,get:o(function(){return TD.PassThroughClient},"get")});var xD=new sT.GoogleAuth;se.auth=xD});var dT=k(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.getAPI=AD;function AD(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(AD,"getAPI")});var fT=k((d7,pT)=>{pT.exports=require("util").inspect});var Ma=k((p7,kT)=>{var qf=typeof Map=="function"&&Map.prototype,Nf=Object.getOwnPropertyDescriptor&&qf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hc=qf&&Nf&&typeof Nf.get=="function"?Nf.get:null,mT=qf&&Map.prototype.forEach,Vf=typeof Set=="function"&&Set.prototype,zf=Object.getOwnPropertyDescriptor&&Vf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,gc=Vf&&zf&&typeof zf.get=="function"?zf.get:null,hT=Vf&&Set.prototype.forEach,wD=typeof WeakMap=="function"&&WeakMap.prototype,za=wD?WeakMap.prototype.has:null,ID=typeof WeakSet=="function"&&WeakSet.prototype,Da=ID?WeakSet.prototype.has:null,RD=typeof WeakRef=="function"&&WeakRef.prototype,gT=RD?WeakRef.prototype.deref:null,OD=Boolean.prototype.valueOf,CD=Object.prototype.toString,$D=Function.prototype.toString,kD=String.prototype.match,Hf=String.prototype.slice,qn=String.prototype.replace,ND=String.prototype.toUpperCase,yT=String.prototype.toLowerCase,AT=RegExp.prototype.test,_T=Array.prototype.concat,jr=Array.prototype.join,zD=Array.prototype.slice,vT=Math.floor,Mf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Df=Object.getOwnPropertySymbols,jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,_i=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ua=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_i||!0)?Symbol.toStringTag:null,wT=Object.prototype.propertyIsEnumerable,bT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function PT(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||AT.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-vT(-t):vT(t);if(n!==t){var i=String(n),s=Hf.call(e,i.length+1);return qn.call(i,r,"$&_")+"."+qn.call(qn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return qn.call(e,r,"$&_")}o(PT,"addNumericSeparator");var Lf=fT(),ST=Lf.custom,ET=OT(ST)?ST:null,IT={__proto__:null,double:'"',single:"'"},DD={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};kT.exports=o(function t(e,r,n,i){var s=r||{};if(cn(s,"quoteStyle")&&!cn(IT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(cn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=cn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(cn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(cn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return $T(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return d?PT(e,l):l}if(typeof e=="bigint"){var f=String(e)+"n";return d?PT(e,f):f}var p=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=p&&p>0&&typeof e=="object")return Ff(e)?"[Array]":"[Object]";var _=eU(s,n);if(typeof i>"u")i=[];else if(CT(i,e)>=0)return"[Circular]";function h(q,J,W){if(J&&(i=zD.call(i),i.push(J)),W){var re={depth:s.depth};return cn(s,"quoteStyle")&&(re.quoteStyle=s.quoteStyle),t(q,re,n+1,i)}return t(q,s,n+1,i)}if(o(h,"inspect"),typeof e=="function"&&!TT(e)){var g=HD(e),y=mc(e,h);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+jr.call(y,", ")+" }":"")}if(OT(e)){var T=_i?qn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):jf.call(e);return typeof e=="object"&&!_i?Na(T):T}if(YD(e)){for(var P="<"+yT.call(String(e.nodeName)),x=e.attributes||[],N=0;N<x.length;N++)P+=" "+x[N].name+"="+RT(UD(x[N].value),"double",s);return P+=">",e.childNodes&&e.childNodes.length&&(P+="..."),P+="</"+yT.call(String(e.nodeName))+">",P}if(Ff(e)){if(e.length===0)return"[]";var F=mc(e,h);return _&&!QD(F)?"["+Bf(F,_)+"]":"[ "+jr.call(F,", ")+" ]"}if(jD(e)){var X=mc(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!wT.call(e,"cause")?"{ ["+String(e)+"] "+jr.call(_T.call("[cause]: "+h(e.cause),X),", ")+" }":X.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+jr.call(X,", ")+" }"}if(typeof e=="object"&&c){if(ET&&typeof e[ET]=="function"&&Lf)return Lf(e,{depth:p-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(GD(e)){var Z=[];return mT&&mT.call(e,function(q,J){Z.push(h(J,e,!0)+" => "+h(q,e))}),xT("Map",hc.call(e),Z,_)}if(KD(e)){var G=[];return hT&&hT.call(e,function(q){G.push(h(q,e))}),xT("Set",gc.call(e),G,_)}if(WD(e))return Uf("WeakMap");if(JD(e))return Uf("WeakSet");if(ZD(e))return Uf("WeakRef");if(FD(e))return Na(h(Number(e)));if(qD(e))return Na(h(Mf.call(e)));if(BD(e))return Na(OD.call(e));if(LD(e))return Na(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!MD(e)&&!TT(e)){var Y=mc(e,h),ee=bT?bT(e)===Object.prototype:e instanceof Object||e.constructor===Object,K=e instanceof Object?"":"null prototype",Oe=!ee&&Ua&&Object(e)===e&&Ua in e?Hf.call(Vn(e),8,-1):K?"Object":"",te=ee||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=te+(Oe||K?"["+jr.call(_T.call([],Oe||[],K||[]),": ")+"] ":"");return Y.length===0?V+"{}":_?V+"{"+Bf(Y,_)+"}":V+"{ "+jr.call(Y,", ")+" }"}return String(e)},"inspect_");function RT(t,e,r){var n=r.quoteStyle||e,i=IT[n];return i+t+i}o(RT,"wrapQuotes");function UD(t){return qn.call(String(t),/"/g,""")}o(UD,"quote");function mo(t){return!Ua||!(typeof t=="object"&&(Ua in t||typeof t[Ua]<"u"))}o(mo,"canTrustToString");function Ff(t){return Vn(t)==="[object Array]"&&mo(t)}o(Ff,"isArray");function MD(t){return Vn(t)==="[object Date]"&&mo(t)}o(MD,"isDate");function TT(t){return Vn(t)==="[object RegExp]"&&mo(t)}o(TT,"isRegExp");function jD(t){return Vn(t)==="[object Error]"&&mo(t)}o(jD,"isError");function LD(t){return Vn(t)==="[object String]"&&mo(t)}o(LD,"isString");function FD(t){return Vn(t)==="[object Number]"&&mo(t)}o(FD,"isNumber");function BD(t){return Vn(t)==="[object Boolean]"&&mo(t)}o(BD,"isBoolean");function OT(t){if(_i)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!jf)return!1;try{return jf.call(t),!0}catch{}return!1}o(OT,"isSymbol");function qD(t){if(!t||typeof t!="object"||!Mf)return!1;try{return Mf.call(t),!0}catch{}return!1}o(qD,"isBigInt");var VD=Object.prototype.hasOwnProperty||function(t){return t in this};function cn(t,e){return VD.call(t,e)}o(cn,"has");function Vn(t){return CD.call(t)}o(Vn,"toStr");function HD(t){if(t.name)return t.name;var e=kD.call($D.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(HD,"nameOf");function CT(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}o(CT,"indexOf");function GD(t){if(!hc||!t||typeof t!="object")return!1;try{hc.call(t);try{gc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(GD,"isMap");function WD(t){if(!za||!t||typeof t!="object")return!1;try{za.call(t,za);try{Da.call(t,Da)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(WD,"isWeakMap");function ZD(t){if(!gT||!t||typeof t!="object")return!1;try{return gT.call(t),!0}catch{}return!1}o(ZD,"isWeakRef");function KD(t){if(!gc||!t||typeof t!="object")return!1;try{gc.call(t);try{hc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(KD,"isSet");function JD(t){if(!Da||!t||typeof t!="object")return!1;try{Da.call(t,Da);try{za.call(t,za)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(JD,"isWeakSet");function YD(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(YD,"isElement");function $T(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return $T(Hf.call(t,0,e.maxStringLength),e)+n}var i=DD[e.quoteStyle||"single"];i.lastIndex=0;var s=qn.call(qn.call(t,i,"\\$1"),/[\x00-\x1f]/g,XD);return RT(s,"single",e)}o($T,"inspectString");function XD(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+ND.call(e.toString(16))}o(XD,"lowbyte");function Na(t){return"Object("+t+")"}o(Na,"markBoxed");function Uf(t){return t+" { ? }"}o(Uf,"weakCollectionOf");function xT(t,e,r,n){var i=n?Bf(r,n):jr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(xT,"collectionOf");function QD(t){for(var e=0;e<t.length;e++)if(CT(t[e],`
|
|
56
|
+
`)>=0)return!1;return!0}o(QD,"singleLineValues");function eU(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=jr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:jr.call(Array(e+1),r)}}o(eU,"getIndent");function Bf(t,e){if(t.length===0)return"";var r=`
|
|
57
57
|
`+e.prev+e.base;return r+jr.call(t,","+r)+`
|
|
58
|
-
`+e.prev}o(Mf,"indentedJoin");function pc(t,e){var r=Uf(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=cn(t,i)?e(t[i],t):""}var s=typeof $f=="function"?$f(t):[],c;if(yi){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var l in t)cn(t,l)&&(r&&String(Number(l))===l&&l<t.length||yi&&c["$"+l]instanceof Symbol||(mT.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof $f=="function")for(var p=0;p<s.length;p++)hT.call(t,s[p])&&n.push("["+e(s[p])+"]: "+e(t[s[p]],t));return n}o(pc,"arrObjKeys")});var ET=k((OX,ST)=>{"use strict";var zD=Ua(),DD=Cn(),hc=o(function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},"listGetNode"),UD=o(function(t,e){if(t){var r=hc(t,e);return r&&r.value}},"listGet"),MD=o(function(t,e,r){var n=hc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),jD=o(function(t,e){return t?!!hc(t,e):!1},"listHas"),LD=o(function(t,e){if(t)return hc(t,e,!0)},"listDelete");ST.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new DD("Side channel does not contain "+zD(n))},"assert"),delete:o(function(n){var i=LD(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return UD(e,n)},"get"),has:o(function(n){return jD(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),MD(e,n,i)},"set")};return r},"getSideChannelList")});var Bf=k(($X,AT)=>{"use strict";var TT=Qi(),xT=td(),FD=xT([TT("%String.prototype.indexOf%")]);AT.exports=o(function(e,r){var n=TT(e,!!r);return typeof n=="function"&&FD(e,".prototype.")>-1?xT([n]):n},"callBoundIntrinsic")});var qf=k((NX,IT)=>{"use strict";var BD=Qi(),Ma=Bf(),qD=Ua(),VD=Cn(),wT=BD("%Map%",!0),HD=Ma("Map.prototype.get",!0),GD=Ma("Map.prototype.set",!0),WD=Ma("Map.prototype.has",!0),ZD=Ma("Map.prototype.delete",!0),KD=Ma("Map.prototype.size",!0);IT.exports=!!wT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new VD("Side channel does not contain "+qD(n))},"assert"),delete:o(function(n){if(e){var i=ZD(e,n);return KD(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return HD(e,n)},"get"),has:o(function(n){return e?WD(e,n):!1},"has"),set:o(function(n,i){e||(e=new wT),GD(e,n,i)},"set")};return r},"getSideChannelMap")});var OT=k((DX,RT)=>{"use strict";var JD=Qi(),yc=Bf(),YD=Ua(),gc=qf(),XD=Cn(),_i=JD("%WeakMap%",!0),QD=yc("WeakMap.prototype.get",!0),eU=yc("WeakMap.prototype.set",!0),tU=yc("WeakMap.prototype.has",!0),rU=yc("WeakMap.prototype.delete",!0);RT.exports=_i?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new XD("Side channel does not contain "+YD(i))},"assert"),delete:o(function(i){if(_i&&i&&(typeof i=="object"||typeof i=="function")){if(e)return rU(e,i)}else if(gc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return _i&&i&&(typeof i=="object"||typeof i=="function")&&e?QD(e,i):r&&r.get(i)},"get"),has:o(function(i){return _i&&i&&(typeof i=="object"||typeof i=="function")&&e?tU(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){_i&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new _i),eU(e,i,s)):gc&&(r||(r=gc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):gc});var Vf=k((MX,CT)=>{"use strict";var nU=Cn(),oU=Ua(),iU=ET(),aU=qf(),sU=OT(),uU=sU||aU||iU;CT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new nU("Side channel does not contain "+oU(n))},"assert"),delete:o(function(n){return!!e&&e.delete(n)},"delete"),get:o(function(n){return e&&e.get(n)},"get"),has:o(function(n){return!!e&&e.has(n)},"has"),set:o(function(n,i){e||(e=uU()),e.set(n,i)},"set")};return r},"getSideChannel")});var _c=k((LX,$T)=>{"use strict";var cU=String.prototype.replace,lU=/%20/g,Hf={RFC1738:"RFC1738",RFC3986:"RFC3986"};$T.exports={default:Hf.RFC3986,formatters:{RFC1738:o(function(t){return cU.call(t,lU,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Hf.RFC1738,RFC3986:Hf.RFC3986}});var Kf=k((BX,kT)=>{"use strict";var dU=_c(),pU=Vf(),Gf=Object.prototype.hasOwnProperty,ho=Array.isArray,vc=pU(),vi=o(function(e,r){return vc.set(e,r),e},"markOverflow"),go=o(function(e){return vc.has(e)},"isOverflow"),ja=o(function(e){return vc.get(e)},"getMaxIndex"),Zf=o(function(e,r){vc.set(e,r)},"setMaxIndex"),Lr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),fU=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(ho(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),La=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),mU=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(ho(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return vi(La(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(go(e)){var s=ja(e)+1;e[s]=r,Zf(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Gf.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(go(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<c.length;l++){var p=parseInt(c[l],10);d[p+1]=r[c[l]]}return vi(d,ja(r)+1)}var f=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&f.length>n.arrayLimit?vi(La(f,n),f.length-1):f}var _=e;return ho(e)&&!ho(r)&&(_=La(e,n)),ho(e)&&ho(r)?(r.forEach(function(h,g){if(Gf.call(e,g)){var y=e[g];y&&typeof y=="object"&&h&&typeof h=="object"?e[g]=t(y,h,n):e[e.length]=h}else e[g]=h}),e):Object.keys(r).reduce(function(h,g){var y=r[g];if(Gf.call(h,g)?h[g]=t(h[g],y,n):h[g]=y,go(r)&&!go(h)&&vi(h,ja(r)),go(h)){var T=parseInt(g,10);String(T)===g&&T>=0&&T>ja(h)&&Zf(h,T)}return h},_)},"merge"),hU=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),gU=o(function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),Wf=1024,yU=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var d="",l=0;l<c.length;l+=Wf){for(var p=c.length>=Wf?c.slice(l,l+Wf):c,f=[],_=0;_<p.length;++_){var h=p.charCodeAt(_);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===dU.RFC1738&&(h===40||h===41)){f[f.length]=p.charAt(_);continue}if(h<128){f[f.length]=Lr[h];continue}if(h<2048){f[f.length]=Lr[192|h>>6]+Lr[128|h&63];continue}if(h<55296||h>=57344){f[f.length]=Lr[224|h>>12]+Lr[128|h>>6&63]+Lr[128|h&63];continue}_+=1,h=65536+((h&1023)<<10|p.charCodeAt(_)&1023),f[f.length]=Lr[240|h>>18]+Lr[128|h>>12&63]+Lr[128|h>>6&63]+Lr[128|h&63]}d+=f.join("")}return d},"encode"),_U=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),l=0;l<d.length;++l){var p=d[l],f=c[p];typeof f=="object"&&f!==null&&n.indexOf(f)===-1&&(r[r.length]={obj:c,prop:p},n[n.length]=f)}return fU(r),e},"compact"),vU=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),bU=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),PU=o(function(e,r,n,i){if(go(e)){var s=ja(e)+1;return e[s]=r,Zf(e,s),e}var c=[].concat(e,r);return c.length>n?vi(La(c,{plainObjects:i}),c.length-1):c},"combine"),SU=o(function(e,r){if(ho(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");kT.exports={arrayToObject:La,assign:hU,combine:PU,compact:_U,decode:gU,encode:yU,isBuffer:bU,isOverflow:go,isRegExp:vU,markOverflow:vi,maybeMap:SU,merge:mU}});var jT=k((VX,MT)=>{"use strict";var zT=Vf(),bc=Kf(),Fa=_c(),EU=Object.prototype.hasOwnProperty,DT={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Fr=Array.isArray,TU=Array.prototype.push,UT=o(function(t,e){TU.apply(t,Fr(e)?e:[e])},"pushToArray"),xU=Date.prototype.toISOString,NT=Fa.default,mt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:bc.encode,encodeValuesOnly:!1,filter:void 0,format:NT,formatter:Fa.formatters[NT],indices:!1,serializeDate:o(function(e){return xU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},AU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Jf={},wU=o(function t(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N){for(var L=e,X=N,W=0,G=!1;(X=X.get(Jf))!==void 0&&!G;){var Z=X.get(e);if(W+=1,typeof Z<"u"){if(Z===W)throw new RangeError("Cyclic object value");G=!0}typeof X.get(Jf)>"u"&&(W=0)}if(typeof f=="function"?L=f(r,L):L instanceof Date?L=g(L):n==="comma"&&Fr(L)&&(L=bc.maybeMap(L,function(Be){return Be instanceof Date?g(Be):Be})),L===null){if(c)return p&&!P?p(r,mt.encoder,x,"key",y):r;L=""}if(AU(L)||bc.isBuffer(L)){if(p){var ee=P?r:p(r,mt.encoder,x,"key",y);return[T(ee)+"="+T(p(L,mt.encoder,x,"value",y))]}return[T(r)+"="+T(String(L))]}var Y=[];if(typeof L>"u")return Y;var Se;if(n==="comma"&&Fr(L))P&&p&&(L=bc.maybeMap(L,p)),Se=[{value:L.length>0?L.join(",")||null:void 0}];else if(Fr(f))Se=f;else{var te=Object.keys(L);Se=_?te.sort(_):te}var q=l?String(r).replace(/\./g,"%2E"):String(r),B=i&&Fr(L)&&L.length===1?q+"[]":q;if(s&&Fr(L)&&L.length===0)return B+"[]";for(var J=0;J<Se.length;++J){var K=Se[J],re=typeof K=="object"&&K&&typeof K.value<"u"?K.value:L[K];if(!(d&&re===null)){var oe=h&&l?String(K).replace(/\./g,"%2E"):String(K),Ae=Fr(L)?typeof n=="function"?n(B,oe):B:B+(h?"."+oe:"["+oe+"]");N.set(e,W);var Oe=zT();Oe.set(Jf,N),UT(Y,t(re,Ae,n,i,s,c,d,l,n==="comma"&&P&&Fr(L)?null:p,f,_,h,g,y,T,P,x,Oe))}}return Y},"stringify"),IU=o(function(e){if(!e)return mt;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||mt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Fa.default;if(typeof e.format<"u"){if(!EU.call(Fa.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Fa.formatters[n],s=mt.filter;(typeof e.filter=="function"||Fr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in DT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=mt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:mt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:mt.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:mt.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:mt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?mt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:mt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:mt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:mt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:mt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:mt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:mt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:mt.strictNullHandling}},"normalizeStringifyOptions");MT.exports=function(t,e){var r=t,n=IU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Fr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=DT[n.arrayFormat],l=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=zT(),f=0;f<i.length;++f){var _=i[f],h=r[_];n.skipNulls&&h===null||UT(c,wU(h,_,d,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var g=c.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}});var BT=k((GX,FT)=>{"use strict";var Br=Kf(),Pc=Object.prototype.hasOwnProperty,Yf=Array.isArray,et={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Br.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},RU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),LT=o(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),OU="utf8=%26%2310003%3B",CU="utf8=%E2%9C%93",$U=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,l,p=r.charset;if(r.charsetSentinel)for(l=0;l<c.length;++l)c[l].indexOf("utf8=")===0&&(c[l]===CU?p="utf-8":c[l]===OU&&(p="iso-8859-1"),d=l,l=c.length);for(l=0;l<c.length;++l)if(l!==d){var f=c[l],_=f.indexOf("]="),h=_===-1?f.indexOf("="):_+1,g,y;if(h===-1?(g=r.decoder(f,et.decoder,p,"key"),y=r.strictNullHandling?null:""):(g=r.decoder(f.slice(0,h),et.decoder,p,"key"),g!==null&&(y=Br.maybeMap(LT(f.slice(h+1),r,Yf(n[g])?n[g].length:0),function(P){return r.decoder(P,et.decoder,p,"value")}))),y&&r.interpretNumericEntities&&p==="iso-8859-1"&&(y=RU(String(y))),f.indexOf("[]=")>-1&&(y=Yf(y)?[y]:y),r.comma&&Yf(y)&&y.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");y=Br.combine([],y,r.arrayLimit,r.plainObjects)}if(g!==null){var T=Pc.call(n,g);T&&(r.duplicates==="combine"||f.indexOf("[]=")>-1)?n[g]=Br.combine(n[g],y,r.arrayLimit,r.plainObjects):(!T||r.duplicates==="last")&&(n[g]=y)}}return n},"parseQueryStringValues"),kU=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:LT(e,r,i),d=t.length-1;d>=0;--d){var l,p=t[d];if(p==="[]"&&r.parseArrays)Br.isOverflow(c)?l=c:l=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Br.combine([],c,r.arrayLimit,r.plainObjects);else{l=r.plainObjects?{__proto__:null}:{};var f=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,_=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,h=parseInt(_,10),g=!isNaN(h)&&p!==_&&String(h)===_&&h>=0&&r.parseArrays;if(!r.parseArrays&&_==="")l={0:c};else if(g&&h<r.arrayLimit)l=[],l[h]=c;else{if(g&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g?(l[h]=c,Br.markOverflow(l,h)):_!=="__proto__"&&(l[_]=c)}}c=l}return c},"parseObject"),NU=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Pc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,l=[];if(d){if(!r.plainObjects&&Pc.call(Object.prototype,d)&&!r.allowPrototypes)return;l[l.length]=d}for(var p=0;(c=s.exec(n))!==null&&p<r.depth;){p+=1;var f=c[1].slice(1,-1);if(!r.plainObjects&&Pc.call(Object.prototype,f)&&!r.allowPrototypes)return;l[l.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");l[l.length]="["+n.slice(c.index)+"]"}return l},"splitKeyIntoSegments"),zU=o(function(e,r,n,i){if(e){var s=NU(e,n);if(s)return kU(s,r,n,i)}},"parseQueryStringKeys"),DU=o(function(e){if(!e)return et;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?et.charset:e.charset,n=typeof e.duplicates>"u"?et.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:et.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:et.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:et.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:et.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:et.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter=="string"||Br.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:et.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:et.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:et.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:et.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:et.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");FT.exports=function(t,e){var r=DU(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?$U(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],l=zU(d,n[d],r,typeof t=="string");i=Br.merge(i,l,r)}return r.allowSparse===!0?i:Br.compact(i)}});var Xf=k((ZX,qT)=>{"use strict";var UU=jT(),MU=BT(),jU=_c();qT.exports={formats:jU,parse:MU,stringify:UU}});var HT=k((Qf,VT)=>{(function(t,e){typeof Qf=="object"?VT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Qf,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){c.push(this.encodeValue(r,l,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&c.push(this.encodeValue(r,s[l],l))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){d.push(this.encodeValue(r,l))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&(d.push(this.encodeUnreserved(l)),d.push(this.encodeValue(r,s[l].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var l=null,p=[];if(n.indexOf(c.charAt(0))!==-1&&(l=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(_){var h=/([^:\*]*)(?::(\d+)|(\*))?/.exec(_);p.push.apply(p,r.getValues(i,l,h[1],h[2]||h[3]))}),l&&l!=="+"){var f=",";return l==="?"?f="&":l!=="#"&&(f=l),(p.length!==0?l:"")+p.join(f)}else return p.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var GT=k(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.isBrowser=LU;function LU(){return typeof window<"u"}o(LU,"isBrowser")});var Ec=k(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.headersToClassicHeaders=WT;Sc.marshallGaxiosResponse=FU;function WT(t){let e={};if(t instanceof Headers)t.forEach((r,n)=>{e[n]=r});else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else e=t||{};return e}o(WT,"headersToClassicHeaders");function FU(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:WT(t?.headers)}})}o(FU,"marshallGaxiosResponse")});var JT=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.sessions=void 0;Jt.request=e1;Jt.closeSession=tm;var KT=require("http2"),BU=require("zlib"),qU=require("url"),VU=Xf(),HU=ta(),GU=require("stream"),WU=require("util"),ZU=require("process"),KU=Ec(),{HTTP2_HEADER_CONTENT_ENCODING:JU,HTTP2_HEADER_CONTENT_TYPE:ZT,HTTP2_HEADER_METHOD:YU,HTTP2_HEADER_PATH:XU,HTTP2_HEADER_STATUS:QU}=KT.constants,Ba=!!ZU.env.HTTP2_DEBUG;Jt.sessions={};async function e1(t){let e=HU(!0,{},t);e.validateStatus=e.validateStatus||t1,e.responseType=e.responseType||"json";let r=new qU.URL(e.url),n=r1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let _=(t.paramsSerializer||VU.stringify)(e.params);i+=`?${_}`}let s=(0,KU.headersToClassicHeaders)(e.headers);s[XU]=i,s[YU]=t.method||"GET",e.headers=s,s[ZT]||e.responseType!=="text"&&(s[ZT]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],l=n.session,p;return new Promise((f,_)=>{try{p=l.request(s).on("response",h=>{Object.assign(c,{headers:h,status:h[QU]});let g=p;if(h[JU]==="gzip"&&(g=p.pipe(BU.createGunzip())),e.responseType==="stream"){c.data=g,f(c);return}g.on("data",y=>{d.push(y)}).on("error",y=>{_(y)}).on("end",()=>{let y=Buffer.concat(d),T=y;if(y){if(e.responseType==="json")try{T=JSON.parse(y.toString("utf8"))}catch{T=y.toString("utf8")}else e.responseType==="text"?T=y.toString("utf8"):e.responseType==="arraybuffer"&&(T=y.buffer);c.data=T}if(!e.validateStatus(c.status)){let P=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let x=WU.inspect(c.data,{depth:5});P=`${P}
|
|
59
|
-
'${x}`}_(new Error(P,{cause:c}))}
|
|
60
|
-
`),this.push(T),
|
|
61
|
-
content-type: ${
|
|
58
|
+
`+e.prev}o(Bf,"indentedJoin");function mc(t,e){var r=Ff(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=cn(t,i)?e(t[i],t):""}var s=typeof Df=="function"?Df(t):[],c;if(_i){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var l in t)cn(t,l)&&(r&&String(Number(l))===l&&l<t.length||_i&&c["$"+l]instanceof Symbol||(AT.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof Df=="function")for(var f=0;f<s.length;f++)wT.call(t,s[f])&&n.push("["+e(s[f])+"]: "+e(t[s[f]],t));return n}o(mc,"arrObjKeys")});var zT=k((m7,NT)=>{"use strict";var tU=Ma(),rU=$n(),yc=o(function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},"listGetNode"),nU=o(function(t,e){if(t){var r=yc(t,e);return r&&r.value}},"listGet"),oU=o(function(t,e,r){var n=yc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),iU=o(function(t,e){return t?!!yc(t,e):!1},"listHas"),aU=o(function(t,e){if(t)return yc(t,e,!0)},"listDelete");NT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new rU("Side channel does not contain "+tU(n))},"assert"),delete:o(function(n){var i=aU(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return nU(e,n)},"get"),has:o(function(n){return iU(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),oU(e,n,i)},"set")};return r},"getSideChannelList")});var Gf=k((g7,MT)=>{"use strict";var DT=ea(),UT=id(),sU=UT([DT("%String.prototype.indexOf%")]);MT.exports=o(function(e,r){var n=DT(e,!!r);return typeof n=="function"&&sU(e,".prototype.")>-1?UT([n]):n},"callBoundIntrinsic")});var Wf=k((_7,LT)=>{"use strict";var uU=ea(),ja=Gf(),cU=Ma(),lU=$n(),jT=uU("%Map%",!0),dU=ja("Map.prototype.get",!0),pU=ja("Map.prototype.set",!0),fU=ja("Map.prototype.has",!0),mU=ja("Map.prototype.delete",!0),hU=ja("Map.prototype.size",!0);LT.exports=!!jT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new lU("Side channel does not contain "+cU(n))},"assert"),delete:o(function(n){if(e){var i=mU(e,n);return hU(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return dU(e,n)},"get"),has:o(function(n){return e?fU(e,n):!1},"has"),set:o(function(n,i){e||(e=new jT),pU(e,n,i)},"set")};return r},"getSideChannelMap")});var BT=k((b7,FT)=>{"use strict";var gU=ea(),vc=Gf(),yU=Ma(),_c=Wf(),_U=$n(),vi=gU("%WeakMap%",!0),vU=vc("WeakMap.prototype.get",!0),bU=vc("WeakMap.prototype.set",!0),PU=vc("WeakMap.prototype.has",!0),SU=vc("WeakMap.prototype.delete",!0);FT.exports=vi?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new _U("Side channel does not contain "+yU(i))},"assert"),delete:o(function(i){if(vi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return SU(e,i)}else if(_c&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return vi&&i&&(typeof i=="object"||typeof i=="function")&&e?vU(e,i):r&&r.get(i)},"get"),has:o(function(i){return vi&&i&&(typeof i=="object"||typeof i=="function")&&e?PU(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){vi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new vi),bU(e,i,s)):_c&&(r||(r=_c()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):_c});var Zf=k((S7,qT)=>{"use strict";var EU=$n(),TU=Ma(),xU=zT(),AU=Wf(),wU=BT(),IU=wU||AU||xU;qT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new EU("Side channel does not contain "+TU(n))},"assert"),delete:o(function(n){return!!e&&e.delete(n)},"delete"),get:o(function(n){return e&&e.get(n)},"get"),has:o(function(n){return!!e&&e.has(n)},"has"),set:o(function(n,i){e||(e=IU()),e.set(n,i)},"set")};return r},"getSideChannel")});var bc=k((T7,VT)=>{"use strict";var RU=String.prototype.replace,OU=/%20/g,Kf={RFC1738:"RFC1738",RFC3986:"RFC3986"};VT.exports={default:Kf.RFC3986,formatters:{RFC1738:o(function(t){return RU.call(t,OU,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Kf.RFC1738,RFC3986:Kf.RFC3986}});var Qf=k((A7,HT)=>{"use strict";var CU=bc(),$U=Zf(),Jf=Object.prototype.hasOwnProperty,ho=Array.isArray,Pc=$U(),bi=o(function(e,r){return Pc.set(e,r),e},"markOverflow"),go=o(function(e){return Pc.has(e)},"isOverflow"),La=o(function(e){return Pc.get(e)},"getMaxIndex"),Xf=o(function(e,r){Pc.set(e,r)},"setMaxIndex"),Lr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),kU=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(ho(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),Fa=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),NU=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(ho(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return bi(Fa(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(go(e)){var s=La(e)+1;e[s]=r,Xf(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Jf.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(go(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<c.length;l++){var f=parseInt(c[l],10);d[f+1]=r[c[l]]}return bi(d,La(r)+1)}var p=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&p.length>n.arrayLimit?bi(Fa(p,n),p.length-1):p}var _=e;return ho(e)&&!ho(r)&&(_=Fa(e,n)),ho(e)&&ho(r)?(r.forEach(function(h,g){if(Jf.call(e,g)){var y=e[g];y&&typeof y=="object"&&h&&typeof h=="object"?e[g]=t(y,h,n):e[e.length]=h}else e[g]=h}),e):Object.keys(r).reduce(function(h,g){var y=r[g];if(Jf.call(h,g)?h[g]=t(h[g],y,n):h[g]=y,go(r)&&!go(h)&&bi(h,La(r)),go(h)){var T=parseInt(g,10);String(T)===g&&T>=0&&T>La(h)&&Xf(h,T)}return h},_)},"merge"),zU=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),DU=o(function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),Yf=1024,UU=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var d="",l=0;l<c.length;l+=Yf){for(var f=c.length>=Yf?c.slice(l,l+Yf):c,p=[],_=0;_<f.length;++_){var h=f.charCodeAt(_);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===CU.RFC1738&&(h===40||h===41)){p[p.length]=f.charAt(_);continue}if(h<128){p[p.length]=Lr[h];continue}if(h<2048){p[p.length]=Lr[192|h>>6]+Lr[128|h&63];continue}if(h<55296||h>=57344){p[p.length]=Lr[224|h>>12]+Lr[128|h>>6&63]+Lr[128|h&63];continue}_+=1,h=65536+((h&1023)<<10|f.charCodeAt(_)&1023),p[p.length]=Lr[240|h>>18]+Lr[128|h>>12&63]+Lr[128|h>>6&63]+Lr[128|h&63]}d+=p.join("")}return d},"encode"),MU=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),l=0;l<d.length;++l){var f=d[l],p=c[f];typeof p=="object"&&p!==null&&n.indexOf(p)===-1&&(r[r.length]={obj:c,prop:f},n[n.length]=p)}return kU(r),e},"compact"),jU=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),LU=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),FU=o(function(e,r,n,i){if(go(e)){var s=La(e)+1;return e[s]=r,Xf(e,s),e}var c=[].concat(e,r);return c.length>n?bi(Fa(c,{plainObjects:i}),c.length-1):c},"combine"),BU=o(function(e,r){if(ho(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");HT.exports={arrayToObject:Fa,assign:zU,combine:FU,compact:MU,decode:DU,encode:UU,isBuffer:LU,isOverflow:go,isRegExp:jU,markOverflow:bi,maybeMap:BU,merge:NU}});var YT=k((I7,JT)=>{"use strict";var WT=Zf(),Sc=Qf(),Ba=bc(),qU=Object.prototype.hasOwnProperty,ZT={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Fr=Array.isArray,VU=Array.prototype.push,KT=o(function(t,e){VU.apply(t,Fr(e)?e:[e])},"pushToArray"),HU=Date.prototype.toISOString,GT=Ba.default,mt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Sc.encode,encodeValuesOnly:!1,filter:void 0,format:GT,formatter:Ba.formatters[GT],indices:!1,serializeDate:o(function(e){return HU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},GU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),em={},WU=o(function t(e,r,n,i,s,c,d,l,f,p,_,h,g,y,T,P,x,N){for(var F=e,X=N,Z=0,G=!1;(X=X.get(em))!==void 0&&!G;){var Y=X.get(e);if(Z+=1,typeof Y<"u"){if(Y===Z)throw new RangeError("Cyclic object value");G=!0}typeof X.get(em)>"u"&&(Z=0)}if(typeof p=="function"?F=p(r,F):F instanceof Date?F=g(F):n==="comma"&&Fr(F)&&(F=Sc.maybeMap(F,function(Be){return Be instanceof Date?g(Be):Be})),F===null){if(c)return f&&!P?f(r,mt.encoder,x,"key",y):r;F=""}if(GU(F)||Sc.isBuffer(F)){if(f){var ee=P?r:f(r,mt.encoder,x,"key",y);return[T(ee)+"="+T(f(F,mt.encoder,x,"value",y))]}return[T(r)+"="+T(String(F))]}var K=[];if(typeof F>"u")return K;var Oe;if(n==="comma"&&Fr(F))P&&f&&(F=Sc.maybeMap(F,f)),Oe=[{value:F.length>0?F.join(",")||null:void 0}];else if(Fr(p))Oe=p;else{var te=Object.keys(F);Oe=_?te.sort(_):te}var V=l?String(r).replace(/\./g,"%2E"):String(r),q=i&&Fr(F)&&F.length===1?V+"[]":V;if(s&&Fr(F)&&F.length===0)return q+"[]";for(var J=0;J<Oe.length;++J){var W=Oe[J],re=typeof W=="object"&&W&&typeof W.value<"u"?W.value:F[W];if(!(d&&re===null)){var oe=h&&l?String(W).replace(/\./g,"%2E"):String(W),Ie=Fr(F)?typeof n=="function"?n(q,oe):q:q+(h?"."+oe:"["+oe+"]");N.set(e,Z);var Ce=WT();Ce.set(em,N),KT(K,t(re,Ie,n,i,s,c,d,l,n==="comma"&&P&&Fr(F)?null:f,p,_,h,g,y,T,P,x,Ce))}}return K},"stringify"),ZU=o(function(e){if(!e)return mt;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||mt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Ba.default;if(typeof e.format<"u"){if(!qU.call(Ba.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Ba.formatters[n],s=mt.filter;(typeof e.filter=="function"||Fr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in ZT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=mt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:mt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:mt.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:mt.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:mt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?mt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:mt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:mt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:mt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:mt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:mt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:mt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:mt.strictNullHandling}},"normalizeStringifyOptions");JT.exports=function(t,e){var r=t,n=ZU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Fr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=ZT[n.arrayFormat],l=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var f=WT(),p=0;p<i.length;++p){var _=i[p],h=r[_];n.skipNulls&&h===null||KT(c,WU(h,_,d,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,f))}var g=c.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}});var ex=k((O7,QT)=>{"use strict";var Br=Qf(),Ec=Object.prototype.hasOwnProperty,tm=Array.isArray,tt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Br.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},KU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),XT=o(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),JU="utf8=%26%2310003%3B",YU="utf8=%E2%9C%93",XU=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<c.length;++l)c[l].indexOf("utf8=")===0&&(c[l]===YU?f="utf-8":c[l]===JU&&(f="iso-8859-1"),d=l,l=c.length);for(l=0;l<c.length;++l)if(l!==d){var p=c[l],_=p.indexOf("]="),h=_===-1?p.indexOf("="):_+1,g,y;if(h===-1?(g=r.decoder(p,tt.decoder,f,"key"),y=r.strictNullHandling?null:""):(g=r.decoder(p.slice(0,h),tt.decoder,f,"key"),g!==null&&(y=Br.maybeMap(XT(p.slice(h+1),r,tm(n[g])?n[g].length:0),function(P){return r.decoder(P,tt.decoder,f,"value")}))),y&&r.interpretNumericEntities&&f==="iso-8859-1"&&(y=KU(String(y))),p.indexOf("[]=")>-1&&(y=tm(y)?[y]:y),r.comma&&tm(y)&&y.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");y=Br.combine([],y,r.arrayLimit,r.plainObjects)}if(g!==null){var T=Ec.call(n,g);T&&(r.duplicates==="combine"||p.indexOf("[]=")>-1)?n[g]=Br.combine(n[g],y,r.arrayLimit,r.plainObjects):(!T||r.duplicates==="last")&&(n[g]=y)}}return n},"parseQueryStringValues"),QU=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:XT(e,r,i),d=t.length-1;d>=0;--d){var l,f=t[d];if(f==="[]"&&r.parseArrays)Br.isOverflow(c)?l=c:l=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Br.combine([],c,r.arrayLimit,r.plainObjects);else{l=r.plainObjects?{__proto__:null}:{};var p=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f,_=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,h=parseInt(_,10),g=!isNaN(h)&&f!==_&&String(h)===_&&h>=0&&r.parseArrays;if(!r.parseArrays&&_==="")l={0:c};else if(g&&h<r.arrayLimit)l=[],l[h]=c;else{if(g&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g?(l[h]=c,Br.markOverflow(l,h)):_!=="__proto__"&&(l[_]=c)}}c=l}return c},"parseObject"),e1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Ec.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,l=[];if(d){if(!r.plainObjects&&Ec.call(Object.prototype,d)&&!r.allowPrototypes)return;l[l.length]=d}for(var f=0;(c=s.exec(n))!==null&&f<r.depth;){f+=1;var p=c[1].slice(1,-1);if(!r.plainObjects&&Ec.call(Object.prototype,p)&&!r.allowPrototypes)return;l[l.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");l[l.length]="["+n.slice(c.index)+"]"}return l},"splitKeyIntoSegments"),t1=o(function(e,r,n,i){if(e){var s=e1(e,n);if(s)return QU(s,r,n,i)}},"parseQueryStringKeys"),r1=o(function(e){if(!e)return tt;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?tt.charset:e.charset,n=typeof e.duplicates>"u"?tt.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:tt.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:tt.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:tt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:tt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:tt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:tt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:tt.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:tt.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:tt.decoder,delimiter:typeof e.delimiter=="string"||Br.isRegExp(e.delimiter)?e.delimiter:tt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:tt.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:tt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:tt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:tt.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:tt.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:tt.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:tt.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");QT.exports=function(t,e){var r=r1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?XU(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],l=t1(d,n[d],r,typeof t=="string");i=Br.merge(i,l,r)}return r.allowSparse===!0?i:Br.compact(i)}});var rm=k(($7,tx)=>{"use strict";var n1=YT(),o1=ex(),i1=bc();tx.exports={formats:i1,parse:o1,stringify:n1}});var nx=k((nm,rx)=>{(function(t,e){typeof nm=="object"?rx.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(nm,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){c.push(this.encodeValue(r,l,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&c.push(this.encodeValue(r,s[l],l))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){d.push(this.encodeValue(r,l))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&(d.push(this.encodeUnreserved(l)),d.push(this.encodeValue(r,s[l].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var l=null,f=[];if(n.indexOf(c.charAt(0))!==-1&&(l=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(_){var h=/([^:\*]*)(?::(\d+)|(\*))?/.exec(_);f.push.apply(f,r.getValues(i,l,h[1],h[2]||h[3]))}),l&&l!=="+"){var p=",";return l==="?"?p="&":l!=="#"&&(p=l),(f.length!==0?l:"")+f.join(p)}else return f.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var ox=k(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.isBrowser=a1;function a1(){return typeof window<"u"}o(a1,"isBrowser")});var xc=k(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.headersToClassicHeaders=ix;Tc.marshallGaxiosResponse=s1;function ix(t){let e={};if(t instanceof Headers)t.forEach((r,n)=>{e[n]=r});else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else e=t||{};return e}o(ix,"headersToClassicHeaders");function s1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:ix(t?.headers)}})}o(s1,"marshallGaxiosResponse")});var ux=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.sessions=void 0;Jt.request=b1;Jt.closeSession=im;var sx=require("http2"),u1=require("zlib"),c1=require("url"),l1=rm(),d1=ra(),p1=require("stream"),f1=require("util"),m1=require("process"),h1=xc(),{HTTP2_HEADER_CONTENT_ENCODING:g1,HTTP2_HEADER_CONTENT_TYPE:ax,HTTP2_HEADER_METHOD:y1,HTTP2_HEADER_PATH:_1,HTTP2_HEADER_STATUS:v1}=sx.constants,qa=!!m1.env.HTTP2_DEBUG;Jt.sessions={};async function b1(t){let e=d1(!0,{},t);e.validateStatus=e.validateStatus||P1,e.responseType=e.responseType||"json";let r=new c1.URL(e.url),n=S1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let _=(t.paramsSerializer||l1.stringify)(e.params);i+=`?${_}`}let s=(0,h1.headersToClassicHeaders)(e.headers);s[_1]=i,s[y1]=t.method||"GET",e.headers=s,s[ax]||e.responseType!=="text"&&(s[ax]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],l=n.session,f;return new Promise((p,_)=>{try{f=l.request(s).on("response",h=>{Object.assign(c,{headers:h,status:h[v1]});let g=f;if(h[g1]==="gzip"&&(g=f.pipe(u1.createGunzip())),e.responseType==="stream"){c.data=g,p(c);return}g.on("data",y=>{d.push(y)}).on("error",y=>{_(y)}).on("end",()=>{let y=Buffer.concat(d),T=y;if(y){if(e.responseType==="json")try{T=JSON.parse(y.toString("utf8"))}catch{T=y.toString("utf8")}else e.responseType==="text"?T=y.toString("utf8"):e.responseType==="arraybuffer"&&(T=y.buffer);c.data=T}if(!e.validateStatus(c.status)){let P=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let x=f1.inspect(c.data,{depth:5});P=`${P}
|
|
59
|
+
'${x}`}_(new Error(P,{cause:c}))}p(c)})}).on("error",h=>{_(h)})}catch(h){im(r).then(()=>_(h)).catch(_);return}if(c.request=f,t.data){if(t.data instanceof p1.Stream)t.data.pipe(f);else if(typeof t.data=="string"){let h=Buffer.from(t.data);f.end(h)}else if(typeof t.data=="object"){let h=JSON.stringify(t.data);f.end(h)}}n.timeoutHandle=setTimeout(()=>im(r),500)})}o(b1,"request");function P1(t){return t>=200&&t<300}o(P1,"validateStatus");function S1(t){if(Jt.sessions[t])qa&&console.log(`Used cached client for ${t}`);else{qa&&console.log(`Creating client for ${t}`);let e=sx.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete Jt.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete Jt.sessions[t]}),Jt.sessions[t]={session:e}}return Jt.sessions[t]}o(S1,"_getClient");async function im(t){let e=Jt.sessions[t.host];if(!e)return;let{session:r}=e;delete Jt.sessions[t.host],qa&&console.error(`Closing ${t.host}`),r.close(()=>{qa&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(qa&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(im,"closeSession")});var cx=k((L7,E1)=>{E1.exports={name:"googleapis-common",version:"8.0.2",description:"A common tooling library used by the googleapis npm module. You probably don't want to use this directly.",repository:{type:"git",directory:"packages/nodejs-googleapis-common",url:"https://github.com/googleapis/google-cloud-node-core.git"},main:"build/src/index.js",types:"build/src/index.d.ts",files:["build/src","!build/src/**/*.map"],scripts:{prebenchmark:"npm run compile",benchmark:"node build/benchmark/bench.js",compile:"tsc -p .",test:"c8 mocha build/test","system-test":"c8 mocha build/system-test --timeout 600000","presystem-test":"npm run compile",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",lint:"gts check","samples-test":"mocha build/samples-test",docs:"jsdoc -c .jsdoc.js",webpack:"webpack","browser-test":"karma start",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},keywords:[],author:"Google LLC",license:"Apache-2.0",dependencies:{extend:"^3.0.2",gaxios:"7.1.3","google-auth-library":"10.5.0","google-logging-utils":"1.1.3",qs:"^6.7.0","url-template":"^2.0.8"},devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/nock":"^11.0.0","@types/proxyquire":"^1.3.31","@types/qs":"^6.5.3","@types/sinon":"^21.0.0","@types/tmp":"^0.2.6","@types/url-template":"^2.0.28",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2",http2spy:"^2.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","path-to-regexp":"^6.0.0",proxyquire:"^2.1.3",puppeteer:"^24.0.0",sinon:"21.0.3",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},engines:{node:">=18.0.0"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/nodejs-googleapis-common"}});var Ac=k(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.createAPIRequest=I1;var am=st(),T1=rm(),mx=require("stream"),lx=nx(),dx=ra(),um=ox(),x1=ux(),sm=xc(),hx=cx(),px=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function A1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(A1,"isReadableStream");function w1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(w1,"getMissingParams");function I1(t,e){if(e)fx(t).then(r=>e(null,r),e);else return fx(t)}o(I1,"createAPIRequest");async function fx(t){let e=dx(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=dx(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,c=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let d=(0,sm.headersToClassicHeaders)(r.headers||{});R1(d,e.apiVersion),delete r.headers,Object.keys(r).forEach(g=>{if(g.slice(-1)==="_"){let y=g.slice(0,-1);r[y]=r[g],delete r[g]}});let l=w1(r,t.requiredParams);if(l)throw new Error("Missing required parameters: "+l.join(", "));if(e.url){let g=e.url;typeof g=="object"&&(g=g.toString()),e.url=lx.parse(g).expand(r)}if(t.mediaUrl&&(t.mediaUrl=lx.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let g=new URL(e.url),y=g.href.substr(g.origin.length);e.url=new URL(y,t.context._options.rootUrl).href}e.paramsSerializer=g=>T1.stringify(g,{arrayFormat:"repeat"}),t.pathParams.forEach(g=>delete r[g]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function f(g){let y=px(),T=`--${y}--`,P=new mx.PassThrough({flush(F){this.push(`\r
|
|
60
|
+
`),this.push(T),F()}}),x=new cm,N=A1(g[1].body);d["content-type"]=`multipart/related; boundary=${y}`;for(let F of g){let X=`--${y}\r
|
|
61
|
+
content-type: ${F["content-type"]}\r
|
|
62
62
|
\r
|
|
63
|
-
`;P.push(X),typeof
|
|
64
|
-
`)):(x.on("progress",
|
|
63
|
+
`;P.push(X),typeof F.body=="string"?(P.push(F.body),P.push(`\r
|
|
64
|
+
`)):(x.on("progress",Z=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:Z})}),F.body.pipe(x).pipe(P))}N||(P.push(T),P.push(null)),e.data=P}o(f,"multipartUpload");function p(g){let y=px(),T=`--${y}--`;d["content-type"]=`multipart/related; boundary=${y}`;let P="";for(let x of g){let N=`--${y}\r
|
|
65
65
|
content-type: ${x["content-type"]}\r
|
|
66
66
|
\r
|
|
67
67
|
`;P+=N,typeof x.body=="string"&&(P+=x.body,P+=`\r
|
|
68
|
-
`)}P+=T,e.data=P}if(o(f,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let g=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,om.isBrowser)()?f(g):p(g)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=rm.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,om.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:nx.version,comment:"gzip"});let g=e.userAgentDirectives.map(y=>{let T=`${y.product}/${y.version}`;return y.comment&&(T+=` (${y.comment})`),T}).join(" ");e.headers.set("User-Agent",g)}if(e.validateStatus||(e.validateStatus=g=>g>=200&&g<300||g===304),e.retry=e.retry===void 0?!0:e.retry,delete e.auth,e.universeDomain&&e.universe_domain&&e.universeDomain!==e.universe_domain)throw new Error("Please set either universe_domain or universeDomain, but not both.");let _=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,h=e.universeDomain??e.universe_domain??_??"googleapis.com";if(h!=="googleapis.com"&&e.url){let g=new URL(e.url);g.hostname.endsWith(".googleapis.com")&&(g.hostname=g.hostname.replace(/googleapis\.com$/,h),e.url=g.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let g=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(g&&h!==g)throw new Error(`The configured universe domain (${h}) does not match the universe domain found in the credentials (${g}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let y=await s.getRequestHeaders(e.url),T=Object.assign({},e);return T.headers=rm.Gaxios.mergeHeaders(T.headers,y),i1.request(T)}else{let y=await s.request(e);return(0,nm.marshallGaxiosResponse)(y)}}else return new rm.Gaxios().request(e).then(g=>(0,nm.marshallGaxiosResponse)(g))}o(tx,"createAPIRequestAsync");var im=class extends rx.Transform{static{o(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function c1(t,e){(0,om.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${nx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(c1,"populateAPIHeader")});var ox=k(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.AuthPlus=void 0;var ln=$a(),sm=class extends ln.GoogleAuth{static{o(this,"AuthPlus")}JWT=ln.JWT;Compute=ln.Compute;OAuth2=ln.OAuth2Client;GoogleAuth=ln.GoogleAuth;AwsClient=ln.AwsClient;IdentityPoolClient=ln.IdentityPoolClient;ExternalAccountClient=ln.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new ln.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};xc.AuthPlus=sm});var cm=k(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.Endpoint=void 0;var ix=Tc(),um=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=ax(e.rootUrl+e.servicePath+r.path),l={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let p=ax(e.rootUrl+r.mediaUpload.protocols.simple.path);l.mediaUrl=p.substring(1,p.length-1)}if(!s)return(0,ix.createAPIRequest)(l);(0,ix.createAPIRequest)(l,s)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};Ac.Endpoint=um;function ax(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(ax,"buildurl")});var ux=k(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.Discovery=void 0;var l1=require("fs"),d1=st(),p1=require("url"),sx=require("util"),f1=Tc(),m1=cm(),h1=sx.promisify(l1.readFile),lm=class{static{o(this,"Discovery")}transporter=new d1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new m1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async l=>{let p=await this.discoverAPI(l.discoveryRestUrl);return{api:l,endpointCreator:p}})),c={},d={};for(let l of s)d[l.api.name]||(c[l.api.name]={},d[l.api.name]=p=>{let f=typeof p,_;if(f==="string")_=p,p={};else if(f==="object")_=p.version,delete p.version;else throw new Error("Argument error: Accepts only string or object");try{let h=l.endpointCreator(p,this);return Object.freeze(h)}catch(h){throw new Error(sx.format('Unable to load endpoint %s("%s"): %s',l.api.name,_,h.message))}}),c[l.api.name][l.api.version]=l.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=p1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await h1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,f1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};wc.Discovery=lm});var Ic=k(xe=>{"use strict";var g1=xe&&xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y1=xe&&xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g1(e,t,r)};Object.defineProperty(xe,"__esModule",{value:!0});xe.Endpoint=xe.Discovery=xe.AuthPlus=xe.createAPIRequest=xe.getAPI=xe.GaxiosError=xe.Gaxios=xe.AwsClient=xe.IdentityPoolClient=xe.BaseExternalAccountClient=xe.ExternalAccountClient=xe.GoogleAuth=xe.UserRefreshClient=xe.Compute=xe.JWT=xe.OAuth2Client=xe.gaxios=xe.googleAuthLibrary=void 0;xe.googleAuthLibrary=$a();xe.gaxios=st();var dn=$a();Object.defineProperty(xe,"OAuth2Client",{enumerable:!0,get:o(function(){return dn.OAuth2Client},"get")});Object.defineProperty(xe,"JWT",{enumerable:!0,get:o(function(){return dn.JWT},"get")});Object.defineProperty(xe,"Compute",{enumerable:!0,get:o(function(){return dn.Compute},"get")});Object.defineProperty(xe,"UserRefreshClient",{enumerable:!0,get:o(function(){return dn.UserRefreshClient},"get")});Object.defineProperty(xe,"GoogleAuth",{enumerable:!0,get:o(function(){return dn.GoogleAuth},"get")});Object.defineProperty(xe,"ExternalAccountClient",{enumerable:!0,get:o(function(){return dn.ExternalAccountClient},"get")});Object.defineProperty(xe,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return dn.BaseExternalAccountClient},"get")});Object.defineProperty(xe,"IdentityPoolClient",{enumerable:!0,get:o(function(){return dn.IdentityPoolClient},"get")});Object.defineProperty(xe,"AwsClient",{enumerable:!0,get:o(function(){return dn.AwsClient},"get")});var cx=st();Object.defineProperty(xe,"Gaxios",{enumerable:!0,get:o(function(){return cx.Gaxios},"get")});Object.defineProperty(xe,"GaxiosError",{enumerable:!0,get:o(function(){return cx.GaxiosError},"get")});var _1=QE();Object.defineProperty(xe,"getAPI",{enumerable:!0,get:o(function(){return _1.getAPI},"get")});var v1=Tc();Object.defineProperty(xe,"createAPIRequest",{enumerable:!0,get:o(function(){return v1.createAPIRequest},"get")});var b1=ox();Object.defineProperty(xe,"AuthPlus",{enumerable:!0,get:o(function(){return b1.AuthPlus},"get")});var P1=ux();Object.defineProperty(xe,"Discovery",{enumerable:!0,get:o(function(){return P1.Discovery},"get")});var S1=cm();Object.defineProperty(xe,"Endpoint",{enumerable:!0,get:o(function(){return S1.Endpoint},"get")});y1(Ec(),xe)});var dx=k(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.people_v1=void 0;var me=Ic(),lx;(function(t){class e{static{o(this,"People")}context;contactGroups;otherContacts;people;constructor(l,p){this.context={_options:l||{},google:p},this.contactGroups=new r(this.context),this.otherContacts=new i(this.context),this.people=new s(this.context)}}t.People=e;class r{static{o(this,"Resource$Contactgroups")}context;members;constructor(l){this.context=l,this.members=new n(this.context)}batchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}create(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}delete(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}update(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups=r;class n{static{o(this,"Resource$Contactgroups$Members")}context;constructor(l){this.context=l}modify(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/members:modify").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups$Members=n;class i{static{o(this,"Resource$Othercontacts")}context;constructor(l){this.context=l}copyOtherContactToMyContactsGroup(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:copyOtherContactToMyContactsGroup").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}search(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts:search").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Othercontacts=i;class s{static{o(this,"Resource$People")}context;connections;constructor(l){this.context=l,this.connections=new c(this.context)}batchCreateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchCreateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchDeleteContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchDeleteContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchUpdateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchUpdateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}createContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:createContact").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContact").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}getBatchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}listDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:listDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContact").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People=s;class c{static{o(this,"Resource$People$Connections")}context;constructor(l){this.context=l}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/connections").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People$Connections=c})(lx||(Rc.people_v1=lx={}))});var mx=k(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.AuthPlus=ur.people_v1=ur.auth=ur.VERSIONS=void 0;ur.people=E1;var px=Ic(),fx=dx();Object.defineProperty(ur,"people_v1",{enumerable:!0,get:o(function(){return fx.people_v1},"get")});ur.VERSIONS={v1:fx.people_v1.People};function E1(t){return(0,px.getAPI)("people",t,ur.VERSIONS,this)}o(E1,"people");var T1=new px.AuthPlus;ur.auth=T1;var x1=Ic();Object.defineProperty(ur,"AuthPlus",{enumerable:!0,get:o(function(){return x1.AuthPlus},"get")})});var hx=k((dm,pm)=>{(function(t,e){typeof dm=="object"&&typeof pm<"u"?pm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(dm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",l="week",p="month",f="quarter",_="year",h="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(te){var q=["th","st","nd","rd"],B=te%100;return"["+te+(q[(B-20)%10]||q[B]||q[0])+"]"},"ordinal")},x=o(function(te,q,B){var J=String(te);return!J||J.length>=q?te:""+Array(q+1-J.length).join(B)+te},"m"),N={s:x,z:o(function(te){var q=-te.utcOffset(),B=Math.abs(q),J=Math.floor(B/60),K=B%60;return(q<=0?"+":"-")+x(J,2,"0")+":"+x(K,2,"0")},"z"),m:o(function te(q,B){if(q.date()<B.date())return-te(B,q);var J=12*(B.year()-q.year())+(B.month()-q.month()),K=q.clone().add(J,p),re=B-K<0,oe=q.clone().add(J+(re?-1:1),p);return+(-(J+(B-K)/(re?K-oe:oe-K))||0)},"t"),a:o(function(te){return te<0?Math.ceil(te)||0:Math.floor(te)},"a"),p:o(function(te){return{M:p,y:_,w:l,d,D:h,h:c,m:s,s:i,ms:n,Q:f}[te]||String(te||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(te){return te===void 0},"u")},L="en",X={};X[L]=P;var W=o(function(te){return te instanceof Y},"p"),G=o(function te(q,B,J){var K;if(!q)return L;if(typeof q=="string"){var re=q.toLowerCase();X[re]&&(K=re),B&&(X[re]=B,K=re);var oe=q.split("-");if(!K&&oe.length>1)return te(oe[0])}else{var Ae=q.name;X[Ae]=q,K=Ae}return!J&&K&&(L=K),K||!J&&L},"t"),Z=o(function(te,q){if(W(te))return te.clone();var B=typeof q=="object"?q:{};return B.date=te,B.args=arguments,new Y(B)},"w"),ee=N;ee.l=G,ee.i=W,ee.w=function(te,q){return Z(te,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var Y=(function(){function te(B){this.$L=G(B.locale,null,!0),this.parse(B)}o(te,"M");var q=te.prototype;return q.parse=function(B){this.$d=(function(J){var K=J.date,re=J.utc;if(K===null)return new Date(NaN);if(ee.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var oe=K.match(y);if(oe){var Ae=oe[2]-1||0,Oe=(oe[7]||"0").substring(0,3);return re?new Date(Date.UTC(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)):new Date(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)}}return new Date(K)})(B),this.$x=B.x||{},this.init()},q.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},q.$utils=function(){return ee},q.isValid=function(){return this.$d.toString()!==g},q.isSame=function(B,J){var K=Z(B);return this.startOf(J)<=K&&K<=this.endOf(J)},q.isAfter=function(B,J){return Z(B)<this.startOf(J)},q.isBefore=function(B,J){return this.endOf(J)<Z(B)},q.$g=function(B,J,K){return ee.u(B)?this[J]:this.set(K,B)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(B,J){var K=this,re=!!ee.u(J)||J,oe=ee.p(B),Ae=o(function(Nt,Fe){var qe=ee.w(K.$u?Date.UTC(K.$y,Fe,Nt):new Date(K.$y,Fe,Nt),K);return re?qe:qe.endOf(d)},"l"),Oe=o(function(Nt,Fe){return ee.w(K.toDate()[Nt].apply(K.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(Fe)),K)},"$"),Be=this.$W,Ge=this.$M,ht=this.$D,Q="set"+(this.$u?"UTC":"");switch(oe){case _:return re?Ae(1,0):Ae(31,11);case p:return re?Ae(1,Ge):Ae(0,Ge+1);case l:var tt=this.$locale().weekStart||0,it=(Be<tt?Be+7:Be)-tt;return Ae(re?ht-it:ht+(6-it),Ge);case d:case h:return Oe(Q+"Hours",0);case c:return Oe(Q+"Minutes",1);case s:return Oe(Q+"Seconds",2);case i:return Oe(Q+"Milliseconds",3);default:return this.clone()}},q.endOf=function(B){return this.startOf(B,!1)},q.$set=function(B,J){var K,re=ee.p(B),oe="set"+(this.$u?"UTC":""),Ae=(K={},K[d]=oe+"Date",K[h]=oe+"Date",K[p]=oe+"Month",K[_]=oe+"FullYear",K[c]=oe+"Hours",K[s]=oe+"Minutes",K[i]=oe+"Seconds",K[n]=oe+"Milliseconds",K)[re],Oe=re===d?this.$D+(J-this.$W):J;if(re===p||re===_){var Be=this.clone().set(h,1);Be.$d[Ae](Oe),Be.init(),this.$d=Be.set(h,Math.min(this.$D,Be.daysInMonth())).$d}else Ae&&this.$d[Ae](Oe);return this.init(),this},q.set=function(B,J){return this.clone().$set(B,J)},q.get=function(B){return this[ee.p(B)]()},q.add=function(B,J){var K,re=this;B=Number(B);var oe=ee.p(J),Ae=o(function(Ge){var ht=Z(re);return ee.w(ht.date(ht.date()+Math.round(Ge*B)),re)},"y");if(oe===p)return this.set(p,this.$M+B);if(oe===_)return this.set(_,this.$y+B);if(oe===d)return Ae(1);if(oe===l)return Ae(7);var Oe=(K={},K[s]=e,K[c]=r,K[i]=t,K)[oe]||1,Be=this.$d.getTime()+B*Oe;return ee.w(Be,this)},q.subtract=function(B,J){return this.add(-1*B,J)},q.format=function(B){var J=this,K=this.$locale();if(!this.isValid())return K.invalidDate||g;var re=B||"YYYY-MM-DDTHH:mm:ssZ",oe=ee.z(this),Ae=this.$H,Oe=this.$m,Be=this.$M,Ge=K.weekdays,ht=K.months,Q=K.meridiem,tt=o(function(Fe,qe,v,E){return Fe&&(Fe[qe]||Fe(J,re))||v[qe].slice(0,E)},"h"),it=o(function(Fe){return ee.s(Ae%12||12,Fe,"0")},"d"),Nt=Q||function(Fe,qe,v){var E=Fe<12?"AM":"PM";return v?E.toLowerCase():E};return re.replace(T,(function(Fe,qe){return qe||(function(v){switch(v){case"YY":return String(J.$y).slice(-2);case"YYYY":return ee.s(J.$y,4,"0");case"M":return Be+1;case"MM":return ee.s(Be+1,2,"0");case"MMM":return tt(K.monthsShort,Be,ht,3);case"MMMM":return tt(ht,Be);case"D":return J.$D;case"DD":return ee.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return tt(K.weekdaysMin,J.$W,Ge,2);case"ddd":return tt(K.weekdaysShort,J.$W,Ge,3);case"dddd":return Ge[J.$W];case"H":return String(Ae);case"HH":return ee.s(Ae,2,"0");case"h":return it(1);case"hh":return it(2);case"a":return Nt(Ae,Oe,!0);case"A":return Nt(Ae,Oe,!1);case"m":return String(Oe);case"mm":return ee.s(Oe,2,"0");case"s":return String(J.$s);case"ss":return ee.s(J.$s,2,"0");case"SSS":return ee.s(J.$ms,3,"0");case"Z":return oe}return null})(Fe)||oe.replace(":","")}))},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(B,J,K){var re,oe=this,Ae=ee.p(J),Oe=Z(B),Be=(Oe.utcOffset()-this.utcOffset())*e,Ge=this-Oe,ht=o(function(){return ee.m(oe,Oe)},"D");switch(Ae){case _:re=ht()/12;break;case p:re=ht();break;case f:re=ht()/3;break;case l:re=(Ge-Be)/6048e5;break;case d:re=(Ge-Be)/864e5;break;case c:re=Ge/r;break;case s:re=Ge/e;break;case i:re=Ge/t;break;default:re=Ge}return K?re:ee.a(re)},q.daysInMonth=function(){return this.endOf(p).$D},q.$locale=function(){return X[this.$L]},q.locale=function(B,J){if(!B)return this.$L;var K=this.clone(),re=G(B,J,!0);return re&&(K.$L=re),K},q.clone=function(){return ee.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},te})(),Se=Y.prototype;return Z.prototype=Se,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",p],["$y",_],["$D",h]].forEach((function(te){Se[te[1]]=function(q){return this.$g(q,te[0],te[1])}})),Z.extend=function(te,q){return te.$i||(te(q,Y,Z),te.$i=!0),Z},Z.locale=G,Z.isDayjs=W,Z.unix=function(te){return Z(1e3*te)},Z.en=X[L],Z.Ls=X,Z.p={},Z}))});var w1={};gs(w1,{googleContacts:()=>A1});module.exports=aw(w1);var sw=Object.freeze({status:"aborted"});function ae(t,e,r){function n(d,l){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:l,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,l);let p=c.prototype,f=Object.keys(p);for(let _=0;_<f.length;_++){let h=f[_];h in d||(d[h]=p[h].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var l;let p=r?.Parent?new s:this;n(p,d),(l=p._zod).deferred??(l.deferred=[]);for(let f of p._zod.deferred)f();return p}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(ae,"$constructor");var xr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ys=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},ol={};function Jr(t){return t&&Object.assign(ol,t),ol}o(Jr,"config");function al(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}o(al,"getEnumValues");function yh(t,e){return typeof e=="bigint"?e.toString():e}o(yh,"jsonStringifyReplacer");function vs(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(vs,"cached");function _h(t){return t==null}o(_h,"nullish");function bs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(bs,"cleanRegex");var gh=Symbol("evaluating");function ut(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==gh)return n===void 0&&(n=gh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(ut,"defineLazy");var sl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ri(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ri,"isObject");var uw=vs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function vh(t){if(Ri(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ri(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(vh,"isPlainObject");var bh=new Set(["string","number","symbol"]);function Co(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Co,"escapeRegex");function Ps(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Ps,"clone");function Xe(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(Xe,"normalizeParams");function Ph(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Ph,"optionalKeys");var Sh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $o(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}o($o,"aborted");function bn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(bn,"prefixIssues");function _s(t){return typeof t=="string"?t:t?.message}o(_s,"unwrapMessage");function Pn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=_s(t.inst?._zod.def?.error?.(t))??_s(e?.error?.(t))??_s(r.customError?.(t))??_s(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Pn,"finalizeIssue");function Eh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Eh,"getLengthableOrigin");function ul(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(ul,"issue");var Th=o((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,yh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),xh=ae("$ZodError",Th),Oi=ae("$ZodError",Th,{Parent:Error});var lw=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new xr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw sl(d,i?.callee),d}return c.value},"_parse"),Ss=lw(Oi),dw=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw sl(d,i?.callee),d}return c.value},"_parseAsync"),Es=dw(Oi),pw=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new xr;return s.issues.length?{success:!1,error:new(t??xh)(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParse"),Ci=pw(Oi),fw=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParseAsync"),$i=fw(Oi);var mw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",hw=new RegExp(`^${mw}$`);var Ah=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),wh=/^-?\d+n?$/,Ih=/^-?\d+$/,cl=/^-?\d+(?:\.\d+)?$/,Rh=/^(?:true|false)$/i;var Sn=ae("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),gw={number:"number",bigint:"bigint",object:"date"};var Oh=ae("$ZodCheckGreaterThan",(t,e)=>{Sn.init(t,e);let r=gw[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Ch=ae("$ZodCheckNumberFormat",(t,e)=>{Sn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=Sh[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=Ih)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var $h=ae("$ZodCheckMinLength",(t,e)=>{var r;Sn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!_h(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=Eh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var ll=ae("$ZodCheckStringFormat",(t,e)=>{var r,n;Sn.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),kh=ae("$ZodCheckRegex",(t,e)=>{ll.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});var zh={major:4,minor:3,patch:6};var rt=ae("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=zh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,l)=>{let p=$o(c),f;for(let _ of d){if(_._zod.def.when){if(!_._zod.def.when(c))continue}else if(p)continue;let h=c.issues.length,g=_._zod.check(c);if(g instanceof Promise&&l?.async===!1)throw new xr;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==h&&(p||(p=$o(c,h)))});else{if(c.issues.length===h)continue;p||(p=$o(c,h))}}return f?f.then(()=>c):c},"runChecks"),s=o((c,d,l)=>{if($o(c))return c.aborted=!0,c;let p=i(d,n,l);if(p instanceof Promise){if(l.async===!1)throw new xr;return p.then(f=>t._zod.parse(f,l))}return t._zod.parse(p,l)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let p=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(f=>s(f,c,d)):s(p,c,d)}let l=t._zod.parse(c,d);if(l instanceof Promise){if(d.async===!1)throw new xr;return l.then(p=>i(p,n,d))}return i(l,n,d)}}ut(t,"~standard",()=>({validate:o(i=>{try{let s=Ci(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $i(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),As=ae("$ZodString",(t,e)=>{rt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ah(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),dl=ae("$ZodStringFormat",(t,e)=>{ll.init(t,e),As.init(t,e)});var Lh=ae("$ZodURL",(t,e)=>{dl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var pl=ae("$ZodNumber",(t,e)=>{rt.init(t,e),t._zod.pattern=t._zod.bag.pattern??cl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),Fh=ae("$ZodNumberFormat",(t,e)=>{Ch.init(t,e),pl.init(t,e)}),fl=ae("$ZodBoolean",(t,e)=>{rt.init(t,e),t._zod.pattern=Rh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Bh=ae("$ZodBigInt",(t,e)=>{rt.init(t,e),t._zod.pattern=wh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}});var qh=ae("$ZodAny",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r}),Vh=ae("$ZodUnknown",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r});var Hh=ae("$ZodVoid",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),Gh=ae("$ZodDate",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Dh(t,e,r){t.issues.length&&e.issues.push(...bn(r,t.issues)),e.value[r]=t.value}o(Dh,"handleArrayResult");var Wh=ae("$ZodArray",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],l=e.element._zod.run({value:d,issues:[]},n);l instanceof Promise?s.push(l.then(p=>Dh(p,r,c))):Dh(l,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function xs(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...bn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(xs,"handlePropertyResult");function yw(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Ph(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(yw,"normalizeDef");function _w(t,e,r,n,i,s){let c=[],d=i.keySet,l=i.catchall._zod,p=l.def.type,f=l.optout==="optional";for(let _ in e){if(d.has(_))continue;if(p==="never"){c.push(_);continue}let h=l.run({value:e[_],issues:[]},n);h instanceof Promise?t.push(h.then(g=>xs(g,r,_,e,f))):xs(h,r,_,e,f)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(_w,"handleCatchall");var Zh=ae("$ZodObject",(t,e)=>{if(rt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let l={...d};return Object.defineProperty(e,"shape",{value:l}),l},"get")})}let n=vs(()=>yw(e));ut(t._zod,"propValues",()=>{let d=e.shape,l={};for(let p in d){let f=d[p]._zod;if(f.values){l[p]??(l[p]=new Set);for(let _ of f.values)l[p].add(_)}}return l});let i=Ri,s=e.catchall,c;t._zod.parse=(d,l)=>{c??(c=n.value);let p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d;d.value={};let f=[],_=c.shape;for(let h of c.keys){let g=_[h],y=g._zod.optout==="optional",T=g._zod.run({value:p[h],issues:[]},l);T instanceof Promise?f.push(T.then(P=>xs(P,d,h,p,y))):xs(T,d,h,p,y)}return s?_w(f,p,d,l,n.value,t):f.length?Promise.all(f).then(()=>d):d}});function Uh(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!$o(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Pn(c,n,Jr())))}),e)}o(Uh,"handleUnionResults");var ml=ae("$ZodUnion",(t,e)=>{rt.init(t,e),ut(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ut(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ut(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ut(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>bs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let l of e.options){let p=l._zod.run({value:i.value,issues:[]},s);if(p instanceof Promise)d.push(p),c=!0;else{if(p.issues.length===0)return p;d.push(p)}}return c?Promise.all(d).then(l=>Uh(l,i,t,s)):Uh(d,i,t,s)}});var Kh=ae("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ml.init(t,e);let r=t._zod.parse;ut(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,l]of Object.entries(c)){i[d]||(i[d]=new Set);for(let p of l)i[d].add(p)}}return i});let n=vs(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let l of d){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!Ri(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var Jh=ae("$ZodRecord",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!vh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let p of c)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);let f=e.valueType._zod.run({value:i[p],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...bn(p,_.issues)),r.value[p]=_.value})):(f.issues.length&&r.issues.push(...bn(p,f.issues)),r.value[p]=f.value)}let l;for(let p in i)d.has(p)||(l=l??[],l.push(p));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let l=e.keyType._zod.run({value:d,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cl.test(d)&&l.issues.length){let _=e.keyType._zod.run({value:Number(d),issues:[]},n);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(l=_)}if(l.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(_=>Pn(_,n,Jr())),input:d,path:[d],inst:t});continue}let f=e.valueType._zod.run({value:i[d],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...bn(d,_.issues)),r.value[l.value]=_.value})):(f.issues.length&&r.issues.push(...bn(d,f.issues)),r.value[l.value]=f.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Yh=ae("$ZodEnum",(t,e)=>{rt.init(t,e);let r=al(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>bh.has(typeof i)).map(i=>typeof i=="string"?Co(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Xh=ae("$ZodLiteral",(t,e)=>{if(rt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Co(n):n?Co(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Qh=ae("$ZodTransform",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ys(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new xr;return r.value=i,r}});function Mh(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Mh,"handleOptionalResult");var eg=ae("$ZodOptional",(t,e)=>{rt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ut(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Mh(s,r.value)):Mh(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var tg=ae("$ZodNullable",(t,e)=>{rt.init(t,e),ut(t._zod,"optin",()=>e.innerType._zod.optin),ut(t._zod,"optout",()=>e.innerType._zod.optout),ut(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bs(r.source)}|null)$`):void 0}),ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var rg=ae("$ZodPipe",(t,e)=>{rt.init(t,e),ut(t._zod,"values",()=>e.in._zod.values),ut(t._zod,"optin",()=>e.in._zod.optin),ut(t._zod,"optout",()=>e.out._zod.optout),ut(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ts(c,e.in,n)):Ts(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ts(s,e.out,n)):Ts(i,e.out,n)}});function Ts(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ts,"handlePipeResult");var ng=ae("$ZodCustom",(t,e)=>{Sn.init(t,e),rt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>jh(s,r,n,t));jh(i,r,n,t)}});function jh(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(ul(i))}}o(jh,"handleRefineResult");var ig;var hl=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ag(){return new hl}o(ag,"registry");(ig=globalThis).__zod_globalRegistry??(ig.__zod_globalRegistry=ag());var gl=globalThis.__zod_globalRegistry;function sg(t,e){return new t({type:"string",...Xe(e)})}o(sg,"_string");function ug(t,e){return new t({type:"string",coerce:!0,...Xe(e)})}o(ug,"_coercedString");function cg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Xe(e)})}o(cg,"_url");function lg(t,e){return new t({type:"number",checks:[],...Xe(e)})}o(lg,"_number");function dg(t,e){return new t({type:"number",coerce:!0,checks:[],...Xe(e)})}o(dg,"_coercedNumber");function pg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Xe(e)})}o(pg,"_int");function fg(t,e){return new t({type:"boolean",...Xe(e)})}o(fg,"_boolean");function mg(t,e){return new t({type:"boolean",coerce:!0,...Xe(e)})}o(mg,"_coercedBoolean");function hg(t,e){return new t({type:"bigint",coerce:!0,...Xe(e)})}o(hg,"_coercedBigint");function gg(t){return new t({type:"any"})}o(gg,"_any");function yg(t){return new t({type:"unknown"})}o(yg,"_unknown");function _g(t,e){return new t({type:"void",...Xe(e)})}o(_g,"_void");function vg(t,e){return new t({type:"date",coerce:!0,...Xe(e)})}o(vg,"_coercedDate");function ws(t,e){return new Oh({check:"greater_than",...Xe(e),value:t,inclusive:!0})}o(ws,"_gte");function pr(t,e){return new $h({check:"min_length",...Xe(e),minimum:t})}o(pr,"_minLength");function En(t,e){return new kh({check:"string_format",format:"regex",...Xe(e),pattern:t})}o(En,"_regex");function bg(t,e,r){let n=Xe(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(bg,"_custom");var ct=ae("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");rt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Ss(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ci(t,r,n),t.parseAsync=async(r,n)=>Es(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>$i(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Ps(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Rs=ae("ZodMiniString",(t,e)=>{As.init(t,e),ct.init(t,e)});function b(t){return sg(Rs,t)}o(b,"string");var Pg=ae("ZodMiniStringFormat",(t,e)=>{dl.init(t,e),Rs.init(t,e)});var Cw=ae("ZodMiniURL",(t,e)=>{Lh.init(t,e),Pg.init(t,e)});function Sg(t){return cg(Cw,t)}o(Sg,"url");var Os=ae("ZodMiniNumber",(t,e)=>{pl.init(t,e),ct.init(t,e)});function xt(t){return lg(Os,t)}o(xt,"number");var $w=ae("ZodMiniNumberFormat",(t,e)=>{Fh.init(t,e),Os.init(t,e)});function Eg(t){return pg($w,t)}o(Eg,"int");var yl=ae("ZodMiniBoolean",(t,e)=>{fl.init(t,e),ct.init(t,e)});function Me(t){return fg(yl,t)}o(Me,"boolean");var Tg=ae("ZodMiniBigInt",(t,e)=>{Bh.init(t,e),ct.init(t,e)});var kw=ae("ZodMiniAny",(t,e)=>{qh.init(t,e),ct.init(t,e)});function Ni(){return gg(kw)}o(Ni,"any");var Nw=ae("ZodMiniUnknown",(t,e)=>{Vh.init(t,e),ct.init(t,e)});function ve(){return yg(Nw)}o(ve,"unknown");var zw=ae("ZodMiniVoid",(t,e)=>{Hh.init(t,e),ct.init(t,e)});function xg(t){return _g(zw,t)}o(xg,"_void");var Ag=ae("ZodMiniDate",(t,e)=>{Gh.init(t,e),ct.init(t,e)});var Dw=ae("ZodMiniArray",(t,e)=>{Wh.init(t,e),ct.init(t,e)});function we(t,e){return new Dw({type:"array",element:t,...Xe(e)})}o(we,"array");var Uw=ae("ZodMiniObject",(t,e)=>{Zh.init(t,e),ct.init(t,e),ut(t,"shape",()=>e.shape)});function C(t,e){let r={type:"object",shape:t??{},...Xe(e)};return new Uw(r)}o(C,"object");var Mw=ae("ZodMiniUnion",(t,e)=>{ml.init(t,e),ct.init(t,e)});function Ie(t,e){return new Mw({type:"union",options:t,...Xe(e)})}o(Ie,"union");var jw=ae("ZodMiniDiscriminatedUnion",(t,e)=>{Kh.init(t,e),ct.init(t,e)});function Tn(t,e,r){return new jw({type:"union",options:e,discriminator:t,...Xe(r)})}o(Tn,"discriminatedUnion");var Lw=ae("ZodMiniRecord",(t,e)=>{Jh.init(t,e),ct.init(t,e)});function be(t,e,r){return new Lw({type:"record",keyType:t,valueType:e,...Xe(r)})}o(be,"record");var Fw=ae("ZodMiniEnum",(t,e)=>{Yh.init(t,e),ct.init(t,e),t.options=Object.values(e.entries)});function $e(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Fw({type:"enum",entries:r,...Xe(e)})}o($e,"_enum");var Bw=ae("ZodMiniLiteral",(t,e)=>{Xh.init(t,e),ct.init(t,e)});function pe(t,e){return new Bw({type:"literal",values:Array.isArray(t)?t:[t],...Xe(e)})}o(pe,"literal");var qw=ae("ZodMiniTransform",(t,e)=>{Qh.init(t,e),ct.init(t,e)});function xn(t){return new qw({type:"transform",transform:t})}o(xn,"transform");var Vw=ae("ZodMiniOptional",(t,e)=>{eg.init(t,e),ct.init(t,e)});function H(t){return new Vw({type:"optional",innerType:t})}o(H,"optional");var Hw=ae("ZodMiniNullable",(t,e)=>{tg.init(t,e),ct.init(t,e)});function zi(t){return new Hw({type:"nullable",innerType:t})}o(zi,"nullable");var Gw=ae("ZodMiniPipe",(t,e)=>{rg.init(t,e),ct.init(t,e)});function An(t,e){return new Gw({type:"pipe",in:t,out:e})}o(An,"pipe");var Ww=ae("ZodMiniCustom",(t,e)=>{ng.init(t,e),ct.init(t,e)});function Cs(t,e){return bg(Ww,t??(()=>!0),e)}o(Cs,"custom");var Di={};gs(Di,{bigint:()=>Qw,boolean:()=>Xw,date:()=>eI,number:()=>Yw,string:()=>Jw});function Jw(t){return ug(Rs,t)}o(Jw,"string");function Yw(t){return dg(Os,t)}o(Yw,"number");function Xw(t){return mg(yl,t)}o(Xw,"boolean");function Qw(t){return hg(Tg,t)}o(Qw,"bigint");function eI(t){return vg(Ag,t)}o(eI,"date");var vl=C({retryOnFailure:C({defaultValue:H(Me()),hide:H(Me())}),continueOnFailure:C({defaultValue:H(Me()),hide:H(Me())})}),_l=class{constructor(e,r,n,i,s,c,d,l,p,f,_){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=l;this.outputSchema=p;this.audience=f;this.aiMetadata=_}static{o(this,"IAction")}},wn=o(t=>new _l(t.name,t.displayName,t.description,t.props,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata),"createAction");var je=C({displayName:b(),description:H(b())}),Re=o((t,e)=>C({type:pe(e),required:Me(),defaultValue:H(Ni())}),"TPropertyValue");var Ut=C({...je.shape,...Re(b(),"SHORT_TEXT").shape}),Yr=C({...je.shape,...Re(b(),"LONG_TEXT").shape});var Ig=C({label:b(),value:ve()}),$s=C({disabled:H(Me()),placeholder:H(b()),options:we(Ig)});var Mt=C({...je.shape,options:$s,...Re(ve(),"STATIC_DROPDOWN").shape}),Xr=C({...je.shape,options:$s,...Re(we(ve()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var bl=C({...je.shape,...Re(ve(),"DROPDOWN").shape,refreshers:we(b())}),Ui=C({...je.shape,...Re(we(ve()),"MULTI_SELECT_DROPDOWN").shape,refreshers:we(b())});var Qr=C({...je.shape,...Re(Me(),"CHECKBOX").shape});var en=C({...je.shape,...Re(xt(),"NUMBER").shape});var Mi=C({...je.shape,streaming:H(Me()),...Re(ve(),"FILE").shape});var ji=C({...je.shape,...Re(b(),"DATE_TIME").shape});var Rg=be(b(),Ie([Ut,Yr,Mt,Ui,Xr,Qr,en,Mi,ji])),Li=C({...je.shape,properties:Rg,...Re(we(ve()),"ARRAY").shape});var Fi=C({...je.shape,...Re(Ie([be(b(),ve())]),"JSON").shape});var Og=Ie([Ut,Mt,Fi,Li,Xr]),rI=be(b(),Og),Pl=C({refreshers:we(b()),...je.shape,...Re(ve(),"DYNAMIC").shape});var ks=C({...je.shape,...Re(xg(),"MARKDOWN").shape});var Bi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Bi||{}),ko=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ko||{}),No=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(No||{});var qi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(qi||{}),Sl="both_client_credentials_and_authorization_code";var In=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(In||{}),Vi=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Vi||{}),nI=C({strategy:$e(Vi),paramName:H(b())}),Hi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Hi||{});var Ns=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ns||{}),Cg=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),$g=C({type:pe("DELAY"),resumeDateTime:b(),requestIdToReply:H(b()),handlerId:H(b()),streamStepProgress:H($e(Ns))}),kg=C({type:pe("WEBHOOK"),requestId:b(),requestIdToReply:H(b()),response:Cg,handlerId:H(b()),streamStepProgress:H($e(Ns))}),oI=Ie([$g,kg]);var iI=C({body:ve(),rawBody:H(ve()),headers:be(b(),b()),queryParams:be(b(),b())});function at(t){return t==null}o(at,"isNil");function Gi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Gi,"isEmpty");function zs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(zs,"assertNotNullOrUndefined");var El=ft(require("crypto"),1);var aI=128,Xn,zo,sI=o(t=>{!Xn||Xn.length<t?(Xn=Buffer.allocUnsafe(t*aI),El.default.randomFillSync(Xn),zo=0):zo+t>Xn.length&&(El.default.randomFillSync(Xn),zo=0),zo+=t},"fillPool"),uI=o(t=>(sI(t|=0),Xn.subarray(zo-t,zo)),"random"),cI=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),l=i;for(;l--;)if(c+=t[d[l]&n]||"",c.length===s)return c}}},"customRandom"),zg=o((t,e=21)=>cI(t,e,uI),"customAlphabet");var lI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Dg=21,sV=b().check(En(new RegExp(`^[0-9a-zA-Z]{${Dg}}$`))),dI=zg(lI,Dg);var Rn=An(xn(t=>t instanceof Date?t.toISOString():t),b()),Qt={id:b(),created:Rn,updated:Rn},Qe=o(t=>H(zi(t)),"Nullable");function Tl(t){return H(zi($e(t)))}o(Tl,"NullableEnum");var lV=An(xn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),H(Me())),Ds=o(t=>An(xn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),H(we(t))),"OptionalArrayFromQuery");var fV=be(b(),ve());var Wi=(f=>(f.OPENAI="openai",f.OPENROUTER="openrouter",f.ANTHROPIC="anthropic",f.AZURE="azure",f.GOOGLE="google",f.ACTIVEPIECES="activepieces",f.CLOUDFLARE_GATEWAY="cloudflare-gateway",f.CUSTOM="custom",f.BEDROCK="bedrock",f.MISTRAL="mistral",f))(Wi||{});var xV=b().check(En(/^#[0-9A-Fa-f]{6}$/));var wV=C({filename:b(),data:ve(),type:pe("file"),mimetype:H(b())});var pI=ft(Mg());var NV=C({...Qt,name:b(),permissions:we(b()),platformId:Qe(b()),type:b(),userCount:H(xt())});var jg=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(jg||{}),xl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(xl||{}),Al=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Al||{});var wl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wl||{});var Il=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Il||{});var fI=C({mode:$e(jg),value:ve()}),mI=C({auth:H(b()),fields:be(b(),fI)}),hI=C({pieceName:b(),pieceVersion:b(),actionName:b(),predefinedInput:H(mI)}),gI=C({type:pe("PIECE"),toolName:b().check(pr(1)),pieceMetadata:hI}),yI=C({type:pe("none")}),_I=C({type:pe("access_token"),accessToken:b()}),vI=C({type:pe("api_key"),apiKey:b(),apiKeyHeader:b()}),bI=C({type:pe("headers"),headers:be(b(),b())}),PI=Tn("type",[yI,_I,vI,bI]),Lg=C({type:pe("FLOW"),toolName:b().check(pr(1)),externalFlowId:b(),flowDisplayName:H(b())}),Fg=C({type:pe("MCP"),toolName:b().check(pr(1)),serverUrl:Sg(),protocol:$e(Al),auth:PI}),Bg=C({type:pe("KNOWLEDGE_BASE"),toolName:b().check(pr(1)),sourceType:$e(xl),sourceId:b(),sourceName:b()}),SI=Tn("type",[gI,Lg,Fg,Bg]),EI=C({displayName:b(),description:H(b()),type:$e(wl)}),qg=C({type:pe("MARKDOWN"),markdown:b()}),Do={type:pe("TOOL_CALL"),input:Qe(be(b(),ve())),output:H(ve()),toolName:b(),status:$e(Il),toolCallId:b(),startTime:b(),endTime:H(b())},dH=C(Do),Vg=Tn("toolCallType",[C({...Do,toolCallType:pe("PIECE"),pieceName:b(),pieceVersion:b(),actionName:b()}),C({...Do,toolCallType:pe("FLOW"),displayName:b(),externalFlowId:b()}),C({...Do,toolCallType:pe("MCP"),displayName:b(),serverUrl:b()}),C({...Do,toolCallType:pe("KNOWLEDGE_BASE"),displayName:b(),sourceType:b()}),C({...Do,toolCallType:pe("UNKNOWN"),displayName:b()})]),TI=Ie([qg,Vg]);var Rl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rl||{}),tn=C({apiKey:b()}),xI=tn,AI=C({apiKey:b(),apiKeyHash:b()}),wI=tn,II=tn,RI=tn,OI=tn,CI=tn,$I=tn,kI=tn,Kg=C({accessKeyId:b().check(pr(1)),secretAccessKey:b().check(pr(1))}),NI=C({}),zI=C({}),DI=C({}),UI=C({}),MI=C({}),jI=C({}),Jg=C({modelId:b(),modelName:b(),modelType:$e(Rl)}),Yg=C({apiKeyHeader:b(),baseUrl:b(),models:we(Jg),defaultHeaders:H(be(b(),b()))}),Xg=C({accountId:b(),gatewayId:b(),models:we(Jg),vertexProject:H(b()),vertexRegion:H(b())}),Qg=C({resourceName:b(),apiVersion:An(xn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),H(b()))}),ey=C({region:b().check(pr(1))}),LI=Ie([xI,RI,OI,CI,$I,II,wI,AI,Kg,kI]),ty=Ie([Yg,Xg,Qg,ey,NI,DI,UI,MI,zI,jI]),FI=C({id:b(),name:b(),type:$e(Rl)}),BI=C({id:b(),name:b(),provider:$e(Wi),config:ty,enabledForChat:Me()}),qI=C({provider:$e(Wi),config:ty,auth:LI,platformId:b()});var hH={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Hg=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],VI=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],HI=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Gg=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],GI=["grok-4.20","grok-4.1-fast"],WI={openai:Hg,anthropic:VI,google:Gg,activepieces:[...HI.map(t=>`anthropic/${t}`),...Hg.map(t=>`openai/${t}`),...Gg.map(t=>`google/${t}`),...GI.map(t=>`x-ai/${t}`)]};var Wg=128e3,ZI={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function KI({provider:t}){return t?ZI[t]??Wg:Wg}o(KI,"getMaxContextTokens");var Zg={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},JI={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},YI=new Set(["anthropic","mistral"]);function Ar(t){return{chatModels:WI[t],maxContextTokens:KI({provider:t}),defaultEmbeddingModel:Zg[t],supportsEmbedding:Zg[t]!==void 0,supportsImageGeneration:!YI.has(t),webSearch:JI[t]}}o(Ar,"buildProviderCapabilities");var XI={openai:Ar("openai"),anthropic:Ar("anthropic"),openrouter:Ar("openrouter"),azure:Ar("azure"),google:Ar("google"),"cloudflare-gateway":Ar("cloudflare-gateway"),custom:Ar("custom"),bedrock:Ar("bedrock"),mistral:Ar("mistral"),activepieces:Ar("activepieces")};var QI=C({base64Url:b(),fileName:b(),extension:H(b())}),eR=C({mimeType:b(),url:b(),fileName:H(b())}),Ol=Ie([QI,eR]);var tR=Ie([C({type:pe("file"),value:Ol}),C({type:pe("markdown"),value:b(),files:H(we(Ol))})]),rR=C({sessionId:b(),message:b(),files:H(we(b()))});var ny=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ny||{}),oy=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(oy||{}),Cl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cl||{});var nR=Ie([C({...Qt,name:b(),externalId:b(),type:pe("STATIC_DROPDOWN"),tableId:b(),projectId:b(),data:C({options:we(C({value:b()}))})}),C({...Qt,name:b(),externalId:b(),type:Ie([pe("TEXT"),pe("NUMBER"),pe("DATE")]),tableId:b(),projectId:b()})]),oR=C({...Qt,name:b(),folderId:Qe(b()),projectId:b(),externalId:b(),status:Tl(oy),trigger:Tl(ny)}),iR=C({...Qt,tableId:b(),projectId:b(),cells:be(b(),C({updated:b(),created:b(),value:ve(),fieldName:b()}))}),aR=C({events:we($e(Cl)),webhookUrl:b(),flowId:b()}),sR=C({fields:we(C({id:b(),name:b()})),rows:we(be(b(),b())),name:b()}),uR=C({projectId:b(),limit:H(Di.number()),cursor:H(b()),name:H(b()),externalIds:Ds(b()),folderId:H(b()),folderIds:Ds(b())}),cR=C({records:we(we(C({fieldId:b(),value:ay()}))),tableId:b()}),lR=C({cells:H(we(C({fieldId:b(),value:ay()}))),tableId:b(),agentUpdate:H(Me())}),iy=Tn("operator",[Qn("eq"),Qn("neq"),Qn("gt"),Qn("gte"),Qn("lt"),Qn("lte"),Qn("co"),ry("exists"),ry("not_exists")]),dR=C({tableId:b(),limit:H(Di.number()),cursor:H(b()),filters:Ds(iy)});function ay(){return An(xn(t=>t==null?t:String(t)),zi(b()))}o(ay,"coerceToString");function Qn(t){return C({fieldId:b(),operator:pe(t),value:b()})}o(Qn,"valueFilter");function ry(t){return C({fieldId:b(),operator:pe(t)})}o(ry,"existenceFilter");var pR=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),fR=C({...Qt,deleted:Qe(Rn),ownerId:b(),displayName:b(),platformId:b(),externalId:Qe(b())});var sy=C({name:b(),description:H(b()),type:b(),required:Me()}),mR=C({pieceName:b(),triggerName:b(),input:C({toolName:b(),toolDescription:b(),inputSchema:we(sy),returnsResponse:Me()})});var uy="^[0-9]+\\.[0-9]+\\.[0-9]+$",NH=new RegExp(uy),gR="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",zH=b().check(En(new RegExp(uy))),DH=b().check(En(new RegExp(gR))),yR=C({packageType:pe("ARCHIVE"),pieceType:$e(ko),pieceName:b(),pieceVersion:b(),archiveId:b(),platformId:b()}),cy=C({packageType:pe("REGISTRY"),pieceType:pe("OFFICIAL"),pieceName:b(),pieceVersion:b()}),ly=C({packageType:pe("REGISTRY"),pieceType:pe("CUSTOM"),pieceName:b(),pieceVersion:b(),platformId:b()}),UH=Ie([cy,ly]),MH=Ie([yR,cy,ly]);var _R=Tn("type",[C({type:pe("CRON_EXPRESSION"),cronExpression:b(),timezone:b()}),C({type:pe("INTERVAL"),intervalMs:Eg().check(ws(6e4))})]),jH=C({...Qt,type:$e(In),projectId:b(),flowId:b(),triggerName:b(),schedule:Qe(_R),flowVersionId:b(),pieceName:b(),pieceVersion:b(),deleted:Qe(b()),simulate:Me()}),dy=(P=>(P.UNKNOWN="UNKNOWN",P.FLOW_RUN_LOG="FLOW_RUN_LOG",P.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",P.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",P.FLOW_STEP_FILE="FLOW_STEP_FILE",P.SAMPLE_DATA="SAMPLE_DATA",P.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",P.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",P.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",P.PROJECT_RELEASE="PROJECT_RELEASE",P.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",P.PLATFORM_ASSET="PLATFORM_ASSET",P.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",P.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",P.KNOWLEDGE_BASE="KNOWLEDGE_BASE",P.FLOW_BUNDLE="FLOW_BUNDLE",P))(dy||{}),py=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(py||{}),fy=(r=>(r.S3="S3",r.DB="DB",r))(fy||{}),LH=C({...Qt,projectId:Qe(b()),platformId:Qe(b()),type:$e(dy),compression:$e(py),data:H(ve()),location:$e(fy),size:Qe(xt()),fileName:Qe(b()),s3Key:Qe(b()),metadata:Qe(be(b(),b()))}),my=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(my||{}),hy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(hy||{}),FH=C({id:b(),email:b(),firstName:b(),status:$e(hy),externalId:Qe(b()),platformId:Qe(b()),platformRole:$e(my),lastName:b(),created:Rn,updated:Rn,lastActiveDate:Qe(Rn),imageUrl:Qe(b())});var $l=C({...je.shape,...Re(be(b(),ve()),"OBJECT").shape});var vy=C({...je.shape,...Re(b(),"COLOR").shape});var kl=Ie([Ut,Yr,ks,Qr,Mt,Xr,bl,Ui,Pl,en,Li,$l,Fi,ji,Mi,vy]),Te={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var wr=C({displayName:b(),description:H(b()),hasConnectionIdentifier:H(Me())});var by=C({username:b(),password:b()}),Nl=C({...wr.shape,username:C({displayName:b(),description:H(b())}),password:C({displayName:b(),description:H(b())}),...Re(by,"BASIC_AUTH").shape});var SR=be(b(),Ie([Ut,Yr,en,Qr,Mt])),zl=C({...wr.shape,props:SR,...Re(ve(),"CUSTOM_AUTH").shape});var eo=C({...wr.shape,...Re(C({auth:b()}),"SECRET_TEXT").shape});var ER=be(b(),Ie([Ut,Yr,eo,en,Qr,Mt,Xr,ks])),Py=C({...wr.shape,props:ER,...Re(ve(),"OIDC").shape});var Dl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Dl||{}),Sy=Ie([Ut,eo,Mt]),Ey=be(b(),Sy),TR=C({props:H(be(b(),Sy)),authUrl:b(),tokenUrl:b(),scope:we(b()),prompt:H(Ie([pe("none"),pe("consent"),pe("login"),pe("omit")])),pkce:H(Me()),pkceMethod:H(Ie([pe("plain"),pe("S256")])),authorizationMethod:H($e(Dl)),grantType:H(Ie([$e(qi),pe(Sl)])),extra:H(be(b(),b()))}),Ty=C({access_token:b(),props:H(Ey),data:be(b(),Ni())}),Ul=C({...wr.shape,...TR.shape,...Re(Ty,"OAUTH2").shape});var Uo=Ie([Nl,zl,Py,Ul,eo]),Zi="Connection",Ml={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Zi}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Zi,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Zi}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Zi}},None(){}};var vW={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var xR=C({...je.shape,...Re(ve(),"CUSTOM").shape,code:b()});var AR=Ie([kl,Uo]),jl=be(b(),AR),jW=be(b(),kl);var xy=Ie([C({strategy:pe("CRON"),cronExpression:b()}),C({strategy:pe("NONE")})]),Mo=class{constructor(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N,L){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=l;this.renewConfiguration=p;this.onRenew=f;this.onEnable=_;this.onDisable=h;this.onStart=g;this.run=y;this.test=T;this.sampleData=P;this.testStrategy=x;this.outputSchema=N;this.aiMetadata=L}static{o(this,"ITrigger")}},Ay=o(t=>{switch(t.type){case"WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata);case"POLLING":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"MANUAL":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"APP_WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,at(t.sampleData)&&at(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var wy="2",Ms="0.82.0";var Ll=class{constructor(e,r,n,i,s,c,d,l,p=Ms,f,_="",h){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=l;this.minimumSupportedRelease=p;this.maximumSupportedRelease=f;this.description=_;this.deprecated=h;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wy}),"getContextInfo");(!IR(p)||RR(p,Ms))&&(this.minimumSupportedRelease=Ms),s.forEach(g=>this._actions[g.name]=g),c.forEach(g=>this._triggers[g.name]=g)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:wR(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Ry=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ll(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function wR(t){if(t!==void 0)return Array.isArray(t)?t.map(Iy):Iy(t)}o(wR,"withConnectionIdentifierFlag");function Iy(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}o(Iy,"flagConnectionIdentifier");function IR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(IR,"isValidSimpleSemver");function RR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(RR,"isSemverLessThan");var OR=H(be(b(),be(b(),b()))),Oy=C({id:H(b()),name:b(),displayName:b(),logoUrl:b(),description:b(),authors:we(b()),platformId:H(b()),directoryPath:H(b()),auth:H(Ie([Uo,we(Uo)])),version:b(),categories:H(we($e(No))),minimumSupportedRelease:H(b()),maximumSupportedRelease:H(b()),deprecated:H(Me()),i18n:OR}),CR=$e(["human","ai","both"]),Cy=C({description:H(b()),idempotent:H(Me())}),$y=C({name:b(),displayName:b(),description:b(),props:jl,requireAuth:Me(),errorHandlingOptions:H(vl),outputSchema:H(Cs()),audience:H(CR),aiMetadata:H(Cy)}),ky=C({name:b(),displayName:b(),description:b(),props:jl,errorHandlingOptions:H(vl),type:$e(In),sampleData:ve(),handshakeConfiguration:H(Cs()),renewConfiguration:H(xy),testStrategy:$e(Hi),outputSchema:H(Cs()),aiMetadata:H(Cy)}),$R=C({...Oy.shape,actions:be(b(),$y),triggers:be(b(),ky)}),kR=C({...Oy.shape,actions:xt(),triggers:xt(),suggestedActions:H(we($y)),suggestedTriggers:H(we(ky))}),Ny=C({projectUsage:xt(),pieceType:$e(ko),packageType:$e(Bi),platformId:H(b()),archiveId:H(b())}),jZ=C({...$R.shape,...Ny.shape}),LZ=C({...kR.shape,...Ny.shape}),FZ=C({name:b(),version:b()});var NR=ft(require("path")),zR=ft(require("fs/promises"));var My=require("node:stream");var js=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Ls=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Fl,r=new Bl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Fl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},Bl=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ki=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function zy({error:t,requestBody:e}){return t instanceof Ki?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(zy,"toFailsafeOutput");var jo=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(jo||{});var Fs=class extends js{static{o(this,"FetchHttpClient")}constructor(e="",r=new Ls){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[L,X]of Object.entries(c))i.append(L,X);let d=i.toString(),l=d?`${n}?${d}`:n,p=e.responseType??"json",f=e.followRedirects??!0,_=e.retries??0,{body:h,extraHeaders:g,isStream:y}=DR(e.method)?UR(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},T=jR({...s,...g}),P=await MR(async()=>{let L=new AbortController,X=e.timeout&&e.timeout>0?setTimeout(()=>L.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:T,body:h,redirect:f?"follow":"manual",signal:L.signal};return y&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(l,W)}finally{X!==void 0&&clearTimeout(X)}},_),x=f?300:400;if(P.status<200||P.status>=x){let L=await Dy(P,p),X=new Ki(e.body,{status:P.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",X),X}let N=await Dy(P,p);return{status:P.status,headers:LR(P.headers),body:N}}};function DR(t){return t!=="GET"&&t!=="HEAD"}o(DR,"acceptsRequestBody");function UR(t,e){if(BR(t))return{body:void 0,extraHeaders:{},isStream:!1};if(FR(t)){let n=new My.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(UR,"serializeBody");async function Dy(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Dy,"parseResponseBody");async function MR(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Uy(n);continue}return i}catch(i){if(r=i,n<e){await Uy(n);continue}throw i}throw r}o(MR,"sendWithRetries");function Uy(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Uy,"backoff");function jR(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(jR,"normalizeHeaders");function LR(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(LR,"toHttpHeaders");function FR(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(FR,"isNodeFormData");function BR(t){return t==null}o(BR,"isNil");var On=new Fs;var RC=ft(require("fs")),Bv=ft(Fv());var OC={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function CC(t){let e=t.split(";")[0].trim().toLowerCase();return OC[e]??""}o(CC,"contentTypeToExtension");var $C=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),kC=o((t,e)=>{let r="https://api.example.com";try{let n=e?t(e):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function qv({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:l="headers"}){return wn({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:Te.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:p})=>({url:Te.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
-
i.e ${kC(e,p)}/resource or /resource`,required:!0,defaultValue:p?e(p):"",...c?.url??{}})}),"props")}),method:Te.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(jo).map(p=>({label:p,value:p}))},...c?.method??{}}),headers:Te.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:Te.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:Te.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:Te.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:p})=>{if(!p)return{};let f=p,_={};switch(f){case"none":break;case"json":_.data=Te.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=Te.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=Te.Array({displayName:"Form Data",required:!0,properties:{fieldName:Te.ShortText({displayName:"Field Name",required:!0}),fieldType:Te.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:Te.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:Te.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:Te.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:Te.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:Te.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:Te.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async p=>{let{method:f,url:_,headers:h,queryParams:g,body:y,body_type:T,failsafe:P,timeout:x,response_is_binary:N,followRedirects:L}=p.propsValue;zs(f,"Method"),zs(_,"URL");let X=at(r)?{}:await r(p.auth,p.propsValue),W=_.url,G=W.startsWith("http://")||W.startsWith("https://")?W:$C({baseUrl:e(p.auth),relativePath:W}),Z={method:f,url:G,headers:{...h??{},...l==="headers"||!at(l)?X:{}},queryParams:{...l==="queryParams"?X:{},...g??{}},timeout:x?x*1e3:0,followRedirects:L};if(N&&(Z.responseType="arraybuffer"),y)if(T&&T!=="none"){let ee=y.data;if(T==="form_data"){let Y=ee,Se=new Bv.default;for(let{fieldName:te,fieldType:q,textFieldValue:B,fileFieldValue:J}of Y)q==="text"&&!Gi(B)?Se.append(te,B):q==="file"&&!Gi(J)&&Se.append(te,J.data,{filename:J?.filename});Z.body=Se,Z.headers={...Z.headers,...Se.getHeaders()}}else Z.body=ee}else T||(Z.body=y);try{let ee=await On.sendRequest(Z);return await NC(p.files,ee.body,ee.status,ee.headers,N)}catch(ee){if(P)return zy({error:ee,requestBody:Z.body});throw ee}},"run")})}o(qv,"createCustomApiCallAction");var NC=o(async(t,e,r,n,i)=>{let s;if(i&&zC(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=CC(c??"")||"txt",l;e instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?l=e:l=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:l})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),zC=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var ea={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(at(d))throw new Error("lastPoll doesn't exist in the store.");let l=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),p=l.reduce((f,_)=>Math.max(f,_.epochMilliSeconds),d);return await e.put("lastPoll",p),l.filter(f=>f.epochMilliSeconds>d).map(f=>f.data)}case 1:{let d=await e.get("lastItem"),l=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),p=l.findIndex(h=>h.id===d),f=[];at(d)||p==-1?f=l??[]:f=l?.slice(0,p)??[],at(i)||(f=f.slice(-i));let _=f?.[0]?.id;return at(_)||await e.put("lastItem",_),f.map(h=>h.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:s}){switch(t.strategy){case 0:{if(s&&!at(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(s&&!at(await e.get("lastItem")))break;let d=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;at(d)?await e.delete("lastItem"):await e.put("lastItem",d);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return DC(c.map(d=>d.data))}};function DC(t){return t.length<=5?t:t.slice(0,5)}o(DC,"getFirstFiveOrAll");var kn={baseUrl:"https://people.googleapis.com/v1/people"};var mr=Ml.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:["https://www.googleapis.com/auth/contacts","email"]});var Hv=wn({auth:mr,name:"add_contact",description:"Add a contact to a Google Contacts account",audience:"both",aiMetadata:{description:"Creates a new person in the authenticated Google Contacts account from name, email, phone, company, and job title fields. Use when an agent needs to add someone to address book contacts; first and last name are required. Not idempotent \u2014 each call creates a separate contact even with identical input, so guard against duplicates.",idempotent:!1},displayName:"Add Contact",props:{firstName:Te.ShortText({displayName:"First Name",description:"The first name of the contact",required:!0}),middleName:Te.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Te.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!0}),jobTitle:Te.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Te.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Te.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Te.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e={names:[{givenName:t.propsValue.firstName,middleName:t.propsValue.middleName,familyName:t.propsValue.lastName}]},r={};t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]),e={...e,...r};let n={method:"POST",url:`${kn.baseUrl}:createContact`,body:e,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token}};return(await On.sendRequest(n)).body}});var Gv=wn({auth:mr,name:"update_contact",description:"Update a contact in Google Contacts account.",audience:"both",aiMetadata:{description:"Updates fields (name, email, phone, company, job title) on an existing Google Contacts person identified by its resourceName (people/{id}). Use when an agent needs to modify a known contact; requires both the resourceName and the current etag, and a field mask listing which fields to update \u2014 the call is rejected if the contact changed since the etag was fetched. Repeating the same update with the same etag/values is safe and yields the same result.",idempotent:!0},displayName:"Update Contact",props:{resourceName:Te.ShortText({displayName:"Resource Name",description:"The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.",required:!0}),etag:Te.ShortText({displayName:"Etag",description:"The `etag` ensures contact updates only apply if the contact hasn't changed since last retrieved.",required:!0}),updatePersonFields:Te.StaticMultiSelectDropdown({displayName:"Update Field Mask",description:"A field mask to restrict which fields on the person are updated.",required:!0,options:{options:[{label:"Names",value:"names"},{label:"Email",value:"emailAddresses"},{label:"Phone Number",value:"phoneNumbers"},{label:"Job Title / Company",value:"organizations"}]},defaultValue:["names","emailAddresses"]}),firstName:Te.ShortText({displayName:"First Name",description:"The first name of the contact",required:!1}),middleName:Te.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Te.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!1}),jobTitle:Te.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Te.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Te.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Te.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e=t.propsValue.resourceName.substring(6),r={etag:t.propsValue.etag},n={updatePersonFields:t.propsValue.updatePersonFields.join(",")};(t.propsValue.firstName||t.propsValue.middleName||t.propsValue.lastName)&&(r.names=[{givenName:t.propsValue.firstName||void 0,middleName:t.propsValue.middleName||void 0,familyName:t.propsValue.lastName||void 0}]),t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]);let i={method:"PATCH",url:`${kn.baseUrl}${e}:updateContact`,body:r,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:n};return(await On.sendRequest(i)).body}});var Wv=wn({auth:mr,name:"search_contact",description:"Search contacts in Google Contacts account.",audience:"both",aiMetadata:{description:"Searches the authenticated Google Contacts account for people matching a plain-text query, which prefix-matches against contact fields. Use when an agent needs to find a contact or its resourceName before updating it; the query is required and a read mask selects which fields come back (max 30 results). Read-only and idempotent.",idempotent:!0},displayName:"Search Contacts",props:{query:Te.ShortText({displayName:"Query",description:'The plain-text query for the request.The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".',required:!0}),readMask:Te.StaticMultiSelectDropdown({displayName:"Read Mask",description:"A field mask to restrict which fields on each person are returned.",required:!0,options:{options:[{label:"addresses",value:"addresses"},{label:"ageRanges",value:"ageRanges"},{label:"biographies",value:"biographies"},{label:"birthdays",value:"birthdays"},{label:"calendarUrls",value:"calendarUrls"},{label:"clientData",value:"clientData"},{label:"coverPhotos",value:"coverPhotos"},{label:"emailAddresses",value:"emailAddresses"},{label:"events",value:"events"},{label:"externalIds",value:"externalIds"},{label:"genders",value:"genders"},{label:"imClients",value:"imClients"},{label:"interests",value:"interests"},{label:"locales",value:"locales"},{label:"locations",value:"locations"},{label:"memberships",value:"memberships"},{label:"metadata",value:"metadata"},{label:"miscKeywords",value:"miscKeywords"},{label:"names",value:"names"},{label:"nicknames",value:"nicknames"},{label:"occupations",value:"occupations"},{label:"organizations",value:"organizations"},{label:"phoneNumbers",value:"phoneNumbers"},{label:"photos",value:"photos"},{label:"relations",value:"relations"},{label:"sipAddresses",value:"sipAddresses"},{label:"skills",value:"skills"},{label:"urls",value:"urls"},{label:"userDefined",value:"userDefined"}]},defaultValue:["names","emailAddresses"]}),pageSize:Te.Number({displayName:"Page Size",description:"The number of results to return. Maximum 30.",required:!1})},async run(t){let e={query:t.propsValue.query,readMask:t.propsValue.readMask.join(",")};t.propsValue.pageSize&&(e.pageSize=String(t.propsValue.pageSize));let r={method:"GET",url:`${kn.baseUrl}:searchContacts`,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:e};return(await On.sendRequest(r)).body}});var gx=ft(mx()),yx=ft($a()),_x=ft(hx());var Oc={strategy:0,items:o(async({store:t,auth:e})=>{let r=new yx.OAuth2Client;r.setCredentials(e);let n=(0,gx.people)({version:"v1",auth:r}),i,s=[];do{let c=await n.people.connections.list({resourceName:"people/me",pageToken:i,pageSize:100,sortOrder:"LAST_MODIFIED_DESCENDING",personFields:["addresses","ageRanges","biographies","birthdays","calendarUrls","clientData","coverPhotos","emailAddresses","events","externalIds","genders","imClients","interests","locales","locations","memberships","metadata","miscKeywords","names","nicknames","occupations","organizations","phoneNumbers","photos","relations","sipAddresses","skills","urls","userDefined"].join()});for(let d of c.data.connections||[])d.metadata?.deleted!==!0&&s.push({data:d,epochMilliSeconds:(0,_x.default)(d.metadata?.sources?.[0].updateTime).valueOf()});i=c.data.nextPageToken}while(i);return s},"items")},vx=Ay({auth:mr,name:"new_or_updated_contact",displayName:"New Or Updated Contact",description:"Triggers when there is a new or updated contact",aiMetadata:{description:"Fires when a contact in the authenticated Google Contacts account is newly created or has been modified since the last poll. Each event represents one person record with its current fields; deleted contacts are excluded."},props:{},sampleData:{resourceName:"people/c4278485694217203807",etag:"%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9",metadata:{sources:[{type:"CONTACT",id:"3b603c120c68305f",etag:"#dUp6RO4EJS8=",updateTime:"2023-01-30T14:35:18.142565Z"}],objectType:"PERSON"},names:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},displayName:"Shahed Mashni",familyName:"Mashni",givenName:"Shahed",displayNameLastFirst:"Mashni, Shahed",unstructuredName:"Shahed Mashni"}],photos:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},url:"https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100",default:!0}],memberships:[{metadata:{source:{type:"CONTACT",id:"3b603c120c68305f"}},contactGroupMembership:{contactGroupId:"myContacts",contactGroupResourceName:"contactGroups/myContacts"}}]},type:"POLLING",async onEnable(t){return await ea.onEnable(Oc,{store:t.store,auth:t.auth,propsValue:{}})},async onDisable(t){return await ea.onEnable(Oc,{store:t.store,auth:t.auth,propsValue:{}})},async run(t){return await ea.poll(Oc,{store:t.store,auth:t.auth,propsValue:{},files:t.files})},test:o(async t=>await ea.test(Oc,{store:t.store,auth:t.auth,propsValue:{},files:t.files}),"test")});var A1=Ry({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-contacts.png",categories:["SALES_AND_CRM"],actions:[Hv,Gv,Wv,qv({baseUrl:o(()=>kn.baseUrl,"baseUrl"),auth:mr,authMapping:o(async t=>({Authorization:`Bearer ${t.access_token}`}),"authMapping")})],displayName:"Google Contacts",description:"Stay connected and organized",authors:["Abdallah-Alwarawreh","Salem-Alaa","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060"],triggers:[vx],auth:mr});0&&(module.exports={googleContacts});
|
|
68
|
+
`)}P+=T,e.data=P}if(o(p,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let g=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,um.isBrowser)()?p(g):f(g)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=am.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,um.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:hx.version,comment:"gzip"});let g=e.userAgentDirectives.map(y=>{let T=`${y.product}/${y.version}`;return y.comment&&(T+=` (${y.comment})`),T}).join(" ");e.headers.set("User-Agent",g)}if(e.validateStatus||(e.validateStatus=g=>g>=200&&g<300||g===304),e.retry=e.retry===void 0?!0:e.retry,delete e.auth,e.universeDomain&&e.universe_domain&&e.universeDomain!==e.universe_domain)throw new Error("Please set either universe_domain or universeDomain, but not both.");let _=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,h=e.universeDomain??e.universe_domain??_??"googleapis.com";if(h!=="googleapis.com"&&e.url){let g=new URL(e.url);g.hostname.endsWith(".googleapis.com")&&(g.hostname=g.hostname.replace(/googleapis\.com$/,h),e.url=g.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let g=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(g&&h!==g)throw new Error(`The configured universe domain (${h}) does not match the universe domain found in the credentials (${g}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let y=await s.getRequestHeaders(e.url),T=Object.assign({},e);return T.headers=am.Gaxios.mergeHeaders(T.headers,y),x1.request(T)}else{let y=await s.request(e);return(0,sm.marshallGaxiosResponse)(y)}}else return new am.Gaxios().request(e).then(g=>(0,sm.marshallGaxiosResponse)(g))}o(fx,"createAPIRequestAsync");var cm=class extends mx.Transform{static{o(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function R1(t,e){(0,um.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${hx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(R1,"populateAPIHeader")});var gx=k(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.AuthPlus=void 0;var ln=ka(),dm=class extends ln.GoogleAuth{static{o(this,"AuthPlus")}JWT=ln.JWT;Compute=ln.Compute;OAuth2=ln.OAuth2Client;GoogleAuth=ln.GoogleAuth;AwsClient=ln.AwsClient;IdentityPoolClient=ln.IdentityPoolClient;ExternalAccountClient=ln.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new ln.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};wc.AuthPlus=dm});var fm=k(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.Endpoint=void 0;var yx=Ac(),pm=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=_x(e.rootUrl+e.servicePath+r.path),l={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let f=_x(e.rootUrl+r.mediaUpload.protocols.simple.path);l.mediaUrl=f.substring(1,f.length-1)}if(!s)return(0,yx.createAPIRequest)(l);(0,yx.createAPIRequest)(l,s)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};Ic.Endpoint=pm;function _x(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(_x,"buildurl")});var bx=k(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.Discovery=void 0;var O1=require("fs"),C1=st(),$1=require("url"),vx=require("util"),k1=Ac(),N1=fm(),z1=vx.promisify(O1.readFile),mm=class{static{o(this,"Discovery")}transporter=new C1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new N1.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async l=>{let f=await this.discoverAPI(l.discoveryRestUrl);return{api:l,endpointCreator:f}})),c={},d={};for(let l of s)d[l.api.name]||(c[l.api.name]={},d[l.api.name]=f=>{let p=typeof f,_;if(p==="string")_=f,f={};else if(p==="object")_=f.version,delete f.version;else throw new Error("Argument error: Accepts only string or object");try{let h=l.endpointCreator(f,this);return Object.freeze(h)}catch(h){throw new Error(vx.format('Unable to load endpoint %s("%s"): %s',l.api.name,_,h.message))}}),c[l.api.name][l.api.version]=l.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=$1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await z1(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,k1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Rc.Discovery=mm});var Oc=k(we=>{"use strict";var D1=we&&we.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),U1=we&&we.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D1(e,t,r)};Object.defineProperty(we,"__esModule",{value:!0});we.Endpoint=we.Discovery=we.AuthPlus=we.createAPIRequest=we.getAPI=we.GaxiosError=we.Gaxios=we.AwsClient=we.IdentityPoolClient=we.BaseExternalAccountClient=we.ExternalAccountClient=we.GoogleAuth=we.UserRefreshClient=we.Compute=we.JWT=we.OAuth2Client=we.gaxios=we.googleAuthLibrary=void 0;we.googleAuthLibrary=ka();we.gaxios=st();var dn=ka();Object.defineProperty(we,"OAuth2Client",{enumerable:!0,get:o(function(){return dn.OAuth2Client},"get")});Object.defineProperty(we,"JWT",{enumerable:!0,get:o(function(){return dn.JWT},"get")});Object.defineProperty(we,"Compute",{enumerable:!0,get:o(function(){return dn.Compute},"get")});Object.defineProperty(we,"UserRefreshClient",{enumerable:!0,get:o(function(){return dn.UserRefreshClient},"get")});Object.defineProperty(we,"GoogleAuth",{enumerable:!0,get:o(function(){return dn.GoogleAuth},"get")});Object.defineProperty(we,"ExternalAccountClient",{enumerable:!0,get:o(function(){return dn.ExternalAccountClient},"get")});Object.defineProperty(we,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return dn.BaseExternalAccountClient},"get")});Object.defineProperty(we,"IdentityPoolClient",{enumerable:!0,get:o(function(){return dn.IdentityPoolClient},"get")});Object.defineProperty(we,"AwsClient",{enumerable:!0,get:o(function(){return dn.AwsClient},"get")});var Px=st();Object.defineProperty(we,"Gaxios",{enumerable:!0,get:o(function(){return Px.Gaxios},"get")});Object.defineProperty(we,"GaxiosError",{enumerable:!0,get:o(function(){return Px.GaxiosError},"get")});var M1=dT();Object.defineProperty(we,"getAPI",{enumerable:!0,get:o(function(){return M1.getAPI},"get")});var j1=Ac();Object.defineProperty(we,"createAPIRequest",{enumerable:!0,get:o(function(){return j1.createAPIRequest},"get")});var L1=gx();Object.defineProperty(we,"AuthPlus",{enumerable:!0,get:o(function(){return L1.AuthPlus},"get")});var F1=bx();Object.defineProperty(we,"Discovery",{enumerable:!0,get:o(function(){return F1.Discovery},"get")});var B1=fm();Object.defineProperty(we,"Endpoint",{enumerable:!0,get:o(function(){return B1.Endpoint},"get")});U1(xc(),we)});var Ex=k(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.people_v1=void 0;var ge=Oc(),Sx;(function(t){class e{static{o(this,"People")}context;contactGroups;otherContacts;people;constructor(l,f){this.context={_options:l||{},google:f},this.contactGroups=new r(this.context),this.otherContacts=new i(this.context),this.people=new s(this.context)}}t.People=e;class r{static{o(this,"Resource$Contactgroups")}context;members;constructor(l){this.context=l,this.members=new n(this.context)}batchGet(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}create(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}delete(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}get(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}list(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}update(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}}t.Resource$Contactgroups=r;class n{static{o(this,"Resource$Contactgroups$Members")}context;constructor(l){this.context=l}modify(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/members:modify").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}}t.Resource$Contactgroups$Members=n;class i{static{o(this,"Resource$Othercontacts")}context;constructor(l){this.context=l}copyOtherContactToMyContactsGroup(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:copyOtherContactToMyContactsGroup").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}list(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}search(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts:search").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}}t.Resource$Othercontacts=i;class s{static{o(this,"Resource$People")}context;connections;constructor(l){this.context=l,this.connections=new c(this.context)}batchCreateContacts(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchCreateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}batchDeleteContacts(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchDeleteContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}batchUpdateContacts(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchUpdateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}createContact(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:createContact").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}deleteContact(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContact").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}deleteContactPhoto(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}get(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}getBatchGet(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}listDirectoryPeople(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:listDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}searchContacts(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}searchDirectoryPeople(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}updateContact(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContact").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}updateContactPhoto(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}}t.Resource$People=s;class c{static{o(this,"Resource$People$Connections")}context;constructor(l){this.context=l}list(l,f,p){let _=l||{},h=f||{};typeof l=="function"&&(p=l,_={},h={}),typeof f=="function"&&(p=f,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/connections").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(p)(0,ge.createAPIRequest)(y,p);else return(0,ge.createAPIRequest)(y)}}t.Resource$People$Connections=c})(Sx||(Cc.people_v1=Sx={}))});var Ax=k(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.AuthPlus=ur.people_v1=ur.auth=ur.VERSIONS=void 0;ur.people=q1;var Tx=Oc(),xx=Ex();Object.defineProperty(ur,"people_v1",{enumerable:!0,get:o(function(){return xx.people_v1},"get")});ur.VERSIONS={v1:xx.people_v1.People};function q1(t){return(0,Tx.getAPI)("people",t,ur.VERSIONS,this)}o(q1,"people");var V1=new Tx.AuthPlus;ur.auth=V1;var H1=Oc();Object.defineProperty(ur,"AuthPlus",{enumerable:!0,get:o(function(){return H1.AuthPlus},"get")})});var wx=k((hm,gm)=>{(function(t,e){typeof hm=="object"&&typeof gm<"u"?gm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(hm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",l="week",f="month",p="quarter",_="year",h="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(te){var V=["th","st","nd","rd"],q=te%100;return"["+te+(V[(q-20)%10]||V[q]||V[0])+"]"},"ordinal")},x=o(function(te,V,q){var J=String(te);return!J||J.length>=V?te:""+Array(V+1-J.length).join(q)+te},"m"),N={s:x,z:o(function(te){var V=-te.utcOffset(),q=Math.abs(V),J=Math.floor(q/60),W=q%60;return(V<=0?"+":"-")+x(J,2,"0")+":"+x(W,2,"0")},"z"),m:o(function te(V,q){if(V.date()<q.date())return-te(q,V);var J=12*(q.year()-V.year())+(q.month()-V.month()),W=V.clone().add(J,f),re=q-W<0,oe=V.clone().add(J+(re?-1:1),f);return+(-(J+(q-W)/(re?W-oe:oe-W))||0)},"t"),a:o(function(te){return te<0?Math.ceil(te)||0:Math.floor(te)},"a"),p:o(function(te){return{M:f,y:_,w:l,d,D:h,h:c,m:s,s:i,ms:n,Q:p}[te]||String(te||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(te){return te===void 0},"u")},F="en",X={};X[F]=P;var Z=o(function(te){return te instanceof K},"p"),G=o(function te(V,q,J){var W;if(!V)return F;if(typeof V=="string"){var re=V.toLowerCase();X[re]&&(W=re),q&&(X[re]=q,W=re);var oe=V.split("-");if(!W&&oe.length>1)return te(oe[0])}else{var Ie=V.name;X[Ie]=V,W=Ie}return!J&&W&&(F=W),W||!J&&F},"t"),Y=o(function(te,V){if(Z(te))return te.clone();var q=typeof V=="object"?V:{};return q.date=te,q.args=arguments,new K(q)},"w"),ee=N;ee.l=G,ee.i=Z,ee.w=function(te,V){return Y(te,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var K=(function(){function te(q){this.$L=G(q.locale,null,!0),this.parse(q)}o(te,"M");var V=te.prototype;return V.parse=function(q){this.$d=(function(J){var W=J.date,re=J.utc;if(W===null)return new Date(NaN);if(ee.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var oe=W.match(y);if(oe){var Ie=oe[2]-1||0,Ce=(oe[7]||"0").substring(0,3);return re?new Date(Date.UTC(oe[1],Ie,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Ce)):new Date(oe[1],Ie,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Ce)}}return new Date(W)})(q),this.$x=q.x||{},this.init()},V.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},V.$utils=function(){return ee},V.isValid=function(){return this.$d.toString()!==g},V.isSame=function(q,J){var W=Y(q);return this.startOf(J)<=W&&W<=this.endOf(J)},V.isAfter=function(q,J){return Y(q)<this.startOf(J)},V.isBefore=function(q,J){return this.endOf(J)<Y(q)},V.$g=function(q,J,W){return ee.u(q)?this[J]:this.set(W,q)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(q,J){var W=this,re=!!ee.u(J)||J,oe=ee.p(q),Ie=o(function(Nt,Fe){var qe=ee.w(W.$u?Date.UTC(W.$y,Fe,Nt):new Date(W.$y,Fe,Nt),W);return re?qe:qe.endOf(d)},"l"),Ce=o(function(Nt,Fe){return ee.w(W.toDate()[Nt].apply(W.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(Fe)),W)},"$"),Be=this.$W,Ge=this.$M,ht=this.$D,Q="set"+(this.$u?"UTC":"");switch(oe){case _:return re?Ie(1,0):Ie(31,11);case f:return re?Ie(1,Ge):Ie(0,Ge+1);case l:var rt=this.$locale().weekStart||0,it=(Be<rt?Be+7:Be)-rt;return Ie(re?ht-it:ht+(6-it),Ge);case d:case h:return Ce(Q+"Hours",0);case c:return Ce(Q+"Minutes",1);case s:return Ce(Q+"Seconds",2);case i:return Ce(Q+"Milliseconds",3);default:return this.clone()}},V.endOf=function(q){return this.startOf(q,!1)},V.$set=function(q,J){var W,re=ee.p(q),oe="set"+(this.$u?"UTC":""),Ie=(W={},W[d]=oe+"Date",W[h]=oe+"Date",W[f]=oe+"Month",W[_]=oe+"FullYear",W[c]=oe+"Hours",W[s]=oe+"Minutes",W[i]=oe+"Seconds",W[n]=oe+"Milliseconds",W)[re],Ce=re===d?this.$D+(J-this.$W):J;if(re===f||re===_){var Be=this.clone().set(h,1);Be.$d[Ie](Ce),Be.init(),this.$d=Be.set(h,Math.min(this.$D,Be.daysInMonth())).$d}else Ie&&this.$d[Ie](Ce);return this.init(),this},V.set=function(q,J){return this.clone().$set(q,J)},V.get=function(q){return this[ee.p(q)]()},V.add=function(q,J){var W,re=this;q=Number(q);var oe=ee.p(J),Ie=o(function(Ge){var ht=Y(re);return ee.w(ht.date(ht.date()+Math.round(Ge*q)),re)},"y");if(oe===f)return this.set(f,this.$M+q);if(oe===_)return this.set(_,this.$y+q);if(oe===d)return Ie(1);if(oe===l)return Ie(7);var Ce=(W={},W[s]=e,W[c]=r,W[i]=t,W)[oe]||1,Be=this.$d.getTime()+q*Ce;return ee.w(Be,this)},V.subtract=function(q,J){return this.add(-1*q,J)},V.format=function(q){var J=this,W=this.$locale();if(!this.isValid())return W.invalidDate||g;var re=q||"YYYY-MM-DDTHH:mm:ssZ",oe=ee.z(this),Ie=this.$H,Ce=this.$m,Be=this.$M,Ge=W.weekdays,ht=W.months,Q=W.meridiem,rt=o(function(Fe,qe,b,E){return Fe&&(Fe[qe]||Fe(J,re))||b[qe].slice(0,E)},"h"),it=o(function(Fe){return ee.s(Ie%12||12,Fe,"0")},"d"),Nt=Q||function(Fe,qe,b){var E=Fe<12?"AM":"PM";return b?E.toLowerCase():E};return re.replace(T,(function(Fe,qe){return qe||(function(b){switch(b){case"YY":return String(J.$y).slice(-2);case"YYYY":return ee.s(J.$y,4,"0");case"M":return Be+1;case"MM":return ee.s(Be+1,2,"0");case"MMM":return rt(W.monthsShort,Be,ht,3);case"MMMM":return rt(ht,Be);case"D":return J.$D;case"DD":return ee.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return rt(W.weekdaysMin,J.$W,Ge,2);case"ddd":return rt(W.weekdaysShort,J.$W,Ge,3);case"dddd":return Ge[J.$W];case"H":return String(Ie);case"HH":return ee.s(Ie,2,"0");case"h":return it(1);case"hh":return it(2);case"a":return Nt(Ie,Ce,!0);case"A":return Nt(Ie,Ce,!1);case"m":return String(Ce);case"mm":return ee.s(Ce,2,"0");case"s":return String(J.$s);case"ss":return ee.s(J.$s,2,"0");case"SSS":return ee.s(J.$ms,3,"0");case"Z":return oe}return null})(Fe)||oe.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(q,J,W){var re,oe=this,Ie=ee.p(J),Ce=Y(q),Be=(Ce.utcOffset()-this.utcOffset())*e,Ge=this-Ce,ht=o(function(){return ee.m(oe,Ce)},"D");switch(Ie){case _:re=ht()/12;break;case f:re=ht();break;case p:re=ht()/3;break;case l:re=(Ge-Be)/6048e5;break;case d:re=(Ge-Be)/864e5;break;case c:re=Ge/r;break;case s:re=Ge/e;break;case i:re=Ge/t;break;default:re=Ge}return W?re:ee.a(re)},V.daysInMonth=function(){return this.endOf(f).$D},V.$locale=function(){return X[this.$L]},V.locale=function(q,J){if(!q)return this.$L;var W=this.clone(),re=G(q,J,!0);return re&&(W.$L=re),W},V.clone=function(){return ee.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},te})(),Oe=K.prototype;return Y.prototype=Oe,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",f],["$y",_],["$D",h]].forEach((function(te){Oe[te[1]]=function(V){return this.$g(V,te[0],te[1])}})),Y.extend=function(te,V){return te.$i||(te(V,K,Y),te.$i=!0),Y},Y.locale=G,Y.isDayjs=Z,Y.unix=function(te){return Y(1e3*te)},Y.en=X[F],Y.Ls=X,Y.p={},Y}))});var W1={};ys(W1,{googleContacts:()=>G1});module.exports=_w(W1);var vw=Object.freeze({status:"aborted"});function ae(t,e,r){function n(d,l){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:l,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,l);let f=c.prototype,p=Object.keys(f);for(let _=0;_<p.length;_++){let h=p[_];h in d||(d[h]=f[h].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var l;let f=r?.Parent?new s:this;n(f,d),(l=f._zod).deferred??(l.deferred=[]);for(let p of f._zod.deferred)p();return f}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(ae,"$constructor");var xr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_s=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},al={};function Jr(t){return t&&Object.assign(al,t),al}o(Jr,"config");function ul(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}o(ul,"getEnumValues");function Ph(t,e){return typeof e=="bigint"?e.toString():e}o(Ph,"jsonStringifyReplacer");function bs(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(bs,"cached");function Sh(t){return t==null}o(Sh,"nullish");function Ps(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Ps,"cleanRegex");var bh=Symbol("evaluating");function ut(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==bh)return n===void 0&&(n=bh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(ut,"defineLazy");var cl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Oi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Oi,"isObject");var bw=bs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Eh(t){if(Oi(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Oi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Eh,"isPlainObject");var Th=new Set(["string","number","symbol"]);function Co(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Co,"escapeRegex");function Ss(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Ss,"clone");function Xe(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(Xe,"normalizeParams");function xh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(xh,"optionalKeys");var Ah={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $o(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}o($o,"aborted");function bn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(bn,"prefixIssues");function vs(t){return typeof t=="string"?t:t?.message}o(vs,"unwrapMessage");function Pn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=vs(t.inst?._zod.def?.error?.(t))??vs(e?.error?.(t))??vs(r.customError?.(t))??vs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Pn,"finalizeIssue");function wh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(wh,"getLengthableOrigin");function ll(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(ll,"issue");var Ih=o((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Ph,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Rh=ae("$ZodError",Ih),Ci=ae("$ZodError",Ih,{Parent:Error});var Sw=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new xr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw cl(d,i?.callee),d}return c.value},"_parse"),Es=Sw(Ci),Ew=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>Pn(l,s,Jr())));throw cl(d,i?.callee),d}return c.value},"_parseAsync"),Ts=Ew(Ci),Tw=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new xr;return s.issues.length?{success:!1,error:new(t??Rh)(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParse"),$i=Tw(Ci),xw=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>Pn(c,i,Jr())))}:{success:!0,data:s.value}},"_safeParseAsync"),ki=xw(Ci);var Aw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ww=new RegExp(`^${Aw}$`);var Oh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Ch=/^-?\d+n?$/,$h=/^-?\d+$/,dl=/^-?\d+(?:\.\d+)?$/,kh=/^(?:true|false)$/i;var Sn=ae("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Iw={number:"number",bigint:"bigint",object:"date"};var Nh=ae("$ZodCheckGreaterThan",(t,e)=>{Sn.init(t,e);let r=Iw[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var zh=ae("$ZodCheckNumberFormat",(t,e)=>{Sn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=Ah[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=$h)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Dh=ae("$ZodCheckMinLength",(t,e)=>{var r;Sn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Sh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=wh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var pl=ae("$ZodCheckStringFormat",(t,e)=>{var r,n;Sn.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Uh=ae("$ZodCheckRegex",(t,e)=>{pl.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});var jh={major:4,minor:3,patch:6};var nt=ae("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=jh;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,l)=>{let f=$o(c),p;for(let _ of d){if(_._zod.def.when){if(!_._zod.def.when(c))continue}else if(f)continue;let h=c.issues.length,g=_._zod.check(c);if(g instanceof Promise&&l?.async===!1)throw new xr;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,c.issues.length!==h&&(f||(f=$o(c,h)))});else{if(c.issues.length===h)continue;f||(f=$o(c,h))}}return p?p.then(()=>c):c},"runChecks"),s=o((c,d,l)=>{if($o(c))return c.aborted=!0,c;let f=i(d,n,l);if(f instanceof Promise){if(l.async===!1)throw new xr;return f.then(p=>t._zod.parse(p,l))}return t._zod.parse(f,l)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let f=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return f instanceof Promise?f.then(p=>s(p,c,d)):s(f,c,d)}let l=t._zod.parse(c,d);if(l instanceof Promise){if(d.async===!1)throw new xr;return l.then(f=>i(f,n,d))}return i(l,n,d)}}ut(t,"~standard",()=>({validate:o(i=>{try{let s=$i(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ki(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),ws=ae("$ZodString",(t,e)=>{nt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Oh(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),fl=ae("$ZodStringFormat",(t,e)=>{pl.init(t,e),ws.init(t,e)});var Vh=ae("$ZodURL",(t,e)=>{fl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var ml=ae("$ZodNumber",(t,e)=>{nt.init(t,e),t._zod.pattern=t._zod.bag.pattern??dl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),Hh=ae("$ZodNumberFormat",(t,e)=>{zh.init(t,e),ml.init(t,e)}),hl=ae("$ZodBoolean",(t,e)=>{nt.init(t,e),t._zod.pattern=kh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Gh=ae("$ZodBigInt",(t,e)=>{nt.init(t,e),t._zod.pattern=Ch,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}});var Wh=ae("$ZodAny",(t,e)=>{nt.init(t,e),t._zod.parse=r=>r}),Zh=ae("$ZodUnknown",(t,e)=>{nt.init(t,e),t._zod.parse=r=>r});var Kh=ae("$ZodVoid",(t,e)=>{nt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),Jh=ae("$ZodDate",(t,e)=>{nt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Lh(t,e,r){t.issues.length&&e.issues.push(...bn(r,t.issues)),e.value[r]=t.value}o(Lh,"handleArrayResult");var Yh=ae("$ZodArray",(t,e)=>{nt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],l=e.element._zod.run({value:d,issues:[]},n);l instanceof Promise?s.push(l.then(f=>Lh(f,r,c))):Lh(l,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function As(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...bn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(As,"handlePropertyResult");function Rw(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=xh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(Rw,"normalizeDef");function Ow(t,e,r,n,i,s){let c=[],d=i.keySet,l=i.catchall._zod,f=l.def.type,p=l.optout==="optional";for(let _ in e){if(d.has(_))continue;if(f==="never"){c.push(_);continue}let h=l.run({value:e[_],issues:[]},n);h instanceof Promise?t.push(h.then(g=>As(g,r,_,e,p))):As(h,r,_,e,p)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(Ow,"handleCatchall");var Xh=ae("$ZodObject",(t,e)=>{if(nt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let l={...d};return Object.defineProperty(e,"shape",{value:l}),l},"get")})}let n=bs(()=>Rw(e));ut(t._zod,"propValues",()=>{let d=e.shape,l={};for(let f in d){let p=d[f]._zod;if(p.values){l[f]??(l[f]=new Set);for(let _ of p.values)l[f].add(_)}}return l});let i=Oi,s=e.catchall,c;t._zod.parse=(d,l)=>{c??(c=n.value);let f=d.value;if(!i(f))return d.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),d;d.value={};let p=[],_=c.shape;for(let h of c.keys){let g=_[h],y=g._zod.optout==="optional",T=g._zod.run({value:f[h],issues:[]},l);T instanceof Promise?p.push(T.then(P=>As(P,d,h,f,y))):As(T,d,h,f,y)}return s?Ow(p,f,d,l,n.value,t):p.length?Promise.all(p).then(()=>d):d}});function Fh(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!$o(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>Pn(c,n,Jr())))}),e)}o(Fh,"handleUnionResults");var gl=ae("$ZodUnion",(t,e)=>{nt.init(t,e),ut(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ut(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ut(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ut(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Ps(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let l of e.options){let f=l._zod.run({value:i.value,issues:[]},s);if(f instanceof Promise)d.push(f),c=!0;else{if(f.issues.length===0)return f;d.push(f)}}return c?Promise.all(d).then(l=>Fh(l,i,t,s)):Fh(d,i,t,s)}});var Qh=ae("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,gl.init(t,e);let r=t._zod.parse;ut(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,l]of Object.entries(c)){i[d]||(i[d]=new Set);for(let f of l)i[d].add(f)}}return i});let n=bs(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let l of d){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!Oi(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var eg=ae("$ZodRecord",(t,e)=>{nt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Eh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let f of c)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){d.add(typeof f=="number"?f.toString():f);let p=e.valueType._zod.run({value:i[f],issues:[]},n);p instanceof Promise?s.push(p.then(_=>{_.issues.length&&r.issues.push(...bn(f,_.issues)),r.value[f]=_.value})):(p.issues.length&&r.issues.push(...bn(f,p.issues)),r.value[f]=p.value)}let l;for(let f in i)d.has(f)||(l=l??[],l.push(f));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let l=e.keyType._zod.run({value:d,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&dl.test(d)&&l.issues.length){let _=e.keyType._zod.run({value:Number(d),issues:[]},n);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(l=_)}if(l.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(_=>Pn(_,n,Jr())),input:d,path:[d],inst:t});continue}let p=e.valueType._zod.run({value:i[d],issues:[]},n);p instanceof Promise?s.push(p.then(_=>{_.issues.length&&r.issues.push(...bn(d,_.issues)),r.value[l.value]=_.value})):(p.issues.length&&r.issues.push(...bn(d,p.issues)),r.value[l.value]=p.value)}}return s.length?Promise.all(s).then(()=>r):r}});var tg=ae("$ZodEnum",(t,e)=>{nt.init(t,e);let r=ul(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Th.has(typeof i)).map(i=>typeof i=="string"?Co(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),rg=ae("$ZodLiteral",(t,e)=>{if(nt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Co(n):n?Co(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var ng=ae("$ZodTransform",(t,e)=>{nt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _s(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new xr;return r.value=i,r}});function Bh(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Bh,"handleOptionalResult");var og=ae("$ZodOptional",(t,e)=>{nt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ut(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ps(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Bh(s,r.value)):Bh(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var ig=ae("$ZodNullable",(t,e)=>{nt.init(t,e),ut(t._zod,"optin",()=>e.innerType._zod.optin),ut(t._zod,"optout",()=>e.innerType._zod.optout),ut(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ps(r.source)}|null)$`):void 0}),ut(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var ag=ae("$ZodPipe",(t,e)=>{nt.init(t,e),ut(t._zod,"values",()=>e.in._zod.values),ut(t._zod,"optin",()=>e.in._zod.optin),ut(t._zod,"optout",()=>e.out._zod.optout),ut(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>xs(c,e.in,n)):xs(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>xs(s,e.out,n)):xs(i,e.out,n)}});function xs(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(xs,"handlePipeResult");var sg=ae("$ZodCustom",(t,e)=>{Sn.init(t,e),nt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>qh(s,r,n,t));qh(i,r,n,t)}});function qh(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(ll(i))}}o(qh,"handleRefineResult");var cg;var yl=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function lg(){return new yl}o(lg,"registry");(cg=globalThis).__zod_globalRegistry??(cg.__zod_globalRegistry=lg());var _l=globalThis.__zod_globalRegistry;function dg(t,e){return new t({type:"string",...Xe(e)})}o(dg,"_string");function pg(t,e){return new t({type:"string",coerce:!0,...Xe(e)})}o(pg,"_coercedString");function fg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Xe(e)})}o(fg,"_url");function mg(t,e){return new t({type:"number",checks:[],...Xe(e)})}o(mg,"_number");function hg(t,e){return new t({type:"number",coerce:!0,checks:[],...Xe(e)})}o(hg,"_coercedNumber");function gg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Xe(e)})}o(gg,"_int");function yg(t,e){return new t({type:"boolean",...Xe(e)})}o(yg,"_boolean");function _g(t,e){return new t({type:"boolean",coerce:!0,...Xe(e)})}o(_g,"_coercedBoolean");function vg(t,e){return new t({type:"bigint",coerce:!0,...Xe(e)})}o(vg,"_coercedBigint");function bg(t){return new t({type:"any"})}o(bg,"_any");function Pg(t){return new t({type:"unknown"})}o(Pg,"_unknown");function Sg(t,e){return new t({type:"void",...Xe(e)})}o(Sg,"_void");function Eg(t,e){return new t({type:"date",coerce:!0,...Xe(e)})}o(Eg,"_coercedDate");function Is(t,e){return new Nh({check:"greater_than",...Xe(e),value:t,inclusive:!0})}o(Is,"_gte");function pr(t,e){return new Dh({check:"min_length",...Xe(e),minimum:t})}o(pr,"_minLength");function En(t,e){return new Uh({check:"string_format",format:"regex",...Xe(e),pattern:t})}o(En,"_regex");function Tg(t,e,r){let n=Xe(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(Tg,"_custom");var ct=ae("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");nt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Es(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>$i(t,r,n),t.parseAsync=async(r,n)=>Ts(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ki(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Ss(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Os=ae("ZodMiniString",(t,e)=>{ws.init(t,e),ct.init(t,e)});function v(t){return dg(Os,t)}o(v,"string");var xg=ae("ZodMiniStringFormat",(t,e)=>{fl.init(t,e),Os.init(t,e)});var qw=ae("ZodMiniURL",(t,e)=>{Vh.init(t,e),xg.init(t,e)});function Ag(t){return fg(qw,t)}o(Ag,"url");var Cs=ae("ZodMiniNumber",(t,e)=>{ml.init(t,e),ct.init(t,e)});function yt(t){return mg(Cs,t)}o(yt,"number");var Vw=ae("ZodMiniNumberFormat",(t,e)=>{Hh.init(t,e),Cs.init(t,e)});function wg(t){return gg(Vw,t)}o(wg,"int");var vl=ae("ZodMiniBoolean",(t,e)=>{hl.init(t,e),ct.init(t,e)});function Me(t){return yg(vl,t)}o(Me,"boolean");var Ig=ae("ZodMiniBigInt",(t,e)=>{Gh.init(t,e),ct.init(t,e)});var Hw=ae("ZodMiniAny",(t,e)=>{Wh.init(t,e),ct.init(t,e)});function zi(){return bg(Hw)}o(zi,"any");var Gw=ae("ZodMiniUnknown",(t,e)=>{Zh.init(t,e),ct.init(t,e)});function Se(){return Pg(Gw)}o(Se,"unknown");var Ww=ae("ZodMiniVoid",(t,e)=>{Kh.init(t,e),ct.init(t,e)});function Rg(t){return Sg(Ww,t)}o(Rg,"_void");var Og=ae("ZodMiniDate",(t,e)=>{Jh.init(t,e),ct.init(t,e)});var Zw=ae("ZodMiniArray",(t,e)=>{Yh.init(t,e),ct.init(t,e)});function _e(t,e){return new Zw({type:"array",element:t,...Xe(e)})}o(_e,"array");var Kw=ae("ZodMiniObject",(t,e)=>{Xh.init(t,e),ct.init(t,e),ut(t,"shape",()=>e.shape)});function O(t,e){let r={type:"object",shape:t??{},...Xe(e)};return new Kw(r)}o(O,"object");var Jw=ae("ZodMiniUnion",(t,e)=>{gl.init(t,e),ct.init(t,e)});function Re(t,e){return new Jw({type:"union",options:t,...Xe(e)})}o(Re,"union");var Yw=ae("ZodMiniDiscriminatedUnion",(t,e)=>{Qh.init(t,e),ct.init(t,e)});function Tn(t,e,r){return new Yw({type:"union",options:e,discriminator:t,...Xe(r)})}o(Tn,"discriminatedUnion");var Xw=ae("ZodMiniRecord",(t,e)=>{eg.init(t,e),ct.init(t,e)});function Ee(t,e,r){return new Xw({type:"record",keyType:t,valueType:e,...Xe(r)})}o(Ee,"record");var Qw=ae("ZodMiniEnum",(t,e)=>{tg.init(t,e),ct.init(t,e),t.options=Object.values(e.entries)});function me(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Qw({type:"enum",entries:r,...Xe(e)})}o(me,"_enum");var eI=ae("ZodMiniLiteral",(t,e)=>{rg.init(t,e),ct.init(t,e)});function de(t,e){return new eI({type:"literal",values:Array.isArray(t)?t:[t],...Xe(e)})}o(de,"literal");var tI=ae("ZodMiniTransform",(t,e)=>{ng.init(t,e),ct.init(t,e)});function xn(t){return new tI({type:"transform",transform:t})}o(xn,"transform");var rI=ae("ZodMiniOptional",(t,e)=>{og.init(t,e),ct.init(t,e)});function L(t){return new rI({type:"optional",innerType:t})}o(L,"optional");var nI=ae("ZodMiniNullable",(t,e)=>{ig.init(t,e),ct.init(t,e)});function Di(t){return new nI({type:"nullable",innerType:t})}o(Di,"nullable");var oI=ae("ZodMiniPipe",(t,e)=>{ag.init(t,e),ct.init(t,e)});function An(t,e){return new oI({type:"pipe",in:t,out:e})}o(An,"pipe");var iI=ae("ZodMiniCustom",(t,e)=>{sg.init(t,e),ct.init(t,e)});function $s(t,e){return Tg(iI,t??(()=>!0),e)}o($s,"custom");var Ui={};ys(Ui,{bigint:()=>dI,boolean:()=>lI,date:()=>pI,number:()=>cI,string:()=>uI});function uI(t){return pg(Os,t)}o(uI,"string");function cI(t){return hg(Cs,t)}o(cI,"number");function lI(t){return _g(vl,t)}o(lI,"boolean");function dI(t){return vg(Ig,t)}o(dI,"bigint");function pI(t){return Eg(Og,t)}o(pI,"date");var Pl=O({retryOnFailure:O({defaultValue:L(Me()),hide:L(Me())}),continueOnFailure:O({defaultValue:L(Me()),hide:L(Me())})}),bl=class{constructor(e,r,n,i,s,c,d,l,f,p,_,h,g){this.name=e;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=s;this.run=c;this.test=d;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=p;this.audience=_;this.aiMetadata=h;this.classification=g}static{o(this,"IAction")}},wn=o(t=>new bl(t.name,t.displayName,t.description,t.props,t.propertyGroups,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata,t.classification),"createAction");var ze=O({displayName:v(),description:L(v()),advanced:L(Me()),width:L(me(["half","full"])),icon:L(v()),placeholder:L(v())}),Te=o((t,e)=>O({type:de(e),required:Me(),defaultValue:L(zi())}),"TPropertyValue");var Ut=O({...ze.shape,...Te(v(),"SHORT_TEXT").shape}),Yr=O({...ze.shape,...Te(v(),"LONG_TEXT").shape});var $g=O({label:v(),value:Se(),description:L(v()),icon:L(v())}),ks=O({disabled:L(Me()),placeholder:L(v()),options:_e($g)});var mI=me(["cards"]),Mt=O({...ze.shape,options:ks,display:L(mI),...Te(Se(),"STATIC_DROPDOWN").shape}),Xr=O({...ze.shape,options:ks,...Te(_e(Se()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Sl=O({...ze.shape,...Te(Se(),"DROPDOWN").shape,refreshers:_e(v())}),Mi=O({...ze.shape,...Te(_e(Se()),"MULTI_SELECT_DROPDOWN").shape,refreshers:_e(v())});var Qr=O({...ze.shape,reveals:L(_e(v())),...Te(Me(),"CHECKBOX").shape});var en=O({...ze.shape,display:L(me(["stepper"])),min:L(yt()),max:L(yt()),step:L(yt()),...Te(yt(),"NUMBER").shape});var ji=O({...ze.shape,streaming:L(Me()),...Te(Se(),"FILE").shape});var Li=O({...ze.shape,...Te(v(),"DATE_TIME").shape});var kg=Ee(v(),Re([Ut,Yr,Mt,Mi,Xr,Qr,en,ji,Li])),Fi=O({...ze.shape,properties:kg,...Te(_e(Se()),"ARRAY").shape});var Ng=me(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),zg=O({preset:L(Ng),after:L(v()),before:L(v())}),El=O({...ze.shape,display:L(me(["dropdown"])),...Te(zg,"DATE_RANGE").shape});var Bi=O({...ze.shape,...Te(Re([Ee(v(),Se())]),"JSON").shape});var Dg=Re([Ut,Mt,Bi,Fi,Xr]),hI=Ee(v(),Dg),Tl=O({refreshers:_e(v()),...ze.shape,...Te(Se(),"DYNAMIC").shape});var Ns=O({...ze.shape,...Te(Rg(),"MARKDOWN").shape});var qi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(qi||{}),ko=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ko||{}),No=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(No||{});var Vi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Vi||{}),xl="both_client_credentials_and_authorization_code";var In=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(In||{}),Hi=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Hi||{}),gI=O({strategy:me(Hi),paramName:L(v())}),Gi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Gi||{});var zs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(zs||{}),Ug=O({status:L(yt()),body:L(Se()),headers:L(Ee(v(),v()))}),Mg=O({type:de("DELAY"),resumeDateTime:v(),requestIdToReply:L(v()),handlerId:L(v()),streamStepProgress:L(me(zs))}),jg=O({type:de("WEBHOOK"),requestId:v(),requestIdToReply:L(v()),response:Ug,handlerId:L(v()),streamStepProgress:L(me(zs))}),yI=Re([Mg,jg]);var _I=O({body:Se(),rawBody:L(Se()),headers:Ee(v(),v()),queryParams:Ee(v(),v())});function at(t){return t==null}o(at,"isNil");function Wi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Wi,"isEmpty");function Ds(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(Ds,"assertNotNullOrUndefined");var Al=ft(require("crypto"),1);var vI=128,Rn,zo,bI=o(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!Rn||Rn.length<t?(Rn=Buffer.allocUnsafe(t*vI),Al.default.randomFillSync(Rn),zo=0):zo+t>Rn.length&&(Al.default.randomFillSync(Rn),zo=0)}catch(e){throw Rn=void 0,e}zo+=t},"fillPool"),PI=o(t=>(bI(t|=0),Rn.subarray(zo-t,zo)),"random"),SI=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{if(s<=0)return"";let c="";for(;;){let d=r(i),l=i;for(;l--;)if(c+=t[d[l]&n]||"",c.length===s)return c}}},"customRandom"),Fg=o((t,e=21)=>SI(t,e,PI),"customAlphabet");var EI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bg=21,CV=v().check(En(new RegExp(`^[0-9a-zA-Z]{${Bg}}$`))),TI=Fg(EI,Bg);var On=An(xn(t=>t instanceof Date?t.toISOString():t),v()),Qt={id:v(),created:On,updated:On},et=o(t=>L(Di(t)),"Nullable");function wl(t){return L(Di(me(t)))}o(wl,"NullableEnum");var NV=An(xn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),L(Me())),Us=o(t=>An(xn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),L(_e(t))),"OptionalArrayFromQuery");var UV=Ee(v(),Se());var Zi=(p=>(p.OPENAI="openai",p.OPENROUTER="openrouter",p.ANTHROPIC="anthropic",p.AZURE="azure",p.GOOGLE="google",p.ACTIVEPIECES="activepieces",p.CLOUDFLARE_GATEWAY="cloudflare-gateway",p.CUSTOM="custom",p.BEDROCK="bedrock",p.MISTRAL="mistral",p))(Zi||{});var KV=v().check(En(/^#[0-9A-Fa-f]{6}$/));var YV=O({filename:v(),data:Se(),type:de("file"),mimetype:L(v())});var xI=ft(Vg());var oH=O({...Qt,name:v(),permissions:_e(v()),platformId:et(v()),type:v(),userCount:L(yt())});var Hg=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Hg||{}),Il=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Il||{}),Rl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Rl||{});var Ol=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ol||{});var Cl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Cl||{});var AI=O({mode:me(Hg),value:Se()}),wI=O({auth:L(v()),fields:Ee(v(),AI)}),II=O({pieceName:v(),pieceVersion:v(),actionName:v(),predefinedInput:L(wI)}),RI=O({type:de("PIECE"),toolName:v().check(pr(1)),pieceMetadata:II}),OI=O({type:de("none")}),CI=O({type:de("access_token"),accessToken:v()}),$I=O({type:de("api_key"),apiKey:v(),apiKeyHeader:v()}),kI=O({type:de("headers"),headers:Ee(v(),v())}),NI=Tn("type",[OI,CI,$I,kI]),Gg=O({type:de("FLOW"),toolName:v().check(pr(1)),externalFlowId:v(),flowDisplayName:L(v())}),Wg=O({type:de("MCP"),toolName:v().check(pr(1)),serverUrl:Ag(),protocol:me(Rl),auth:NI}),Zg=O({type:de("KNOWLEDGE_BASE"),toolName:v().check(pr(1)),sourceType:me(Il),sourceId:v(),sourceName:v()}),zI=Tn("type",[RI,Gg,Wg,Zg]),DI=O({displayName:v(),description:L(v()),type:me(Ol)}),Kg=O({type:de("MARKDOWN"),markdown:v()}),Do={type:de("TOOL_CALL"),input:et(Ee(v(),Se())),output:L(Se()),toolName:v(),status:me(Cl),toolCallId:v(),startTime:v(),endTime:L(v())},zH=O(Do),Jg=Tn("toolCallType",[O({...Do,toolCallType:de("PIECE"),pieceName:v(),pieceVersion:v(),actionName:v()}),O({...Do,toolCallType:de("FLOW"),displayName:v(),externalFlowId:v()}),O({...Do,toolCallType:de("MCP"),displayName:v(),serverUrl:v()}),O({...Do,toolCallType:de("KNOWLEDGE_BASE"),displayName:v(),sourceType:v()}),O({...Do,toolCallType:de("UNKNOWN"),displayName:v()})]),UI=Re([Kg,Jg]);var $l=(r=>(r.IMAGE="image",r.TEXT="text",r))($l||{}),tn=O({apiKey:v()}),MI=tn,jI=O({apiKey:v(),apiKeyHash:v()}),LI=tn,FI=tn,BI=tn,qI=tn,VI=tn,HI=tn,GI=tn,ty=O({accessKeyId:v().check(pr(1)),secretAccessKey:v().check(pr(1))}),WI=O({}),ZI=O({}),KI=O({}),JI=O({}),YI=O({}),XI=O({}),ry=O({modelId:v(),modelName:v(),modelType:me($l)}),ny=O({apiKeyHeader:v(),baseUrl:v(),models:_e(ry),defaultHeaders:L(Ee(v(),v()))}),oy=O({accountId:v(),gatewayId:v(),models:_e(ry),vertexProject:L(v()),vertexRegion:L(v())}),iy=O({resourceName:v(),apiVersion:An(xn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),L(v()))}),ay=O({region:v().check(pr(1))}),QI=Re([MI,BI,qI,VI,HI,FI,LI,jI,ty,GI]),sy=Re([ny,oy,iy,ay,WI,KI,JI,YI,ZI,XI]),eR=O({id:v(),name:v(),type:me($l)}),tR=O({id:v(),name:v(),provider:me(Zi),config:sy,enabledForChat:Me()}),rR=O({provider:me(Zi),config:sy,auth:QI,platformId:v()});var jH={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Yg=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],nR=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],oR=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xg=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],iR=["grok-4.20","grok-4.1-fast"],aR={openai:Yg,anthropic:nR,google:Xg,activepieces:[...oR.map(t=>`anthropic/${t}`),...Yg.map(t=>`openai/${t}`),...Xg.map(t=>`google/${t}`),...iR.map(t=>`x-ai/${t}`)]};var Qg=128e3,sR={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function uR({provider:t}){return t?sR[t]??Qg:Qg}o(uR,"getMaxContextTokens");var ey={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},cR={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},lR=new Set(["anthropic","mistral"]);function Ar(t){return{chatModels:aR[t],maxContextTokens:uR({provider:t}),defaultEmbeddingModel:ey[t],supportsEmbedding:ey[t]!==void 0,supportsImageGeneration:!lR.has(t),webSearch:cR[t]}}o(Ar,"buildProviderCapabilities");var dR={openai:Ar("openai"),anthropic:Ar("anthropic"),openrouter:Ar("openrouter"),azure:Ar("azure"),google:Ar("google"),"cloudflare-gateway":Ar("cloudflare-gateway"),custom:Ar("custom"),bedrock:Ar("bedrock"),mistral:Ar("mistral"),activepieces:Ar("activepieces")};var pR=O({base64Url:v(),fileName:v(),extension:L(v())}),fR=O({mimeType:v(),url:v(),fileName:L(v())}),kl=Re([pR,fR]);var mR=Re([O({type:de("file"),value:kl}),O({type:de("markdown"),value:v(),files:L(_e(kl))})]),hR=O({sessionId:v(),message:v(),files:L(_e(v()))});var cy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(cy||{}),ly=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ly||{}),Nl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nl||{});var gR=Re([O({...Qt,name:v(),externalId:v(),type:de("STATIC_DROPDOWN"),tableId:v(),projectId:v(),data:O({options:_e(O({value:v()}))})}),O({...Qt,name:v(),externalId:v(),type:Re([de("TEXT"),de("NUMBER"),de("DATE"),de("DATETIME")]),tableId:v(),projectId:v()})]),yR=O({...Qt,name:v(),folderId:et(v()),projectId:v(),externalId:v(),status:wl(ly),trigger:wl(cy)}),_R=O({...Qt,tableId:v(),projectId:v(),cells:Ee(v(),O({updated:v(),created:v(),value:Se(),fieldName:v()}))}),vR=O({events:_e(me(Nl)),webhookUrl:v(),flowId:v()}),bR=O({fields:_e(O({id:v(),name:v()})),rows:_e(Ee(v(),v())),name:v()}),PR=O({projectId:v(),limit:L(Ui.number()),cursor:L(v()),name:L(v()),externalIds:Us(v()),folderId:L(v()),folderIds:Us(v())}),SR=O({records:_e(_e(O({fieldId:v(),value:py()}))),tableId:v()}),ER=O({cells:L(_e(O({fieldId:v(),value:py()}))),tableId:v(),agentUpdate:L(Me())}),dy=Tn("operator",[Qn("eq"),Qn("neq"),Qn("gt"),Qn("gte"),Qn("lt"),Qn("lte"),Qn("co"),uy("exists"),uy("not_exists")]),TR=O({tableId:v(),limit:L(Ui.number()),cursor:L(v()),filters:Us(dy)});function py(){return An(xn(t=>t==null?t:String(t)),Di(v()))}o(py,"coerceToString");function Qn(t){return O({fieldId:v(),operator:de(t),value:v()})}o(Qn,"valueFilter");function uy(t){return O({fieldId:v(),operator:de(t)})}o(uy,"existenceFilter");var xR=O({status:L(yt()),body:L(Se()),headers:L(Ee(v(),v()))}),AR=O({...Qt,deleted:et(On),ownerId:v(),displayName:v(),platformId:v(),externalId:et(v())});var fy=O({name:v(),description:L(v()),type:v(),required:Me()}),wR=O({pieceName:v(),triggerName:v(),input:O({toolName:v(),toolDescription:v(),inputSchema:_e(fy),returnsResponse:Me()})});var my="^[0-9]+\\.[0-9]+\\.[0-9]+$",oG=new RegExp(my),RR="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",iG=v().check(En(new RegExp(my))),aG=v().check(En(new RegExp(RR))),OR=O({packageType:de("ARCHIVE"),pieceType:me(ko),pieceName:v(),pieceVersion:v(),archiveId:v(),platformId:v()}),hy=O({packageType:de("REGISTRY"),pieceType:de("OFFICIAL"),pieceName:v(),pieceVersion:v()}),gy=O({packageType:de("REGISTRY"),pieceType:de("CUSTOM"),pieceName:v(),pieceVersion:v(),platformId:v()}),sG=Re([hy,gy]),uG=Re([OR,hy,gy]);var CR=Tn("type",[O({type:de("CRON_EXPRESSION"),cronExpression:v(),timezone:v()}),O({type:de("INTERVAL"),intervalMs:wg().check(Is(6e4))})]),cG=O({...Qt,type:me(In),projectId:v(),flowId:v(),triggerName:v(),schedule:et(CR),flowVersionId:v(),pieceName:v(),pieceVersion:v(),deleted:et(v()),simulate:Me()}),yy=(P=>(P.UNKNOWN="UNKNOWN",P.FLOW_RUN_LOG="FLOW_RUN_LOG",P.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",P.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",P.FLOW_STEP_FILE="FLOW_STEP_FILE",P.SAMPLE_DATA="SAMPLE_DATA",P.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",P.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",P.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",P.PROJECT_RELEASE="PROJECT_RELEASE",P.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",P.PLATFORM_ASSET="PLATFORM_ASSET",P.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",P.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",P.KNOWLEDGE_BASE="KNOWLEDGE_BASE",P.FLOW_BUNDLE="FLOW_BUNDLE",P))(yy||{}),_y=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(_y||{}),vy=(r=>(r.S3="S3",r.DB="DB",r))(vy||{}),lG=O({...Qt,projectId:et(v()),platformId:et(v()),type:me(yy),compression:me(_y),data:L(Se()),location:me(vy),size:et(yt()),fileName:et(v()),s3Key:et(v()),metadata:et(Ee(v(),v()))}),by=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(by||{}),Py=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Py||{}),dG=O({id:v(),email:v(),firstName:v(),status:me(Py),externalId:et(v()),platformId:et(v()),platformRole:me(by),lastName:v(),created:On,updated:On,lastActiveDate:et(On),imageUrl:et(v())});var zl=O({...ze.shape,...Te(Ee(v(),Se()),"OBJECT").shape});var Dl=O({...ze.shape,formatProperty:L(v()),...Te(v(),"RICH_TEXT").shape});var xy=O({...ze.shape,...Te(v(),"COLOR").shape});var Ul=Re([Ut,Yr,Dl,Ns,Qr,Mt,Xr,Sl,Mi,Tl,en,Fi,zl,Bi,Li,El,ji,xy]),Ae={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},RichText(t){return{...t,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},DateRange(t){return{...t,valueSchema:void 0,type:"DATE_RANGE"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var wr=O({displayName:v(),description:L(v()),hasConnectionIdentifier:L(Me())});var Ay=O({username:v(),password:v()}),Ml=O({...wr.shape,username:O({displayName:v(),description:L(v())}),password:O({displayName:v(),description:L(v())}),...Te(Ay,"BASIC_AUTH").shape});var zR=Ee(v(),Re([Ut,Yr,en,Qr,Mt])),jl=O({...wr.shape,props:zR,...Te(Se(),"CUSTOM_AUTH").shape});var eo=O({...wr.shape,...Te(O({auth:v()}),"SECRET_TEXT").shape});var DR=Ee(v(),Re([Ut,Yr,eo,en,Qr,Mt,Xr,Ns])),wy=O({...wr.shape,props:DR,...Te(Se(),"OIDC").shape});var Ll=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ll||{}),Iy=Re([Ut,eo,Mt]),Ry=Ee(v(),Iy),UR=O({props:L(Ee(v(),Iy)),authUrl:v(),tokenUrl:v(),scope:_e(v()),prompt:L(Re([de("none"),de("consent"),de("login"),de("omit")])),pkce:L(Me()),pkceMethod:L(Re([de("plain"),de("S256")])),authorizationMethod:L(me(Ll)),grantType:L(Re([me(Vi),de(xl)])),extra:L(Ee(v(),v()))}),Oy=O({access_token:v(),props:L(Ry),data:Ee(v(),zi())}),Fl=O({...wr.shape,...UR.shape,...Te(Oy,"OAUTH2").shape});var Uo=Re([Ml,jl,wy,Fl,eo]),Ki="Connection",Bl={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Ki}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Ki,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Ki}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Ki}},None(){}};var ZW={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var MR=O({...ze.shape,...Te(Se(),"CUSTOM").shape,code:v()});var jR=Re([Ul,Uo]),ql=Ee(v(),jR),hZ=Ee(v(),Ul);var Cy=Re([O({strategy:de("CRON"),cronExpression:v()}),O({strategy:de("NONE")})]),Mo=class{constructor(e,r,n,i,s,c,d,l,f,p,_,h,g,y,T,P,x,N,F,X,Z){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=l;this.renewConfiguration=f;this.onRenew=p;this.onEnable=_;this.onDisable=h;this.onStart=g;this.run=y;this.test=T;this.sampleData=P;this.testStrategy=x;this.outputSchema=N;this.aiMetadata=F;this.classification=X;this.propertyGroups=Z}static{o(this,"ITrigger")}},$y=o(t=>{switch(t.type){case"WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"POLLING":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"MANUAL":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"APP_WEBHOOK":return new Mo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,at(t.sampleData)&&at(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups)}},"createTrigger");var ky="2",js="0.82.0";var Vl=class{constructor(e,r,n,i,s,c,d,l,f=js,p,_="",h){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=l;this.minimumSupportedRelease=f;this.maximumSupportedRelease=p;this.description=_;this.deprecated=h;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:ky}),"getContextInfo");(!FR(f)||BR(f,js))&&(this.minimumSupportedRelease=js),s.forEach(g=>this._actions[g.name]=g),c.forEach(g=>this._triggers[g.name]=g)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:LR(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},zy=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Vl(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function LR(t){if(t!==void 0)return Array.isArray(t)?t.map(Ny):Ny(t)}o(LR,"withConnectionIdentifierFlag");function Ny(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}o(Ny,"flagConnectionIdentifier");function FR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(FR,"isValidSimpleSemver");function BR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(BR,"isSemverLessThan");var qR=L(Ee(v(),Ee(v(),v()))),Dy=O({id:L(v()),name:v(),displayName:v(),logoUrl:v(),description:v(),authors:_e(v()),platformId:L(v()),directoryPath:L(v()),auth:L(Re([Uo,_e(Uo)])),version:v(),categories:L(_e(me(No))),minimumSupportedRelease:L(v()),maximumSupportedRelease:L(v()),deprecated:L(Me()),i18n:qR}),VR=me(["human","ai","both"]),Uy=O({description:L(v()),idempotent:L(Me())}),My=me(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var HR=me(["tabs","section","summary","builder","footer"]),jy=O({key:v(),display:HR,label:L(v()),description:L(v()),icon:L(v()),props:_e(v())}),Ly=O({name:v(),displayName:v(),description:v(),props:ql,propertyGroups:L(_e(jy)),requireAuth:Me(),errorHandlingOptions:L(Pl),outputSchema:L($s()),audience:L(VR),aiMetadata:L(Uy),classification:L(My)}),Fy=O({name:v(),displayName:v(),description:v(),props:ql,propertyGroups:L(_e(jy)),errorHandlingOptions:L(Pl),type:me(In),sampleData:Se(),handshakeConfiguration:L($s()),renewConfiguration:L(Cy),testStrategy:me(Gi),outputSchema:L($s()),aiMetadata:L(Uy),classification:L(My)}),GR=O({...Dy.shape,actions:Ee(v(),Ly),triggers:Ee(v(),Fy)}),WR=O({...Dy.shape,actions:yt(),triggers:yt(),suggestedActions:L(_e(Ly)),suggestedTriggers:L(_e(Fy))}),By=O({projectUsage:yt(),pieceType:me(ko),packageType:me(qi),platformId:L(v()),archiveId:L(v())}),y3=O({...GR.shape,...By.shape}),_3=O({...WR.shape,...By.shape}),v3=O({name:v(),version:v()});var ZR=ft(require("path")),KR=ft(require("fs/promises"));var Lo=require("node:stream");var Ls=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Fs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Hl,r=new Gl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Hl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},Gl=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ji=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function qy({error:t,requestBody:e}){return t instanceof Ji?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(qy,"toFailsafeOutput");var jo=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(jo||{});var Bs=class extends Ls{static{o(this,"FetchHttpClient")}constructor(e="",r=new Fs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[F,X]of Object.entries(c))i.append(F,X);let d=i.toString(),l=d?`${n}?${d}`:n,f=e.responseType??"json",p=e.followRedirects??!0,_=e.retries??0,{body:h,extraHeaders:g,isStream:y}=JR(e.method)?YR(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},T=QR({...s,...g}),P=await XR(async()=>{let F=new AbortController,X=e.timeout&&e.timeout>0?setTimeout(()=>F.abort(),e.timeout):void 0;try{let Z={method:e.method.toString(),headers:T,body:h,redirect:p?"follow":"manual",signal:F.signal};return y&&(Z.duplex="half"),r?.dispatcher!==void 0&&(Z.dispatcher=r.dispatcher),await fetch(l,Z)}finally{X!==void 0&&clearTimeout(X)}},y?0:_),x=p?300:400;if(P.status<200||P.status>=x){let F=await Vy(P,f==="stream"?"text":f),X=new Ji(e.body,{status:P.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",X),X}let N=await Vy(P,f);return{status:P.status,headers:eO(P.headers),body:N}}};function JR(t){return t!=="GET"&&t!=="HEAD"}o(JR,"acceptsRequestBody");function YR(t,e){if(Gy(t))return{body:void 0,extraHeaders:{},isStream:!1};if(tO(t)){let n=new Lo.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return t instanceof Lo.Readable?{body:t,extraHeaders:{},isStream:!0}:typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(YR,"serializeBody");async function Vy(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"stream":return Gy(t.body)?Lo.Readable.from([]):Lo.Readable.fromWeb(t.body);case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Vy,"parseResponseBody");async function XR(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Hy(n);continue}return i}catch(i){if(r=i,n<e){await Hy(n);continue}throw i}throw r}o(XR,"sendWithRetries");function Hy(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Hy,"backoff");function QR(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(QR,"normalizeHeaders");function eO(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(eO,"toHttpHeaders");function tO(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(tO,"isNodeFormData");function Gy(t){return t==null}o(Gy,"isNil");var Cn=new Bs;var BC=ft(require("fs")),Jv=ft(Kv());var qC={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function VC(t){let e=t.split(";")[0].trim().toLowerCase();return qC[e]??""}o(VC,"contentTypeToExtension");var HC=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),GC=o((t,e)=>{let r="https://api.example.com";try{let n=e?t(e):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Yv({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:l="headers",classification:f="WRITE"}){return wn({audience:"human",name:s||"custom_api_call",classification:f,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:Ae.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:p})=>({url:Ae.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
+
i.e ${GC(e,p)}/resource or /resource`,required:!0,defaultValue:p?e(p):"",...c?.url??{}})}),"props")}),method:Ae.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(jo).map(p=>({label:p,value:p}))},...c?.method??{}}),headers:Ae.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:Ae.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:Ae.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:Ae.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:p})=>{if(!p)return{};let _=p,h={};switch(_){case"none":break;case"json":h.data=Ae.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":h.data=Ae.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=Ae.Array({displayName:"Form Data",required:!0,properties:{fieldName:Ae.ShortText({displayName:"Field Name",required:!0}),fieldType:Ae.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:Ae.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:Ae.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:Ae.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:Ae.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:Ae.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:Ae.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async p=>{let{method:_,url:h,headers:g,queryParams:y,body:T,body_type:P,failsafe:x,timeout:N,response_is_binary:F,followRedirects:X}=p.propsValue;Ds(_,"Method"),Ds(h,"URL");let Z=at(r)?{}:await r(p.auth,p.propsValue),G=h.url,Y=G.startsWith("http://")||G.startsWith("https://")?G:HC({baseUrl:e(p.auth),relativePath:G}),ee={method:_,url:Y,headers:{...g??{},...l==="headers"||!at(l)?Z:{}},queryParams:{...l==="queryParams"?Z:{},...y??{}},timeout:N?N*1e3:0,followRedirects:X};if(F&&(ee.responseType="arraybuffer"),T)if(P&&P!=="none"){let K=T.data;if(P==="form_data"){let Oe=K,te=new Jv.default;for(let{fieldName:V,fieldType:q,textFieldValue:J,fileFieldValue:W}of Oe)q==="text"&&!Wi(J)?te.append(V,J):q==="file"&&!Wi(W)&&te.append(V,W.data,{filename:W?.filename});ee.body=te,ee.headers={...ee.headers,...te.getHeaders()}}else ee.body=K}else P||(ee.body=T);try{let K=await Cn.sendRequest(ee);return await WC(p.files,K.body,K.status,K.headers,F)}catch(K){if(x)return qy({error:K,requestBody:ee.body});throw K}},"run")})}o(Yv,"createCustomApiCallAction");var WC=o(async(t,e,r,n,i)=>{let s;if(i&&ZC(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=VC(c??"")||"txt",l;e instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?l=e:l=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:l})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),ZC=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var ta={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(at(d))throw new Error("lastPoll doesn't exist in the store.");let l=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),f=l.reduce((p,_)=>Math.max(p,_.epochMilliSeconds),d);return await e.put("lastPoll",f),l.filter(p=>p.epochMilliSeconds>d).map(p=>p.data)}case 1:{let d=await e.get("lastItem"),l=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),f=l.findIndex(h=>h.id===d),p=[];at(d)||f==-1?p=l??[]:p=l?.slice(0,f)??[],at(i)||(p=p.slice(-i));let _=p?.[0]?.id;return at(_)||await e.put("lastItem",_),p.map(h=>h.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:s}){switch(t.strategy){case 0:{if(s&&!at(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(s&&!at(await e.get("lastItem")))break;let d=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;at(d)?await e.delete("lastItem"):await e.put("lastItem",d);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return KC(c.map(d=>d.data))}};function KC(t){return t.length<=5?t:t.slice(0,5)}o(KC,"getFirstFiveOrAll");var Nn={baseUrl:"https://people.googleapis.com/v1/people"};var mr=Bl.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:["https://www.googleapis.com/auth/contacts","email"]});var JC=[{key:"displayName",label:"Display Name"},{key:"givenName",label:"First Name"},{key:"middleName",label:"Middle Name"},{key:"familyName",label:"Last Name"},{key:"displayNameLastFirst",label:"Display Name (Last, First)"},{key:"unstructuredName",label:"Unstructured Name"},{key:"primary",label:"Primary",value:"metadata.primary",format:"boolean"}],YC=[{key:"value",label:"Email Address",format:"email"},{key:"primary",label:"Primary",value:"metadata.primary",format:"boolean"}],XC=[{key:"value",label:"Phone Number"},{key:"canonicalForm",label:"Canonical Form"},{key:"primary",label:"Primary",value:"metadata.primary",format:"boolean"}],QC=[{key:"name",label:"Company"},{key:"title",label:"Job Title"},{key:"primary",label:"Primary",value:"metadata.primary",format:"boolean"}],e0=[{key:"url",label:"Photo URL",format:"image"},{key:"default",label:"Is Placeholder",format:"boolean"},{key:"primary",label:"Primary",value:"metadata.primary",format:"boolean"}],t0=[{key:"contactGroupId",label:"Contact Group ID",value:"contactGroupMembership.contactGroupId"},{key:"contactGroupResourceName",label:"Contact Group Resource Name",value:"contactGroupMembership.contactGroupResourceName"}],r0=[{key:"objectType",label:"Object Type"},{key:"sources",label:"Sources",labelKey:"updateTime",listItems:[{key:"type",label:"Source Type"},{key:"id",label:"Source ID"},{key:"updateTime",label:"Last Updated",format:"datetime"}]}],Ys=[{key:"resourceName",label:"Resource Name"},{key:"etag",label:"ETag"},{key:"names",label:"Names",labelKey:"displayName",listItems:JC},{key:"emailAddresses",label:"Email Addresses",labelKey:"value",listItems:YC},{key:"phoneNumbers",label:"Phone Numbers",labelKey:"value",listItems:XC},{key:"organizations",label:"Organizations",labelKey:"name",listItems:QC},{key:"photos",label:"Photos",labelKey:"url",listItems:e0},{key:"memberships",label:"Group Memberships",labelKey:"contactGroupMembership.contactGroupId",listItems:t0},{key:"metadata",label:"Metadata",children:r0}],Xv={fields:Ys},Qv={fields:Ys},eb={fields:[{key:"results",label:"Matching Contacts",listItems:[{key:"person",label:"Contact",children:Ys}]}]},tb={fields:Ys};var nb=wn({auth:mr,name:"add_contact",classification:"WRITE",description:"Add a contact to a Google Contacts account",audience:"both",aiMetadata:{description:"Creates a new person in the authenticated Google Contacts account from name, email, phone, company, and job title fields. Use when an agent needs to add someone to address book contacts; first and last name are required. Not idempotent \u2014 each call creates a separate contact even with identical input, so guard against duplicates.",idempotent:!1},displayName:"Add Contact",outputSchema:Xv,props:{firstName:Ae.ShortText({displayName:"First Name",description:"The first name of the contact",required:!0}),middleName:Ae.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Ae.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!0}),jobTitle:Ae.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Ae.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Ae.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Ae.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e={names:[{givenName:t.propsValue.firstName,middleName:t.propsValue.middleName,familyName:t.propsValue.lastName}]},r={};t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]),e={...e,...r};let n={method:"POST",url:`${Nn.baseUrl}:createContact`,body:e,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token}};return(await Cn.sendRequest(n)).body}});var ob=wn({auth:mr,name:"update_contact",classification:"WRITE",description:"Update a contact in Google Contacts account.",audience:"both",aiMetadata:{description:"Updates fields (name, email, phone, company, job title) on an existing Google Contacts person identified by its resourceName (people/{id}). Use when an agent needs to modify a known contact; requires both the resourceName and the current etag, and a field mask listing which fields to update \u2014 the call is rejected if the contact changed since the etag was fetched. Repeating the same update with the same etag/values is safe and yields the same result.",idempotent:!0},displayName:"Update Contact",outputSchema:Qv,props:{resourceName:Ae.ShortText({displayName:"Resource Name",description:"The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.",required:!0}),etag:Ae.ShortText({displayName:"Etag",description:"The `etag` ensures contact updates only apply if the contact hasn't changed since last retrieved.",required:!0}),updatePersonFields:Ae.StaticMultiSelectDropdown({displayName:"Update Field Mask",description:"A field mask to restrict which fields on the person are updated.",required:!0,options:{options:[{label:"Names",value:"names"},{label:"Email",value:"emailAddresses"},{label:"Phone Number",value:"phoneNumbers"},{label:"Job Title / Company",value:"organizations"}]},defaultValue:["names","emailAddresses"]}),firstName:Ae.ShortText({displayName:"First Name",description:"The first name of the contact",required:!1}),middleName:Ae.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:Ae.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!1}),jobTitle:Ae.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:Ae.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:Ae.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:Ae.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e=t.propsValue.resourceName.substring(6),r={etag:t.propsValue.etag},n={updatePersonFields:t.propsValue.updatePersonFields.join(",")};(t.propsValue.firstName||t.propsValue.middleName||t.propsValue.lastName)&&(r.names=[{givenName:t.propsValue.firstName||void 0,middleName:t.propsValue.middleName||void 0,familyName:t.propsValue.lastName||void 0}]),t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]);let i={method:"PATCH",url:`${Nn.baseUrl}${e}:updateContact`,body:r,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:n};return(await Cn.sendRequest(i)).body}});var ib=wn({auth:mr,name:"search_contact",classification:"SEARCH",description:"Search contacts in Google Contacts account.",audience:"both",aiMetadata:{description:"Searches the authenticated Google Contacts account for people matching a plain-text query, which prefix-matches against contact fields. Use when an agent needs to find a contact or its resourceName before updating it; the query is required and a read mask selects which fields come back (max 30 results). Read-only and idempotent.",idempotent:!0},displayName:"Search Contacts",outputSchema:eb,props:{query:Ae.ShortText({displayName:"Query",description:'The plain-text query for the request.The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".',required:!0}),readMask:Ae.StaticMultiSelectDropdown({displayName:"Read Mask",description:"A field mask to restrict which fields on each person are returned.",required:!0,options:{options:[{label:"addresses",value:"addresses"},{label:"ageRanges",value:"ageRanges"},{label:"biographies",value:"biographies"},{label:"birthdays",value:"birthdays"},{label:"calendarUrls",value:"calendarUrls"},{label:"clientData",value:"clientData"},{label:"coverPhotos",value:"coverPhotos"},{label:"emailAddresses",value:"emailAddresses"},{label:"events",value:"events"},{label:"externalIds",value:"externalIds"},{label:"genders",value:"genders"},{label:"imClients",value:"imClients"},{label:"interests",value:"interests"},{label:"locales",value:"locales"},{label:"locations",value:"locations"},{label:"memberships",value:"memberships"},{label:"metadata",value:"metadata"},{label:"miscKeywords",value:"miscKeywords"},{label:"names",value:"names"},{label:"nicknames",value:"nicknames"},{label:"occupations",value:"occupations"},{label:"organizations",value:"organizations"},{label:"phoneNumbers",value:"phoneNumbers"},{label:"photos",value:"photos"},{label:"relations",value:"relations"},{label:"sipAddresses",value:"sipAddresses"},{label:"skills",value:"skills"},{label:"urls",value:"urls"},{label:"userDefined",value:"userDefined"}]},defaultValue:["names","emailAddresses"]}),pageSize:Ae.Number({displayName:"Page Size",description:"The number of results to return. Maximum 30.",required:!1})},async run(t){let e={query:t.propsValue.query,readMask:t.propsValue.readMask.join(",")};t.propsValue.pageSize&&(e.pageSize=String(t.propsValue.pageSize));let r={method:"GET",url:`${Nn.baseUrl}:searchContacts`,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:e};return(await Cn.sendRequest(r)).body}});var Ix=ft(Ax()),Rx=ft(ka()),Ox=ft(wx());var $c={strategy:0,items:o(async({store:t,auth:e})=>{let r=new Rx.OAuth2Client;r.setCredentials(e);let n=(0,Ix.people)({version:"v1",auth:r}),i,s=[];do{let c=await n.people.connections.list({resourceName:"people/me",pageToken:i,pageSize:100,sortOrder:"LAST_MODIFIED_DESCENDING",personFields:["addresses","ageRanges","biographies","birthdays","calendarUrls","clientData","coverPhotos","emailAddresses","events","externalIds","genders","imClients","interests","locales","locations","memberships","metadata","miscKeywords","names","nicknames","occupations","organizations","phoneNumbers","photos","relations","sipAddresses","skills","urls","userDefined"].join()});for(let d of c.data.connections||[])d.metadata?.deleted!==!0&&s.push({data:d,epochMilliSeconds:(0,Ox.default)(d.metadata?.sources?.[0].updateTime).valueOf()});i=c.data.nextPageToken}while(i);return s},"items")},Cx=$y({auth:mr,name:"new_or_updated_contact",classification:"READ",displayName:"New Or Updated Contact",description:"Triggers when there is a new or updated contact",aiMetadata:{description:"Fires when a contact in the authenticated Google Contacts account is newly created or has been modified since the last poll. Each event represents one person record with its current fields; deleted contacts are excluded."},props:{},outputSchema:tb,sampleData:{resourceName:"people/c4278485694217203807",etag:"%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9",metadata:{sources:[{type:"CONTACT",id:"3b603c120c68305f",etag:"#dUp6RO4EJS8=",updateTime:"2023-01-30T14:35:18.142565Z"}],objectType:"PERSON"},names:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},displayName:"Shahed Mashni",familyName:"Mashni",givenName:"Shahed",displayNameLastFirst:"Mashni, Shahed",unstructuredName:"Shahed Mashni"}],photos:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},url:"https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100",default:!0}],memberships:[{metadata:{source:{type:"CONTACT",id:"3b603c120c68305f"}},contactGroupMembership:{contactGroupId:"myContacts",contactGroupResourceName:"contactGroups/myContacts"}}]},type:"POLLING",async onEnable(t){return await ta.onEnable($c,{store:t.store,auth:t.auth,propsValue:{}})},async onDisable(t){return await ta.onEnable($c,{store:t.store,auth:t.auth,propsValue:{}})},async run(t){return await ta.poll($c,{store:t.store,auth:t.auth,propsValue:{},files:t.files})},test:o(async t=>await ta.test($c,{store:t.store,auth:t.auth,propsValue:{},files:t.files}),"test")});var G1=zy({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-contacts.png",categories:["SALES_AND_CRM"],actions:[nb,ob,ib,Yv({baseUrl:o(()=>Nn.baseUrl,"baseUrl"),auth:mr,authMapping:o(async t=>({Authorization:`Bearer ${t.access_token}`}),"authMapping")})],displayName:"Google Contacts",description:"Stay connected and organized",authors:["Abdallah-Alwarawreh","Salem-Alaa","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060"],triggers:[Cx],auth:mr});0&&(module.exports={googleContacts});
|
|
70
70
|
/*! Bundled license information:
|
|
71
71
|
|
|
72
72
|
mime-types/index.js:
|